Merge branch 'master' into sixel

This commit is contained in:
Nicholas Marriott
2021-12-08 10:37:33 +00:00
39 changed files with 1218 additions and 433 deletions

109
tmux.h
View File

@@ -533,6 +533,7 @@ enum tty_code_code {
#define MODE_CRLF 0x4000
#define MODE_KEXTENDED 0x8000
#define MODE_CURSOR_VERY_VISIBLE 0x10000
#define MODE_CURSOR_BLINKING_SET 0x20000
#define ALL_MODES 0xffffff
#define ALL_MOUSE_MODES (MODE_MOUSE_STANDARD|MODE_MOUSE_BUTTON|MODE_MOUSE_ALL)
@@ -616,6 +617,24 @@ struct colour_palette {
#define GRID_LINE_EXTENDED 0x2
#define GRID_LINE_DEAD 0x4
#define CELL_INSIDE 0
#define CELL_TOPBOTTOM 1
#define CELL_LEFTRIGHT 2
#define CELL_TOPLEFT 3
#define CELL_TOPRIGHT 4
#define CELL_BOTTOMLEFT 5
#define CELL_BOTTOMRIGHT 6
#define CELL_TOPJOIN 7
#define CELL_BOTTOMJOIN 8
#define CELL_LEFTJOIN 9
#define CELL_RIGHTJOIN 10
#define CELL_JOIN 11
#define CELL_OUTSIDE 12
#define CELL_BORDERS " xqlkmjwvtun~"
#define SIMPLE_BORDERS " |-+++++++++."
#define PADDED_BORDERS " "
/* Grid cell data. */
struct grid_cell {
struct utf8_data data;
@@ -779,11 +798,16 @@ struct screen {
u_int cy; /* cursor y */
enum screen_cursor_style cstyle; /* cursor style */
char *ccolour; /* cursor colour */
enum screen_cursor_style default_cstyle;
int ccolour; /* cursor colour */
int default_ccolour;
u_int rupper; /* scroll region top */
u_int rlower; /* scroll region bottom */
int mode;
int default_mode;
u_int saved_cx;
u_int saved_cy;
struct grid *saved_grid;
@@ -817,6 +841,27 @@ struct screen_write_ctx {
u_int bg;
};
/* Box border lines option. */
enum box_lines {
BOX_LINES_DEFAULT = -1,
BOX_LINES_SINGLE,
BOX_LINES_DOUBLE,
BOX_LINES_HEAVY,
BOX_LINES_SIMPLE,
BOX_LINES_ROUNDED,
BOX_LINES_PADDED,
BOX_LINES_NONE
};
/* Pane border lines option. */
enum pane_lines {
PANE_LINES_SINGLE,
PANE_LINES_DOUBLE,
PANE_LINES_HEAVY,
PANE_LINES_SIMPLE,
PANE_LINES_NUMBER
};
/* Screen redraw context. */
struct screen_redraw_ctx {
struct client *c;
@@ -825,7 +870,7 @@ struct screen_redraw_ctx {
int statustop;
int pane_status;
int pane_lines;
enum pane_lines pane_lines;
struct grid_cell no_pane_gc;
int no_pane_gc_set;
@@ -1079,13 +1124,6 @@ TAILQ_HEAD(winlink_stack, winlink);
#define PANE_STATUS_TOP 1
#define PANE_STATUS_BOTTOM 2
/* Pane border lines option. */
#define PANE_LINES_SINGLE 0
#define PANE_LINES_DOUBLE 1
#define PANE_LINES_HEAVY 2
#define PANE_LINES_SIMPLE 3
#define PANE_LINES_NUMBER 4
/* Layout direction. */
enum layout_type {
LAYOUT_LEFTRIGHT,
@@ -1263,7 +1301,7 @@ struct tty {
u_int cx;
u_int cy;
enum screen_cursor_style cstyle;
char *ccolour;
int ccolour;
int oflag;
u_int oox;
@@ -1588,10 +1626,18 @@ struct client_window {
};
RB_HEAD(client_windows, client_window);
/* Visible areas not obstructed by overlays. */
#define OVERLAY_MAX_RANGES 3
struct overlay_ranges {
u_int px[OVERLAY_MAX_RANGES];
u_int nx[OVERLAY_MAX_RANGES];
};
/* Client connection. */
typedef int (*prompt_input_cb)(struct client *, void *, const char *, int);
typedef void (*prompt_free_cb)(void *);
typedef int (*overlay_check_cb)(struct client *, void *, u_int, u_int);
typedef void (*overlay_check_cb)(struct client*, void *, u_int, u_int, u_int,
struct overlay_ranges *);
typedef struct screen *(*overlay_mode_cb)(struct client *, void *, u_int *,
u_int *);
typedef void (*overlay_draw_cb)(struct client *, void *,
@@ -1691,6 +1737,9 @@ struct client {
(CLIENT_DEAD| \
CLIENT_SUSPENDED| \
CLIENT_EXIT)
#define CLIENT_NODETACHFLAGS \
(CLIENT_DEAD| \
CLIENT_EXIT)
#define CLIENT_NOSIZEFLAGS \
(CLIENT_DEAD| \
CLIENT_SUSPENDED| \
@@ -1732,6 +1781,7 @@ struct client {
#define PROMPT_KEY 0x10
int prompt_flags;
enum prompt_type prompt_type;
int prompt_cursor;
struct session *session;
struct session *last_session;
@@ -2013,7 +2063,7 @@ char *format_grid_line(struct grid *, u_int);
/* format-draw.c */
void format_draw(struct screen_write_ctx *,
const struct grid_cell *, u_int, const char *,
struct style_ranges *);
struct style_ranges *, int);
u_int format_width(const char *);
char *format_trim_left(const char *, u_int);
char *format_trim_right(const char *, u_int);
@@ -2079,6 +2129,8 @@ struct style *options_string_to_style(struct options *, const char *,
int options_from_string(struct options *,
const struct options_table_entry *, const char *,
const char *, int, char **);
int options_find_choice(const struct options_table_entry *,
const char *, char **);
void options_push_changes(const char *);
int options_remove_or_default(struct options_entry *, int,
char **);
@@ -2094,9 +2146,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 *, int, 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 environ *,
struct session *, const char *, job_update_cb,
job_complete_cb, job_free_cb, void *, int, int, int);
void job_free(struct job *);
int job_transfer(struct job *, pid_t *, char *, size_t);
void job_resize(struct job *, u_int, u_int);
@@ -2231,6 +2283,9 @@ void tty_default_features(int *, const char *, u_int);
int tty_acs_needed(struct tty *);
const char *tty_acs_get(struct tty *, u_char);
int tty_acs_reverse_get(struct tty *, const char *, size_t);
const struct utf8_data *tty_acs_double_borders(int);
const struct utf8_data *tty_acs_heavy_borders(int);
const struct utf8_data *tty_acs_rounded_borders(int);
/* tty-keys.c */
void tty_keys_build(struct tty *);
@@ -2485,6 +2540,8 @@ void server_client_set_overlay(struct client *, u_int, overlay_check_cb,
overlay_mode_cb, overlay_draw_cb, overlay_key_cb,
overlay_free_cb, overlay_resize_cb, void *);
void server_client_clear_overlay(struct client *);
void server_client_overlay_range(u_int, u_int, u_int, u_int, u_int, u_int,
u_int, struct overlay_ranges *);
void server_client_set_key_table(struct client *, const char *);
const char *server_client_get_key_table(struct client *);
int server_client_check_nested(struct client *);
@@ -2592,6 +2649,7 @@ int input_key_get_mouse(struct screen *, struct mouse_event *, u_int,
int colour_find_rgb(u_char, u_char, u_char);
int colour_join_rgb(u_char, u_char, u_char);
void colour_split_rgb(int, u_char *, u_char *, u_char *);
int colour_force_rgb(int);
const char *colour_tostring(int);
int colour_fromstring(const char *s);
int colour_256toRGB(int);
@@ -2712,7 +2770,8 @@ void screen_write_hline(struct screen_write_ctx *, u_int, int, int);
void screen_write_vline(struct screen_write_ctx *, u_int, int, int);
void screen_write_menu(struct screen_write_ctx *, struct menu *, int,
const struct grid_cell *);
void screen_write_box(struct screen_write_ctx *, u_int, u_int);
void screen_write_box(struct screen_write_ctx *, u_int, u_int, int,
const struct grid_cell *, const char *);
void screen_write_preview(struct screen_write_ctx *, struct screen *, u_int,
u_int);
void screen_write_backspace(struct screen_write_ctx *);
@@ -2765,8 +2824,8 @@ void screen_init(struct screen *, u_int, u_int, u_int);
void screen_reinit(struct screen *);
void screen_free(struct screen *);
void screen_reset_tabs(struct screen *);
void screen_set_cursor_style(struct screen *, u_int);
void screen_set_cursor_colour(struct screen *, const char *);
void screen_set_cursor_style(u_int, enum screen_cursor_style *, int *);
void screen_set_cursor_colour(struct screen *, int);
int screen_set_title(struct screen *, const char *);
void screen_set_path(struct screen *, const char *);
void screen_push_title(struct screen *);
@@ -3117,7 +3176,8 @@ int menu_display(struct menu *, int, struct cmdq_item *, u_int,
u_int, struct client *, struct cmd_find_state *,
menu_choice_cb, void *);
struct screen *menu_mode_cb(struct client *, void *, u_int *, u_int *);
int menu_check_cb(struct client *, void *, u_int, u_int);
void menu_check_cb(struct client *, void *, u_int, u_int, u_int,
struct overlay_ranges *);
void menu_draw_cb(struct client *, void *,
struct screen_redraw_ctx *);
void menu_free_cb(struct client *, void *);
@@ -3126,13 +3186,14 @@ int menu_key_cb(struct client *, void *, struct key_event *);
/* popup.c */
#define POPUP_CLOSEEXIT 0x1
#define POPUP_CLOSEEXITZERO 0x2
#define POPUP_NOBORDER 0x4
#define POPUP_INTERNAL 0x8
#define POPUP_INTERNAL 0x4
typedef void (*popup_close_cb)(int, void *);
typedef void (*popup_finish_edit_cb)(char *, size_t, void *);
int popup_display(int, struct cmdq_item *, u_int, u_int, u_int,
u_int, const char *, int, char **, const char *,
struct client *, struct session *, popup_close_cb, void *);
int popup_display(int, int, struct cmdq_item *, u_int, u_int,
u_int, u_int, struct environ *, const char *, int, char **,
const char *, const char *, struct client *,
struct session *, const char *, const char *,
popup_close_cb, void *);
int popup_editor(struct client *, const char *, size_t,
popup_finish_edit_cb, void *);