diff options
Diffstat (limited to 'tmux.h')
-rw-r--r-- | tmux.h | 232 |
1 files changed, 159 insertions, 73 deletions
@@ -20,18 +20,20 @@ #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 "xmalloc.h" extern char **environ; @@ -55,7 +57,11 @@ 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_ctx; struct session; +struct tty_ctx; struct tmuxpeer; struct tmuxproc; struct winlink; @@ -63,10 +69,13 @@ struct winlink; /* Client-server protocol version. */ #define PROTOCOL_VERSION 8 -/* Default configuration files. */ +/* Default configuration files and socket paths. */ #ifndef TMUX_CONF #define TMUX_CONF "/etc/tmux.conf:~/.tmux.conf" #endif +#ifndef TMUX_SOCK +#define TMUX_SOCK "$TMUX_TMPDIR:" _PATH_TMP +#endif /* Minimum layout cell size, NOT including border lines. */ #define PANE_MINIMUM 1 @@ -254,6 +263,8 @@ enum tty_code_code { TTYC_BOLD, TTYC_CIVIS, TTYC_CLEAR, + TTYC_CLMG, + TTYC_CMG, TTYC_CNORM, TTYC_COLORS, TTYC_CR, @@ -274,12 +285,18 @@ enum tty_code_code { TTYC_DIM, TTYC_DL, TTYC_DL1, + TTYC_DSBP, + TTYC_DSFCS, + TTYC_DSMG, TTYC_E3, TTYC_ECH, TTYC_ED, TTYC_EL, TTYC_EL1, TTYC_ENACS, + TTYC_ENBP, + TTYC_ENFCS, + TTYC_ENMG, TTYC_FSL, TTYC_HOME, TTYC_HPA, @@ -445,11 +462,11 @@ enum tty_code_code { TTYC_SITM, TTYC_SMACS, TTYC_SMCUP, - TTYC_SMOL, TTYC_SMKX, + TTYC_SMOL, TTYC_SMSO, - TTYC_SMULX, TTYC_SMUL, + TTYC_SMULX, TTYC_SMXX, TTYC_SS, TTYC_SYNC, @@ -458,7 +475,7 @@ enum tty_code_code { TTYC_U8, TTYC_VPA, TTYC_XENL, - TTYC_XT, + TTYC_XT }; /* Message codes. */ @@ -730,6 +747,7 @@ enum style_default_type { /* Style option. */ struct style { struct grid_cell gc; + int ignore; int fill; enum style_align align; @@ -775,13 +793,16 @@ struct screen { }; /* Screen write context. */ -struct screen_write_collect_item; -struct screen_write_collect_line; +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; int sync; + screen_write_init_ctx_cb init_ctx_cb; + void *arg; + struct screen_write_collect_item *item; u_int scrolled; u_int bg; @@ -885,6 +906,9 @@ struct window_pane { u_int xoff; u_int yoff; + int fg; + int bg; + int flags; #define PANE_REDRAW 0x1 #define PANE_DROP 0x2 @@ -917,8 +941,8 @@ struct window_pane { struct input_ctx *ictx; - struct style cached_style; - struct style cached_active_style; + struct grid_cell cached_gc; + struct grid_cell cached_active_gc; int *palette; int pipe_fd; @@ -939,6 +963,9 @@ struct window_pane { size_t written; size_t skipped; + int border_gc_set; + struct grid_cell border_gc; + TAILQ_ENTRY(window_pane) entry; RB_ENTRY(window_pane) tree_entry; }; @@ -1189,6 +1216,7 @@ struct tty_term { #define TERM_DECSLRM 0x4 #define TERM_DECFRA 0x8 #define TERM_RGBCOLOURS 0x10 +#define TERM_VT100LIKE 0x20 int flags; LIST_ENTRY(tty_term) entry; @@ -1234,8 +1262,6 @@ struct tty { struct termios tio; struct grid_cell cell; - - int last_wp; struct grid_cell last_cell; #define TTY_NOCURSOR 0x1 @@ -1247,7 +1273,7 @@ struct tty { #define TTY_FOCUS 0x40 #define TTY_BLOCK 0x80 #define TTY_HAVEDA 0x100 -#define TTY_HAVEDSR 0x200 +#define TTY_HAVEXDA 0x200 #define TTY_SYNCING 0x400 int flags; @@ -1267,8 +1293,14 @@ struct tty { }; /* TTY command context. */ +typedef void (*tty_ctx_redraw_cb)(const struct tty_ctx *); +typedef int (*tty_ctx_set_client_cb)(struct tty_ctx *, struct client *); struct tty_ctx { - struct window_pane *wp; + struct screen *s; + + tty_ctx_redraw_cb redraw_cb; + tty_ctx_set_client_cb set_client_cb; + void *arg; const struct grid_cell *cell; int wrapped; @@ -1287,28 +1319,38 @@ struct tty_ctx { u_int orupper; u_int orlower; - /* Pane offset. */ + /* Target region (usually pane) offset and size. */ u_int xoff; u_int yoff; + u_int rxoff; + u_int ryoff; + u_int sx; + u_int sy; /* The background colour used for clearing (erasing). */ u_int bg; - /* Window offset and size. */ + /* The default colours and palette. */ + struct grid_cell defaults; + int *palette; + + /* Containing region (usually window) offset and size. */ int bigger; - u_int ox; - u_int oy; - u_int sx; - u_int sy; + u_int wox; + u_int woy; + u_int wsx; + u_int wsy; }; /* Saved message entry. */ struct message_entry { - char *msg; - u_int msg_num; - time_t msg_time; - TAILQ_ENTRY(message_entry) entry; + char *msg; + u_int msg_num; + struct timeval msg_time; + + TAILQ_ENTRY(message_entry) entry; }; +TAILQ_HEAD(message_list, message_entry); /* Parsed arguments structures. */ struct args_entry; @@ -1472,7 +1514,7 @@ RB_HEAD(client_files, client_file); typedef int (*prompt_input_cb)(struct client *, void *, const char *, int); typedef void (*prompt_free_cb)(void *); typedef int (*overlay_check_cb)(struct client *, u_int, u_int); -typedef int (*overlay_mode_cb)(struct client *, u_int *, u_int *); +typedef struct screen *(*overlay_mode_cb)(struct client *, u_int *, u_int *); typedef void (*overlay_draw_cb)(struct client *, struct screen_redraw_ctx *); typedef int (*overlay_key_cb)(struct client *, struct key_event *); typedef void (*overlay_free_cb)(struct client *); @@ -1497,6 +1539,7 @@ struct client { char *term_name; int term_features; + char *term_type; char *ttyname; struct tty tty; @@ -1530,7 +1573,7 @@ struct client { #define CLIENT_CONTROLCONTROL 0x4000 #define CLIENT_FOCUSED 0x8000 #define CLIENT_UTF8 0x10000 -/* 0x20000 unused */ +#define CLIENT_IGNORESIZE 0x20000 #define CLIENT_IDENTIFIED 0x40000 #define CLIENT_STATUSFORCE 0x80000 #define CLIENT_DOUBLECLICK 0x100000 @@ -1543,6 +1586,7 @@ struct client { #define CLIENT_DEFAULTSOCKET 0x8000000 #define CLIENT_STARTSERVER 0x10000000 #define CLIENT_REDRAWPANES 0x20000000 +#define CLIENT_NOFORK 0x40000000 #define CLIENT_ALLREDRAWFLAGS \ (CLIENT_REDRAWWINDOW| \ CLIENT_REDRAWSTATUS| \ @@ -1563,10 +1607,9 @@ struct client { uint64_t redraw_panes; + int message_ignore_styles; char *message_string; struct event message_timer; - u_int message_next; - TAILQ_HEAD(, message_entry) message_log; char *prompt_string; struct utf8_data *prompt_buffer; @@ -1583,6 +1626,8 @@ struct client { #define PROMPT_INCREMENTAL 0x4 #define PROMPT_NOFORMAT 0x8 #define PROMPT_KEY 0x10 +#define PROMPT_WINDOW 0x20 +#define PROMPT_TARGET 0x40 int prompt_flags; struct session *session; @@ -1649,7 +1694,6 @@ enum options_table_type { OPTIONS_TABLE_COLOUR, OPTIONS_TABLE_FLAG, OPTIONS_TABLE_CHOICE, - OPTIONS_TABLE_STYLE, OPTIONS_TABLE_COMMAND }; @@ -1661,12 +1705,13 @@ enum options_table_type { #define OPTIONS_TABLE_IS_ARRAY 0x1 #define OPTIONS_TABLE_IS_HOOK 0x2 +#define OPTIONS_TABLE_IS_STYLE 0x4 struct options_table_entry { const char *name; enum options_table_type type; int scope; - int flags; + int flags; u_int minimum; u_int maximum; @@ -1678,6 +1723,9 @@ struct options_table_entry { const char *separator; const char *pattern; + + const char *text; + const char *unit; }; /* Common command usages. */ @@ -1705,7 +1753,7 @@ struct spawn_context { const char *name; char **argv; int argc; - struct environ *environ; + struct environ *environ; int idx; const char *cwd; @@ -1742,6 +1790,8 @@ 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; @@ -1783,6 +1833,7 @@ void paste_free(struct paste_buffer *); void paste_add(const char *, char *, size_t); int paste_rename(const char *, const char *, char **); int paste_set(char *, size_t, const char *, char **); +void paste_replace(struct paste_buffer *, char *, size_t); char *paste_make_sample(struct paste_buffer *); /* format.c */ @@ -1803,6 +1854,8 @@ void format_free(struct format_tree *); void format_merge(struct format_tree *, struct format_tree *); void printflike(3, 4) format_add(struct format_tree *, const char *, const char *, ...); +void format_add_tv(struct format_tree *, const char *, + struct timeval *); void format_each(struct format_tree *, void (*)(const char *, const char *, void *), void *); char *format_expand_time(struct format_tree *, const char *); @@ -1810,7 +1863,14 @@ char *format_expand(struct format_tree *, const char *); char *format_single(struct cmdq_item *, const char *, struct client *, struct session *, struct winlink *, struct window_pane *); +char *format_single_from_state(struct cmdq_item *, const char *, + struct client *, struct cmd_find_state *); char *format_single_from_target(struct cmdq_item *, const char *); +struct format_tree *format_create_defaults(struct cmdq_item *, struct client *, + struct session *, struct winlink *, struct window_pane *); +struct format_tree *format_create_from_state(struct cmdq_item *, + struct client *, struct cmd_find_state *); +struct format_tree *format_create_from_target(struct cmdq_item *); void format_defaults(struct format_tree *, struct client *, struct session *, struct winlink *, struct window_pane *); void format_defaults_window(struct format_tree *, struct window *); @@ -1843,6 +1903,7 @@ void notify_pane(const char *, struct window_pane *); /* options.c */ struct options *options_create(struct options *); void options_free(struct options *); +struct options *options_get_parent(struct options *); void options_set_parent(struct options *, struct options *); struct options_entry *options_first(struct options *); struct options_entry *options_next(struct options_entry *); @@ -1850,7 +1911,9 @@ struct options_entry *options_empty(struct options *, const struct options_table_entry *); struct options_entry *options_default(struct options *, const struct options_table_entry *); +char *options_default_to_string(const struct options_table_entry *); const char *options_name(struct options_entry *); +struct options *options_owner(struct options_entry *); const struct options_table_entry *options_table_entry(struct options_entry *); struct options_entry *options_get_only(struct options *, const char *); struct options_entry *options_get(struct options *, const char *); @@ -1865,9 +1928,9 @@ struct options_array_item *options_array_first(struct options_entry *); struct options_array_item *options_array_next(struct options_array_item *); u_int options_array_item_index(struct options_array_item *); union options_value *options_array_item_value(struct options_array_item *); -int options_isarray(struct options_entry *); -int options_isstring(struct options_entry *); -char *options_tostring(struct options_entry *, int, int); +int options_is_array(struct options_entry *); +int options_is_string(struct options_entry *); +char *options_to_string(struct options_entry *, int, int); char *options_parse(const char *, int *); struct options_entry *options_parse_get(struct options *, const char *, int *, int); @@ -1876,18 +1939,21 @@ struct options_entry *options_match_get(struct options *, const char *, int *, int, int *); const char *options_get_string(struct options *, const char *); long long options_get_number(struct options *, const char *); -struct style *options_get_style(struct options *, const char *); struct options_entry * printflike(4, 5) options_set_string(struct options *, const char *, int, const char *, ...); struct options_entry *options_set_number(struct options *, const char *, long long); -struct options_entry *options_set_style(struct options *, const char *, int, - const char *); int options_scope_from_name(struct args *, int, const char *, struct cmd_find_state *, struct options **, char **); int options_scope_from_flags(struct args *, int, struct cmd_find_state *, struct options **, char **); +struct style *options_string_to_style(struct options *, const char *, + struct format_tree *); +int options_from_string(struct options *, + const struct options_table_entry *, const char *, + const char *, int, char **); +void options_push_changes(const char *); /* options-table.c */ extern const struct options_table_entry options_table[]; @@ -1937,7 +2003,7 @@ void tty_update_window_offset(struct window *); void tty_update_client_offset(struct client *); void tty_raw(struct tty *, const char *); void tty_attributes(struct tty *, const struct grid_cell *, - struct window_pane *); + const struct grid_cell *, int *); void tty_reset(struct tty *); void tty_region_off(struct tty *); void tty_margin_off(struct tty *); @@ -1960,8 +2026,8 @@ void tty_send_requests(struct tty *); void tty_stop_tty(struct tty *); void tty_set_title(struct tty *, const char *); void tty_update_mode(struct tty *, int, struct screen *); -void tty_draw_line(struct tty *, struct window_pane *, struct screen *, - u_int, u_int, u_int, u_int, u_int); +void tty_draw_line(struct tty *, struct screen *, u_int, u_int, u_int, + u_int, u_int, const struct grid_cell *, int *); void tty_sync_start(struct tty *); void tty_sync_end(struct tty *); int tty_open(struct tty *, char **); @@ -1992,6 +2058,7 @@ 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 *); void tty_cmd_syncstart(struct tty *, const struct tty_ctx *); +void tty_default_colours(struct grid_cell *, struct window_pane *); /* tty-term.c */ extern struct tty_terms tty_terms; @@ -2019,6 +2086,7 @@ const char *tty_term_describe(struct tty_term *, enum tty_code_code); void tty_add_features(int *, const char *, const char *); const char *tty_get_features(int); int tty_apply_features(struct tty_term *, int); +void tty_default_features(int *, const char *, u_int); /* tty-acs.c */ int tty_acs_needed(struct tty *); @@ -2037,6 +2105,8 @@ char *args_print(struct args *); char *args_escape(const char *); int args_has(struct args *, u_char); const char *args_get(struct args *, u_char); +u_char args_first(struct args *, struct args_entry **); +u_char args_next(struct args_entry **); const char *args_first_value(struct args *, u_char, struct args_value **); const char *args_next_value(struct args_value **); long long args_strtonum(struct args *, u_char, long long, long long, @@ -2110,10 +2180,10 @@ char *cmd_template_replace(const char *, const char *, int); /* cmd-attach-session.c */ enum cmd_retval cmd_attach_session(struct cmdq_item *, const char *, int, int, - int, const char *, int); + int, const char *, int, const char *); /* cmd-parse.c */ -void cmd_parse_empty(struct cmd_parse_input *); +void cmd_parse_empty(struct cmd_parse_input *); struct cmd_parse_result *cmd_parse_from_file(FILE *, struct cmd_parse_input *); struct cmd_parse_result *cmd_parse_from_string(const char *, struct cmd_parse_input *); @@ -2204,8 +2274,8 @@ void file_fire_done(struct client_file *); void file_fire_read(struct client_file *); int file_can_print(struct client *); void printflike(2, 3) file_print(struct client *, const char *, ...); -void file_vprint(struct client *, const char *, va_list); -void file_print_buffer(struct client *, void *, size_t); +void file_vprint(struct client *, const char *, va_list); +void file_print_buffer(struct client *, void *, size_t); void printflike(2, 3) file_error(struct client *, const char *, ...); void file_write(struct client *, const char *, int, const void *, size_t, client_file_cb, void *); @@ -2216,6 +2286,7 @@ void file_push(struct client_file *); extern struct tmuxproc *server_proc; extern struct clients clients; extern struct cmd_find_state marked_pane; +extern struct message_list message_log; void server_set_marked(struct session *, struct winlink *, struct window_pane *); void server_clear_marked(void); @@ -2225,6 +2296,7 @@ int server_check_marked(void); 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 *, ...); /* server-client.c */ u_int server_client_how_many(void); @@ -2246,9 +2318,9 @@ void server_client_exec(struct client *, const char *); void server_client_loop(void); void server_client_push_stdout(struct client *); void server_client_push_stderr(struct client *); -void printflike(2, 3) server_client_add_message(struct client *, const char *, - ...); const char *server_client_get_cwd(struct client *, struct session *); +void server_client_set_flags(struct client *, const char *); +const char *server_client_get_flags(struct client *); /* server-fn.c */ void server_redraw_client(struct client *); @@ -2283,7 +2355,8 @@ struct style_range *status_get_range(struct client *, u_int, u_int); void status_init(struct client *); void status_free(struct client *); int status_redraw(struct client *); -void printflike(2, 3) status_message_set(struct client *, const char *, ...); +void printflike(3, 4) status_message_set(struct client *, int, const char *, + ...); void status_message_clear(struct client *); int status_message_redraw(struct client *); void status_prompt_set(struct client *, const char *, const char *, @@ -2309,8 +2382,8 @@ void input_reset(struct input_ctx *, int); struct evbuffer *input_pending(struct input_ctx *); void input_parse_pane(struct window_pane *); void input_parse_buffer(struct window_pane *, u_char *, size_t); -void input_parse_screen(struct input_ctx *, struct screen *, u_char *, - size_t); +void input_parse_screen(struct input_ctx *, struct screen *, + screen_write_init_ctx_cb, void *, u_char *, size_t); /* input-key.c */ int input_key_pane(struct window_pane *, key_code, struct mouse_event *); @@ -2340,6 +2413,8 @@ int attributes_fromstring(const char *); extern const struct grid_cell grid_default_cell; void grid_empty_line(struct grid *, u_int, u_int); int grid_cells_equal(const struct grid_cell *, const struct grid_cell *); +int grid_cells_look_equal(const struct grid_cell *, + const struct grid_cell *); struct grid *grid_create(u_int, u_int, u_int); void grid_destroy(struct grid *); int grid_compare(struct grid *, struct grid *); @@ -2391,11 +2466,16 @@ char *grid_view_string_cells(struct grid *, u_int, u_int, u_int); /* screen-write.c */ void screen_write_make_list(struct screen *); void screen_write_free_list(struct screen *); -void screen_write_start(struct screen_write_ctx *, struct window_pane *, - struct screen *); +void screen_write_start_pane(struct screen_write_ctx *, + struct window_pane *, struct screen *); +void screen_write_start(struct screen_write_ctx *, struct screen *); +void screen_write_start_callback(struct screen_write_ctx *, struct screen *, + screen_write_init_ctx_cb, void *); void screen_write_stop(struct screen_write_ctx *); void screen_write_reset(struct screen_write_ctx *); size_t printflike(1, 2) screen_write_strlen(const char *, ...); +int printflike(7, 8) screen_write_text(struct screen_write_ctx *, u_int, u_int, + u_int, int, const struct grid_cell *, const char *, ...); void printflike(3, 4) screen_write_puts(struct screen_write_ctx *, const struct grid_cell *, const char *, ...); void printflike(4, 5) screen_write_nputs(struct screen_write_ctx *, @@ -2404,8 +2484,6 @@ void screen_write_vnputs(struct screen_write_ctx *, ssize_t, const struct grid_cell *, const char *, va_list); void screen_write_putc(struct screen_write_ctx *, const struct grid_cell *, u_char); -void screen_write_copy(struct screen_write_ctx *, struct screen *, u_int, - u_int, u_int, u_int, bitstr_t *, const struct grid_cell *); void screen_write_fast_copy(struct screen_write_ctx *, struct screen *, u_int, u_int, u_int, u_int); void screen_write_hline(struct screen_write_ctx *, u_int, int, int); @@ -2448,6 +2526,10 @@ void screen_write_collect_add(struct screen_write_ctx *, void screen_write_cell(struct screen_write_ctx *, const struct grid_cell *); void screen_write_setselection(struct screen_write_ctx *, u_char *, u_int); void screen_write_rawstring(struct screen_write_ctx *, u_char *, u_int); +void screen_write_alternateon(struct screen_write_ctx *, + struct grid_cell *, int); +void screen_write_alternateoff(struct screen_write_ctx *, + struct grid_cell *, int); /* screen-redraw.c */ void screen_redraw_screen(struct client *); @@ -2465,8 +2547,7 @@ void screen_set_path(struct screen *, const char *); void screen_push_title(struct screen *); void screen_pop_title(struct screen *); void screen_resize(struct screen *, u_int, u_int, int); -void screen_resize_cursor(struct screen *, u_int, u_int, int, int, u_int *, - u_int *); +void screen_resize_cursor(struct screen *, u_int, u_int, int, int, int); void screen_set_selection(struct screen *, u_int, u_int, u_int, u_int, u_int, int, struct grid_cell *); void screen_clear_selection(struct screen *); @@ -2536,10 +2617,6 @@ struct window_pane *window_pane_find_by_id_str(const char *); struct window_pane *window_pane_find_by_id(u_int); int window_pane_destroy_ready(struct window_pane *); void window_pane_resize(struct window_pane *, u_int, u_int); -void window_pane_alternate_on(struct window_pane *, - struct grid_cell *, int); -void window_pane_alternate_off(struct window_pane *, - struct grid_cell *, int); void window_pane_set_palette(struct window_pane *, u_int, int); void window_pane_unset_palette(struct window_pane *, u_int); void window_pane_reset_palette(struct window_pane *); @@ -2617,6 +2694,7 @@ typedef void (*mode_tree_draw_cb)(void *, void *, struct screen_write_ctx *, u_int, u_int); typedef int (*mode_tree_search_cb)(void *, void *, const char *); typedef void (*mode_tree_menu_cb)(void *, struct client *, key_code); +typedef u_int (*mode_tree_height_cb)(void *, u_int); typedef void (*mode_tree_each_cb)(void *, void *, struct client *, key_code); u_int mode_tree_count_tagged(struct mode_tree_data *); void *mode_tree_get_current(struct mode_tree_data *); @@ -2625,11 +2703,12 @@ void mode_tree_expand(struct mode_tree_data *, uint64_t); int mode_tree_set_current(struct mode_tree_data *, uint64_t); void mode_tree_each_tagged(struct mode_tree_data *, mode_tree_each_cb, struct client *, key_code, int); +void mode_tree_up(struct mode_tree_data *, int); void mode_tree_down(struct mode_tree_data *, int); struct mode_tree_data *mode_tree_start(struct window_pane *, struct args *, mode_tree_build_cb, mode_tree_draw_cb, mode_tree_search_cb, - mode_tree_menu_cb, void *, const struct menu_item *, const char **, - u_int, struct screen **); + mode_tree_menu_cb, mode_tree_height_cb, void *, + const struct menu_item *, const char **, u_int, struct screen **); void mode_tree_zoom(struct mode_tree_data *, struct args *); void mode_tree_build(struct mode_tree_data *); void mode_tree_free(struct mode_tree_data *); @@ -2667,6 +2746,9 @@ void window_copy_start_drag(struct client *, struct mouse_event *); char *window_copy_get_word(struct window_pane *, u_int, u_int); char *window_copy_get_line(struct window_pane *, u_int); +/* window-option.c */ +extern const struct window_mode window_customize_mode; + /* names.c */ void check_window_name(struct window *); char *default_window_name(struct window *); @@ -2701,10 +2783,10 @@ struct session *session_find_by_id_str(const char *); struct session *session_find_by_id(u_int); struct session *session_create(const char *, const char *, const char *, struct environ *, struct options *, struct termios *); -void session_destroy(struct session *, int, const char *); +void session_destroy(struct session *, int, const char *); void session_add_ref(struct session *, const char *); void session_remove_ref(struct session *, const char *); -int session_check_name(const char *); +char *session_check_name(const char *); void session_update_activity(struct session *, struct timeval *); struct session *session_next_session(struct session *); struct session *session_previous_session(struct session *); @@ -2750,9 +2832,10 @@ char *utf8_padcstr(const char *, u_int); char *utf8_rpadcstr(const char *, u_int); int utf8_cstrhas(const char *, const struct utf8_data *); -/* procname.c */ -char *get_proc_name(int, char *); -char *get_proc_cwd(int); +/* osdep-*.c */ +char *osdep_get_name(int, char *); +char *osdep_get_cwd(int); +struct event_base *osdep_event_init(void); /* log.c */ void log_add_level(void); @@ -2766,11 +2849,12 @@ __dead void printflike(1, 2) fatalx(const char *, ...); /* menu.c */ #define MENU_NOMOUSE 0x1 +#define MENU_TAB 0x2 struct menu *menu_create(const char *); void menu_add_items(struct menu *, const struct menu_item *, struct cmdq_item *, struct client *, struct cmd_find_state *); -void menu_add_item(struct menu *, const struct menu_item *, +void menu_add_item(struct menu *, const struct menu_item *, struct cmdq_item *, struct client *, struct cmd_find_state *); void menu_free(struct menu *); @@ -2782,23 +2866,25 @@ int menu_display(struct menu *, int, struct cmdq_item *, u_int, #define POPUP_WRITEKEYS 0x1 #define POPUP_CLOSEEXIT 0x2 #define POPUP_CLOSEEXITZERO 0x4 +typedef void (*popup_close_cb)(int, 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 *); + const char *, struct client *, struct cmd_find_state *, + popup_close_cb, void *); /* style.c */ int style_parse(struct style *,const struct grid_cell *, const char *); const char *style_tostring(struct style *); +void style_add(struct grid_cell *, struct options *, + const char *, struct format_tree *); void style_apply(struct grid_cell *, struct options *, - const char *); -int style_equal(struct style *, struct style *); + const char *, struct format_tree *); void style_set(struct style *, const struct grid_cell *); void style_copy(struct style *, struct style *); -int style_is_default(struct style *); /* spawn.c */ struct winlink *spawn_window(struct spawn_context *, char **); |