mirror of
https://github.com/kovidgoyal/kitty
synced 2026-07-07 17:43:53 +02:00
Image placement using Unicode placeholders
This commit introduces the Unicode placeholder image placement method. In particular: - Virtual placements can be created by passing `U=1` in a put command. - Images with virtual placements can be displayed using the placeholder character `U+10EEEE` with diacritics indicating rows and columns. - The image ID is indicated by the foreground color of the placeholder. Additionally, the most significant byte of the ID can be specified via the third diacritic. - Underline color can be optionally used to specify the placement ID. - A bug was fixed, which caused incomplete image removal when it was overwritten by another image with the same ID.
This commit is contained in:
14
kitty/parse-graphics-command.h
generated
14
kitty/parse-graphics-command.h
generated
@@ -39,7 +39,8 @@ static inline void parse_graphics_code(Screen *screen,
|
||||
cell_x_offset = 'X',
|
||||
cell_y_offset = 'Y',
|
||||
z_index = 'z',
|
||||
cursor_movement = 'C'
|
||||
cursor_movement = 'C',
|
||||
unicode_placement = 'U'
|
||||
};
|
||||
|
||||
enum KEYS key = 'a';
|
||||
@@ -124,6 +125,9 @@ static inline void parse_graphics_code(Screen *screen,
|
||||
case cursor_movement:
|
||||
value_state = UINT;
|
||||
break;
|
||||
case unicode_placement:
|
||||
value_state = UINT;
|
||||
break;
|
||||
default:
|
||||
REPORT_ERROR("Malformed GraphicsCommand control block, invalid key "
|
||||
"character: 0x%x",
|
||||
@@ -268,6 +272,7 @@ static inline void parse_graphics_code(Screen *screen,
|
||||
U(cell_x_offset);
|
||||
U(cell_y_offset);
|
||||
U(cursor_movement);
|
||||
U(unicode_placement);
|
||||
default:
|
||||
break;
|
||||
}
|
||||
@@ -327,7 +332,7 @@ static inline void parse_graphics_code(Screen *screen,
|
||||
|
||||
REPORT_VA_COMMAND(
|
||||
"s {sc sc sc sc sI sI sI sI sI sI sI sI sI sI sI sI sI sI sI sI sI sI sI "
|
||||
"si sI} y#",
|
||||
"sI si sI} y#",
|
||||
"graphics_command", "action", g.action, "delete_action", g.delete_action,
|
||||
"transmission_type", g.transmission_type, "compressed", g.compressed,
|
||||
"format", (unsigned int)g.format, "more", (unsigned int)g.more, "id",
|
||||
@@ -341,8 +346,9 @@ static inline void parse_graphics_code(Screen *screen,
|
||||
"num_cells", (unsigned int)g.num_cells, "num_lines",
|
||||
(unsigned int)g.num_lines, "cell_x_offset", (unsigned int)g.cell_x_offset,
|
||||
"cell_y_offset", (unsigned int)g.cell_y_offset, "cursor_movement",
|
||||
(unsigned int)g.cursor_movement, "z_index", (int)g.z_index, "payload_sz",
|
||||
g.payload_sz, payload, g.payload_sz);
|
||||
(unsigned int)g.cursor_movement, "unicode_placement",
|
||||
(unsigned int)g.unicode_placement, "z_index", (int)g.z_index,
|
||||
"payload_sz", g.payload_sz, payload, g.payload_sz);
|
||||
|
||||
screen_handle_graphics_command(screen, &g, payload);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user