diff options
Diffstat (limited to 'tmux.h')
-rw-r--r-- | tmux.h | 85 |
1 files changed, 80 insertions, 5 deletions
@@ -20,18 +20,19 @@ #define TMUX_H #include <sys/time.h> -#include <sys/queue.h> -#include <sys/tree.h> +#include <sys/uio.h> -#include <bitstring.h> -#include <event.h> #include <limits.h> #include <stdarg.h> -#include <stdint.h> #include <stdio.h> #include <termios.h> #include <wchar.h> +#ifdef HAVE_UTEMPTER +#include <utempter.h> +#endif + +#include "compat.h" #include "tmux-protocol.h" #include "xmalloc.h" @@ -64,6 +65,11 @@ struct screen_write_citem; struct screen_write_cline; struct screen_write_ctx; struct session; + +#ifdef ENABLE_SIXEL +struct sixel_image; +#endif + struct tty_ctx; struct tty_code; struct tty_key; @@ -81,6 +87,9 @@ struct winlink; #ifndef TMUX_TERM #define TMUX_TERM "screen" #endif +#ifndef TMUX_LOCK_CMD +#define TMUX_LOCK_CMD "lock -np" +#endif /* Minimum layout cell size, NOT including border lines. */ #define PANE_MINIMUM 1 @@ -837,6 +846,24 @@ struct style { enum style_default_type default_type; }; +#ifdef ENABLE_SIXEL +/* Image. */ +struct image { + struct screen *s; + struct sixel_image *data; + char *fallback; + + u_int px; + u_int py; + u_int sx; + u_int sy; + + TAILQ_ENTRY (image) all_entry; + TAILQ_ENTRY (image) entry; +}; +TAILQ_HEAD(images, image); +#endif + /* Cursor style. */ enum screen_cursor_style { SCREEN_CURSOR_DEFAULT, @@ -878,6 +905,10 @@ struct screen { bitstr_t *tabs; struct screen_sel *sel; +#ifdef ENABLE_SIXEL + struct images images; +#endif + struct screen_write_cline *write_list; struct hyperlinks *hyperlinks; @@ -1380,6 +1411,7 @@ struct tty { u_int sx; u_int sy; + /* Cell size in pixels. */ u_int xpixel; u_int ypixel; @@ -1388,6 +1420,8 @@ struct tty { enum screen_cursor_style cstyle; int ccolour; + /* Properties of the area being drawn on. */ + /* When true, the drawing area is bigger than the terminal. */ int oflag; u_int oox; u_int ooy; @@ -2330,6 +2364,11 @@ void tty_set_path(struct tty *, const char *); void tty_update_mode(struct tty *, int, struct screen *); void tty_draw_line(struct tty *, struct screen *, u_int, u_int, u_int, u_int, u_int, const struct grid_cell *, struct colour_palette *); + +#ifdef ENABLE_SIXEL +void tty_draw_images(struct client *, struct window_pane *, struct screen *); +#endif + void tty_sync_start(struct tty *); void tty_sync_end(struct tty *); int tty_open(struct tty *, char **); @@ -2360,6 +2399,11 @@ void tty_cmd_scrolldown(struct tty *, const struct tty_ctx *); void tty_cmd_reverseindex(struct tty *, const struct tty_ctx *); void tty_cmd_setselection(struct tty *, const struct tty_ctx *); void tty_cmd_rawstring(struct tty *, const struct tty_ctx *); + +#ifdef ENABLE_SIXEL +void tty_cmd_sixelimage(struct tty *, const struct tty_ctx *); +#endif + void tty_cmd_syncstart(struct tty *, const struct tty_ctx *); void tty_default_colours(struct grid_cell *, struct window_pane *); @@ -2660,6 +2704,7 @@ int server_start(struct tmuxproc *, int, struct event_base *, int, char *); void server_update_socket(void); void server_add_accept(int); void printflike(1, 2) server_add_message(const char *, ...); +int server_create_socket(int, char **); /* server-client.c */ RB_PROTOTYPE(client_windows, client_window, entry, server_client_window_cmp); @@ -2944,6 +2989,10 @@ void screen_write_setselection(struct screen_write_ctx *, const char *, u_char *, u_int); void screen_write_rawstring(struct screen_write_ctx *, u_char *, u_int, int); +#ifdef ENABLE_SIXEL +void screen_write_sixelimage(struct screen_write_ctx *, + struct sixel_image *, u_int); +#endif void screen_write_alternateon(struct screen_write_ctx *, struct grid_cell *, int); void screen_write_alternateoff(struct screen_write_ctx *, @@ -3291,6 +3340,11 @@ char *utf8_padcstr(const char *, u_int); char *utf8_rpadcstr(const char *, u_int); int utf8_cstrhas(const char *, const struct utf8_data *); +/* osdep-*.c */ +char *osdep_get_name(int, char *); +char *osdep_get_cwd(int); +struct event_base *osdep_event_init(void); + /* utf8-combined.c */ int utf8_has_zwj(const struct utf8_data *); int utf8_is_zwj(const struct utf8_data *); @@ -3371,6 +3425,27 @@ struct window_pane *spawn_pane(struct spawn_context *, char **); /* regsub.c */ char *regsub(const char *, const char *, const char *, int); +#ifdef ENABLE_SIXEL +/* image.c */ +int image_free_all(struct screen *); +struct image *image_store(struct screen *, struct sixel_image *); +int image_check_line(struct screen *, u_int, u_int); +int image_check_area(struct screen *, u_int, u_int, u_int, u_int); +int image_scroll_up(struct screen *, u_int); + +/* image-sixel.c */ +#define SIXEL_COLOUR_REGISTERS 1024 +struct sixel_image *sixel_parse(const char *, size_t, u_int, u_int); +void sixel_free(struct sixel_image *); +void sixel_log(struct sixel_image *); +void sixel_size_in_cells(struct sixel_image *, u_int *, u_int *); +struct sixel_image *sixel_scale(struct sixel_image *, u_int, u_int, u_int, + u_int, u_int, u_int, int); +char *sixel_print(struct sixel_image *, struct sixel_image *, + size_t *); +struct screen *sixel_to_screen(struct sixel_image *); +#endif + /* server-acl.c */ void server_acl_init(void); struct server_acl_user *server_acl_user_find(uid_t); |