mirror of
https://github.com/ghostty-org/ghostty.git
synced 2026-08-27 09:31:39 +00:00
libghostty: add kitty graphics image lookup API
Add a GhosttyKittyGraphicsImage opaque type and API for looking up images by ID and querying their properties. This complements the existing placement iterator by allowing direct image introspection. The new ghostty_kitty_graphics_image() function looks up an image by its ID from the storage, returning a borrowed opaque handle. Properties are queried via ghostty_kitty_image_get() using the new GhosttyKittyGraphicsImageData enum, which exposes id, number, width, height, format, compression, and a borrowed data pointer with length. Format and compression are exposed as their own C enum types (GhosttyKittyImageFormat and GhosttyKittyImageCompression) rather than raw integers.
This commit is contained in:
@@ -234,6 +234,8 @@ comptime {
|
||||
@export(&c.terminal_get, .{ .name = "ghostty_terminal_get" });
|
||||
@export(&c.terminal_grid_ref, .{ .name = "ghostty_terminal_grid_ref" });
|
||||
@export(&c.kitty_graphics_get, .{ .name = "ghostty_kitty_graphics_get" });
|
||||
@export(&c.kitty_graphics_image, .{ .name = "ghostty_kitty_graphics_image" });
|
||||
@export(&c.kitty_image_get, .{ .name = "ghostty_kitty_image_get" });
|
||||
@export(&c.kitty_graphics_placement_iterator_new, .{ .name = "ghostty_kitty_graphics_placement_iterator_new" });
|
||||
@export(&c.kitty_graphics_placement_iterator_free, .{ .name = "ghostty_kitty_graphics_placement_iterator_free" });
|
||||
@export(&c.kitty_graphics_placement_next, .{ .name = "ghostty_kitty_graphics_placement_next" });
|
||||
|
||||
Reference in New Issue
Block a user