mirror of
https://github.com/tmux/tmux.git
synced 2026-10-17 00:44:54 +00:00
Kitty image input path.
This commit is contained in:
50
tmux-image.h
50
tmux-image.h
@@ -28,11 +28,14 @@ struct grid_line;
|
||||
struct image;
|
||||
struct image_backend;
|
||||
struct image_line;
|
||||
struct image_saved;
|
||||
struct image_store;
|
||||
struct input_ctx;
|
||||
struct screen;
|
||||
struct screen_write_ctx;
|
||||
struct sixel_image;
|
||||
struct tty;
|
||||
struct window_pane;
|
||||
|
||||
/* Maximum image size in bytes. */
|
||||
#define IMAGE_SIZE_LIMIT (64 * 1024 * 1024)
|
||||
@@ -43,6 +46,12 @@ struct tty;
|
||||
/* Backend images move with terminal scrolling. */
|
||||
#define IMAGE_BACKEND_SCROLLS 0x2
|
||||
|
||||
/* Type of image. */
|
||||
enum image_type {
|
||||
IMAGE_TYPE_SIXEL,
|
||||
IMAGE_TYPE_KITTY
|
||||
};
|
||||
|
||||
/* Source image and placement geometry. */
|
||||
struct image_geom {
|
||||
/* Position and size within the source RGBA pixels. */
|
||||
@@ -95,11 +104,14 @@ struct image_rect {
|
||||
};
|
||||
|
||||
/* image.c */
|
||||
struct image *image_create(struct image_geom *, u_char *);
|
||||
struct image *image_create_with_parent(struct image *, struct image_geom *,
|
||||
size_t, u_char *);
|
||||
struct image *image_create(enum image_type, struct image_geom *, u_char *);
|
||||
struct image *image_create_with_parent(enum image_type, struct image *,
|
||||
struct image_geom *, size_t, u_char *);
|
||||
struct image *image_find(u_int);
|
||||
u_int image_get_id(struct image *);
|
||||
u_int image_get_order_id(struct image *);
|
||||
void image_set_order_id(struct image *, u_int);
|
||||
enum image_type image_get_type(struct image *);
|
||||
void image_ref(struct image *);
|
||||
void image_free(struct image *);
|
||||
void image_touch(struct image *);
|
||||
@@ -113,21 +125,35 @@ void image_size_in_cells(u_int, u_int, u_int, u_int, u_int *,
|
||||
void image_get_pixel_area(struct image *, u_int, u_int, u_int,
|
||||
u_int, u_int *, u_int *, u_int *, u_int *);
|
||||
|
||||
/* image-decode.c */
|
||||
u_char *image_base64_decode(const char *, size_t, size_t, size_t *);
|
||||
u_char *image_png_decode(const u_char *, size_t, size_t, int, size_t,
|
||||
u_int *, u_int *);
|
||||
u_char *image_raw_decode(const u_char *, size_t, size_t, u_int, u_int,
|
||||
u_int, int);
|
||||
|
||||
/* image-grid.c */
|
||||
void image_grid_add(struct grid *, struct image *, u_int, u_int,
|
||||
u_int, u_int, u_int, u_int);
|
||||
void image_grid_remove(struct grid *, u_int, u_int, u_int, u_int);
|
||||
void image_grid_overwrite(struct grid *, u_int, u_int, u_int,
|
||||
u_int);
|
||||
void image_grid_free_line(struct grid *, struct grid_line *);
|
||||
void image_grid_free(struct grid *);
|
||||
void image_grid_remove_all(struct image *);
|
||||
void image_grid_move_cells(struct grid *, u_int, u_int, u_int,
|
||||
u_int);
|
||||
struct image_saved *image_grid_save_lines(struct grid *, u_int, u_int, u_int,
|
||||
int);
|
||||
void image_grid_restore_lines(struct grid *, struct image_saved *);
|
||||
void image_grid_duplicate_lines(struct grid *, u_int, struct grid *,
|
||||
u_int, u_int);
|
||||
void image_grid_copy_area(struct grid *, u_int, u_int, struct grid *,
|
||||
u_int, u_int, u_int, u_int);
|
||||
void image_grid_copy_area(struct grid *, u_int, u_int,
|
||||
struct grid *, u_int, u_int, u_int, u_int);
|
||||
void image_grid_resize_width(struct grid *, u_int);
|
||||
int image_grid_line_has_images(struct grid_line *);
|
||||
int image_grid_has_image(struct grid *, u_int);
|
||||
u_int image_grid_clear(struct grid *, u_int);
|
||||
u_int image_grid_clear_visible(struct grid *, enum image_type);
|
||||
int image_grid_area_has_images(struct grid *, u_int, u_int, u_int,
|
||||
u_int);
|
||||
void image_redraw_area(struct screen_write_ctx *, u_int, u_int,
|
||||
@@ -136,7 +162,9 @@ void image_redraw_all(struct screen_write_ctx *);
|
||||
void image_redraw_scroll(struct screen_write_ctx *);
|
||||
void image_damage_screen(struct screen_write_ctx *, u_int, u_int,
|
||||
u_int, u_int);
|
||||
void image_write(struct screen_write_ctx *, struct image *, u_int);
|
||||
void image_write(struct screen_write_ctx *, struct image *, u_int,
|
||||
int);
|
||||
void image_clear(struct screen_write_ctx *, u_int);
|
||||
int image_grid_get_at(struct grid *, u_int, u_int, struct image **,
|
||||
u_int *, u_int *);
|
||||
const struct grid_cell *image_map_cell(struct tty *, struct grid *, u_int,
|
||||
@@ -168,6 +196,14 @@ void sixel_start_draw(struct tty *, u_int, u_int, u_int, u_int);
|
||||
void sixel_free_pending(struct tty *);
|
||||
void sixel_flush_pending(struct tty *);
|
||||
|
||||
/* image-kitty.c */
|
||||
int kitty_select(struct tty *);
|
||||
void kitty_parse_input(struct input_ctx *, struct window_pane *,
|
||||
struct screen_write_ctx *, u_int, void **, const u_char *,
|
||||
size_t);
|
||||
void kitty_free_state(void *);
|
||||
void kitty_remove_image(struct image *);
|
||||
|
||||
#endif /* ENABLE_IMAGES */
|
||||
|
||||
#endif /* TMUX_IMAGE_H */
|
||||
|
||||
Reference in New Issue
Block a user