diff options
author | Nicholas Marriott <nicholas.marriott@gmail.com> | 2021-03-02 12:08:34 +0000 |
---|---|---|
committer | Nicholas Marriott <nicholas.marriott@gmail.com> | 2021-03-02 12:08:34 +0000 |
commit | c01251d02388efceca515c47c257e2b5342e3716 (patch) | |
tree | ca89407cb43bd2caa40a6854ba49ce1720e892ce /tmux.h | |
parent | 5c275c2a1a963876d4ac392067e42120417dbf43 (diff) | |
parent | 1466b570eedda0423d5a386d2b16b7ff0c0e477c (diff) | |
download | rtmux-c01251d02388efceca515c47c257e2b5342e3716.tar.gz rtmux-c01251d02388efceca515c47c257e2b5342e3716.tar.bz2 rtmux-c01251d02388efceca515c47c257e2b5342e3716.zip |
Merge branch 'master' into 3.2-rc
Diffstat (limited to 'tmux.h')
-rw-r--r-- | tmux.h | 156 |
1 files changed, 98 insertions, 58 deletions
@@ -22,7 +22,6 @@ #include <sys/time.h> #include <sys/uio.h> -#include <event.h> #include <limits.h> #include <stdarg.h> #include <stdio.h> @@ -57,8 +56,8 @@ struct mouse_event; struct options; struct options_array_item; struct options_entry; -struct screen_write_collect_item; -struct screen_write_collect_line; +struct screen_write_citem; +struct screen_write_cline; struct screen_write_ctx; struct session; struct tty_ctx; @@ -263,6 +262,7 @@ enum tty_code_code { TTYC_AX, TTYC_BCE, TTYC_BEL, + TTYC_BIDI, TTYC_BLINK, TTYC_BOLD, TTYC_CIVIS, @@ -501,6 +501,7 @@ enum msgtype { MSG_IDENTIFY_FEATURES, MSG_IDENTIFY_STDOUT, MSG_IDENTIFY_LONGFLAGS, + MSG_IDENTIFY_TERMINFO, MSG_COMMAND = 200, MSG_DETACH, @@ -728,6 +729,13 @@ struct grid { struct grid_line *linedata; }; +/* Virtual cursor in a grid. */ +struct grid_reader { + struct grid *gd; + u_int cx; + u_int cy; +}; + /* Style alignment. */ enum style_align { STYLE_ALIGN_DEFAULT, @@ -789,55 +797,51 @@ struct style { struct screen_sel; struct screen_titles; struct screen { - char *title; - char *path; - struct screen_titles *titles; + char *title; + char *path; + struct screen_titles *titles; - struct grid *grid; /* grid data */ + struct grid *grid; /* grid data */ - u_int cx; /* cursor x */ - u_int cy; /* cursor y */ + u_int cx; /* cursor x */ + u_int cy; /* cursor y */ - u_int cstyle; /* cursor style */ - char *ccolour; /* cursor colour string */ + u_int cstyle; /* cursor style */ + char *ccolour; /* cursor colour string */ - u_int rupper; /* scroll region top */ - u_int rlower; /* scroll region bottom */ + u_int rupper; /* scroll region top */ + u_int rlower; /* scroll region bottom */ - int mode; + int mode; - u_int saved_cx; - u_int saved_cy; - struct grid *saved_grid; - struct grid_cell saved_cell; - int saved_flags; + u_int saved_cx; + u_int saved_cy; + struct grid *saved_grid; + struct grid_cell saved_cell; + int saved_flags; - bitstr_t *tabs; - struct screen_sel *sel; + bitstr_t *tabs; + struct screen_sel *sel; - struct screen_write_collect_line *write_list; + struct screen_write_cline *write_list; }; /* Screen write context. */ typedef void (*screen_write_init_ctx_cb)(struct screen_write_ctx *, struct tty_ctx *); struct screen_write_ctx { - struct window_pane *wp; - struct screen *s; + struct window_pane *wp; + struct screen *s; - int flags; + int flags; #define SCREEN_WRITE_SYNC 0x1 - screen_write_init_ctx_cb init_ctx_cb; - void *arg; + screen_write_init_ctx_cb init_ctx_cb; + void *arg; - struct screen_write_collect_item *item; - u_int scrolled; - u_int bg; - - u_int cells; - u_int written; - u_int skipped; + struct screen_write_citem *item; + u_int scrolled; + u_int bg; }; /* Screen redraw context. */ @@ -889,6 +893,7 @@ struct window_mode { struct cmd_find_state *, struct args *); void (*free)(struct window_mode_entry *); void (*resize)(struct window_mode_entry *, u_int, u_int); + void (*update)(struct window_mode_entry *); void (*key)(struct window_mode_entry *, struct client *, struct session *, struct winlink *, key_code, struct mouse_event *); @@ -995,9 +1000,6 @@ struct window_pane { char *searchstr; int searchregex; - size_t written; - size_t skipped; - int border_gc_set; struct grid_cell border_gc; @@ -1539,6 +1541,8 @@ typedef void (*client_file_cb) (struct client *, const char *, int, int, struct evbuffer *, void *); struct client_file { struct client *c; + struct tmuxpeer *peer; + struct client_files *tree; int references; int stream; @@ -1601,6 +1605,8 @@ struct client { char *term_name; int term_features; char *term_type; + char **term_caps; + u_int term_ncaps; char *ttyname; struct tty tty; @@ -1629,7 +1635,7 @@ struct client { #define CLIENT_DEAD 0x200 #define CLIENT_REDRAWBORDERS 0x400 #define CLIENT_READONLY 0x800 -/* 0x1000 unused */ +#define CLIENT_NOSTARTSERVER 0x1000 #define CLIENT_CONTROL 0x2000 #define CLIENT_CONTROLCONTROL 0x4000 #define CLIENT_FOCUSED 0x8000 @@ -1687,6 +1693,7 @@ struct client { char *prompt_string; struct utf8_data *prompt_buffer; + char *prompt_last; size_t prompt_index; prompt_input_cb prompt_inputcb; prompt_free_cb prompt_freecb; @@ -1881,8 +1888,6 @@ const char *sig2name(int); const char *find_cwd(void); const char *find_home(void); const char *getversion(void); -void expand_paths(const char *, char ***, u_int *); - /* proc.c */ struct imsg; @@ -1897,16 +1902,19 @@ struct tmuxpeer *proc_add_peer(struct tmuxproc *, int, void proc_remove_peer(struct tmuxpeer *); void proc_kill_peer(struct tmuxpeer *); void proc_toggle_log(struct tmuxproc *); +pid_t proc_fork_and_daemon(int *); /* cfg.c */ extern int cfg_finished; extern struct client *cfg_client; +extern char **cfg_files; +extern u_int cfg_nfiles; +extern int cfg_quiet; void start_cfg(void); int load_cfg(const char *, struct client *, struct cmdq_item *, int, struct cmdq_item **); int load_cfg_from_buffer(const void *, size_t, const char *, struct client *, struct cmdq_item *, int, struct cmdq_item **); -void set_cfg_file(const char *); void printflike(1, 2) cfg_add_cause(const char *, ...); void cfg_print_causes(struct cmdq_item *); void cfg_show_causes(struct session *); @@ -1937,7 +1945,7 @@ char *paste_make_sample(struct paste_buffer *); #define FORMAT_WINDOW 0x40000000U struct format_tree; struct format_modifier; -typedef char *(*format_cb)(struct format_tree *); +typedef void *(*format_cb)(struct format_tree *); const char *format_skip(const char *, const char *); int format_true(const char *); struct format_tree *format_create(struct client *, struct cmdq_item *, int, @@ -2060,9 +2068,9 @@ typedef void (*job_free_cb) (void *); #define JOB_NOWAIT 0x1 #define JOB_KEEPWRITE 0x2 #define JOB_PTY 0x4 -struct job *job_run(const char *, struct session *, const char *, - job_update_cb, job_complete_cb, job_free_cb, void *, int, - int, int); +struct job *job_run(const char *, int, char **, struct session *, + const char *, job_update_cb, job_complete_cb, job_free_cb, + void *, int, int, int); void job_free(struct job *); void job_resize(struct job *, u_int, u_int); void job_check_died(pid_t, int); @@ -2163,8 +2171,12 @@ extern struct tty_terms tty_terms; u_int tty_term_ncodes(void); void tty_term_apply(struct tty_term *, const char *, int); void tty_term_apply_overrides(struct tty_term *); -struct tty_term *tty_term_create(struct tty *, char *, int *, int, char **); +struct tty_term *tty_term_create(struct tty *, char *, char **, u_int, int *, + char **); void tty_term_free(struct tty_term *); +int tty_term_read_list(const char *, int, char ***, u_int *, + char **); +void tty_term_free_list(char **, u_int); int tty_term_has(struct tty_term *, enum tty_code_code); const char *tty_term_string(struct tty_term *, enum tty_code_code); const char *tty_term_string1(struct tty_term *, enum tty_code_code, int); @@ -2370,7 +2382,10 @@ void alerts_check_session(struct session *); /* file.c */ int file_cmp(struct client_file *, struct client_file *); RB_PROTOTYPE(client_files, client_file, entry, file_cmp); -struct client_file *file_create(struct client *, int, client_file_cb, void *); +struct client_file *file_create_with_peer(struct tmuxpeer *, + struct client_files *, int, client_file_cb, void *); +struct client_file *file_create_with_client(struct client *, int, + client_file_cb, void *); void file_free(struct client_file *); void file_fire_done(struct client_file *); void file_fire_read(struct client_file *); @@ -2383,6 +2398,16 @@ void file_write(struct client *, const char *, int, const void *, size_t, client_file_cb, void *); void file_read(struct client *, const char *, client_file_cb, void *); void file_push(struct client_file *); +int file_write_left(struct client_files *); +void file_write_open(struct client_files *, struct tmuxpeer *, + struct imsg *, int, int, client_file_cb, void *); +void file_write_data(struct client_files *, struct imsg *); +void file_write_close(struct client_files *, struct imsg *); +void file_read_open(struct client_files *, struct tmuxpeer *, struct imsg *, + int, int, client_file_cb, void *); +void file_write_ready(struct client_files *, struct imsg *); +void file_read_data(struct client_files *, struct imsg *); +void file_read_done(struct client_files *, struct imsg *); /* server.c */ extern struct tmuxproc *server_proc; @@ -2509,6 +2534,7 @@ const char *colour_tostring(int); int colour_fromstring(const char *s); int colour_256toRGB(int); int colour_256to16(int); +int colour_byname(const char *); /* attributes.c */ const char *attributes_tostring(int); @@ -2549,6 +2575,26 @@ void grid_wrap_position(struct grid *, u_int, u_int, u_int *, u_int *); void grid_unwrap_position(struct grid *, u_int *, u_int *, u_int, u_int); u_int grid_line_length(struct grid *, u_int); +/* grid-reader.c */ +void grid_reader_start(struct grid_reader *, struct grid *, u_int, u_int); +void grid_reader_get_cursor(struct grid_reader *, u_int *, u_int *); +u_int grid_reader_line_length(struct grid_reader *); +int grid_reader_in_set(struct grid_reader *, const char *); +void grid_reader_cursor_right(struct grid_reader *, int, int); +void grid_reader_cursor_left(struct grid_reader *); +void grid_reader_cursor_down(struct grid_reader *); +void grid_reader_cursor_up(struct grid_reader *); +void grid_reader_cursor_start_of_line(struct grid_reader *, int); +void grid_reader_cursor_end_of_line(struct grid_reader *, int, int); +void grid_reader_cursor_next_word(struct grid_reader *, const char *); +void grid_reader_cursor_next_word_end(struct grid_reader *, const char *); +void grid_reader_cursor_previous_word(struct grid_reader *, const char *, + int); +int grid_reader_cursor_jump(struct grid_reader *, + const struct utf8_data *); +int grid_reader_cursor_jump_back(struct grid_reader *, + const struct utf8_data *); + /* grid-view.c */ void grid_view_get_cell(struct grid *, u_int, u_int, struct grid_cell *); void grid_view_set_cell(struct grid *, u_int, u_int, @@ -2668,7 +2714,6 @@ void screen_alternate_off(struct screen *, struct grid_cell *, int); /* window.c */ extern struct windows windows; extern struct window_pane_tree all_window_panes; -extern const struct window_mode *all_window_modes[]; int window_cmp(struct window *, struct window *); RB_PROTOTYPE(windows, window, entry, window_cmp); int winlink_cmp(struct winlink *, struct winlink *); @@ -2739,7 +2784,7 @@ int window_pane_key(struct window_pane *, struct client *, int window_pane_visible(struct window_pane *); u_int window_pane_search(struct window_pane *, const char *, int, int); -const char *window_printable_flags(struct winlink *); +const char *window_printable_flags(struct winlink *, int); struct window_pane *window_pane_find_up(struct window_pane *); struct window_pane *window_pane_find_down(struct window_pane *); struct window_pane *window_pane_find_left(struct window_pane *); @@ -2995,18 +3040,13 @@ int menu_display(struct menu *, int, struct cmdq_item *, u_int, menu_choice_cb, void *); /* popup.c */ -#define POPUP_WRITEKEYS 0x1 -#define POPUP_CLOSEEXIT 0x2 -#define POPUP_CLOSEEXITZERO 0x4 +#define POPUP_CLOSEEXIT 0x1 +#define POPUP_CLOSEEXITZERO 0x2 typedef void (*popup_close_cb)(int, void *); typedef void (*popup_finish_edit_cb)(char *, size_t, void *); -u_int popup_width(struct cmdq_item *, u_int, const char **, - struct client *, struct cmd_find_state *); -u_int popup_height(u_int, const char **); int popup_display(int, struct cmdq_item *, u_int, u_int, u_int, - u_int, u_int, const char **, const char *, const char *, - const char *, struct client *, struct cmd_find_state *, - popup_close_cb, void *); + u_int, const char *, int, char **, const char *, + struct client *, struct session *, popup_close_cb, void *); int popup_editor(struct client *, const char *, size_t, popup_finish_edit_cb, void *); |