pub const GHOSTTY_VT_VERSION_MAJOR: u32 = 1;
pub const GHOSTTY_VT_VERSION_MINOR: u32 = 0;
pub const GHOSTTY_VT_VERSION_PATCH: u32 = 1;
pub const GHOSTTY_VT_VERSION: &[u8; 6] = b"1.0.1\0";
pub const GHOSTTY_COLOR_NAMED_BLACK: u32 = 0;
pub const GHOSTTY_COLOR_NAMED_RED: u32 = 1;
pub const GHOSTTY_COLOR_NAMED_GREEN: u32 = 2;
pub const GHOSTTY_COLOR_NAMED_YELLOW: u32 = 3;
pub const GHOSTTY_COLOR_NAMED_BLUE: u32 = 4;
pub const GHOSTTY_COLOR_NAMED_MAGENTA: u32 = 5;
pub const GHOSTTY_COLOR_NAMED_CYAN: u32 = 6;
pub const GHOSTTY_COLOR_NAMED_WHITE: u32 = 7;
pub const GHOSTTY_COLOR_NAMED_BRIGHT_BLACK: u32 = 8;
pub const GHOSTTY_COLOR_NAMED_BRIGHT_RED: u32 = 9;
pub const GHOSTTY_COLOR_NAMED_BRIGHT_GREEN: u32 = 10;
pub const GHOSTTY_COLOR_NAMED_BRIGHT_YELLOW: u32 = 11;
pub const GHOSTTY_COLOR_NAMED_BRIGHT_BLUE: u32 = 12;
pub const GHOSTTY_COLOR_NAMED_BRIGHT_MAGENTA: u32 = 13;
pub const GHOSTTY_COLOR_NAMED_BRIGHT_CYAN: u32 = 14;
pub const GHOSTTY_COLOR_NAMED_BRIGHT_WHITE: u32 = 15;
pub const GHOSTTY_DA_CONFORMANCE_VT100: u32 = 1;
pub const GHOSTTY_DA_CONFORMANCE_VT101: u32 = 1;
pub const GHOSTTY_DA_CONFORMANCE_VT102: u32 = 6;
pub const GHOSTTY_DA_CONFORMANCE_VT125: u32 = 12;
pub const GHOSTTY_DA_CONFORMANCE_VT131: u32 = 7;
pub const GHOSTTY_DA_CONFORMANCE_VT132: u32 = 4;
pub const GHOSTTY_DA_CONFORMANCE_VT220: u32 = 62;
pub const GHOSTTY_DA_CONFORMANCE_VT240: u32 = 62;
pub const GHOSTTY_DA_CONFORMANCE_VT320: u32 = 63;
pub const GHOSTTY_DA_CONFORMANCE_VT340: u32 = 63;
pub const GHOSTTY_DA_CONFORMANCE_VT420: u32 = 64;
pub const GHOSTTY_DA_CONFORMANCE_VT510: u32 = 65;
pub const GHOSTTY_DA_CONFORMANCE_VT520: u32 = 65;
pub const GHOSTTY_DA_CONFORMANCE_VT525: u32 = 65;
pub const GHOSTTY_DA_CONFORMANCE_LEVEL_2: u32 = 62;
pub const GHOSTTY_DA_CONFORMANCE_LEVEL_3: u32 = 63;
pub const GHOSTTY_DA_CONFORMANCE_LEVEL_4: u32 = 64;
pub const GHOSTTY_DA_CONFORMANCE_LEVEL_5: u32 = 65;
pub const GHOSTTY_DA_FEATURE_COLUMNS_132: u32 = 1;
pub const GHOSTTY_DA_FEATURE_PRINTER: u32 = 2;
pub const GHOSTTY_DA_FEATURE_REGIS: u32 = 3;
pub const GHOSTTY_DA_FEATURE_SIXEL: u32 = 4;
pub const GHOSTTY_DA_FEATURE_SELECTIVE_ERASE: u32 = 6;
pub const GHOSTTY_DA_FEATURE_USER_DEFINED_KEYS: u32 = 8;
pub const GHOSTTY_DA_FEATURE_NATIONAL_REPLACEMENT: u32 = 9;
pub const GHOSTTY_DA_FEATURE_TECHNICAL_CHARACTERS: u32 = 15;
pub const GHOSTTY_DA_FEATURE_LOCATOR: u32 = 16;
pub const GHOSTTY_DA_FEATURE_TERMINAL_STATE: u32 = 17;
pub const GHOSTTY_DA_FEATURE_WINDOWING: u32 = 18;
pub const GHOSTTY_DA_FEATURE_HORIZONTAL_SCROLLING: u32 = 21;
pub const GHOSTTY_DA_FEATURE_ANSI_COLOR: u32 = 22;
pub const GHOSTTY_DA_FEATURE_RECTANGULAR_EDITING: u32 = 28;
pub const GHOSTTY_DA_FEATURE_ANSI_TEXT_LOCATOR: u32 = 29;
pub const GHOSTTY_DA_FEATURE_CLIPBOARD: u32 = 52;
pub const GHOSTTY_DA_DEVICE_TYPE_VT100: u32 = 0;
pub const GHOSTTY_DA_DEVICE_TYPE_VT220: u32 = 1;
pub const GHOSTTY_DA_DEVICE_TYPE_VT240: u32 = 2;
pub const GHOSTTY_DA_DEVICE_TYPE_VT330: u32 = 18;
pub const GHOSTTY_DA_DEVICE_TYPE_VT340: u32 = 19;
pub const GHOSTTY_DA_DEVICE_TYPE_VT320: u32 = 24;
pub const GHOSTTY_DA_DEVICE_TYPE_VT382: u32 = 32;
pub const GHOSTTY_DA_DEVICE_TYPE_VT420: u32 = 41;
pub const GHOSTTY_DA_DEVICE_TYPE_VT510: u32 = 61;
pub const GHOSTTY_DA_DEVICE_TYPE_VT520: u32 = 64;
pub const GHOSTTY_DA_DEVICE_TYPE_VT525: u32 = 65;
pub const GHOSTTY_STYLE_UNDERLINE_SHIFT: u32 = 8;
pub const GHOSTTY_FORMATTER_EXTRA_PALETTE: u32 = 1;
pub const GHOSTTY_FORMATTER_EXTRA_MODES: u32 = 2;
pub const GHOSTTY_FORMATTER_EXTRA_SCROLLING_REGION: u32 = 4;
pub const GHOSTTY_FORMATTER_EXTRA_TABSTOPS: u32 = 8;
pub const GHOSTTY_FORMATTER_EXTRA_PWD: u32 = 16;
pub const GHOSTTY_FORMATTER_EXTRA_KEYBOARD: u32 = 32;
pub const GHOSTTY_FORMATTER_EXTRA_CURSOR: u32 = 64;
pub const GHOSTTY_FORMATTER_EXTRA_STYLE: u32 = 128;
pub const GHOSTTY_FORMATTER_EXTRA_HYPERLINK: u32 = 256;
pub const GHOSTTY_FORMATTER_EXTRA_PROTECTION: u32 = 512;
pub const GHOSTTY_FORMATTER_EXTRA_KITTY_KEYBOARD: u32 = 1024;
pub const GHOSTTY_FORMATTER_EXTRA_CHARSETS: u32 = 2048;
pub const GHOSTTY_FORMATTER_EXTRAS_NONE: u32 = 0;
pub const GHOSTTY_FORMATTER_EXTRAS_ALL: u32 = 4095;
pub const GHOSTTY_FORMATTER_EXTRAS_DEFAULT: u32 = 385;
pub const GHOSTTY_MODS_SHIFT: u32 = 1;
pub const GHOSTTY_MODS_CTRL: u32 = 2;
pub const GHOSTTY_MODS_ALT: u32 = 4;
pub const GHOSTTY_MODS_SUPER: u32 = 8;
pub const GHOSTTY_MODS_CAPS_LOCK: u32 = 16;
pub const GHOSTTY_MODS_NUM_LOCK: u32 = 32;
pub const GHOSTTY_MODS_SHIFT_SIDE: u32 = 64;
pub const GHOSTTY_MODS_CTRL_SIDE: u32 = 128;
pub const GHOSTTY_MODS_ALT_SIDE: u32 = 256;
pub const GHOSTTY_MODS_SUPER_SIDE: u32 = 512;
pub const GHOSTTY_KITTY_KEY_DISABLED: u32 = 0;
pub const GHOSTTY_KITTY_KEY_DISAMBIGUATE: u32 = 1;
pub const GHOSTTY_KITTY_KEY_REPORT_EVENTS: u32 = 2;
pub const GHOSTTY_KITTY_KEY_REPORT_ALTERNATES: u32 = 4;
pub const GHOSTTY_KITTY_KEY_REPORT_ALL: u32 = 8;
pub const GHOSTTY_KITTY_KEY_REPORT_ASSOCIATED: u32 = 16;
pub const GHOSTTY_KITTY_KEY_ALL: u32 = 31;
pub mod GhosttyResult {
#[allow(unused_imports)]
use super::*;
pub type Type = ::std::os::raw::c_int;
pub const GHOSTTY_SUCCESS: Type = 0;
pub const GHOSTTY_OUT_OF_MEMORY: Type = -1;
pub const GHOSTTY_INVALID_VALUE: Type = -2;
pub const GHOSTTY_OUT_OF_SPACE: Type = -3;
pub const GHOSTTY_NO_VALUE: Type = -4;
pub const GHOSTTY_IO_ERROR: Type = -5;
pub const GHOSTTY_LIMIT_EXCEEDED: Type = -6;
pub const GHOSTTY_REJECTED: Type = -7;
pub const GHOSTTY_UNSUPPORTED: Type = -8;
pub const GHOSTTY_RESULT_MAX_VALUE: Type = 2147483647;
}
#[repr(C)]
#[derive(Debug)]
pub struct GhosttyTerminalImpl {
_unused: [u8; 0],
}
pub type GhosttyTerminal = *mut GhosttyTerminalImpl;
#[repr(C)]
#[derive(Debug)]
pub struct GhosttySnapshotDecoderImpl {
_unused: [u8; 0],
}
pub type GhosttySnapshotDecoder = *mut GhosttySnapshotDecoderImpl;
#[repr(C)]
#[derive(Debug)]
pub struct GhosttyTrackedGridRefImpl {
_unused: [u8; 0],
}
pub type GhosttyTrackedGridRef = *mut GhosttyTrackedGridRefImpl;
#[repr(C)]
#[derive(Debug)]
pub struct GhosttyKittyGraphicsImpl {
_unused: [u8; 0],
}
pub type GhosttyKittyGraphics = *mut GhosttyKittyGraphicsImpl;
#[repr(C)]
#[derive(Debug)]
pub struct GhosttyKittyGraphicsImageImpl {
_unused: [u8; 0],
}
pub type GhosttyKittyGraphicsImage = *const GhosttyKittyGraphicsImageImpl;
#[repr(C)]
#[derive(Debug)]
pub struct GhosttyKittyGraphicsPlacementIteratorImpl {
_unused: [u8; 0],
}
pub type GhosttyKittyGraphicsPlacementIterator = *mut GhosttyKittyGraphicsPlacementIteratorImpl;
#[repr(C)]
#[derive(Debug)]
pub struct GhosttyRenderStateImpl {
_unused: [u8; 0],
}
pub type GhosttyRenderState = *mut GhosttyRenderStateImpl;
#[repr(C)]
#[derive(Debug)]
pub struct GhosttyRenderStateRowIteratorImpl {
_unused: [u8; 0],
}
pub type GhosttyRenderStateRowIterator = *mut GhosttyRenderStateRowIteratorImpl;
#[repr(C)]
#[derive(Debug)]
pub struct GhosttyRenderStateRowCellsImpl {
_unused: [u8; 0],
}
pub type GhosttyRenderStateRowCells = *mut GhosttyRenderStateRowCellsImpl;
#[repr(C)]
#[derive(Debug)]
pub struct GhosttyRenderStateImageIteratorImpl {
_unused: [u8; 0],
}
pub type GhosttyRenderStateImageIterator = *mut GhosttyRenderStateImageIteratorImpl;
#[repr(C)]
#[derive(Debug)]
pub struct GhosttySearchImpl {
_unused: [u8; 0],
}
pub type GhosttySearch = *mut GhosttySearchImpl;
#[repr(C)]
#[derive(Debug)]
pub struct GhosttySgrParserImpl {
_unused: [u8; 0],
}
pub type GhosttySgrParser = *mut GhosttySgrParserImpl;
#[repr(C)]
#[derive(Debug)]
pub struct GhosttyFormatterImpl {
_unused: [u8; 0],
}
pub type GhosttyFormatter = *mut GhosttyFormatterImpl;
#[repr(C)]
#[derive(Debug)]
pub struct GhosttyOscParserImpl {
_unused: [u8; 0],
}
pub type GhosttyOscParser = *mut GhosttyOscParserImpl;
#[repr(C)]
#[derive(Debug)]
pub struct GhosttyOscCommandImpl {
_unused: [u8; 0],
}
pub type GhosttyOscCommand = *mut GhosttyOscCommandImpl;
pub mod GhosttyFormatterFormat {
#[allow(unused_imports)]
use super::*;
pub type Type = ::std::os::raw::c_uint;
pub const GHOSTTY_FORMATTER_FORMAT_PLAIN: Type = 0;
pub const GHOSTTY_FORMATTER_FORMAT_VT: Type = 1;
pub const GHOSTTY_FORMATTER_FORMAT_HTML: Type = 2;
pub const GHOSTTY_FORMATTER_FORMAT_MAX_VALUE: Type = 2147483647;
}
pub mod GhosttyCursorStyle {
#[allow(unused_imports)]
use super::*;
pub type Type = ::std::os::raw::c_uint;
pub const GHOSTTY_CURSOR_STYLE_BAR: Type = 0;
pub const GHOSTTY_CURSOR_STYLE_BLOCK: Type = 1;
pub const GHOSTTY_CURSOR_STYLE_UNDERLINE: Type = 2;
pub const GHOSTTY_CURSOR_STYLE_BLOCK_HOLLOW: Type = 3;
pub const GHOSTTY_CURSOR_STYLE_MAX_VALUE: Type = 2147483647;
}
pub mod GhosttyImageLayer {
#[allow(unused_imports)]
use super::*;
pub type Type = ::std::os::raw::c_uint;
pub const GHOSTTY_IMAGE_LAYER_BELOW_BACKGROUND: Type = 0;
pub const GHOSTTY_IMAGE_LAYER_BELOW_TEXT: Type = 1;
pub const GHOSTTY_IMAGE_LAYER_ABOVE_TEXT: Type = 2;
pub const GHOSTTY_IMAGE_LAYER_MAX_VALUE: Type = 2147483647;
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct GhosttyString {
pub ptr: *const u8,
pub len: usize,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
["Size of GhosttyString"][::std::mem::size_of::<GhosttyString>() - 16usize];
["Alignment of GhosttyString"][::std::mem::align_of::<GhosttyString>() - 8usize];
["Offset of field: GhosttyString::ptr"][::std::mem::offset_of!(GhosttyString, ptr) - 0usize];
["Offset of field: GhosttyString::len"][::std::mem::offset_of!(GhosttyString, len) - 8usize];
};
impl Default for GhosttyString {
fn default() -> Self {
let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
unsafe {
::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
s.assume_init()
}
}
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct GhosttyBuffer {
pub ptr: *mut u8,
pub cap: usize,
pub len: usize,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
["Size of GhosttyBuffer"][::std::mem::size_of::<GhosttyBuffer>() - 24usize];
["Alignment of GhosttyBuffer"][::std::mem::align_of::<GhosttyBuffer>() - 8usize];
["Offset of field: GhosttyBuffer::ptr"][::std::mem::offset_of!(GhosttyBuffer, ptr) - 0usize];
["Offset of field: GhosttyBuffer::cap"][::std::mem::offset_of!(GhosttyBuffer, cap) - 8usize];
["Offset of field: GhosttyBuffer::len"][::std::mem::offset_of!(GhosttyBuffer, len) - 16usize];
};
impl Default for GhosttyBuffer {
fn default() -> Self {
let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
unsafe {
::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
s.assume_init()
}
}
}
#[repr(C)]
#[derive(Debug, Default, Copy, Clone)]
pub struct GhosttySurfacePosition {
pub x: f64,
pub y: f64,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
["Size of GhosttySurfacePosition"][::std::mem::size_of::<GhosttySurfacePosition>() - 16usize];
["Alignment of GhosttySurfacePosition"]
[::std::mem::align_of::<GhosttySurfacePosition>() - 8usize];
["Offset of field: GhosttySurfacePosition::x"]
[::std::mem::offset_of!(GhosttySurfacePosition, x) - 0usize];
["Offset of field: GhosttySurfacePosition::y"]
[::std::mem::offset_of!(GhosttySurfacePosition, y) - 8usize];
};
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct GhosttyCodepoints {
pub ptr: *const u32,
pub len: usize,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
["Size of GhosttyCodepoints"][::std::mem::size_of::<GhosttyCodepoints>() - 16usize];
["Alignment of GhosttyCodepoints"][::std::mem::align_of::<GhosttyCodepoints>() - 8usize];
["Offset of field: GhosttyCodepoints::ptr"]
[::std::mem::offset_of!(GhosttyCodepoints, ptr) - 0usize];
["Offset of field: GhosttyCodepoints::len"]
[::std::mem::offset_of!(GhosttyCodepoints, len) - 8usize];
};
impl Default for GhosttyCodepoints {
fn default() -> Self {
let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
unsafe {
::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
s.assume_init()
}
}
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct GhosttyCodepointBuffer {
pub ptr: *mut u32,
pub cap: usize,
pub len: usize,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
["Size of GhosttyCodepointBuffer"][::std::mem::size_of::<GhosttyCodepointBuffer>() - 24usize];
["Alignment of GhosttyCodepointBuffer"]
[::std::mem::align_of::<GhosttyCodepointBuffer>() - 8usize];
["Offset of field: GhosttyCodepointBuffer::ptr"]
[::std::mem::offset_of!(GhosttyCodepointBuffer, ptr) - 0usize];
["Offset of field: GhosttyCodepointBuffer::cap"]
[::std::mem::offset_of!(GhosttyCodepointBuffer, cap) - 8usize];
["Offset of field: GhosttyCodepointBuffer::len"]
[::std::mem::offset_of!(GhosttyCodepointBuffer, len) - 16usize];
};
impl Default for GhosttyCodepointBuffer {
fn default() -> Self {
let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
unsafe {
::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
s.assume_init()
}
}
}
unsafe extern "C" {
pub fn ghostty_sized_init(ptr: *mut ::std::os::raw::c_void, size: usize);
}
unsafe extern "C" {
pub fn ghostty_type_json() -> *const ::std::os::raw::c_char;
}
pub type GhosttyAllocatorAllocFn = ::std::option::Option<
unsafe extern "C" fn(
ctx: *mut ::std::os::raw::c_void,
len: usize,
alignment: u8,
ret_addr: usize,
) -> *mut ::std::os::raw::c_void,
>;
pub type GhosttyAllocatorResizeFn = ::std::option::Option<
unsafe extern "C" fn(
ctx: *mut ::std::os::raw::c_void,
memory: *mut ::std::os::raw::c_void,
memory_len: usize,
alignment: u8,
new_len: usize,
ret_addr: usize,
) -> bool,
>;
pub type GhosttyAllocatorRemapFn = ::std::option::Option<
unsafe extern "C" fn(
ctx: *mut ::std::os::raw::c_void,
memory: *mut ::std::os::raw::c_void,
memory_len: usize,
alignment: u8,
new_len: usize,
ret_addr: usize,
) -> *mut ::std::os::raw::c_void,
>;
pub type GhosttyAllocatorFreeFn = ::std::option::Option<
unsafe extern "C" fn(
ctx: *mut ::std::os::raw::c_void,
memory: *mut ::std::os::raw::c_void,
memory_len: usize,
alignment: u8,
ret_addr: usize,
),
>;
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct GhosttyAllocatorVtable {
pub alloc: GhosttyAllocatorAllocFn,
pub resize: GhosttyAllocatorResizeFn,
pub remap: GhosttyAllocatorRemapFn,
pub free: GhosttyAllocatorFreeFn,
pub reserved: [*mut ::std::os::raw::c_void; 4usize],
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
["Size of GhosttyAllocatorVtable"][::std::mem::size_of::<GhosttyAllocatorVtable>() - 64usize];
["Alignment of GhosttyAllocatorVtable"]
[::std::mem::align_of::<GhosttyAllocatorVtable>() - 8usize];
["Offset of field: GhosttyAllocatorVtable::alloc"]
[::std::mem::offset_of!(GhosttyAllocatorVtable, alloc) - 0usize];
["Offset of field: GhosttyAllocatorVtable::resize"]
[::std::mem::offset_of!(GhosttyAllocatorVtable, resize) - 8usize];
["Offset of field: GhosttyAllocatorVtable::remap"]
[::std::mem::offset_of!(GhosttyAllocatorVtable, remap) - 16usize];
["Offset of field: GhosttyAllocatorVtable::free"]
[::std::mem::offset_of!(GhosttyAllocatorVtable, free) - 24usize];
["Offset of field: GhosttyAllocatorVtable::reserved"]
[::std::mem::offset_of!(GhosttyAllocatorVtable, reserved) - 32usize];
};
impl Default for GhosttyAllocatorVtable {
fn default() -> Self {
let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
unsafe {
::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
s.assume_init()
}
}
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct GhosttyAllocator {
pub ctx: *mut ::std::os::raw::c_void,
pub vtable: *const GhosttyAllocatorVtable,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
["Size of GhosttyAllocator"][::std::mem::size_of::<GhosttyAllocator>() - 16usize];
["Alignment of GhosttyAllocator"][::std::mem::align_of::<GhosttyAllocator>() - 8usize];
["Offset of field: GhosttyAllocator::ctx"]
[::std::mem::offset_of!(GhosttyAllocator, ctx) - 0usize];
["Offset of field: GhosttyAllocator::vtable"]
[::std::mem::offset_of!(GhosttyAllocator, vtable) - 8usize];
};
impl Default for GhosttyAllocator {
fn default() -> Self {
let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
unsafe {
::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
s.assume_init()
}
}
}
unsafe extern "C" {
pub fn ghostty_alloc(allocator: *const GhosttyAllocator, len: usize) -> *mut u8;
}
unsafe extern "C" {
pub fn ghostty_free(allocator: *const GhosttyAllocator, ptr: *mut u8, len: usize);
}
pub mod GhosttyOptimizeMode {
#[allow(unused_imports)]
use super::*;
pub type Type = ::std::os::raw::c_uint;
pub const GHOSTTY_OPTIMIZE_DEBUG: Type = 0;
pub const GHOSTTY_OPTIMIZE_RELEASE_SAFE: Type = 1;
pub const GHOSTTY_OPTIMIZE_RELEASE_SMALL: Type = 2;
pub const GHOSTTY_OPTIMIZE_RELEASE_FAST: Type = 3;
pub const GHOSTTY_OPTIMIZE_MODE_MAX_VALUE: Type = 2147483647;
}
pub mod GhosttyBuildInfo {
#[allow(unused_imports)]
use super::*;
pub type Type = ::std::os::raw::c_uint;
pub const GHOSTTY_BUILD_INFO_INVALID: Type = 0;
pub const GHOSTTY_BUILD_INFO_SIMD: Type = 1;
pub const GHOSTTY_BUILD_INFO_KITTY_GRAPHICS: Type = 2;
pub const GHOSTTY_BUILD_INFO_TMUX_CONTROL_MODE: Type = 3;
pub const GHOSTTY_BUILD_INFO_OPTIMIZE: Type = 4;
pub const GHOSTTY_BUILD_INFO_VERSION_STRING: Type = 5;
pub const GHOSTTY_BUILD_INFO_VERSION_MAJOR: Type = 6;
pub const GHOSTTY_BUILD_INFO_VERSION_MINOR: Type = 7;
pub const GHOSTTY_BUILD_INFO_VERSION_PATCH: Type = 8;
pub const GHOSTTY_BUILD_INFO_VERSION_PRE: Type = 9;
pub const GHOSTTY_BUILD_INFO_VERSION_BUILD: Type = 10;
pub const GHOSTTY_BUILD_INFO_FEATURE_SNAPSHOT: Type = 11;
pub const GHOSTTY_BUILD_INFO_FEATURE_FORMATTER: Type = 12;
pub const GHOSTTY_BUILD_INFO_FEATURE_SELECTION: Type = 13;
pub const GHOSTTY_BUILD_INFO_FEATURE_SEARCH: Type = 14;
pub const GHOSTTY_BUILD_INFO_FEATURE_RENDER_STATE: Type = 15;
pub const GHOSTTY_BUILD_INFO_FEATURE_INPUT_ENCODE: Type = 16;
pub const GHOSTTY_BUILD_INFO_FEATURE_COLOR: Type = 17;
pub const GHOSTTY_BUILD_INFO_FEATURE_GRID_INTROSPECTION: Type = 18;
pub const GHOSTTY_BUILD_INFO_FEATURE_GLYPH_PROTOCOL: Type = 19;
pub const GHOSTTY_BUILD_INFO_MAX_VALUE: Type = 2147483647;
}
unsafe extern "C" {
pub fn ghostty_build_info(
data: GhosttyBuildInfo::Type,
out: *mut ::std::os::raw::c_void,
) -> GhosttyResult::Type;
}
unsafe extern "C" {
pub fn ghostty_version() -> *const ::std::os::raw::c_char;
}
#[repr(C)]
#[derive(Debug, Default, Copy, Clone)]
pub struct GhosttyColorRgb {
pub r: u8,
pub g: u8,
pub b: u8,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
["Size of GhosttyColorRgb"][::std::mem::size_of::<GhosttyColorRgb>() - 3usize];
["Alignment of GhosttyColorRgb"][::std::mem::align_of::<GhosttyColorRgb>() - 1usize];
["Offset of field: GhosttyColorRgb::r"][::std::mem::offset_of!(GhosttyColorRgb, r) - 0usize];
["Offset of field: GhosttyColorRgb::g"][::std::mem::offset_of!(GhosttyColorRgb, g) - 1usize];
["Offset of field: GhosttyColorRgb::b"][::std::mem::offset_of!(GhosttyColorRgb, b) - 2usize];
};
pub type GhosttyColorPaletteIndex = u8;
#[repr(C)]
#[derive(Debug, Default, Copy, Clone)]
pub struct GhosttyColorPaletteMask {
pub bits: [u64; 4usize],
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
["Size of GhosttyColorPaletteMask"][::std::mem::size_of::<GhosttyColorPaletteMask>() - 32usize];
["Alignment of GhosttyColorPaletteMask"]
[::std::mem::align_of::<GhosttyColorPaletteMask>() - 8usize];
["Offset of field: GhosttyColorPaletteMask::bits"]
[::std::mem::offset_of!(GhosttyColorPaletteMask, bits) - 0usize];
};
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct GhosttyColorX11Entry {
pub name: *const ::std::os::raw::c_char,
pub color: GhosttyColorRgb,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
["Size of GhosttyColorX11Entry"][::std::mem::size_of::<GhosttyColorX11Entry>() - 16usize];
["Alignment of GhosttyColorX11Entry"][::std::mem::align_of::<GhosttyColorX11Entry>() - 8usize];
["Offset of field: GhosttyColorX11Entry::name"]
[::std::mem::offset_of!(GhosttyColorX11Entry, name) - 0usize];
["Offset of field: GhosttyColorX11Entry::color"]
[::std::mem::offset_of!(GhosttyColorX11Entry, color) - 8usize];
};
impl Default for GhosttyColorX11Entry {
fn default() -> Self {
let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
unsafe {
::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
s.assume_init()
}
}
}
unsafe extern "C" {
pub fn ghostty_color_rgb_get(color: *const GhosttyColorRgb, r: *mut u8, g: *mut u8, b: *mut u8);
}
unsafe extern "C" {
pub fn ghostty_color_parse_x11(
name: *const ::std::os::raw::c_char,
len: usize,
out: *mut GhosttyColorRgb,
) -> GhosttyResult::Type;
}
unsafe extern "C" {
pub fn ghostty_color_parse(
value: *const ::std::os::raw::c_char,
len: usize,
out: *mut GhosttyColorRgb,
) -> GhosttyResult::Type;
}
unsafe extern "C" {
pub fn ghostty_color_parse_palette_entry(
value: *const ::std::os::raw::c_char,
len: usize,
out_index: *mut u8,
out_rgb: *mut GhosttyColorRgb,
) -> GhosttyResult::Type;
}
unsafe extern "C" {
pub fn ghostty_color_palette_default(out: *mut GhosttyColorRgb);
}
unsafe extern "C" {
pub fn ghostty_color_palette_generate(
base: *const GhosttyColorRgb,
skip: *const GhosttyColorPaletteMask,
bg: *const GhosttyColorRgb,
fg: *const GhosttyColorRgb,
harmonious: bool,
out: *mut GhosttyColorRgb,
);
}
unsafe extern "C" {
pub fn ghostty_color_luminance(color: *const GhosttyColorRgb) -> f64;
}
unsafe extern "C" {
pub fn ghostty_color_perceived_luminance(color: *const GhosttyColorRgb) -> f64;
}
unsafe extern "C" {
pub fn ghostty_color_contrast(a: *const GhosttyColorRgb, b: *const GhosttyColorRgb) -> f64;
}
unsafe extern "C" {
pub fn ghostty_color_x11_names() -> *const GhosttyColorX11Entry;
}
unsafe extern "C" {
pub fn ghostty_color_x11_name_count() -> usize;
}
pub mod GhosttyColorScheme {
#[allow(unused_imports)]
use super::*;
pub type Type = ::std::os::raw::c_uint;
pub const GHOSTTY_COLOR_SCHEME_LIGHT: Type = 0;
pub const GHOSTTY_COLOR_SCHEME_DARK: Type = 1;
pub const GHOSTTY_COLOR_SCHEME_MAX_VALUE: Type = 2147483647;
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct GhosttyDeviceAttributesPrimary {
pub conformance_level: u16,
pub features: [u16; 64usize],
pub num_features: usize,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
["Size of GhosttyDeviceAttributesPrimary"]
[::std::mem::size_of::<GhosttyDeviceAttributesPrimary>() - 144usize];
["Alignment of GhosttyDeviceAttributesPrimary"]
[::std::mem::align_of::<GhosttyDeviceAttributesPrimary>() - 8usize];
["Offset of field: GhosttyDeviceAttributesPrimary::conformance_level"]
[::std::mem::offset_of!(GhosttyDeviceAttributesPrimary, conformance_level) - 0usize];
["Offset of field: GhosttyDeviceAttributesPrimary::features"]
[::std::mem::offset_of!(GhosttyDeviceAttributesPrimary, features) - 2usize];
["Offset of field: GhosttyDeviceAttributesPrimary::num_features"]
[::std::mem::offset_of!(GhosttyDeviceAttributesPrimary, num_features) - 136usize];
};
impl Default for GhosttyDeviceAttributesPrimary {
fn default() -> Self {
let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
unsafe {
::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
s.assume_init()
}
}
}
#[repr(C)]
#[derive(Debug, Default, Copy, Clone)]
pub struct GhosttyDeviceAttributesSecondary {
pub device_type: u16,
pub firmware_version: u16,
pub rom_cartridge: u16,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
["Size of GhosttyDeviceAttributesSecondary"]
[::std::mem::size_of::<GhosttyDeviceAttributesSecondary>() - 6usize];
["Alignment of GhosttyDeviceAttributesSecondary"]
[::std::mem::align_of::<GhosttyDeviceAttributesSecondary>() - 2usize];
["Offset of field: GhosttyDeviceAttributesSecondary::device_type"]
[::std::mem::offset_of!(GhosttyDeviceAttributesSecondary, device_type) - 0usize];
["Offset of field: GhosttyDeviceAttributesSecondary::firmware_version"]
[::std::mem::offset_of!(GhosttyDeviceAttributesSecondary, firmware_version) - 2usize];
["Offset of field: GhosttyDeviceAttributesSecondary::rom_cartridge"]
[::std::mem::offset_of!(GhosttyDeviceAttributesSecondary, rom_cartridge) - 4usize];
};
#[repr(C)]
#[derive(Debug, Default, Copy, Clone)]
pub struct GhosttyDeviceAttributesTertiary {
pub unit_id: u32,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
["Size of GhosttyDeviceAttributesTertiary"]
[::std::mem::size_of::<GhosttyDeviceAttributesTertiary>() - 4usize];
["Alignment of GhosttyDeviceAttributesTertiary"]
[::std::mem::align_of::<GhosttyDeviceAttributesTertiary>() - 4usize];
["Offset of field: GhosttyDeviceAttributesTertiary::unit_id"]
[::std::mem::offset_of!(GhosttyDeviceAttributesTertiary, unit_id) - 0usize];
};
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct GhosttyDeviceAttributes {
pub primary: GhosttyDeviceAttributesPrimary,
pub secondary: GhosttyDeviceAttributesSecondary,
pub tertiary: GhosttyDeviceAttributesTertiary,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
["Size of GhosttyDeviceAttributes"]
[::std::mem::size_of::<GhosttyDeviceAttributes>() - 160usize];
["Alignment of GhosttyDeviceAttributes"]
[::std::mem::align_of::<GhosttyDeviceAttributes>() - 8usize];
["Offset of field: GhosttyDeviceAttributes::primary"]
[::std::mem::offset_of!(GhosttyDeviceAttributes, primary) - 0usize];
["Offset of field: GhosttyDeviceAttributes::secondary"]
[::std::mem::offset_of!(GhosttyDeviceAttributes, secondary) - 144usize];
["Offset of field: GhosttyDeviceAttributes::tertiary"]
[::std::mem::offset_of!(GhosttyDeviceAttributes, tertiary) - 152usize];
};
impl Default for GhosttyDeviceAttributes {
fn default() -> Self {
let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
unsafe {
::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
s.assume_init()
}
}
}
unsafe extern "C" {
pub fn ghostty_color_scheme_report_encode(
scheme: GhosttyColorScheme::Type,
buf: *mut u8,
buf_len: usize,
out_written: *mut usize,
) -> GhosttyResult::Type;
}
pub mod GhosttyFocusEvent {
#[allow(unused_imports)]
use super::*;
pub type Type = ::std::os::raw::c_uint;
pub const GHOSTTY_FOCUS_GAINED: Type = 0;
pub const GHOSTTY_FOCUS_LOST: Type = 1;
pub const GHOSTTY_FOCUS_MAX_VALUE: Type = 2147483647;
}
unsafe extern "C" {
pub fn ghostty_focus_encode(
event: GhosttyFocusEvent::Type,
buf: *mut u8,
buf_len: usize,
out_written: *mut usize,
) -> GhosttyResult::Type;
}
pub type GhosttyReaderFn = ::std::option::Option<
unsafe extern "C" fn(
userdata: *mut ::std::os::raw::c_void,
buffer: *mut u8,
capacity: usize,
out_read: *mut usize,
) -> bool,
>;
pub type GhosttyWriterFn = ::std::option::Option<
unsafe extern "C" fn(
userdata: *mut ::std::os::raw::c_void,
data: *const u8,
len: usize,
) -> bool,
>;
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct GhosttyReader {
pub read: GhosttyReaderFn,
pub userdata: *mut ::std::os::raw::c_void,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
["Size of GhosttyReader"][::std::mem::size_of::<GhosttyReader>() - 16usize];
["Alignment of GhosttyReader"][::std::mem::align_of::<GhosttyReader>() - 8usize];
["Offset of field: GhosttyReader::read"][::std::mem::offset_of!(GhosttyReader, read) - 0usize];
["Offset of field: GhosttyReader::userdata"]
[::std::mem::offset_of!(GhosttyReader, userdata) - 8usize];
};
impl Default for GhosttyReader {
fn default() -> Self {
let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
unsafe {
::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
s.assume_init()
}
}
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct GhosttyWriter {
pub write: GhosttyWriterFn,
pub userdata: *mut ::std::os::raw::c_void,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
["Size of GhosttyWriter"][::std::mem::size_of::<GhosttyWriter>() - 16usize];
["Alignment of GhosttyWriter"][::std::mem::align_of::<GhosttyWriter>() - 8usize];
["Offset of field: GhosttyWriter::write"]
[::std::mem::offset_of!(GhosttyWriter, write) - 0usize];
["Offset of field: GhosttyWriter::userdata"]
[::std::mem::offset_of!(GhosttyWriter, userdata) - 8usize];
};
impl Default for GhosttyWriter {
fn default() -> Self {
let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
unsafe {
::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
s.assume_init()
}
}
}
pub type GhosttyMimeReaderFn = ::std::option::Option<
unsafe extern "C" fn(
userdata: *mut ::std::os::raw::c_void,
mime: GhosttyString,
writer: GhosttyWriter,
) -> bool,
>;
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct GhosttyMimeReader {
pub read: GhosttyMimeReaderFn,
pub userdata: *mut ::std::os::raw::c_void,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
["Size of GhosttyMimeReader"][::std::mem::size_of::<GhosttyMimeReader>() - 16usize];
["Alignment of GhosttyMimeReader"][::std::mem::align_of::<GhosttyMimeReader>() - 8usize];
["Offset of field: GhosttyMimeReader::read"]
[::std::mem::offset_of!(GhosttyMimeReader, read) - 0usize];
["Offset of field: GhosttyMimeReader::userdata"]
[::std::mem::offset_of!(GhosttyMimeReader, userdata) - 8usize];
};
impl Default for GhosttyMimeReader {
fn default() -> Self {
let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
unsafe {
::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
s.assume_init()
}
}
}
pub type GhosttyCell = u64;
pub type GhosttyRow = u64;
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct GhosttyCellsView {
pub ptr: *const GhosttyCell,
pub len: usize,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
["Size of GhosttyCellsView"][::std::mem::size_of::<GhosttyCellsView>() - 16usize];
["Alignment of GhosttyCellsView"][::std::mem::align_of::<GhosttyCellsView>() - 8usize];
["Offset of field: GhosttyCellsView::ptr"]
[::std::mem::offset_of!(GhosttyCellsView, ptr) - 0usize];
["Offset of field: GhosttyCellsView::len"]
[::std::mem::offset_of!(GhosttyCellsView, len) - 8usize];
};
impl Default for GhosttyCellsView {
fn default() -> Self {
let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
unsafe {
::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
s.assume_init()
}
}
}
pub mod GhosttyCellContentTag {
#[allow(unused_imports)]
use super::*;
pub type Type = ::std::os::raw::c_uint;
pub const GHOSTTY_CELL_CONTENT_CODEPOINT: Type = 0;
pub const GHOSTTY_CELL_CONTENT_CODEPOINT_GRAPHEME: Type = 1;
pub const GHOSTTY_CELL_CONTENT_BG_COLOR_PALETTE: Type = 2;
pub const GHOSTTY_CELL_CONTENT_BG_COLOR_RGB: Type = 3;
pub const GHOSTTY_CELL_CONTENT_TAG_MAX_VALUE: Type = 2147483647;
}
pub mod GhosttyCellWide {
#[allow(unused_imports)]
use super::*;
pub type Type = ::std::os::raw::c_uint;
pub const GHOSTTY_CELL_WIDE_NARROW: Type = 0;
pub const GHOSTTY_CELL_WIDE_WIDE: Type = 1;
pub const GHOSTTY_CELL_WIDE_SPACER_TAIL: Type = 2;
pub const GHOSTTY_CELL_WIDE_SPACER_HEAD: Type = 3;
pub const GHOSTTY_CELL_WIDE_MAX_VALUE: Type = 2147483647;
}
pub mod GhosttyCellSemanticContent {
#[allow(unused_imports)]
use super::*;
pub type Type = ::std::os::raw::c_uint;
pub const GHOSTTY_CELL_SEMANTIC_OUTPUT: Type = 0;
pub const GHOSTTY_CELL_SEMANTIC_INPUT: Type = 1;
pub const GHOSTTY_CELL_SEMANTIC_PROMPT: Type = 2;
pub const GHOSTTY_CELL_SEMANTIC_MAX_VALUE: Type = 2147483647;
}
pub mod GhosttyCellData {
#[allow(unused_imports)]
use super::*;
pub type Type = ::std::os::raw::c_uint;
pub const GHOSTTY_CELL_DATA_INVALID: Type = 0;
pub const GHOSTTY_CELL_DATA_CODEPOINT: Type = 1;
pub const GHOSTTY_CELL_DATA_CONTENT_TAG: Type = 2;
pub const GHOSTTY_CELL_DATA_WIDE: Type = 3;
pub const GHOSTTY_CELL_DATA_HAS_TEXT: Type = 4;
pub const GHOSTTY_CELL_DATA_HAS_STYLING: Type = 5;
pub const GHOSTTY_CELL_DATA_STYLE_ID: Type = 6;
pub const GHOSTTY_CELL_DATA_HAS_HYPERLINK: Type = 7;
pub const GHOSTTY_CELL_DATA_PROTECTED: Type = 8;
pub const GHOSTTY_CELL_DATA_SEMANTIC_CONTENT: Type = 9;
pub const GHOSTTY_CELL_DATA_COLOR_PALETTE: Type = 10;
pub const GHOSTTY_CELL_DATA_COLOR_RGB: Type = 11;
pub const GHOSTTY_CELL_DATA_MAX_VALUE: Type = 2147483647;
}
pub mod GhosttyRowSemanticPrompt {
#[allow(unused_imports)]
use super::*;
pub type Type = ::std::os::raw::c_uint;
pub const GHOSTTY_ROW_SEMANTIC_NONE: Type = 0;
pub const GHOSTTY_ROW_SEMANTIC_PROMPT: Type = 1;
pub const GHOSTTY_ROW_SEMANTIC_PROMPT_CONTINUATION: Type = 2;
pub const GHOSTTY_ROW_SEMANTIC_MAX_VALUE: Type = 2147483647;
}
pub mod GhosttyRowData {
#[allow(unused_imports)]
use super::*;
pub type Type = ::std::os::raw::c_uint;
pub const GHOSTTY_ROW_DATA_INVALID: Type = 0;
pub const GHOSTTY_ROW_DATA_WRAP: Type = 1;
pub const GHOSTTY_ROW_DATA_WRAP_CONTINUATION: Type = 2;
pub const GHOSTTY_ROW_DATA_GRAPHEME: Type = 3;
pub const GHOSTTY_ROW_DATA_STYLED: Type = 4;
pub const GHOSTTY_ROW_DATA_HYPERLINK: Type = 5;
pub const GHOSTTY_ROW_DATA_SEMANTIC_PROMPT: Type = 6;
pub const GHOSTTY_ROW_DATA_KITTY_VIRTUAL_PLACEHOLDER: Type = 7;
pub const GHOSTTY_ROW_DATA_DIRTY: Type = 8;
pub const GHOSTTY_ROW_DATA_MAX_VALUE: Type = 2147483647;
}
unsafe extern "C" {
pub fn ghostty_cell_get(
cell: GhosttyCell,
data: GhosttyCellData::Type,
out: *mut ::std::os::raw::c_void,
) -> GhosttyResult::Type;
}
unsafe extern "C" {
pub fn ghostty_cell_get_multi(
cell: GhosttyCell,
count: usize,
keys: *const GhosttyCellData::Type,
values: *mut *mut ::std::os::raw::c_void,
out_written: *mut usize,
) -> GhosttyResult::Type;
}
unsafe extern "C" {
pub fn ghostty_row_get(
row: GhosttyRow,
data: GhosttyRowData::Type,
out: *mut ::std::os::raw::c_void,
) -> GhosttyResult::Type;
}
unsafe extern "C" {
pub fn ghostty_row_get_multi(
row: GhosttyRow,
count: usize,
keys: *const GhosttyRowData::Type,
values: *mut *mut ::std::os::raw::c_void,
out_written: *mut usize,
) -> GhosttyResult::Type;
}
pub type GhosttyStyleId = u16;
pub mod GhosttyStyleColorTag {
#[allow(unused_imports)]
use super::*;
pub type Type = ::std::os::raw::c_uint;
pub const GHOSTTY_STYLE_COLOR_NONE: Type = 0;
pub const GHOSTTY_STYLE_COLOR_PALETTE: Type = 1;
pub const GHOSTTY_STYLE_COLOR_RGB: Type = 2;
pub const GHOSTTY_STYLE_COLOR_TAG_MAX_VALUE: Type = 2147483647;
}
#[repr(C)]
#[derive(Copy, Clone)]
pub union GhosttyStyleColorValue {
pub palette: GhosttyColorPaletteIndex,
pub rgb: GhosttyColorRgb,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
["Size of GhosttyStyleColorValue"][::std::mem::size_of::<GhosttyStyleColorValue>() - 3usize];
["Alignment of GhosttyStyleColorValue"]
[::std::mem::align_of::<GhosttyStyleColorValue>() - 1usize];
["Offset of field: GhosttyStyleColorValue::palette"]
[::std::mem::offset_of!(GhosttyStyleColorValue, palette) - 0usize];
["Offset of field: GhosttyStyleColorValue::rgb"]
[::std::mem::offset_of!(GhosttyStyleColorValue, rgb) - 0usize];
};
impl Default for GhosttyStyleColorValue {
fn default() -> Self {
let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
unsafe {
::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
s.assume_init()
}
}
}
#[repr(C)]
#[derive(Copy, Clone)]
pub struct GhosttyStyleColor {
pub tag: u8,
pub value: GhosttyStyleColorValue,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
["Size of GhosttyStyleColor"][::std::mem::size_of::<GhosttyStyleColor>() - 4usize];
["Alignment of GhosttyStyleColor"][::std::mem::align_of::<GhosttyStyleColor>() - 1usize];
["Offset of field: GhosttyStyleColor::tag"]
[::std::mem::offset_of!(GhosttyStyleColor, tag) - 0usize];
["Offset of field: GhosttyStyleColor::value"]
[::std::mem::offset_of!(GhosttyStyleColor, value) - 1usize];
};
impl Default for GhosttyStyleColor {
fn default() -> Self {
let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
unsafe {
::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
s.assume_init()
}
}
}
pub type GhosttyStyleFlags = u16;
#[repr(C)]
#[derive(Copy, Clone)]
pub struct GhosttyStyle {
pub fg_color: GhosttyStyleColor,
pub bg_color: GhosttyStyleColor,
pub underline_color: GhosttyStyleColor,
pub flags: GhosttyStyleFlags,
pub reserved: u16,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
["Size of GhosttyStyle"][::std::mem::size_of::<GhosttyStyle>() - 16usize];
["Alignment of GhosttyStyle"][::std::mem::align_of::<GhosttyStyle>() - 2usize];
["Offset of field: GhosttyStyle::fg_color"]
[::std::mem::offset_of!(GhosttyStyle, fg_color) - 0usize];
["Offset of field: GhosttyStyle::bg_color"]
[::std::mem::offset_of!(GhosttyStyle, bg_color) - 4usize];
["Offset of field: GhosttyStyle::underline_color"]
[::std::mem::offset_of!(GhosttyStyle, underline_color) - 8usize];
["Offset of field: GhosttyStyle::flags"][::std::mem::offset_of!(GhosttyStyle, flags) - 12usize];
["Offset of field: GhosttyStyle::reserved"]
[::std::mem::offset_of!(GhosttyStyle, reserved) - 14usize];
};
impl Default for GhosttyStyle {
fn default() -> Self {
let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
unsafe {
::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
s.assume_init()
}
}
}
unsafe extern "C" {
pub fn ghostty_style_default(style: *mut GhosttyStyle);
}
unsafe extern "C" {
pub fn ghostty_style_is_default(style: *const GhosttyStyle) -> bool;
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct GhosttyGridRef {
pub node: *mut ::std::os::raw::c_void,
pub x: u16,
pub y: u16,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
["Size of GhosttyGridRef"][::std::mem::size_of::<GhosttyGridRef>() - 16usize];
["Alignment of GhosttyGridRef"][::std::mem::align_of::<GhosttyGridRef>() - 8usize];
["Offset of field: GhosttyGridRef::node"]
[::std::mem::offset_of!(GhosttyGridRef, node) - 0usize];
["Offset of field: GhosttyGridRef::x"][::std::mem::offset_of!(GhosttyGridRef, x) - 8usize];
["Offset of field: GhosttyGridRef::y"][::std::mem::offset_of!(GhosttyGridRef, y) - 10usize];
};
impl Default for GhosttyGridRef {
fn default() -> Self {
let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
unsafe {
::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
s.assume_init()
}
}
}
unsafe extern "C" {
pub fn ghostty_grid_ref_cell(
ref_: *const GhosttyGridRef,
out_cell: *mut GhosttyCell,
) -> GhosttyResult::Type;
}
unsafe extern "C" {
pub fn ghostty_grid_ref_row(
ref_: *const GhosttyGridRef,
out_row: *mut GhosttyRow,
) -> GhosttyResult::Type;
}
unsafe extern "C" {
pub fn ghostty_grid_ref_graphemes(
ref_: *const GhosttyGridRef,
buf: *mut u32,
buf_len: usize,
out_written: *mut usize,
) -> GhosttyResult::Type;
}
unsafe extern "C" {
pub fn ghostty_grid_ref_hyperlink_uri(
ref_: *const GhosttyGridRef,
buf: *mut u8,
buf_len: usize,
out_written: *mut usize,
) -> GhosttyResult::Type;
}
unsafe extern "C" {
pub fn ghostty_grid_ref_style(
ref_: *const GhosttyGridRef,
out_style: *mut GhosttyStyle,
) -> GhosttyResult::Type;
}
#[repr(C)]
#[derive(Debug, Default, Copy, Clone)]
pub struct GhosttyPointCoordinate {
pub x: u16,
pub y: u32,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
["Size of GhosttyPointCoordinate"][::std::mem::size_of::<GhosttyPointCoordinate>() - 8usize];
["Alignment of GhosttyPointCoordinate"]
[::std::mem::align_of::<GhosttyPointCoordinate>() - 4usize];
["Offset of field: GhosttyPointCoordinate::x"]
[::std::mem::offset_of!(GhosttyPointCoordinate, x) - 0usize];
["Offset of field: GhosttyPointCoordinate::y"]
[::std::mem::offset_of!(GhosttyPointCoordinate, y) - 4usize];
};
pub mod GhosttyPointTag {
#[allow(unused_imports)]
use super::*;
pub type Type = ::std::os::raw::c_uint;
pub const GHOSTTY_POINT_TAG_ACTIVE: Type = 0;
pub const GHOSTTY_POINT_TAG_VIEWPORT: Type = 1;
pub const GHOSTTY_POINT_TAG_SCREEN: Type = 2;
pub const GHOSTTY_POINT_TAG_HISTORY: Type = 3;
pub const GHOSTTY_POINT_TAG_MAX_VALUE: Type = 2147483647;
}
#[repr(C)]
#[derive(Copy, Clone)]
pub union GhosttyPointValue {
pub coordinate: GhosttyPointCoordinate,
pub _padding: [u64; 2usize],
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
["Size of GhosttyPointValue"][::std::mem::size_of::<GhosttyPointValue>() - 16usize];
["Alignment of GhosttyPointValue"][::std::mem::align_of::<GhosttyPointValue>() - 8usize];
["Offset of field: GhosttyPointValue::coordinate"]
[::std::mem::offset_of!(GhosttyPointValue, coordinate) - 0usize];
["Offset of field: GhosttyPointValue::_padding"]
[::std::mem::offset_of!(GhosttyPointValue, _padding) - 0usize];
};
impl Default for GhosttyPointValue {
fn default() -> Self {
let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
unsafe {
::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
s.assume_init()
}
}
}
#[repr(C)]
#[derive(Copy, Clone)]
pub struct GhosttyPoint {
pub tag: GhosttyPointTag::Type,
pub value: GhosttyPointValue,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
["Size of GhosttyPoint"][::std::mem::size_of::<GhosttyPoint>() - 24usize];
["Alignment of GhosttyPoint"][::std::mem::align_of::<GhosttyPoint>() - 8usize];
["Offset of field: GhosttyPoint::tag"][::std::mem::offset_of!(GhosttyPoint, tag) - 0usize];
["Offset of field: GhosttyPoint::value"][::std::mem::offset_of!(GhosttyPoint, value) - 8usize];
};
impl Default for GhosttyPoint {
fn default() -> Self {
let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
unsafe {
::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
s.assume_init()
}
}
}
#[repr(C)]
#[derive(Debug)]
pub struct GhosttySelectionGestureImpl {
_unused: [u8; 0],
}
pub type GhosttySelectionGesture = *mut GhosttySelectionGestureImpl;
#[repr(C)]
#[derive(Debug)]
pub struct GhosttySelectionGestureEventImpl {
_unused: [u8; 0],
}
pub type GhosttySelectionGestureEvent = *mut GhosttySelectionGestureEventImpl;
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct GhosttySelection {
pub start: GhosttyGridRef,
pub end: GhosttyGridRef,
pub rectangle: bool,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
["Size of GhosttySelection"][::std::mem::size_of::<GhosttySelection>() - 40usize];
["Alignment of GhosttySelection"][::std::mem::align_of::<GhosttySelection>() - 8usize];
["Offset of field: GhosttySelection::start"]
[::std::mem::offset_of!(GhosttySelection, start) - 0usize];
["Offset of field: GhosttySelection::end"]
[::std::mem::offset_of!(GhosttySelection, end) - 16usize];
["Offset of field: GhosttySelection::rectangle"]
[::std::mem::offset_of!(GhosttySelection, rectangle) - 32usize];
};
impl Default for GhosttySelection {
fn default() -> Self {
let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
unsafe {
::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
s.assume_init()
}
}
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct GhosttySelectionBuffer {
pub ptr: *mut GhosttySelection,
pub cap: usize,
pub len: usize,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
["Size of GhosttySelectionBuffer"][::std::mem::size_of::<GhosttySelectionBuffer>() - 24usize];
["Alignment of GhosttySelectionBuffer"]
[::std::mem::align_of::<GhosttySelectionBuffer>() - 8usize];
["Offset of field: GhosttySelectionBuffer::ptr"]
[::std::mem::offset_of!(GhosttySelectionBuffer, ptr) - 0usize];
["Offset of field: GhosttySelectionBuffer::cap"]
[::std::mem::offset_of!(GhosttySelectionBuffer, cap) - 8usize];
["Offset of field: GhosttySelectionBuffer::len"]
[::std::mem::offset_of!(GhosttySelectionBuffer, len) - 16usize];
};
impl Default for GhosttySelectionBuffer {
fn default() -> Self {
let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
unsafe {
::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
s.assume_init()
}
}
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct GhosttyTerminalSelectWordOptions {
pub size: usize,
pub ref_: GhosttyGridRef,
pub boundary_codepoints: *const u32,
pub boundary_codepoints_len: usize,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
["Size of GhosttyTerminalSelectWordOptions"]
[::std::mem::size_of::<GhosttyTerminalSelectWordOptions>() - 40usize];
["Alignment of GhosttyTerminalSelectWordOptions"]
[::std::mem::align_of::<GhosttyTerminalSelectWordOptions>() - 8usize];
["Offset of field: GhosttyTerminalSelectWordOptions::size"]
[::std::mem::offset_of!(GhosttyTerminalSelectWordOptions, size) - 0usize];
["Offset of field: GhosttyTerminalSelectWordOptions::ref_"]
[::std::mem::offset_of!(GhosttyTerminalSelectWordOptions, ref_) - 8usize];
["Offset of field: GhosttyTerminalSelectWordOptions::boundary_codepoints"]
[::std::mem::offset_of!(GhosttyTerminalSelectWordOptions, boundary_codepoints) - 24usize];
["Offset of field: GhosttyTerminalSelectWordOptions::boundary_codepoints_len"][::std::mem::offset_of!(
GhosttyTerminalSelectWordOptions,
boundary_codepoints_len
) - 32usize];
};
impl Default for GhosttyTerminalSelectWordOptions {
fn default() -> Self {
let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
unsafe {
::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
s.assume_init()
}
}
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct GhosttyTerminalSelectWordBetweenOptions {
pub size: usize,
pub start: GhosttyGridRef,
pub end: GhosttyGridRef,
pub boundary_codepoints: *const u32,
pub boundary_codepoints_len: usize,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
["Size of GhosttyTerminalSelectWordBetweenOptions"]
[::std::mem::size_of::<GhosttyTerminalSelectWordBetweenOptions>() - 56usize];
["Alignment of GhosttyTerminalSelectWordBetweenOptions"]
[::std::mem::align_of::<GhosttyTerminalSelectWordBetweenOptions>() - 8usize];
["Offset of field: GhosttyTerminalSelectWordBetweenOptions::size"]
[::std::mem::offset_of!(GhosttyTerminalSelectWordBetweenOptions, size) - 0usize];
["Offset of field: GhosttyTerminalSelectWordBetweenOptions::start"]
[::std::mem::offset_of!(GhosttyTerminalSelectWordBetweenOptions, start) - 8usize];
["Offset of field: GhosttyTerminalSelectWordBetweenOptions::end"]
[::std::mem::offset_of!(GhosttyTerminalSelectWordBetweenOptions, end) - 24usize];
["Offset of field: GhosttyTerminalSelectWordBetweenOptions::boundary_codepoints"][::std::mem::offset_of!(
GhosttyTerminalSelectWordBetweenOptions,
boundary_codepoints
) - 40usize];
["Offset of field: GhosttyTerminalSelectWordBetweenOptions::boundary_codepoints_len"][::std::mem::offset_of!(
GhosttyTerminalSelectWordBetweenOptions,
boundary_codepoints_len
)
- 48usize];
};
impl Default for GhosttyTerminalSelectWordBetweenOptions {
fn default() -> Self {
let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
unsafe {
::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
s.assume_init()
}
}
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct GhosttyTerminalSelectLineOptions {
pub size: usize,
pub ref_: GhosttyGridRef,
pub whitespace: *const u32,
pub whitespace_len: usize,
pub semantic_prompt_boundary: bool,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
["Size of GhosttyTerminalSelectLineOptions"]
[::std::mem::size_of::<GhosttyTerminalSelectLineOptions>() - 48usize];
["Alignment of GhosttyTerminalSelectLineOptions"]
[::std::mem::align_of::<GhosttyTerminalSelectLineOptions>() - 8usize];
["Offset of field: GhosttyTerminalSelectLineOptions::size"]
[::std::mem::offset_of!(GhosttyTerminalSelectLineOptions, size) - 0usize];
["Offset of field: GhosttyTerminalSelectLineOptions::ref_"]
[::std::mem::offset_of!(GhosttyTerminalSelectLineOptions, ref_) - 8usize];
["Offset of field: GhosttyTerminalSelectLineOptions::whitespace"]
[::std::mem::offset_of!(GhosttyTerminalSelectLineOptions, whitespace) - 24usize];
["Offset of field: GhosttyTerminalSelectLineOptions::whitespace_len"]
[::std::mem::offset_of!(GhosttyTerminalSelectLineOptions, whitespace_len) - 32usize];
["Offset of field: GhosttyTerminalSelectLineOptions::semantic_prompt_boundary"][::std::mem::offset_of!(
GhosttyTerminalSelectLineOptions,
semantic_prompt_boundary
) - 40usize];
};
impl Default for GhosttyTerminalSelectLineOptions {
fn default() -> Self {
let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
unsafe {
::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
s.assume_init()
}
}
}
pub mod GhosttySelectionOrder {
#[allow(unused_imports)]
use super::*;
pub type Type = ::std::os::raw::c_uint;
pub const GHOSTTY_SELECTION_ORDER_FORWARD: Type = 0;
pub const GHOSTTY_SELECTION_ORDER_REVERSE: Type = 1;
pub const GHOSTTY_SELECTION_ORDER_MIRRORED_FORWARD: Type = 2;
pub const GHOSTTY_SELECTION_ORDER_MIRRORED_REVERSE: Type = 3;
pub const GHOSTTY_SELECTION_ORDER_MAX_VALUE: Type = 2147483647;
}
pub mod GhosttySelectionAdjust {
#[allow(unused_imports)]
use super::*;
pub type Type = ::std::os::raw::c_uint;
pub const GHOSTTY_SELECTION_ADJUST_LEFT: Type = 0;
pub const GHOSTTY_SELECTION_ADJUST_RIGHT: Type = 1;
pub const GHOSTTY_SELECTION_ADJUST_UP: Type = 2;
pub const GHOSTTY_SELECTION_ADJUST_DOWN: Type = 3;
pub const GHOSTTY_SELECTION_ADJUST_HOME: Type = 4;
pub const GHOSTTY_SELECTION_ADJUST_END: Type = 5;
pub const GHOSTTY_SELECTION_ADJUST_PAGE_UP: Type = 6;
pub const GHOSTTY_SELECTION_ADJUST_PAGE_DOWN: Type = 7;
pub const GHOSTTY_SELECTION_ADJUST_BEGINNING_OF_LINE: Type = 8;
pub const GHOSTTY_SELECTION_ADJUST_END_OF_LINE: Type = 9;
pub const GHOSTTY_SELECTION_ADJUST_MAX_VALUE: Type = 2147483647;
}
pub mod GhosttySelectionGestureBehavior {
#[allow(unused_imports)]
use super::*;
pub type Type = ::std::os::raw::c_uint;
pub const GHOSTTY_SELECTION_GESTURE_BEHAVIOR_CELL: Type = 0;
pub const GHOSTTY_SELECTION_GESTURE_BEHAVIOR_WORD: Type = 1;
pub const GHOSTTY_SELECTION_GESTURE_BEHAVIOR_LINE: Type = 2;
pub const GHOSTTY_SELECTION_GESTURE_BEHAVIOR_OUTPUT: Type = 3;
pub const GHOSTTY_SELECTION_GESTURE_BEHAVIOR_MAX_VALUE: Type = 2147483647;
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct GhosttySelectionGestureBehaviors {
pub single_click: GhosttySelectionGestureBehavior::Type,
pub double_click: GhosttySelectionGestureBehavior::Type,
pub triple_click: GhosttySelectionGestureBehavior::Type,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
["Size of GhosttySelectionGestureBehaviors"]
[::std::mem::size_of::<GhosttySelectionGestureBehaviors>() - 12usize];
["Alignment of GhosttySelectionGestureBehaviors"]
[::std::mem::align_of::<GhosttySelectionGestureBehaviors>() - 4usize];
["Offset of field: GhosttySelectionGestureBehaviors::single_click"]
[::std::mem::offset_of!(GhosttySelectionGestureBehaviors, single_click) - 0usize];
["Offset of field: GhosttySelectionGestureBehaviors::double_click"]
[::std::mem::offset_of!(GhosttySelectionGestureBehaviors, double_click) - 4usize];
["Offset of field: GhosttySelectionGestureBehaviors::triple_click"]
[::std::mem::offset_of!(GhosttySelectionGestureBehaviors, triple_click) - 8usize];
};
impl Default for GhosttySelectionGestureBehaviors {
fn default() -> Self {
let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
unsafe {
::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
s.assume_init()
}
}
}
#[repr(C)]
#[derive(Debug, Default, Copy, Clone)]
pub struct GhosttySelectionGestureGeometry {
pub columns: u32,
pub cell_width: u32,
pub padding_left: u32,
pub screen_height: u32,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
["Size of GhosttySelectionGestureGeometry"]
[::std::mem::size_of::<GhosttySelectionGestureGeometry>() - 16usize];
["Alignment of GhosttySelectionGestureGeometry"]
[::std::mem::align_of::<GhosttySelectionGestureGeometry>() - 4usize];
["Offset of field: GhosttySelectionGestureGeometry::columns"]
[::std::mem::offset_of!(GhosttySelectionGestureGeometry, columns) - 0usize];
["Offset of field: GhosttySelectionGestureGeometry::cell_width"]
[::std::mem::offset_of!(GhosttySelectionGestureGeometry, cell_width) - 4usize];
["Offset of field: GhosttySelectionGestureGeometry::padding_left"]
[::std::mem::offset_of!(GhosttySelectionGestureGeometry, padding_left) - 8usize];
["Offset of field: GhosttySelectionGestureGeometry::screen_height"]
[::std::mem::offset_of!(GhosttySelectionGestureGeometry, screen_height) - 12usize];
};
pub mod GhosttySelectionGestureAutoscroll {
#[allow(unused_imports)]
use super::*;
pub type Type = ::std::os::raw::c_uint;
pub const GHOSTTY_SELECTION_GESTURE_AUTOSCROLL_NONE: Type = 0;
pub const GHOSTTY_SELECTION_GESTURE_AUTOSCROLL_UP: Type = 1;
pub const GHOSTTY_SELECTION_GESTURE_AUTOSCROLL_DOWN: Type = 2;
pub const GHOSTTY_SELECTION_GESTURE_AUTOSCROLL_MAX_VALUE: Type = 2147483647;
}
pub mod GhosttySelectionGestureData {
#[allow(unused_imports)]
use super::*;
pub type Type = ::std::os::raw::c_uint;
pub const GHOSTTY_SELECTION_GESTURE_DATA_INVALID: Type = 0;
pub const GHOSTTY_SELECTION_GESTURE_DATA_CLICK_COUNT: Type = 1;
pub const GHOSTTY_SELECTION_GESTURE_DATA_DRAGGED: Type = 2;
pub const GHOSTTY_SELECTION_GESTURE_DATA_AUTOSCROLL: Type = 3;
pub const GHOSTTY_SELECTION_GESTURE_DATA_BEHAVIOR: Type = 4;
pub const GHOSTTY_SELECTION_GESTURE_DATA_ANCHOR: Type = 5;
pub const GHOSTTY_SELECTION_GESTURE_DATA_MAX_VALUE: Type = 2147483647;
}
pub mod GhosttySelectionGestureEventType {
#[allow(unused_imports)]
use super::*;
pub type Type = ::std::os::raw::c_uint;
pub const GHOSTTY_SELECTION_GESTURE_EVENT_TYPE_PRESS: Type = 0;
pub const GHOSTTY_SELECTION_GESTURE_EVENT_TYPE_RELEASE: Type = 1;
pub const GHOSTTY_SELECTION_GESTURE_EVENT_TYPE_DRAG: Type = 2;
pub const GHOSTTY_SELECTION_GESTURE_EVENT_TYPE_AUTOSCROLL_TICK: Type = 3;
pub const GHOSTTY_SELECTION_GESTURE_EVENT_TYPE_DEEP_PRESS: Type = 4;
pub const GHOSTTY_SELECTION_GESTURE_EVENT_TYPE_MAX_VALUE: Type = 2147483647;
}
pub mod GhosttySelectionGestureEventOption {
#[allow(unused_imports)]
use super::*;
pub type Type = ::std::os::raw::c_uint;
pub const GHOSTTY_SELECTION_GESTURE_EVENT_OPT_INVALID: Type = 0;
pub const GHOSTTY_SELECTION_GESTURE_EVENT_OPT_REF: Type = 1;
pub const GHOSTTY_SELECTION_GESTURE_EVENT_OPT_POSITION: Type = 2;
pub const GHOSTTY_SELECTION_GESTURE_EVENT_OPT_REPEAT_DISTANCE: Type = 3;
pub const GHOSTTY_SELECTION_GESTURE_EVENT_OPT_TIME_NS: Type = 4;
pub const GHOSTTY_SELECTION_GESTURE_EVENT_OPT_REPEAT_INTERVAL_NS: Type = 5;
pub const GHOSTTY_SELECTION_GESTURE_EVENT_OPT_WORD_BOUNDARY_CODEPOINTS: Type = 6;
pub const GHOSTTY_SELECTION_GESTURE_EVENT_OPT_BEHAVIORS: Type = 7;
pub const GHOSTTY_SELECTION_GESTURE_EVENT_OPT_RECTANGLE: Type = 8;
pub const GHOSTTY_SELECTION_GESTURE_EVENT_OPT_GEOMETRY: Type = 9;
pub const GHOSTTY_SELECTION_GESTURE_EVENT_OPT_VIEWPORT: Type = 10;
pub const GHOSTTY_SELECTION_GESTURE_EVENT_OPT_MAX_VALUE: Type = 2147483647;
}
unsafe extern "C" {
pub fn ghostty_selection_gesture_event_new(
allocator: *const GhosttyAllocator,
out_event: *mut GhosttySelectionGestureEvent,
type_: GhosttySelectionGestureEventType::Type,
) -> GhosttyResult::Type;
}
unsafe extern "C" {
pub fn ghostty_selection_gesture_event_free(event: GhosttySelectionGestureEvent);
}
unsafe extern "C" {
pub fn ghostty_selection_gesture_event_set(
event: GhosttySelectionGestureEvent,
option: GhosttySelectionGestureEventOption::Type,
value: *const ::std::os::raw::c_void,
) -> GhosttyResult::Type;
}
unsafe extern "C" {
pub fn ghostty_selection_gesture_event(
gesture: GhosttySelectionGesture,
terminal: GhosttyTerminal,
event: GhosttySelectionGestureEvent,
out_selection: *mut GhosttySelection,
) -> GhosttyResult::Type;
}
unsafe extern "C" {
pub fn ghostty_selection_gesture_new(
allocator: *const GhosttyAllocator,
out_gesture: *mut GhosttySelectionGesture,
) -> GhosttyResult::Type;
}
unsafe extern "C" {
pub fn ghostty_selection_gesture_free(
gesture: GhosttySelectionGesture,
terminal: GhosttyTerminal,
);
}
unsafe extern "C" {
pub fn ghostty_selection_gesture_reset(
gesture: GhosttySelectionGesture,
terminal: GhosttyTerminal,
);
}
unsafe extern "C" {
pub fn ghostty_selection_gesture_get(
gesture: GhosttySelectionGesture,
terminal: GhosttyTerminal,
data: GhosttySelectionGestureData::Type,
value: *mut ::std::os::raw::c_void,
) -> GhosttyResult::Type;
}
unsafe extern "C" {
pub fn ghostty_selection_gesture_get_multi(
gesture: GhosttySelectionGesture,
terminal: GhosttyTerminal,
count: usize,
keys: *const GhosttySelectionGestureData::Type,
values: *mut *mut ::std::os::raw::c_void,
out_written: *mut usize,
) -> GhosttyResult::Type;
}
unsafe extern "C" {
pub fn ghostty_terminal_select_word(
terminal: GhosttyTerminal,
options: *const GhosttyTerminalSelectWordOptions,
out_selection: *mut GhosttySelection,
) -> GhosttyResult::Type;
}
unsafe extern "C" {
pub fn ghostty_terminal_select_word_between(
terminal: GhosttyTerminal,
options: *const GhosttyTerminalSelectWordBetweenOptions,
out_selection: *mut GhosttySelection,
) -> GhosttyResult::Type;
}
unsafe extern "C" {
pub fn ghostty_terminal_select_line(
terminal: GhosttyTerminal,
options: *const GhosttyTerminalSelectLineOptions,
out_selection: *mut GhosttySelection,
) -> GhosttyResult::Type;
}
unsafe extern "C" {
pub fn ghostty_terminal_select_all(
terminal: GhosttyTerminal,
out_selection: *mut GhosttySelection,
) -> GhosttyResult::Type;
}
unsafe extern "C" {
pub fn ghostty_terminal_select_output(
terminal: GhosttyTerminal,
ref_: *const GhosttyGridRef,
out_selection: *mut GhosttySelection,
) -> GhosttyResult::Type;
}
unsafe extern "C" {
pub fn ghostty_terminal_selection_adjust(
terminal: GhosttyTerminal,
selection: *mut GhosttySelection,
adjustment: GhosttySelectionAdjust::Type,
) -> GhosttyResult::Type;
}
unsafe extern "C" {
pub fn ghostty_terminal_selection_order(
terminal: GhosttyTerminal,
selection: *const GhosttySelection,
out_order: *mut GhosttySelectionOrder::Type,
) -> GhosttyResult::Type;
}
unsafe extern "C" {
pub fn ghostty_terminal_selection_ordered(
terminal: GhosttyTerminal,
selection: *const GhosttySelection,
desired: GhosttySelectionOrder::Type,
out_selection: *mut GhosttySelection,
) -> GhosttyResult::Type;
}
unsafe extern "C" {
pub fn ghostty_terminal_selection_contains(
terminal: GhosttyTerminal,
selection: *const GhosttySelection,
point: GhosttyPoint,
out_contains: *mut bool,
) -> GhosttyResult::Type;
}
unsafe extern "C" {
pub fn ghostty_terminal_selection_equal(
terminal: GhosttyTerminal,
a: *const GhosttySelection,
b: *const GhosttySelection,
out_equal: *mut bool,
) -> GhosttyResult::Type;
}
pub type GhosttyMode = u16;
pub mod GhosttyModeReportState {
#[allow(unused_imports)]
use super::*;
pub type Type = ::std::os::raw::c_uint;
pub const GHOSTTY_MODE_REPORT_NOT_RECOGNIZED: Type = 0;
pub const GHOSTTY_MODE_REPORT_SET: Type = 1;
pub const GHOSTTY_MODE_REPORT_RESET: Type = 2;
pub const GHOSTTY_MODE_REPORT_PERMANENTLY_SET: Type = 3;
pub const GHOSTTY_MODE_REPORT_PERMANENTLY_RESET: Type = 4;
pub const GHOSTTY_MODE_REPORT_MAX_VALUE: Type = 2147483647;
}
unsafe extern "C" {
pub fn ghostty_mode_report_encode(
mode: GhosttyMode,
state: GhosttyModeReportState::Type,
buf: *mut u8,
buf_len: usize,
out_written: *mut usize,
) -> GhosttyResult::Type;
}
pub mod GhosttyOscCommandType {
#[allow(unused_imports)]
use super::*;
pub type Type = ::std::os::raw::c_uint;
pub const GHOSTTY_OSC_COMMAND_INVALID: Type = 0;
pub const GHOSTTY_OSC_COMMAND_CHANGE_WINDOW_TITLE: Type = 1;
pub const GHOSTTY_OSC_COMMAND_CHANGE_WINDOW_ICON: Type = 2;
pub const GHOSTTY_OSC_COMMAND_SEMANTIC_PROMPT: Type = 3;
pub const GHOSTTY_OSC_COMMAND_CLIPBOARD_CONTENTS: Type = 4;
pub const GHOSTTY_OSC_COMMAND_REPORT_PWD: Type = 5;
pub const GHOSTTY_OSC_COMMAND_MOUSE_SHAPE: Type = 6;
pub const GHOSTTY_OSC_COMMAND_COLOR_OPERATION: Type = 7;
pub const GHOSTTY_OSC_COMMAND_KITTY_COLOR_PROTOCOL: Type = 8;
pub const GHOSTTY_OSC_COMMAND_SHOW_DESKTOP_NOTIFICATION: Type = 9;
pub const GHOSTTY_OSC_COMMAND_HYPERLINK_START: Type = 10;
pub const GHOSTTY_OSC_COMMAND_HYPERLINK_END: Type = 11;
pub const GHOSTTY_OSC_COMMAND_CONEMU_SLEEP: Type = 12;
pub const GHOSTTY_OSC_COMMAND_CONEMU_SHOW_MESSAGE_BOX: Type = 13;
pub const GHOSTTY_OSC_COMMAND_CONEMU_CHANGE_TAB_TITLE: Type = 14;
pub const GHOSTTY_OSC_COMMAND_CONEMU_PROGRESS_REPORT: Type = 15;
pub const GHOSTTY_OSC_COMMAND_CONEMU_WAIT_INPUT: Type = 16;
pub const GHOSTTY_OSC_COMMAND_CONEMU_GUIMACRO: Type = 17;
pub const GHOSTTY_OSC_COMMAND_CONEMU_RUN_PROCESS: Type = 18;
pub const GHOSTTY_OSC_COMMAND_CONEMU_OUTPUT_ENVIRONMENT_VARIABLE: Type = 19;
pub const GHOSTTY_OSC_COMMAND_CONEMU_XTERM_EMULATION: Type = 20;
pub const GHOSTTY_OSC_COMMAND_CONEMU_COMMENT: Type = 21;
pub const GHOSTTY_OSC_COMMAND_KITTY_TEXT_SIZING: Type = 22;
pub const GHOSTTY_OSC_COMMAND_KITTY_CLIPBOARD_PROTOCOL: Type = 23;
pub const GHOSTTY_OSC_COMMAND_KITTY_DND_PROTOCOL: Type = 24;
pub const GHOSTTY_OSC_COMMAND_HIERARCHICAL_CONTEXT: Type = 25;
pub const GHOSTTY_OSC_COMMAND_KITTY_DESKTOP_NOTIFICATION: Type = 26;
pub const GHOSTTY_OSC_COMMAND_UNKNOWN: Type = 27;
pub const GHOSTTY_OSC_COMMAND_PROGRAM_STATUS: Type = 28;
pub const GHOSTTY_OSC_COMMAND_TYPE_MAX_VALUE: Type = 2147483647;
}
pub mod GhosttyOscTerminator {
#[allow(unused_imports)]
use super::*;
pub type Type = ::std::os::raw::c_uint;
pub const GHOSTTY_OSC_TERMINATOR_ST: Type = 0;
pub const GHOSTTY_OSC_TERMINATOR_BEL: Type = 1;
pub const GHOSTTY_OSC_TERMINATOR_MAX_VALUE: Type = 2147483647;
}
pub mod GhosttyOscOption {
#[allow(unused_imports)]
use super::*;
pub type Type = ::std::os::raw::c_uint;
pub const GHOSTTY_OSC_OPT_INVALID: Type = 0;
pub const GHOSTTY_OSC_OPT_UNKNOWN_MAX_BYTES: Type = 1;
pub const GHOSTTY_OSC_OPT_MAX_VALUE: Type = 2147483647;
}
pub mod GhosttyOscCommandData {
#[allow(unused_imports)]
use super::*;
pub type Type = ::std::os::raw::c_uint;
pub const GHOSTTY_OSC_DATA_INVALID: Type = 0;
pub const GHOSTTY_OSC_DATA_CHANGE_WINDOW_TITLE_STR: Type = 1;
pub const GHOSTTY_OSC_DATA_UNKNOWN_CONTENT: Type = 2;
pub const GHOSTTY_OSC_DATA_UNKNOWN_TRUNCATED: Type = 3;
pub const GHOSTTY_OSC_DATA_UNKNOWN_TERMINATOR: Type = 4;
pub const GHOSTTY_OSC_DATA_MAX_VALUE: Type = 2147483647;
}
unsafe extern "C" {
pub fn ghostty_osc_new(
allocator: *const GhosttyAllocator,
parser: *mut GhosttyOscParser,
) -> GhosttyResult::Type;
}
unsafe extern "C" {
pub fn ghostty_osc_free(parser: GhosttyOscParser);
}
unsafe extern "C" {
pub fn ghostty_osc_reset(parser: GhosttyOscParser);
}
unsafe extern "C" {
pub fn ghostty_osc_set(
parser: GhosttyOscParser,
option: GhosttyOscOption::Type,
value: *const ::std::os::raw::c_void,
) -> GhosttyResult::Type;
}
unsafe extern "C" {
pub fn ghostty_osc_next(parser: GhosttyOscParser, byte: u8);
}
unsafe extern "C" {
pub fn ghostty_osc_end(parser: GhosttyOscParser, terminator: u8) -> GhosttyOscCommand;
}
unsafe extern "C" {
pub fn ghostty_osc_command_type(command: GhosttyOscCommand) -> GhosttyOscCommandType::Type;
}
unsafe extern "C" {
pub fn ghostty_osc_command_data(
command: GhosttyOscCommand,
data: GhosttyOscCommandData::Type,
out: *mut ::std::os::raw::c_void,
) -> GhosttyResult::Type;
}
pub mod GhosttySizeReportStyle {
#[allow(unused_imports)]
use super::*;
pub type Type = ::std::os::raw::c_uint;
pub const GHOSTTY_SIZE_REPORT_MODE_2048: Type = 0;
pub const GHOSTTY_SIZE_REPORT_CSI_14_T: Type = 1;
pub const GHOSTTY_SIZE_REPORT_CSI_16_T: Type = 2;
pub const GHOSTTY_SIZE_REPORT_CSI_18_T: Type = 3;
pub const GHOSTTY_SIZE_REPORT_CSI_19_T: Type = 4;
pub const GHOSTTY_SIZE_REPORT_STYLE_MAX_VALUE: Type = 2147483647;
}
#[repr(C)]
#[derive(Debug, Default, Copy, Clone)]
pub struct GhosttySizeReportSize {
pub rows: u16,
pub columns: u16,
pub cell_width: u32,
pub cell_height: u32,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
["Size of GhosttySizeReportSize"][::std::mem::size_of::<GhosttySizeReportSize>() - 12usize];
["Alignment of GhosttySizeReportSize"]
[::std::mem::align_of::<GhosttySizeReportSize>() - 4usize];
["Offset of field: GhosttySizeReportSize::rows"]
[::std::mem::offset_of!(GhosttySizeReportSize, rows) - 0usize];
["Offset of field: GhosttySizeReportSize::columns"]
[::std::mem::offset_of!(GhosttySizeReportSize, columns) - 2usize];
["Offset of field: GhosttySizeReportSize::cell_width"]
[::std::mem::offset_of!(GhosttySizeReportSize, cell_width) - 4usize];
["Offset of field: GhosttySizeReportSize::cell_height"]
[::std::mem::offset_of!(GhosttySizeReportSize, cell_height) - 8usize];
};
unsafe extern "C" {
pub fn ghostty_size_report_encode(
style: GhosttySizeReportStyle::Type,
size: *const GhosttySizeReportSize,
buf: *mut u8,
buf_len: usize,
out_written: *mut usize,
) -> GhosttyResult::Type;
}
pub mod GhosttyKittyGraphicsData {
#[allow(unused_imports)]
use super::*;
pub type Type = ::std::os::raw::c_uint;
pub const GHOSTTY_KITTY_GRAPHICS_DATA_INVALID: Type = 0;
pub const GHOSTTY_KITTY_GRAPHICS_DATA_PLACEMENT_ITERATOR: Type = 1;
pub const GHOSTTY_KITTY_GRAPHICS_DATA_GENERATION: Type = 2;
pub const GHOSTTY_KITTY_GRAPHICS_DATA_MAX_VALUE: Type = 2147483647;
}
pub mod GhosttyKittyGraphicsPlacementData {
#[allow(unused_imports)]
use super::*;
pub type Type = ::std::os::raw::c_uint;
pub const GHOSTTY_KITTY_GRAPHICS_PLACEMENT_DATA_INVALID: Type = 0;
pub const GHOSTTY_KITTY_GRAPHICS_PLACEMENT_DATA_IMAGE_ID: Type = 1;
pub const GHOSTTY_KITTY_GRAPHICS_PLACEMENT_DATA_PLACEMENT_ID: Type = 2;
pub const GHOSTTY_KITTY_GRAPHICS_PLACEMENT_DATA_IS_VIRTUAL: Type = 3;
pub const GHOSTTY_KITTY_GRAPHICS_PLACEMENT_DATA_X_OFFSET: Type = 4;
pub const GHOSTTY_KITTY_GRAPHICS_PLACEMENT_DATA_Y_OFFSET: Type = 5;
pub const GHOSTTY_KITTY_GRAPHICS_PLACEMENT_DATA_SOURCE_X: Type = 6;
pub const GHOSTTY_KITTY_GRAPHICS_PLACEMENT_DATA_SOURCE_Y: Type = 7;
pub const GHOSTTY_KITTY_GRAPHICS_PLACEMENT_DATA_SOURCE_WIDTH: Type = 8;
pub const GHOSTTY_KITTY_GRAPHICS_PLACEMENT_DATA_SOURCE_HEIGHT: Type = 9;
pub const GHOSTTY_KITTY_GRAPHICS_PLACEMENT_DATA_COLUMNS: Type = 10;
pub const GHOSTTY_KITTY_GRAPHICS_PLACEMENT_DATA_ROWS: Type = 11;
pub const GHOSTTY_KITTY_GRAPHICS_PLACEMENT_DATA_Z: Type = 12;
pub const GHOSTTY_KITTY_GRAPHICS_PLACEMENT_DATA_MAX_VALUE: Type = 2147483647;
}
pub mod GhosttyKittyGraphicsPlacementIteratorOption {
#[allow(unused_imports)]
use super::*;
pub type Type = ::std::os::raw::c_uint;
pub const GHOSTTY_KITTY_GRAPHICS_PLACEMENT_ITERATOR_OPT_INVALID: Type = 0;
pub const GHOSTTY_KITTY_GRAPHICS_PLACEMENT_ITERATOR_OPT_LAYER: Type = 1;
pub const GHOSTTY_KITTY_GRAPHICS_PLACEMENT_ITERATOR_OPT_MAX_VALUE: Type = 2147483647;
}
pub mod GhosttyKittyImageFormat {
#[allow(unused_imports)]
use super::*;
pub type Type = ::std::os::raw::c_uint;
pub const GHOSTTY_KITTY_IMAGE_FORMAT_RGB: Type = 0;
pub const GHOSTTY_KITTY_IMAGE_FORMAT_RGBA: Type = 1;
pub const GHOSTTY_KITTY_IMAGE_FORMAT_PNG: Type = 2;
pub const GHOSTTY_KITTY_IMAGE_FORMAT_GRAY_ALPHA: Type = 3;
pub const GHOSTTY_KITTY_IMAGE_FORMAT_GRAY: Type = 4;
pub const GHOSTTY_KITTY_IMAGE_FORMAT_MAX_VALUE: Type = 2147483647;
}
pub mod GhosttyKittyImageCompression {
#[allow(unused_imports)]
use super::*;
pub type Type = ::std::os::raw::c_uint;
pub const GHOSTTY_KITTY_IMAGE_COMPRESSION_NONE: Type = 0;
pub const GHOSTTY_KITTY_IMAGE_COMPRESSION_ZLIB_DEFLATE: Type = 1;
pub const GHOSTTY_KITTY_IMAGE_COMPRESSION_MAX_VALUE: Type = 2147483647;
}
pub mod GhosttyKittyGraphicsImageData {
#[allow(unused_imports)]
use super::*;
pub type Type = ::std::os::raw::c_uint;
pub const GHOSTTY_KITTY_GRAPHICS_IMAGE_DATA_INVALID: Type = 0;
pub const GHOSTTY_KITTY_GRAPHICS_IMAGE_DATA_ID: Type = 1;
pub const GHOSTTY_KITTY_GRAPHICS_IMAGE_DATA_NUMBER: Type = 2;
pub const GHOSTTY_KITTY_GRAPHICS_IMAGE_DATA_WIDTH: Type = 3;
pub const GHOSTTY_KITTY_GRAPHICS_IMAGE_DATA_HEIGHT: Type = 4;
pub const GHOSTTY_KITTY_GRAPHICS_IMAGE_DATA_FORMAT: Type = 5;
pub const GHOSTTY_KITTY_GRAPHICS_IMAGE_DATA_COMPRESSION: Type = 6;
pub const GHOSTTY_KITTY_GRAPHICS_IMAGE_DATA_PIXELS: Type = 7;
pub const GHOSTTY_KITTY_GRAPHICS_IMAGE_DATA_EXPECTED_LEN: Type = 8;
pub const GHOSTTY_KITTY_GRAPHICS_IMAGE_DATA_GENERATION: Type = 9;
pub const GHOSTTY_KITTY_GRAPHICS_IMAGE_DATA_MAX_VALUE: Type = 2147483647;
}
#[repr(C)]
#[derive(Debug, Default, Copy, Clone)]
pub struct GhosttyKittyGraphicsPlacementRenderInfo {
pub size: usize,
pub pixel_width: u32,
pub pixel_height: u32,
pub grid_cols: u32,
pub grid_rows: u32,
pub viewport_col: i32,
pub viewport_row: i32,
pub viewport_visible: bool,
pub source_x: u32,
pub source_y: u32,
pub source_width: u32,
pub source_height: u32,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
["Size of GhosttyKittyGraphicsPlacementRenderInfo"]
[::std::mem::size_of::<GhosttyKittyGraphicsPlacementRenderInfo>() - 56usize];
["Alignment of GhosttyKittyGraphicsPlacementRenderInfo"]
[::std::mem::align_of::<GhosttyKittyGraphicsPlacementRenderInfo>() - 8usize];
["Offset of field: GhosttyKittyGraphicsPlacementRenderInfo::size"]
[::std::mem::offset_of!(GhosttyKittyGraphicsPlacementRenderInfo, size) - 0usize];
["Offset of field: GhosttyKittyGraphicsPlacementRenderInfo::pixel_width"]
[::std::mem::offset_of!(GhosttyKittyGraphicsPlacementRenderInfo, pixel_width) - 8usize];
["Offset of field: GhosttyKittyGraphicsPlacementRenderInfo::pixel_height"]
[::std::mem::offset_of!(GhosttyKittyGraphicsPlacementRenderInfo, pixel_height) - 12usize];
["Offset of field: GhosttyKittyGraphicsPlacementRenderInfo::grid_cols"]
[::std::mem::offset_of!(GhosttyKittyGraphicsPlacementRenderInfo, grid_cols) - 16usize];
["Offset of field: GhosttyKittyGraphicsPlacementRenderInfo::grid_rows"]
[::std::mem::offset_of!(GhosttyKittyGraphicsPlacementRenderInfo, grid_rows) - 20usize];
["Offset of field: GhosttyKittyGraphicsPlacementRenderInfo::viewport_col"]
[::std::mem::offset_of!(GhosttyKittyGraphicsPlacementRenderInfo, viewport_col) - 24usize];
["Offset of field: GhosttyKittyGraphicsPlacementRenderInfo::viewport_row"]
[::std::mem::offset_of!(GhosttyKittyGraphicsPlacementRenderInfo, viewport_row) - 28usize];
["Offset of field: GhosttyKittyGraphicsPlacementRenderInfo::viewport_visible"][::std::mem::offset_of!(
GhosttyKittyGraphicsPlacementRenderInfo,
viewport_visible
) - 32usize];
["Offset of field: GhosttyKittyGraphicsPlacementRenderInfo::source_x"]
[::std::mem::offset_of!(GhosttyKittyGraphicsPlacementRenderInfo, source_x) - 36usize];
["Offset of field: GhosttyKittyGraphicsPlacementRenderInfo::source_y"]
[::std::mem::offset_of!(GhosttyKittyGraphicsPlacementRenderInfo, source_y) - 40usize];
["Offset of field: GhosttyKittyGraphicsPlacementRenderInfo::source_width"]
[::std::mem::offset_of!(GhosttyKittyGraphicsPlacementRenderInfo, source_width) - 44usize];
["Offset of field: GhosttyKittyGraphicsPlacementRenderInfo::source_height"]
[::std::mem::offset_of!(GhosttyKittyGraphicsPlacementRenderInfo, source_height) - 48usize];
};
unsafe extern "C" {
pub fn ghostty_kitty_graphics_get(
graphics: GhosttyKittyGraphics,
data: GhosttyKittyGraphicsData::Type,
out: *mut ::std::os::raw::c_void,
) -> GhosttyResult::Type;
}
unsafe extern "C" {
pub fn ghostty_kitty_graphics_animation_tick(
graphics: GhosttyKittyGraphics,
now_ms: u64,
next_ms: *mut u64,
) -> GhosttyResult::Type;
}
unsafe extern "C" {
pub fn ghostty_kitty_graphics_image(
graphics: GhosttyKittyGraphics,
image_id: u32,
) -> GhosttyKittyGraphicsImage;
}
unsafe extern "C" {
pub fn ghostty_kitty_graphics_image_get(
image: GhosttyKittyGraphicsImage,
data: GhosttyKittyGraphicsImageData::Type,
out: *mut ::std::os::raw::c_void,
) -> GhosttyResult::Type;
}
unsafe extern "C" {
pub fn ghostty_kitty_graphics_image_get_multi(
image: GhosttyKittyGraphicsImage,
count: usize,
keys: *const GhosttyKittyGraphicsImageData::Type,
values: *mut *mut ::std::os::raw::c_void,
out_written: *mut usize,
) -> GhosttyResult::Type;
}
unsafe extern "C" {
pub fn ghostty_kitty_graphics_placement_iterator_new(
allocator: *const GhosttyAllocator,
out_iterator: *mut GhosttyKittyGraphicsPlacementIterator,
) -> GhosttyResult::Type;
}
unsafe extern "C" {
pub fn ghostty_kitty_graphics_placement_iterator_free(
iterator: GhosttyKittyGraphicsPlacementIterator,
);
}
unsafe extern "C" {
pub fn ghostty_kitty_graphics_placement_iterator_set(
iterator: GhosttyKittyGraphicsPlacementIterator,
option: GhosttyKittyGraphicsPlacementIteratorOption::Type,
value: *const ::std::os::raw::c_void,
) -> GhosttyResult::Type;
}
unsafe extern "C" {
pub fn ghostty_kitty_graphics_placement_next(
iterator: GhosttyKittyGraphicsPlacementIterator,
) -> bool;
}
unsafe extern "C" {
pub fn ghostty_kitty_graphics_placement_get(
iterator: GhosttyKittyGraphicsPlacementIterator,
data: GhosttyKittyGraphicsPlacementData::Type,
out: *mut ::std::os::raw::c_void,
) -> GhosttyResult::Type;
}
unsafe extern "C" {
pub fn ghostty_kitty_graphics_placement_get_multi(
iterator: GhosttyKittyGraphicsPlacementIterator,
count: usize,
keys: *const GhosttyKittyGraphicsPlacementData::Type,
values: *mut *mut ::std::os::raw::c_void,
out_written: *mut usize,
) -> GhosttyResult::Type;
}
unsafe extern "C" {
pub fn ghostty_kitty_graphics_placement_rect(
iterator: GhosttyKittyGraphicsPlacementIterator,
image: GhosttyKittyGraphicsImage,
terminal: GhosttyTerminal,
out_selection: *mut GhosttySelection,
) -> GhosttyResult::Type;
}
unsafe extern "C" {
pub fn ghostty_kitty_graphics_placement_pixel_size(
iterator: GhosttyKittyGraphicsPlacementIterator,
image: GhosttyKittyGraphicsImage,
terminal: GhosttyTerminal,
out_width: *mut u32,
out_height: *mut u32,
) -> GhosttyResult::Type;
}
unsafe extern "C" {
pub fn ghostty_kitty_graphics_placement_grid_size(
iterator: GhosttyKittyGraphicsPlacementIterator,
image: GhosttyKittyGraphicsImage,
terminal: GhosttyTerminal,
out_cols: *mut u32,
out_rows: *mut u32,
) -> GhosttyResult::Type;
}
unsafe extern "C" {
pub fn ghostty_kitty_graphics_placement_viewport_pos(
iterator: GhosttyKittyGraphicsPlacementIterator,
image: GhosttyKittyGraphicsImage,
terminal: GhosttyTerminal,
out_col: *mut i32,
out_row: *mut i32,
) -> GhosttyResult::Type;
}
unsafe extern "C" {
pub fn ghostty_kitty_graphics_placement_source_rect(
iterator: GhosttyKittyGraphicsPlacementIterator,
image: GhosttyKittyGraphicsImage,
out_x: *mut u32,
out_y: *mut u32,
out_width: *mut u32,
out_height: *mut u32,
) -> GhosttyResult::Type;
}
unsafe extern "C" {
pub fn ghostty_kitty_graphics_placement_render_info(
iterator: GhosttyKittyGraphicsPlacementIterator,
image: GhosttyKittyGraphicsImage,
terminal: GhosttyTerminal,
out_info: *mut GhosttyKittyGraphicsPlacementRenderInfo,
) -> GhosttyResult::Type;
}
pub mod GhosttyTerminalCompressionMode {
#[allow(unused_imports)]
use super::*;
pub type Type = ::std::os::raw::c_uint;
pub const GHOSTTY_TERMINAL_COMPRESSION_MODE_INCREMENTAL: Type = 0;
pub const GHOSTTY_TERMINAL_COMPRESSION_MODE_FULL: Type = 1;
pub const GHOSTTY_TERMINAL_COMPRESSION_MODE_MAX_VALUE: Type = 2147483647;
}
pub mod GhosttyTerminalCompressionResult {
#[allow(unused_imports)]
use super::*;
pub type Type = ::std::os::raw::c_uint;
pub const GHOSTTY_TERMINAL_COMPRESSION_RESULT_UNSUPPORTED: Type = 0;
pub const GHOSTTY_TERMINAL_COMPRESSION_RESULT_PENDING: Type = 1;
pub const GHOSTTY_TERMINAL_COMPRESSION_RESULT_COMPLETE: Type = 2;
pub const GHOSTTY_TERMINAL_COMPRESSION_RESULT_MAX_VALUE: Type = 2147483647;
}
pub mod GhosttyTerminalScrollViewportTag {
#[allow(unused_imports)]
use super::*;
pub type Type = ::std::os::raw::c_uint;
pub const GHOSTTY_TERMINAL_SCROLL_VIEWPORT_TOP: Type = 0;
pub const GHOSTTY_TERMINAL_SCROLL_VIEWPORT_BOTTOM: Type = 1;
pub const GHOSTTY_TERMINAL_SCROLL_VIEWPORT_DELTA: Type = 2;
pub const GHOSTTY_TERMINAL_SCROLL_VIEWPORT_ROW: Type = 3;
pub const GHOSTTY_TERMINAL_SCROLL_VIEWPORT_DELTA_PROMPT: Type = 4;
pub const GHOSTTY_TERMINAL_SCROLL_VIEWPORT_MAX_VALUE: Type = 2147483647;
}
#[repr(C)]
#[derive(Copy, Clone)]
pub union GhosttyTerminalScrollViewportValue {
pub delta: isize,
pub row: usize,
pub delta_prompt: isize,
pub _padding: [u64; 2usize],
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
["Size of GhosttyTerminalScrollViewportValue"]
[::std::mem::size_of::<GhosttyTerminalScrollViewportValue>() - 16usize];
["Alignment of GhosttyTerminalScrollViewportValue"]
[::std::mem::align_of::<GhosttyTerminalScrollViewportValue>() - 8usize];
["Offset of field: GhosttyTerminalScrollViewportValue::delta"]
[::std::mem::offset_of!(GhosttyTerminalScrollViewportValue, delta) - 0usize];
["Offset of field: GhosttyTerminalScrollViewportValue::row"]
[::std::mem::offset_of!(GhosttyTerminalScrollViewportValue, row) - 0usize];
["Offset of field: GhosttyTerminalScrollViewportValue::delta_prompt"]
[::std::mem::offset_of!(GhosttyTerminalScrollViewportValue, delta_prompt) - 0usize];
["Offset of field: GhosttyTerminalScrollViewportValue::_padding"]
[::std::mem::offset_of!(GhosttyTerminalScrollViewportValue, _padding) - 0usize];
};
impl Default for GhosttyTerminalScrollViewportValue {
fn default() -> Self {
let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
unsafe {
::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
s.assume_init()
}
}
}
#[repr(C)]
#[derive(Copy, Clone)]
pub struct GhosttyTerminalScrollViewport {
pub tag: GhosttyTerminalScrollViewportTag::Type,
pub value: GhosttyTerminalScrollViewportValue,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
["Size of GhosttyTerminalScrollViewport"]
[::std::mem::size_of::<GhosttyTerminalScrollViewport>() - 24usize];
["Alignment of GhosttyTerminalScrollViewport"]
[::std::mem::align_of::<GhosttyTerminalScrollViewport>() - 8usize];
["Offset of field: GhosttyTerminalScrollViewport::tag"]
[::std::mem::offset_of!(GhosttyTerminalScrollViewport, tag) - 0usize];
["Offset of field: GhosttyTerminalScrollViewport::value"]
[::std::mem::offset_of!(GhosttyTerminalScrollViewport, value) - 8usize];
};
impl Default for GhosttyTerminalScrollViewport {
fn default() -> Self {
let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
unsafe {
::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
s.assume_init()
}
}
}
pub mod GhosttyTerminalScreen {
#[allow(unused_imports)]
use super::*;
pub type Type = ::std::os::raw::c_uint;
pub const GHOSTTY_TERMINAL_SCREEN_PRIMARY: Type = 0;
pub const GHOSTTY_TERMINAL_SCREEN_ALTERNATE: Type = 1;
pub const GHOSTTY_TERMINAL_SCREEN_MAX_VALUE: Type = 2147483647;
}
pub mod GhosttyTerminalBoundary {
#[allow(unused_imports)]
use super::*;
pub type Type = ::std::os::raw::c_uint;
pub const GHOSTTY_TERMINAL_BOUNDARY_GROUND: Type = 1;
pub const GHOSTTY_TERMINAL_BOUNDARY_APC_START: Type = 2;
pub const GHOSTTY_TERMINAL_BOUNDARY_APC_END: Type = 4;
pub const GHOSTTY_TERMINAL_BOUNDARY_DCS_START: Type = 8;
pub const GHOSTTY_TERMINAL_BOUNDARY_DCS_END: Type = 16;
pub const GHOSTTY_TERMINAL_BOUNDARY_OSC_START: Type = 32;
pub const GHOSTTY_TERMINAL_BOUNDARY_OSC_END: Type = 64;
pub const GHOSTTY_TERMINAL_BOUNDARY_MAX_VALUE: Type = 2147483647;
}
pub mod GhosttyTerminalStringKind {
#[allow(unused_imports)]
use super::*;
pub type Type = ::std::os::raw::c_uint;
pub const GHOSTTY_TERMINAL_STRING_KIND_APC: Type = 0;
pub const GHOSTTY_TERMINAL_STRING_KIND_DCS: Type = 1;
pub const GHOSTTY_TERMINAL_STRING_KIND_OSC: Type = 2;
pub const GHOSTTY_TERMINAL_STRING_KIND_MAX_VALUE: Type = 2147483647;
}
pub mod GhosttyTerminalStringIntroducer {
#[allow(unused_imports)]
use super::*;
pub type Type = ::std::os::raw::c_uint;
pub const GHOSTTY_TERMINAL_STRING_INTRODUCER_ESC: Type = 0;
pub const GHOSTTY_TERMINAL_STRING_INTRODUCER_C1: Type = 1;
pub const GHOSTTY_TERMINAL_STRING_INTRODUCER_MAX_VALUE: Type = 2147483647;
}
pub mod GhosttyTerminalStringEnd {
#[allow(unused_imports)]
use super::*;
pub type Type = ::std::os::raw::c_uint;
pub const GHOSTTY_TERMINAL_STRING_END_ST_ESC: Type = 0;
pub const GHOSTTY_TERMINAL_STRING_END_ST_C1: Type = 1;
pub const GHOSTTY_TERMINAL_STRING_END_CANCELLED: Type = 2;
pub const GHOSTTY_TERMINAL_STRING_END_ABORTED: Type = 3;
pub const GHOSTTY_TERMINAL_STRING_END_BEL: Type = 4;
pub const GHOSTTY_TERMINAL_STRING_END_MAX_VALUE: Type = 2147483647;
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct GhosttyTerminalWriteStop {
pub size: usize,
pub consumed: usize,
pub reached: u32,
pub kind: GhosttyTerminalStringKind::Type,
pub introducer: GhosttyTerminalStringIntroducer::Type,
pub end: GhosttyTerminalStringEnd::Type,
pub byte: u8,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
["Size of GhosttyTerminalWriteStop"]
[::std::mem::size_of::<GhosttyTerminalWriteStop>() - 40usize];
["Alignment of GhosttyTerminalWriteStop"]
[::std::mem::align_of::<GhosttyTerminalWriteStop>() - 8usize];
["Offset of field: GhosttyTerminalWriteStop::size"]
[::std::mem::offset_of!(GhosttyTerminalWriteStop, size) - 0usize];
["Offset of field: GhosttyTerminalWriteStop::consumed"]
[::std::mem::offset_of!(GhosttyTerminalWriteStop, consumed) - 8usize];
["Offset of field: GhosttyTerminalWriteStop::reached"]
[::std::mem::offset_of!(GhosttyTerminalWriteStop, reached) - 16usize];
["Offset of field: GhosttyTerminalWriteStop::kind"]
[::std::mem::offset_of!(GhosttyTerminalWriteStop, kind) - 20usize];
["Offset of field: GhosttyTerminalWriteStop::introducer"]
[::std::mem::offset_of!(GhosttyTerminalWriteStop, introducer) - 24usize];
["Offset of field: GhosttyTerminalWriteStop::end"]
[::std::mem::offset_of!(GhosttyTerminalWriteStop, end) - 28usize];
["Offset of field: GhosttyTerminalWriteStop::byte"]
[::std::mem::offset_of!(GhosttyTerminalWriteStop, byte) - 32usize];
};
impl Default for GhosttyTerminalWriteStop {
fn default() -> Self {
let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
unsafe {
::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
s.assume_init()
}
}
}
#[repr(C)]
#[derive(Debug, Default, Copy, Clone)]
pub struct GhosttyTerminalScrollbar {
pub total: u64,
pub offset: u64,
pub len: u64,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
["Size of GhosttyTerminalScrollbar"]
[::std::mem::size_of::<GhosttyTerminalScrollbar>() - 24usize];
["Alignment of GhosttyTerminalScrollbar"]
[::std::mem::align_of::<GhosttyTerminalScrollbar>() - 8usize];
["Offset of field: GhosttyTerminalScrollbar::total"]
[::std::mem::offset_of!(GhosttyTerminalScrollbar, total) - 0usize];
["Offset of field: GhosttyTerminalScrollbar::offset"]
[::std::mem::offset_of!(GhosttyTerminalScrollbar, offset) - 8usize];
["Offset of field: GhosttyTerminalScrollbar::len"]
[::std::mem::offset_of!(GhosttyTerminalScrollbar, len) - 16usize];
};
#[repr(C)]
#[derive(Debug, Default, Copy, Clone)]
pub struct GhosttyTerminalMemoryUsage {
pub size: usize,
pub compression_supported: bool,
pub primary_pages: u64,
pub primary_virtual_bytes: u64,
pub primary_resident_bytes: u64,
pub primary_compressed_pages: u64,
pub primary_compressed_bytes: u64,
pub primary_image_bytes: u64,
pub alternate_pages: u64,
pub alternate_virtual_bytes: u64,
pub alternate_resident_bytes: u64,
pub alternate_compressed_pages: u64,
pub alternate_compressed_bytes: u64,
pub alternate_image_bytes: u64,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
["Size of GhosttyTerminalMemoryUsage"]
[::std::mem::size_of::<GhosttyTerminalMemoryUsage>() - 112usize];
["Alignment of GhosttyTerminalMemoryUsage"]
[::std::mem::align_of::<GhosttyTerminalMemoryUsage>() - 8usize];
["Offset of field: GhosttyTerminalMemoryUsage::size"]
[::std::mem::offset_of!(GhosttyTerminalMemoryUsage, size) - 0usize];
["Offset of field: GhosttyTerminalMemoryUsage::compression_supported"]
[::std::mem::offset_of!(GhosttyTerminalMemoryUsage, compression_supported) - 8usize];
["Offset of field: GhosttyTerminalMemoryUsage::primary_pages"]
[::std::mem::offset_of!(GhosttyTerminalMemoryUsage, primary_pages) - 16usize];
["Offset of field: GhosttyTerminalMemoryUsage::primary_virtual_bytes"]
[::std::mem::offset_of!(GhosttyTerminalMemoryUsage, primary_virtual_bytes) - 24usize];
["Offset of field: GhosttyTerminalMemoryUsage::primary_resident_bytes"]
[::std::mem::offset_of!(GhosttyTerminalMemoryUsage, primary_resident_bytes) - 32usize];
["Offset of field: GhosttyTerminalMemoryUsage::primary_compressed_pages"]
[::std::mem::offset_of!(GhosttyTerminalMemoryUsage, primary_compressed_pages) - 40usize];
["Offset of field: GhosttyTerminalMemoryUsage::primary_compressed_bytes"]
[::std::mem::offset_of!(GhosttyTerminalMemoryUsage, primary_compressed_bytes) - 48usize];
["Offset of field: GhosttyTerminalMemoryUsage::primary_image_bytes"]
[::std::mem::offset_of!(GhosttyTerminalMemoryUsage, primary_image_bytes) - 56usize];
["Offset of field: GhosttyTerminalMemoryUsage::alternate_pages"]
[::std::mem::offset_of!(GhosttyTerminalMemoryUsage, alternate_pages) - 64usize];
["Offset of field: GhosttyTerminalMemoryUsage::alternate_virtual_bytes"]
[::std::mem::offset_of!(GhosttyTerminalMemoryUsage, alternate_virtual_bytes) - 72usize];
["Offset of field: GhosttyTerminalMemoryUsage::alternate_resident_bytes"]
[::std::mem::offset_of!(GhosttyTerminalMemoryUsage, alternate_resident_bytes) - 80usize];
["Offset of field: GhosttyTerminalMemoryUsage::alternate_compressed_pages"]
[::std::mem::offset_of!(GhosttyTerminalMemoryUsage, alternate_compressed_pages) - 88usize];
["Offset of field: GhosttyTerminalMemoryUsage::alternate_compressed_bytes"]
[::std::mem::offset_of!(GhosttyTerminalMemoryUsage, alternate_compressed_bytes) - 96usize];
["Offset of field: GhosttyTerminalMemoryUsage::alternate_image_bytes"]
[::std::mem::offset_of!(GhosttyTerminalMemoryUsage, alternate_image_bytes) - 104usize];
};
pub type GhosttyTerminalBellFn = ::std::option::Option<
unsafe extern "C" fn(terminal: GhosttyTerminal, userdata: *mut ::std::os::raw::c_void),
>;
pub mod GhosttyTerminalUnknownSequenceTag {
#[allow(unused_imports)]
use super::*;
pub type Type = ::std::os::raw::c_uint;
pub const GHOSTTY_TERMINAL_UNKNOWN_SEQUENCE_APC: Type = 0;
pub const GHOSTTY_TERMINAL_UNKNOWN_SEQUENCE_OSC: Type = 1;
pub const GHOSTTY_TERMINAL_UNKNOWN_SEQUENCE_MAX_VALUE: Type = 2147483647;
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct GhosttyTerminalUnknownStringSequence {
pub truncated: bool,
pub content: GhosttyString,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
["Size of GhosttyTerminalUnknownStringSequence"]
[::std::mem::size_of::<GhosttyTerminalUnknownStringSequence>() - 24usize];
["Alignment of GhosttyTerminalUnknownStringSequence"]
[::std::mem::align_of::<GhosttyTerminalUnknownStringSequence>() - 8usize];
["Offset of field: GhosttyTerminalUnknownStringSequence::truncated"]
[::std::mem::offset_of!(GhosttyTerminalUnknownStringSequence, truncated) - 0usize];
["Offset of field: GhosttyTerminalUnknownStringSequence::content"]
[::std::mem::offset_of!(GhosttyTerminalUnknownStringSequence, content) - 8usize];
};
impl Default for GhosttyTerminalUnknownStringSequence {
fn default() -> Self {
let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
unsafe {
::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
s.assume_init()
}
}
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct GhosttyTerminalUnknownOscSequence {
pub truncated: bool,
pub content: GhosttyString,
pub terminator: GhosttyOscTerminator::Type,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
["Size of GhosttyTerminalUnknownOscSequence"]
[::std::mem::size_of::<GhosttyTerminalUnknownOscSequence>() - 32usize];
["Alignment of GhosttyTerminalUnknownOscSequence"]
[::std::mem::align_of::<GhosttyTerminalUnknownOscSequence>() - 8usize];
["Offset of field: GhosttyTerminalUnknownOscSequence::truncated"]
[::std::mem::offset_of!(GhosttyTerminalUnknownOscSequence, truncated) - 0usize];
["Offset of field: GhosttyTerminalUnknownOscSequence::content"]
[::std::mem::offset_of!(GhosttyTerminalUnknownOscSequence, content) - 8usize];
["Offset of field: GhosttyTerminalUnknownOscSequence::terminator"]
[::std::mem::offset_of!(GhosttyTerminalUnknownOscSequence, terminator) - 24usize];
};
impl Default for GhosttyTerminalUnknownOscSequence {
fn default() -> Self {
let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
unsafe {
::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
s.assume_init()
}
}
}
#[repr(C)]
#[derive(Copy, Clone)]
pub union GhosttyTerminalUnknownSequenceValue {
pub apc: GhosttyTerminalUnknownStringSequence,
pub osc: GhosttyTerminalUnknownOscSequence,
pub _padding: [u64; 16usize],
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
["Size of GhosttyTerminalUnknownSequenceValue"]
[::std::mem::size_of::<GhosttyTerminalUnknownSequenceValue>() - 128usize];
["Alignment of GhosttyTerminalUnknownSequenceValue"]
[::std::mem::align_of::<GhosttyTerminalUnknownSequenceValue>() - 8usize];
["Offset of field: GhosttyTerminalUnknownSequenceValue::apc"]
[::std::mem::offset_of!(GhosttyTerminalUnknownSequenceValue, apc) - 0usize];
["Offset of field: GhosttyTerminalUnknownSequenceValue::osc"]
[::std::mem::offset_of!(GhosttyTerminalUnknownSequenceValue, osc) - 0usize];
["Offset of field: GhosttyTerminalUnknownSequenceValue::_padding"]
[::std::mem::offset_of!(GhosttyTerminalUnknownSequenceValue, _padding) - 0usize];
};
impl Default for GhosttyTerminalUnknownSequenceValue {
fn default() -> Self {
let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
unsafe {
::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
s.assume_init()
}
}
}
#[repr(C)]
#[derive(Copy, Clone)]
pub struct GhosttyTerminalUnknownSequence {
pub tag: GhosttyTerminalUnknownSequenceTag::Type,
pub value: GhosttyTerminalUnknownSequenceValue,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
["Size of GhosttyTerminalUnknownSequence"]
[::std::mem::size_of::<GhosttyTerminalUnknownSequence>() - 136usize];
["Alignment of GhosttyTerminalUnknownSequence"]
[::std::mem::align_of::<GhosttyTerminalUnknownSequence>() - 8usize];
["Offset of field: GhosttyTerminalUnknownSequence::tag"]
[::std::mem::offset_of!(GhosttyTerminalUnknownSequence, tag) - 0usize];
["Offset of field: GhosttyTerminalUnknownSequence::value"]
[::std::mem::offset_of!(GhosttyTerminalUnknownSequence, value) - 8usize];
};
impl Default for GhosttyTerminalUnknownSequence {
fn default() -> Self {
let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
unsafe {
::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
s.assume_init()
}
}
}
pub type GhosttyTerminalUnknownSequenceFn = ::std::option::Option<
unsafe extern "C" fn(
terminal: GhosttyTerminal,
userdata: *mut ::std::os::raw::c_void,
sequence: *const GhosttyTerminalUnknownSequence,
),
>;
pub mod GhosttyClipboardLocation {
#[allow(unused_imports)]
use super::*;
pub type Type = ::std::os::raw::c_uint;
pub const GHOSTTY_CLIPBOARD_LOCATION_STANDARD: Type = 0;
pub const GHOSTTY_CLIPBOARD_LOCATION_SELECTION: Type = 1;
pub const GHOSTTY_CLIPBOARD_LOCATION_PRIMARY: Type = 2;
pub const GHOSTTY_CLIPBOARD_LOCATION_MAX_VALUE: Type = 2147483647;
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct GhosttyClipboardContent {
pub mime: GhosttyString,
pub data: GhosttyString,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
["Size of GhosttyClipboardContent"][::std::mem::size_of::<GhosttyClipboardContent>() - 32usize];
["Alignment of GhosttyClipboardContent"]
[::std::mem::align_of::<GhosttyClipboardContent>() - 8usize];
["Offset of field: GhosttyClipboardContent::mime"]
[::std::mem::offset_of!(GhosttyClipboardContent, mime) - 0usize];
["Offset of field: GhosttyClipboardContent::data"]
[::std::mem::offset_of!(GhosttyClipboardContent, data) - 16usize];
};
impl Default for GhosttyClipboardContent {
fn default() -> Self {
let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
unsafe {
::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
s.assume_init()
}
}
}
pub mod GhosttyClipboardWriteResult {
#[allow(unused_imports)]
use super::*;
pub type Type = ::std::os::raw::c_uint;
pub const GHOSTTY_CLIPBOARD_WRITE_RESULT_SUCCESS: Type = 0;
pub const GHOSTTY_CLIPBOARD_WRITE_RESULT_DENIED: Type = 1;
pub const GHOSTTY_CLIPBOARD_WRITE_RESULT_UNSUPPORTED: Type = 2;
pub const GHOSTTY_CLIPBOARD_WRITE_RESULT_BUSY: Type = 3;
pub const GHOSTTY_CLIPBOARD_WRITE_RESULT_INVALID_DATA: Type = 4;
pub const GHOSTTY_CLIPBOARD_WRITE_RESULT_IO_ERROR: Type = 5;
pub const GHOSTTY_CLIPBOARD_WRITE_RESULT_MAX_VALUE: Type = 2147483647;
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct GhosttyClipboardWriteReply {
pub size: usize,
pub result: GhosttyClipboardWriteResult::Type,
pub remember: bool,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
["Size of GhosttyClipboardWriteReply"]
[::std::mem::size_of::<GhosttyClipboardWriteReply>() - 16usize];
["Alignment of GhosttyClipboardWriteReply"]
[::std::mem::align_of::<GhosttyClipboardWriteReply>() - 8usize];
["Offset of field: GhosttyClipboardWriteReply::size"]
[::std::mem::offset_of!(GhosttyClipboardWriteReply, size) - 0usize];
["Offset of field: GhosttyClipboardWriteReply::result"]
[::std::mem::offset_of!(GhosttyClipboardWriteReply, result) - 8usize];
["Offset of field: GhosttyClipboardWriteReply::remember"]
[::std::mem::offset_of!(GhosttyClipboardWriteReply, remember) - 12usize];
};
impl Default for GhosttyClipboardWriteReply {
fn default() -> Self {
let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
unsafe {
::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
s.assume_init()
}
}
}
pub type GhosttyClipboardWriteReplyFn = ::std::option::Option<
unsafe extern "C" fn(
write: *const GhosttyClipboardWrite,
reply: *const GhosttyClipboardWriteReply,
),
>;
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct GhosttyClipboardWrite {
pub location: GhosttyClipboardLocation::Type,
pub contents: *const GhosttyClipboardContent,
pub contents_len: usize,
pub name: GhosttyString,
pub granted: bool,
pub can_remember: bool,
pub ctx: *const ::std::os::raw::c_void,
pub reply: GhosttyClipboardWriteReplyFn,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
["Size of GhosttyClipboardWrite"][::std::mem::size_of::<GhosttyClipboardWrite>() - 64usize];
["Alignment of GhosttyClipboardWrite"]
[::std::mem::align_of::<GhosttyClipboardWrite>() - 8usize];
["Offset of field: GhosttyClipboardWrite::location"]
[::std::mem::offset_of!(GhosttyClipboardWrite, location) - 0usize];
["Offset of field: GhosttyClipboardWrite::contents"]
[::std::mem::offset_of!(GhosttyClipboardWrite, contents) - 8usize];
["Offset of field: GhosttyClipboardWrite::contents_len"]
[::std::mem::offset_of!(GhosttyClipboardWrite, contents_len) - 16usize];
["Offset of field: GhosttyClipboardWrite::name"]
[::std::mem::offset_of!(GhosttyClipboardWrite, name) - 24usize];
["Offset of field: GhosttyClipboardWrite::granted"]
[::std::mem::offset_of!(GhosttyClipboardWrite, granted) - 40usize];
["Offset of field: GhosttyClipboardWrite::can_remember"]
[::std::mem::offset_of!(GhosttyClipboardWrite, can_remember) - 41usize];
["Offset of field: GhosttyClipboardWrite::ctx"]
[::std::mem::offset_of!(GhosttyClipboardWrite, ctx) - 48usize];
["Offset of field: GhosttyClipboardWrite::reply"]
[::std::mem::offset_of!(GhosttyClipboardWrite, reply) - 56usize];
};
impl Default for GhosttyClipboardWrite {
fn default() -> Self {
let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
unsafe {
::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
s.assume_init()
}
}
}
pub type GhosttyTerminalClipboardWriteFn = ::std::option::Option<
unsafe extern "C" fn(
terminal: GhosttyTerminal,
userdata: *mut ::std::os::raw::c_void,
write: *const GhosttyClipboardWrite,
),
>;
pub mod GhosttyClipboardReadResult {
#[allow(unused_imports)]
use super::*;
pub type Type = ::std::os::raw::c_uint;
pub const GHOSTTY_CLIPBOARD_READ_RESULT_SUCCESS: Type = 0;
pub const GHOSTTY_CLIPBOARD_READ_RESULT_DENIED: Type = 1;
pub const GHOSTTY_CLIPBOARD_READ_RESULT_UNSUPPORTED: Type = 2;
pub const GHOSTTY_CLIPBOARD_READ_RESULT_BUSY: Type = 3;
pub const GHOSTTY_CLIPBOARD_READ_RESULT_IO_ERROR: Type = 4;
pub const GHOSTTY_CLIPBOARD_READ_RESULT_MAX_VALUE: Type = 2147483647;
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct GhosttyClipboardReadReply {
pub size: usize,
pub result: GhosttyClipboardReadResult::Type,
pub contents: *const GhosttyClipboardContent,
pub contents_len: usize,
pub available: *const GhosttyString,
pub available_len: usize,
pub remember: bool,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
["Size of GhosttyClipboardReadReply"]
[::std::mem::size_of::<GhosttyClipboardReadReply>() - 56usize];
["Alignment of GhosttyClipboardReadReply"]
[::std::mem::align_of::<GhosttyClipboardReadReply>() - 8usize];
["Offset of field: GhosttyClipboardReadReply::size"]
[::std::mem::offset_of!(GhosttyClipboardReadReply, size) - 0usize];
["Offset of field: GhosttyClipboardReadReply::result"]
[::std::mem::offset_of!(GhosttyClipboardReadReply, result) - 8usize];
["Offset of field: GhosttyClipboardReadReply::contents"]
[::std::mem::offset_of!(GhosttyClipboardReadReply, contents) - 16usize];
["Offset of field: GhosttyClipboardReadReply::contents_len"]
[::std::mem::offset_of!(GhosttyClipboardReadReply, contents_len) - 24usize];
["Offset of field: GhosttyClipboardReadReply::available"]
[::std::mem::offset_of!(GhosttyClipboardReadReply, available) - 32usize];
["Offset of field: GhosttyClipboardReadReply::available_len"]
[::std::mem::offset_of!(GhosttyClipboardReadReply, available_len) - 40usize];
["Offset of field: GhosttyClipboardReadReply::remember"]
[::std::mem::offset_of!(GhosttyClipboardReadReply, remember) - 48usize];
};
impl Default for GhosttyClipboardReadReply {
fn default() -> Self {
let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
unsafe {
::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
s.assume_init()
}
}
}
pub type GhosttyClipboardReadReplyFn = ::std::option::Option<
unsafe extern "C" fn(
read: *const GhosttyClipboardRead,
reply: *const GhosttyClipboardReadReply,
),
>;
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct GhosttyClipboardRead {
pub location: GhosttyClipboardLocation::Type,
pub mimes: *const GhosttyString,
pub mimes_len: usize,
pub list: bool,
pub name: GhosttyString,
pub granted: bool,
pub can_remember: bool,
pub ctx: *const ::std::os::raw::c_void,
pub reply: GhosttyClipboardReadReplyFn,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
["Size of GhosttyClipboardRead"][::std::mem::size_of::<GhosttyClipboardRead>() - 72usize];
["Alignment of GhosttyClipboardRead"][::std::mem::align_of::<GhosttyClipboardRead>() - 8usize];
["Offset of field: GhosttyClipboardRead::location"]
[::std::mem::offset_of!(GhosttyClipboardRead, location) - 0usize];
["Offset of field: GhosttyClipboardRead::mimes"]
[::std::mem::offset_of!(GhosttyClipboardRead, mimes) - 8usize];
["Offset of field: GhosttyClipboardRead::mimes_len"]
[::std::mem::offset_of!(GhosttyClipboardRead, mimes_len) - 16usize];
["Offset of field: GhosttyClipboardRead::list"]
[::std::mem::offset_of!(GhosttyClipboardRead, list) - 24usize];
["Offset of field: GhosttyClipboardRead::name"]
[::std::mem::offset_of!(GhosttyClipboardRead, name) - 32usize];
["Offset of field: GhosttyClipboardRead::granted"]
[::std::mem::offset_of!(GhosttyClipboardRead, granted) - 48usize];
["Offset of field: GhosttyClipboardRead::can_remember"]
[::std::mem::offset_of!(GhosttyClipboardRead, can_remember) - 49usize];
["Offset of field: GhosttyClipboardRead::ctx"]
[::std::mem::offset_of!(GhosttyClipboardRead, ctx) - 56usize];
["Offset of field: GhosttyClipboardRead::reply"]
[::std::mem::offset_of!(GhosttyClipboardRead, reply) - 64usize];
};
impl Default for GhosttyClipboardRead {
fn default() -> Self {
let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
unsafe {
::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
s.assume_init()
}
}
}
pub type GhosttyTerminalClipboardReadFn = ::std::option::Option<
unsafe extern "C" fn(
terminal: GhosttyTerminal,
userdata: *mut ::std::os::raw::c_void,
read: *const GhosttyClipboardRead,
),
>;
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct GhosttyTerminalDesktopNotification {
pub title: GhosttyString,
pub body: GhosttyString,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
["Size of GhosttyTerminalDesktopNotification"]
[::std::mem::size_of::<GhosttyTerminalDesktopNotification>() - 32usize];
["Alignment of GhosttyTerminalDesktopNotification"]
[::std::mem::align_of::<GhosttyTerminalDesktopNotification>() - 8usize];
["Offset of field: GhosttyTerminalDesktopNotification::title"]
[::std::mem::offset_of!(GhosttyTerminalDesktopNotification, title) - 0usize];
["Offset of field: GhosttyTerminalDesktopNotification::body"]
[::std::mem::offset_of!(GhosttyTerminalDesktopNotification, body) - 16usize];
};
impl Default for GhosttyTerminalDesktopNotification {
fn default() -> Self {
let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
unsafe {
::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
s.assume_init()
}
}
}
pub type GhosttyTerminalDesktopNotificationFn = ::std::option::Option<
unsafe extern "C" fn(
terminal: GhosttyTerminal,
userdata: *mut ::std::os::raw::c_void,
notification: *const GhosttyTerminalDesktopNotification,
),
>;
pub mod GhosttyTerminalProgressState {
#[allow(unused_imports)]
use super::*;
pub type Type = ::std::os::raw::c_uint;
pub const GHOSTTY_TERMINAL_PROGRESS_STATE_REMOVE: Type = 0;
pub const GHOSTTY_TERMINAL_PROGRESS_STATE_SET: Type = 1;
pub const GHOSTTY_TERMINAL_PROGRESS_STATE_ERROR: Type = 2;
pub const GHOSTTY_TERMINAL_PROGRESS_STATE_INDETERMINATE: Type = 3;
pub const GHOSTTY_TERMINAL_PROGRESS_STATE_PAUSE: Type = 4;
pub const GHOSTTY_TERMINAL_PROGRESS_STATE_MAX_VALUE: Type = 2147483647;
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct GhosttyTerminalProgressReport {
pub state: GhosttyTerminalProgressState::Type,
pub progress: i8,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
["Size of GhosttyTerminalProgressReport"]
[::std::mem::size_of::<GhosttyTerminalProgressReport>() - 8usize];
["Alignment of GhosttyTerminalProgressReport"]
[::std::mem::align_of::<GhosttyTerminalProgressReport>() - 4usize];
["Offset of field: GhosttyTerminalProgressReport::state"]
[::std::mem::offset_of!(GhosttyTerminalProgressReport, state) - 0usize];
["Offset of field: GhosttyTerminalProgressReport::progress"]
[::std::mem::offset_of!(GhosttyTerminalProgressReport, progress) - 4usize];
};
impl Default for GhosttyTerminalProgressReport {
fn default() -> Self {
let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
unsafe {
::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
s.assume_init()
}
}
}
pub type GhosttyTerminalProgressReportFn = ::std::option::Option<
unsafe extern "C" fn(
terminal: GhosttyTerminal,
userdata: *mut ::std::os::raw::c_void,
report: *const GhosttyTerminalProgressReport,
),
>;
pub mod GhosttyProgramStatusState {
#[allow(unused_imports)]
use super::*;
pub type Type = ::std::os::raw::c_uint;
pub const GHOSTTY_PROGRAM_STATUS_STATE_IDLE: Type = 0;
pub const GHOSTTY_PROGRAM_STATUS_STATE_WORKING: Type = 1;
pub const GHOSTTY_PROGRAM_STATUS_STATE_DONE: Type = 2;
pub const GHOSTTY_PROGRAM_STATUS_STATE_BLOCKED: Type = 3;
pub const GHOSTTY_PROGRAM_STATUS_STATE_ERROR: Type = 4;
pub const GHOSTTY_PROGRAM_STATUS_STATE_CLEAR: Type = 5;
pub const GHOSTTY_PROGRAM_STATUS_STATE_MAX_VALUE: Type = 2147483647;
}
pub mod GhosttyProgramStatusKind {
#[allow(unused_imports)]
use super::*;
pub type Type = ::std::os::raw::c_uint;
pub const GHOSTTY_PROGRAM_STATUS_KIND_NONE: Type = 0;
pub const GHOSTTY_PROGRAM_STATUS_KIND_PERMISSION: Type = 1;
pub const GHOSTTY_PROGRAM_STATUS_KIND_QUESTION: Type = 2;
pub const GHOSTTY_PROGRAM_STATUS_KIND_AUTH: Type = 3;
pub const GHOSTTY_PROGRAM_STATUS_KIND_MAX_VALUE: Type = 2147483647;
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct GhosttyTerminalProgramStatus {
pub state: GhosttyProgramStatusState::Type,
pub kind: GhosttyProgramStatusKind::Type,
pub progress: i8,
pub id: GhosttyString,
pub app: GhosttyString,
pub title: GhosttyString,
pub message: GhosttyString,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
["Size of GhosttyTerminalProgramStatus"]
[::std::mem::size_of::<GhosttyTerminalProgramStatus>() - 80usize];
["Alignment of GhosttyTerminalProgramStatus"]
[::std::mem::align_of::<GhosttyTerminalProgramStatus>() - 8usize];
["Offset of field: GhosttyTerminalProgramStatus::state"]
[::std::mem::offset_of!(GhosttyTerminalProgramStatus, state) - 0usize];
["Offset of field: GhosttyTerminalProgramStatus::kind"]
[::std::mem::offset_of!(GhosttyTerminalProgramStatus, kind) - 4usize];
["Offset of field: GhosttyTerminalProgramStatus::progress"]
[::std::mem::offset_of!(GhosttyTerminalProgramStatus, progress) - 8usize];
["Offset of field: GhosttyTerminalProgramStatus::id"]
[::std::mem::offset_of!(GhosttyTerminalProgramStatus, id) - 16usize];
["Offset of field: GhosttyTerminalProgramStatus::app"]
[::std::mem::offset_of!(GhosttyTerminalProgramStatus, app) - 32usize];
["Offset of field: GhosttyTerminalProgramStatus::title"]
[::std::mem::offset_of!(GhosttyTerminalProgramStatus, title) - 48usize];
["Offset of field: GhosttyTerminalProgramStatus::message"]
[::std::mem::offset_of!(GhosttyTerminalProgramStatus, message) - 64usize];
};
impl Default for GhosttyTerminalProgramStatus {
fn default() -> Self {
let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
unsafe {
::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
s.assume_init()
}
}
}
pub type GhosttyTerminalProgramStatusFn = ::std::option::Option<
unsafe extern "C" fn(
terminal: GhosttyTerminal,
userdata: *mut ::std::os::raw::c_void,
report: *const GhosttyTerminalProgramStatus,
),
>;
pub mod GhosttySemanticPromptKind {
#[allow(unused_imports)]
use super::*;
pub type Type = ::std::os::raw::c_uint;
pub const GHOSTTY_SEMANTIC_PROMPT_INVALID: Type = 0;
pub const GHOSTTY_SEMANTIC_PROMPT_PROMPT_START: Type = 1;
pub const GHOSTTY_SEMANTIC_PROMPT_INPUT_START: Type = 2;
pub const GHOSTTY_SEMANTIC_PROMPT_OUTPUT_START: Type = 3;
pub const GHOSTTY_SEMANTIC_PROMPT_COMMAND_END: Type = 4;
pub const GHOSTTY_SEMANTIC_PROMPT_MAX_VALUE: Type = 2147483647;
}
pub mod GhosttySemanticPromptPromptKind {
#[allow(unused_imports)]
use super::*;
pub type Type = ::std::os::raw::c_uint;
pub const GHOSTTY_SEMANTIC_PROMPT_PROMPT_PRIMARY: Type = 0;
pub const GHOSTTY_SEMANTIC_PROMPT_PROMPT_RIGHT: Type = 1;
pub const GHOSTTY_SEMANTIC_PROMPT_PROMPT_CONTINUATION: Type = 2;
pub const GHOSTTY_SEMANTIC_PROMPT_PROMPT_SECONDARY: Type = 3;
pub const GHOSTTY_SEMANTIC_PROMPT_PROMPT_MAX_VALUE: Type = 2147483647;
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct GhosttyTerminalSemanticPrompt {
pub kind: GhosttySemanticPromptKind::Type,
pub prompt_kind: GhosttySemanticPromptPromptKind::Type,
pub has_exit_code: bool,
pub exit_code: i32,
pub command: GhosttyString,
pub error: GhosttyString,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
["Size of GhosttyTerminalSemanticPrompt"]
[::std::mem::size_of::<GhosttyTerminalSemanticPrompt>() - 48usize];
["Alignment of GhosttyTerminalSemanticPrompt"]
[::std::mem::align_of::<GhosttyTerminalSemanticPrompt>() - 8usize];
["Offset of field: GhosttyTerminalSemanticPrompt::kind"]
[::std::mem::offset_of!(GhosttyTerminalSemanticPrompt, kind) - 0usize];
["Offset of field: GhosttyTerminalSemanticPrompt::prompt_kind"]
[::std::mem::offset_of!(GhosttyTerminalSemanticPrompt, prompt_kind) - 4usize];
["Offset of field: GhosttyTerminalSemanticPrompt::has_exit_code"]
[::std::mem::offset_of!(GhosttyTerminalSemanticPrompt, has_exit_code) - 8usize];
["Offset of field: GhosttyTerminalSemanticPrompt::exit_code"]
[::std::mem::offset_of!(GhosttyTerminalSemanticPrompt, exit_code) - 12usize];
["Offset of field: GhosttyTerminalSemanticPrompt::command"]
[::std::mem::offset_of!(GhosttyTerminalSemanticPrompt, command) - 16usize];
["Offset of field: GhosttyTerminalSemanticPrompt::error"]
[::std::mem::offset_of!(GhosttyTerminalSemanticPrompt, error) - 32usize];
};
impl Default for GhosttyTerminalSemanticPrompt {
fn default() -> Self {
let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
unsafe {
::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
s.assume_init()
}
}
}
pub type GhosttyTerminalSemanticPromptFn = ::std::option::Option<
unsafe extern "C" fn(
terminal: GhosttyTerminal,
userdata: *mut ::std::os::raw::c_void,
event: *const GhosttyTerminalSemanticPrompt,
),
>;
pub type GhosttyTerminalResetFn = ::std::option::Option<
unsafe extern "C" fn(terminal: GhosttyTerminal, userdata: *mut ::std::os::raw::c_void),
>;
pub mod GhosttyTerminalResizeWindowTag {
#[allow(unused_imports)]
use super::*;
pub type Type = ::std::os::raw::c_uint;
pub const GHOSTTY_TERMINAL_RESIZE_WINDOW_GRID: Type = 0;
pub const GHOSTTY_TERMINAL_RESIZE_WINDOW_MAX_VALUE: Type = 2147483647;
}
#[repr(C)]
#[derive(Debug, Default, Copy, Clone)]
pub struct GhosttyTerminalResizeWindowGrid {
pub rows: u16,
pub columns: u16,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
["Size of GhosttyTerminalResizeWindowGrid"]
[::std::mem::size_of::<GhosttyTerminalResizeWindowGrid>() - 4usize];
["Alignment of GhosttyTerminalResizeWindowGrid"]
[::std::mem::align_of::<GhosttyTerminalResizeWindowGrid>() - 2usize];
["Offset of field: GhosttyTerminalResizeWindowGrid::rows"]
[::std::mem::offset_of!(GhosttyTerminalResizeWindowGrid, rows) - 0usize];
["Offset of field: GhosttyTerminalResizeWindowGrid::columns"]
[::std::mem::offset_of!(GhosttyTerminalResizeWindowGrid, columns) - 2usize];
};
#[repr(C)]
#[derive(Copy, Clone)]
pub union GhosttyTerminalResizeWindowValue {
pub grid: GhosttyTerminalResizeWindowGrid,
pub _padding: [u64; 2usize],
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
["Size of GhosttyTerminalResizeWindowValue"]
[::std::mem::size_of::<GhosttyTerminalResizeWindowValue>() - 16usize];
["Alignment of GhosttyTerminalResizeWindowValue"]
[::std::mem::align_of::<GhosttyTerminalResizeWindowValue>() - 8usize];
["Offset of field: GhosttyTerminalResizeWindowValue::grid"]
[::std::mem::offset_of!(GhosttyTerminalResizeWindowValue, grid) - 0usize];
["Offset of field: GhosttyTerminalResizeWindowValue::_padding"]
[::std::mem::offset_of!(GhosttyTerminalResizeWindowValue, _padding) - 0usize];
};
impl Default for GhosttyTerminalResizeWindowValue {
fn default() -> Self {
let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
unsafe {
::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
s.assume_init()
}
}
}
#[repr(C)]
#[derive(Copy, Clone)]
pub struct GhosttyTerminalResizeWindow {
pub tag: GhosttyTerminalResizeWindowTag::Type,
pub value: GhosttyTerminalResizeWindowValue,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
["Size of GhosttyTerminalResizeWindow"]
[::std::mem::size_of::<GhosttyTerminalResizeWindow>() - 24usize];
["Alignment of GhosttyTerminalResizeWindow"]
[::std::mem::align_of::<GhosttyTerminalResizeWindow>() - 8usize];
["Offset of field: GhosttyTerminalResizeWindow::tag"]
[::std::mem::offset_of!(GhosttyTerminalResizeWindow, tag) - 0usize];
["Offset of field: GhosttyTerminalResizeWindow::value"]
[::std::mem::offset_of!(GhosttyTerminalResizeWindow, value) - 8usize];
};
impl Default for GhosttyTerminalResizeWindow {
fn default() -> Self {
let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
unsafe {
::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
s.assume_init()
}
}
}
pub type GhosttyTerminalResizeWindowFn = ::std::option::Option<
unsafe extern "C" fn(
terminal: GhosttyTerminal,
userdata: *mut ::std::os::raw::c_void,
request: *const GhosttyTerminalResizeWindow,
),
>;
pub type GhosttyTerminalColorSchemeFn = ::std::option::Option<
unsafe extern "C" fn(
terminal: GhosttyTerminal,
userdata: *mut ::std::os::raw::c_void,
out_scheme: *mut GhosttyColorScheme::Type,
) -> bool,
>;
pub type GhosttyTerminalDeviceAttributesFn = ::std::option::Option<
unsafe extern "C" fn(
terminal: GhosttyTerminal,
userdata: *mut ::std::os::raw::c_void,
out_attrs: *mut GhosttyDeviceAttributes,
) -> bool,
>;
pub type GhosttyTerminalEnquiryFn = ::std::option::Option<
unsafe extern "C" fn(
terminal: GhosttyTerminal,
userdata: *mut ::std::os::raw::c_void,
) -> GhosttyString,
>;
pub type GhosttyTerminalSizeFn = ::std::option::Option<
unsafe extern "C" fn(
terminal: GhosttyTerminal,
userdata: *mut ::std::os::raw::c_void,
out_size: *mut GhosttySizeReportSize,
) -> bool,
>;
pub type GhosttyTerminalTitleChangedFn = ::std::option::Option<
unsafe extern "C" fn(terminal: GhosttyTerminal, userdata: *mut ::std::os::raw::c_void),
>;
pub type GhosttyTerminalRenderHoldFn = ::std::option::Option<
unsafe extern "C" fn(
terminal: GhosttyTerminal,
userdata: *mut ::std::os::raw::c_void,
held: bool,
),
>;
pub type GhosttyTerminalPwdChangedFn = ::std::option::Option<
unsafe extern "C" fn(terminal: GhosttyTerminal, userdata: *mut ::std::os::raw::c_void),
>;
pub type GhosttyTerminalWritePtyFn = ::std::option::Option<
unsafe extern "C" fn(
terminal: GhosttyTerminal,
userdata: *mut ::std::os::raw::c_void,
data: *const u8,
len: usize,
),
>;
pub type GhosttyTerminalXtversionFn = ::std::option::Option<
unsafe extern "C" fn(
terminal: GhosttyTerminal,
userdata: *mut ::std::os::raw::c_void,
) -> GhosttyString,
>;
#[repr(C)]
#[derive(Debug, Default, Copy, Clone)]
pub struct GhosttyTerminalModeConfig {
pub mode: GhosttyMode,
pub value: bool,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
["Size of GhosttyTerminalModeConfig"]
[::std::mem::size_of::<GhosttyTerminalModeConfig>() - 4usize];
["Alignment of GhosttyTerminalModeConfig"]
[::std::mem::align_of::<GhosttyTerminalModeConfig>() - 2usize];
["Offset of field: GhosttyTerminalModeConfig::mode"]
[::std::mem::offset_of!(GhosttyTerminalModeConfig, mode) - 0usize];
["Offset of field: GhosttyTerminalModeConfig::value"]
[::std::mem::offset_of!(GhosttyTerminalModeConfig, value) - 2usize];
};
pub mod GhosttyTerminalOption {
#[allow(unused_imports)]
use super::*;
pub type Type = ::std::os::raw::c_uint;
pub const GHOSTTY_TERMINAL_OPT_INVALID: Type = 0;
pub const GHOSTTY_TERMINAL_OPT_USERDATA: Type = 1;
pub const GHOSTTY_TERMINAL_OPT_WRITE_PTY: Type = 2;
pub const GHOSTTY_TERMINAL_OPT_BELL: Type = 3;
pub const GHOSTTY_TERMINAL_OPT_ENQUIRY: Type = 4;
pub const GHOSTTY_TERMINAL_OPT_XTVERSION: Type = 5;
pub const GHOSTTY_TERMINAL_OPT_TITLE_CHANGED: Type = 6;
pub const GHOSTTY_TERMINAL_OPT_SIZE: Type = 7;
pub const GHOSTTY_TERMINAL_OPT_COLOR_SCHEME: Type = 8;
pub const GHOSTTY_TERMINAL_OPT_DEVICE_ATTRIBUTES: Type = 9;
pub const GHOSTTY_TERMINAL_OPT_TITLE: Type = 10;
pub const GHOSTTY_TERMINAL_OPT_PWD: Type = 11;
pub const GHOSTTY_TERMINAL_OPT_COLOR_FOREGROUND: Type = 12;
pub const GHOSTTY_TERMINAL_OPT_COLOR_BACKGROUND: Type = 13;
pub const GHOSTTY_TERMINAL_OPT_COLOR_CURSOR: Type = 14;
pub const GHOSTTY_TERMINAL_OPT_COLOR_PALETTE: Type = 15;
pub const GHOSTTY_TERMINAL_OPT_KITTY_IMAGE_STORAGE_LIMIT: Type = 16;
pub const GHOSTTY_TERMINAL_OPT_KITTY_IMAGE_MEDIUM_FILE: Type = 17;
pub const GHOSTTY_TERMINAL_OPT_KITTY_IMAGE_MEDIUM_TEMP_FILE: Type = 18;
pub const GHOSTTY_TERMINAL_OPT_KITTY_IMAGE_MEDIUM_SHARED_MEM: Type = 19;
pub const GHOSTTY_TERMINAL_OPT_APC_MAX_BYTES: Type = 20;
pub const GHOSTTY_TERMINAL_OPT_APC_MAX_BYTES_KITTY: Type = 21;
pub const GHOSTTY_TERMINAL_OPT_SELECTION: Type = 22;
pub const GHOSTTY_TERMINAL_OPT_DEFAULT_CURSOR_STYLE: Type = 23;
pub const GHOSTTY_TERMINAL_OPT_DEFAULT_CURSOR_BLINK: Type = 24;
pub const GHOSTTY_TERMINAL_OPT_GLYPH_PROTOCOL: Type = 25;
pub const GHOSTTY_TERMINAL_OPT_PWD_CHANGED: Type = 26;
pub const GHOSTTY_TERMINAL_OPT_CLIPBOARD_WRITE: Type = 27;
pub const GHOSTTY_TERMINAL_OPT_SCROLLBACK_MAX_BYTES: Type = 28;
pub const GHOSTTY_TERMINAL_OPT_SCROLLBACK_MAX_LINES: Type = 29;
pub const GHOSTTY_TERMINAL_OPT_DESKTOP_NOTIFICATION: Type = 30;
pub const GHOSTTY_TERMINAL_OPT_PROGRESS_REPORT: Type = 31;
pub const GHOSTTY_TERMINAL_OPT_CONTINUATION_MAX_BYTES: Type = 32;
pub const GHOSTTY_TERMINAL_OPT_TITLE_REPORT: Type = 33;
pub const GHOSTTY_TERMINAL_OPT_MODE_DEFAULT: Type = 34;
pub const GHOSTTY_TERMINAL_OPT_MODE: Type = 35;
pub const GHOSTTY_TERMINAL_OPT_UNKNOWN_SEQUENCE: Type = 36;
pub const GHOSTTY_TERMINAL_OPT_UNKNOWN_MAX_BYTES: Type = 37;
pub const GHOSTTY_TERMINAL_OPT_TERMINFO_NAME: Type = 38;
pub const GHOSTTY_TERMINAL_OPT_CLIPBOARD_READ: Type = 39;
pub const GHOSTTY_TERMINAL_OPT_CLIPBOARD_WRITE_MAX_BYTES: Type = 40;
pub const GHOSTTY_TERMINAL_OPT_RESIZE_PULL_SCROLLBACK: Type = 41;
pub const GHOSTTY_TERMINAL_OPT_RENDER_HOLD: Type = 42;
pub const GHOSTTY_TERMINAL_OPT_SEMANTIC_PROMPT: Type = 43;
pub const GHOSTTY_TERMINAL_OPT_RESET: Type = 44;
pub const GHOSTTY_TERMINAL_OPT_XT_CHECKSUM_REPORT: Type = 45;
pub const GHOSTTY_TERMINAL_OPT_XT_CHECKSUM_EXTENSION: Type = 46;
pub const GHOSTTY_TERMINAL_OPT_PROGRAM_STATUS: Type = 47;
pub const GHOSTTY_TERMINAL_OPT_RESIZE_WINDOW: Type = 48;
pub const GHOSTTY_TERMINAL_OPT_MAX_VALUE: Type = 2147483647;
}
pub mod GhosttyTerminalData {
#[allow(unused_imports)]
use super::*;
pub type Type = ::std::os::raw::c_uint;
pub const GHOSTTY_TERMINAL_DATA_INVALID: Type = 0;
pub const GHOSTTY_TERMINAL_DATA_COLS: Type = 1;
pub const GHOSTTY_TERMINAL_DATA_ROWS: Type = 2;
pub const GHOSTTY_TERMINAL_DATA_CURSOR_X: Type = 3;
pub const GHOSTTY_TERMINAL_DATA_CURSOR_Y: Type = 4;
pub const GHOSTTY_TERMINAL_DATA_CURSOR_PENDING_WRAP: Type = 5;
pub const GHOSTTY_TERMINAL_DATA_ACTIVE_SCREEN: Type = 6;
pub const GHOSTTY_TERMINAL_DATA_CURSOR_VISIBLE: Type = 7;
pub const GHOSTTY_TERMINAL_DATA_KITTY_KEYBOARD_FLAGS: Type = 8;
pub const GHOSTTY_TERMINAL_DATA_SCROLLBAR: Type = 9;
pub const GHOSTTY_TERMINAL_DATA_CURSOR_SGR_STYLE: Type = 10;
pub const GHOSTTY_TERMINAL_DATA_MOUSE_TRACKING: Type = 11;
pub const GHOSTTY_TERMINAL_DATA_TITLE: Type = 12;
pub const GHOSTTY_TERMINAL_DATA_PWD: Type = 13;
pub const GHOSTTY_TERMINAL_DATA_TOTAL_ROWS: Type = 14;
pub const GHOSTTY_TERMINAL_DATA_SCROLLBACK_ROWS: Type = 15;
pub const GHOSTTY_TERMINAL_DATA_WIDTH_PX: Type = 16;
pub const GHOSTTY_TERMINAL_DATA_HEIGHT_PX: Type = 17;
pub const GHOSTTY_TERMINAL_DATA_COLOR_FOREGROUND: Type = 18;
pub const GHOSTTY_TERMINAL_DATA_COLOR_BACKGROUND: Type = 19;
pub const GHOSTTY_TERMINAL_DATA_COLOR_CURSOR: Type = 20;
pub const GHOSTTY_TERMINAL_DATA_COLOR_PALETTE: Type = 21;
pub const GHOSTTY_TERMINAL_DATA_COLOR_FOREGROUND_DEFAULT: Type = 22;
pub const GHOSTTY_TERMINAL_DATA_COLOR_BACKGROUND_DEFAULT: Type = 23;
pub const GHOSTTY_TERMINAL_DATA_COLOR_CURSOR_DEFAULT: Type = 24;
pub const GHOSTTY_TERMINAL_DATA_COLOR_PALETTE_DEFAULT: Type = 25;
pub const GHOSTTY_TERMINAL_DATA_KITTY_IMAGE_STORAGE_LIMIT: Type = 26;
pub const GHOSTTY_TERMINAL_DATA_KITTY_IMAGE_MEDIUM_FILE: Type = 27;
pub const GHOSTTY_TERMINAL_DATA_KITTY_IMAGE_MEDIUM_TEMP_FILE: Type = 28;
pub const GHOSTTY_TERMINAL_DATA_KITTY_IMAGE_MEDIUM_SHARED_MEM: Type = 29;
pub const GHOSTTY_TERMINAL_DATA_KITTY_GRAPHICS: Type = 30;
pub const GHOSTTY_TERMINAL_DATA_SELECTION: Type = 31;
pub const GHOSTTY_TERMINAL_DATA_VIEWPORT_ACTIVE: Type = 32;
pub const GHOSTTY_TERMINAL_DATA_VT_PROCESSING_ERROR: Type = 33;
pub const GHOSTTY_TERMINAL_DATA_SCROLLBACK_MAX_BYTES: Type = 34;
pub const GHOSTTY_TERMINAL_DATA_SCROLLBACK_MAX_LINES: Type = 35;
pub const GHOSTTY_TERMINAL_DATA_CONTINUATION_MAX_BYTES: Type = 36;
pub const GHOSTTY_TERMINAL_DATA_MODE: Type = 37;
pub const GHOSTTY_TERMINAL_DATA_VT_GROUND: Type = 38;
pub const GHOSTTY_TERMINAL_DATA_CURSOR_AT_PROMPT: Type = 39;
pub const GHOSTTY_TERMINAL_DATA_CLIPBOARD_WRITE_MAX_BYTES: Type = 40;
pub const GHOSTTY_TERMINAL_DATA_MOUSE_SHAPE: Type = 41;
pub const GHOSTTY_TERMINAL_DATA_MEMORY_USAGE: Type = 42;
pub const GHOSTTY_TERMINAL_DATA_MAX_VALUE: Type = 2147483647;
}
unsafe extern "C" {
pub fn ghostty_terminal_new(
allocator: *const GhosttyAllocator,
terminal: *mut GhosttyTerminal,
cols: u16,
rows: u16,
) -> GhosttyResult::Type;
}
unsafe extern "C" {
pub fn ghostty_terminal_free(terminal: GhosttyTerminal);
}
unsafe extern "C" {
pub fn ghostty_terminal_reset(terminal: GhosttyTerminal);
}
unsafe extern "C" {
pub fn ghostty_terminal_resize(
terminal: GhosttyTerminal,
cols: u16,
rows: u16,
cell_width_px: u32,
cell_height_px: u32,
) -> GhosttyResult::Type;
}
unsafe extern "C" {
pub fn ghostty_terminal_set(
terminal: GhosttyTerminal,
option: GhosttyTerminalOption::Type,
value: *const ::std::os::raw::c_void,
) -> GhosttyResult::Type;
}
unsafe extern "C" {
pub fn ghostty_terminal_vt_write(terminal: GhosttyTerminal, data: *const u8, len: usize);
}
unsafe extern "C" {
pub fn ghostty_terminal_vt_write_until(
terminal: GhosttyTerminal,
data: *const u8,
len: usize,
boundaries: u32,
out: *mut GhosttyTerminalWriteStop,
) -> GhosttyResult::Type;
}
unsafe extern "C" {
pub fn ghostty_terminal_continuation_write(
terminal: GhosttyTerminal,
writer: GhosttyWriter,
) -> GhosttyResult::Type;
}
unsafe extern "C" {
pub fn ghostty_terminal_continuation_buf(
terminal: GhosttyTerminal,
buf: *mut u8,
buf_len: usize,
out_written: *mut usize,
) -> GhosttyResult::Type;
}
unsafe extern "C" {
pub fn ghostty_terminal_continuation_alloc(
terminal: GhosttyTerminal,
allocator: *const GhosttyAllocator,
out_ptr: *mut *mut u8,
out_len: *mut usize,
) -> GhosttyResult::Type;
}
unsafe extern "C" {
pub fn ghostty_terminal_scroll_viewport(
terminal: GhosttyTerminal,
behavior: GhosttyTerminalScrollViewport,
) -> GhosttyResult::Type;
}
unsafe extern "C" {
pub fn ghostty_terminal_compression_activity(
terminal: GhosttyTerminal,
out_activity: *mut u64,
) -> GhosttyResult::Type;
}
unsafe extern "C" {
pub fn ghostty_terminal_compress(
terminal: GhosttyTerminal,
mode: GhosttyTerminalCompressionMode::Type,
out_result: *mut GhosttyTerminalCompressionResult::Type,
) -> GhosttyResult::Type;
}
unsafe extern "C" {
pub fn ghostty_terminal_get(
terminal: GhosttyTerminal,
data: GhosttyTerminalData::Type,
out: *mut ::std::os::raw::c_void,
) -> GhosttyResult::Type;
}
unsafe extern "C" {
pub fn ghostty_terminal_get_multi(
terminal: GhosttyTerminal,
count: usize,
keys: *const GhosttyTerminalData::Type,
values: *mut *mut ::std::os::raw::c_void,
out_written: *mut usize,
) -> GhosttyResult::Type;
}
unsafe extern "C" {
pub fn ghostty_terminal_grid_ref(
terminal: GhosttyTerminal,
point: GhosttyPoint,
out_ref: *mut GhosttyGridRef,
) -> GhosttyResult::Type;
}
unsafe extern "C" {
pub fn ghostty_terminal_grid_ref_track(
terminal: GhosttyTerminal,
point: GhosttyPoint,
out_ref: *mut GhosttyTrackedGridRef,
) -> GhosttyResult::Type;
}
unsafe extern "C" {
pub fn ghostty_terminal_point_from_grid_ref(
terminal: GhosttyTerminal,
ref_: *const GhosttyGridRef,
tag: GhosttyPointTag::Type,
out: *mut GhosttyPointCoordinate,
) -> GhosttyResult::Type;
}
pub type GhosttyFormatterExtras = u32;
pub mod GhosttyFormatterOption {
#[allow(unused_imports)]
use super::*;
pub type Type = ::std::os::raw::c_uint;
pub const GHOSTTY_FORMATTER_OPT_INVALID: Type = 0;
pub const GHOSTTY_FORMATTER_OPT_EMIT: Type = 1;
pub const GHOSTTY_FORMATTER_OPT_UNWRAP: Type = 2;
pub const GHOSTTY_FORMATTER_OPT_TRIM: Type = 3;
pub const GHOSTTY_FORMATTER_OPT_SELECTION: Type = 4;
pub const GHOSTTY_FORMATTER_OPT_EXTRAS: Type = 5;
pub const GHOSTTY_FORMATTER_OPT_MAX_VALUE: Type = 2147483647;
}
unsafe extern "C" {
pub fn ghostty_formatter_terminal_new(
allocator: *const GhosttyAllocator,
formatter: *mut GhosttyFormatter,
terminal: GhosttyTerminal,
) -> GhosttyResult::Type;
}
unsafe extern "C" {
pub fn ghostty_formatter_set(
formatter: GhosttyFormatter,
option: GhosttyFormatterOption::Type,
value: *const ::std::os::raw::c_void,
) -> GhosttyResult::Type;
}
unsafe extern "C" {
pub fn ghostty_formatter_get(
formatter: GhosttyFormatter,
option: GhosttyFormatterOption::Type,
out: *mut ::std::os::raw::c_void,
) -> GhosttyResult::Type;
}
unsafe extern "C" {
pub fn ghostty_formatter_format(
formatter: GhosttyFormatter,
writer: GhosttyWriter,
) -> GhosttyResult::Type;
}
unsafe extern "C" {
pub fn ghostty_formatter_format_buf(
formatter: GhosttyFormatter,
buf: *mut u8,
buf_len: usize,
out_written: *mut usize,
) -> GhosttyResult::Type;
}
unsafe extern "C" {
pub fn ghostty_formatter_format_alloc(
formatter: GhosttyFormatter,
allocator: *const GhosttyAllocator,
out_ptr: *mut *mut u8,
out_len: *mut usize,
) -> GhosttyResult::Type;
}
unsafe extern "C" {
pub fn ghostty_formatter_free(formatter: GhosttyFormatter);
}
pub mod GhosttyRenderStateDirty {
#[allow(unused_imports)]
use super::*;
pub type Type = ::std::os::raw::c_uint;
pub const GHOSTTY_RENDER_STATE_DIRTY_FALSE: Type = 0;
pub const GHOSTTY_RENDER_STATE_DIRTY_PARTIAL: Type = 1;
pub const GHOSTTY_RENDER_STATE_DIRTY_FULL: Type = 2;
pub const GHOSTTY_RENDER_STATE_DIRTY_MAX_VALUE: Type = 2147483647;
}
#[repr(C)]
#[derive(Debug, Default, Copy, Clone)]
pub struct GhosttyRenderStateOverscan {
pub above: u16,
pub below: u16,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
["Size of GhosttyRenderStateOverscan"]
[::std::mem::size_of::<GhosttyRenderStateOverscan>() - 4usize];
["Alignment of GhosttyRenderStateOverscan"]
[::std::mem::align_of::<GhosttyRenderStateOverscan>() - 2usize];
["Offset of field: GhosttyRenderStateOverscan::above"]
[::std::mem::offset_of!(GhosttyRenderStateOverscan, above) - 0usize];
["Offset of field: GhosttyRenderStateOverscan::below"]
[::std::mem::offset_of!(GhosttyRenderStateOverscan, below) - 2usize];
};
#[repr(C)]
#[derive(Debug, Default, Copy, Clone)]
pub struct GhosttyRenderStateRowId {
pub bits: [u64; 2usize],
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
["Size of GhosttyRenderStateRowId"][::std::mem::size_of::<GhosttyRenderStateRowId>() - 16usize];
["Alignment of GhosttyRenderStateRowId"]
[::std::mem::align_of::<GhosttyRenderStateRowId>() - 8usize];
["Offset of field: GhosttyRenderStateRowId::bits"]
[::std::mem::offset_of!(GhosttyRenderStateRowId, bits) - 0usize];
};
pub mod GhosttyRenderStateData {
#[allow(unused_imports)]
use super::*;
pub type Type = ::std::os::raw::c_uint;
pub const GHOSTTY_RENDER_STATE_DATA_INVALID: Type = 0;
pub const GHOSTTY_RENDER_STATE_DATA_COLS: Type = 1;
pub const GHOSTTY_RENDER_STATE_DATA_ROWS: Type = 2;
pub const GHOSTTY_RENDER_STATE_DATA_DIRTY: Type = 3;
pub const GHOSTTY_RENDER_STATE_DATA_ROW_ITERATOR: Type = 4;
pub const GHOSTTY_RENDER_STATE_DATA_COLOR_BACKGROUND: Type = 5;
pub const GHOSTTY_RENDER_STATE_DATA_COLOR_FOREGROUND: Type = 6;
pub const GHOSTTY_RENDER_STATE_DATA_COLOR_CURSOR: Type = 7;
pub const GHOSTTY_RENDER_STATE_DATA_COLOR_CURSOR_HAS_VALUE: Type = 8;
pub const GHOSTTY_RENDER_STATE_DATA_COLOR_PALETTE: Type = 9;
pub const GHOSTTY_RENDER_STATE_DATA_CURSOR_VISUAL_STYLE: Type = 10;
pub const GHOSTTY_RENDER_STATE_DATA_CURSOR_VISIBLE: Type = 11;
pub const GHOSTTY_RENDER_STATE_DATA_CURSOR_BLINKING: Type = 12;
pub const GHOSTTY_RENDER_STATE_DATA_CURSOR_PASSWORD_INPUT: Type = 13;
pub const GHOSTTY_RENDER_STATE_DATA_CURSOR_VIEWPORT_HAS_VALUE: Type = 14;
pub const GHOSTTY_RENDER_STATE_DATA_CURSOR_VIEWPORT_X: Type = 15;
pub const GHOSTTY_RENDER_STATE_DATA_CURSOR_VIEWPORT_Y: Type = 16;
pub const GHOSTTY_RENDER_STATE_DATA_CURSOR_VIEWPORT_WIDE_TAIL: Type = 17;
pub const GHOSTTY_RENDER_STATE_DATA_CURSOR: Type = 18;
pub const GHOSTTY_RENDER_STATE_DATA_COLORS: Type = 19;
pub const GHOSTTY_RENDER_STATE_DATA_OVERSCAN: Type = 20;
pub const GHOSTTY_RENDER_STATE_DATA_OVERSCAN_REQUEST: Type = 21;
pub const GHOSTTY_RENDER_STATE_DATA_IMAGE_ITERATOR: Type = 22;
pub const GHOSTTY_RENDER_STATE_DATA_IMAGE_PLACEMENTS_GENERATION: Type = 23;
pub const GHOSTTY_RENDER_STATE_DATA_MAX_VALUE: Type = 2147483647;
}
pub mod GhosttyRenderStateOption {
#[allow(unused_imports)]
use super::*;
pub type Type = ::std::os::raw::c_uint;
pub const GHOSTTY_RENDER_STATE_OPT_INVALID: Type = 0;
pub const GHOSTTY_RENDER_STATE_OPT_DIRTY: Type = 1;
pub const GHOSTTY_RENDER_STATE_OPT_OVERSCAN: Type = 2;
pub const GHOSTTY_RENDER_STATE_OPT_MAX_VALUE: Type = 2147483647;
}
pub mod GhosttyImageProtocol {
#[allow(unused_imports)]
use super::*;
pub type Type = ::std::os::raw::c_uint;
pub const GHOSTTY_IMAGE_PROTOCOL_KITTY: Type = 0;
pub const GHOSTTY_IMAGE_PROTOCOL_MAX_VALUE: Type = 2147483647;
}
pub mod GhosttyRenderStateKittyPlacementKind {
#[allow(unused_imports)]
use super::*;
pub type Type = ::std::os::raw::c_uint;
pub const GHOSTTY_RENDER_STATE_KITTY_PLACEMENT_KIND_VIRTUAL: Type = 0;
pub const GHOSTTY_RENDER_STATE_KITTY_PLACEMENT_KIND_RELATIVE: Type = 1;
pub const GHOSTTY_RENDER_STATE_KITTY_PLACEMENT_KIND_FIXED: Type = 2;
pub const GHOSTTY_RENDER_STATE_KITTY_PLACEMENT_KIND_MAX_VALUE: Type = 2147483647;
}
pub mod GhosttyRenderStateImageData {
#[allow(unused_imports)]
use super::*;
pub type Type = ::std::os::raw::c_uint;
pub const GHOSTTY_RENDER_STATE_IMAGE_DATA_INVALID: Type = 0;
pub const GHOSTTY_RENDER_STATE_IMAGE_DATA_PROTOCOL: Type = 1;
pub const GHOSTTY_RENDER_STATE_IMAGE_DATA_IMAGE_ID: Type = 2;
pub const GHOSTTY_RENDER_STATE_IMAGE_DATA_IMAGE_GENERATION: Type = 3;
pub const GHOSTTY_RENDER_STATE_IMAGE_DATA_LAYER: Type = 4;
pub const GHOSTTY_RENDER_STATE_IMAGE_DATA_Z: Type = 5;
pub const GHOSTTY_RENDER_STATE_IMAGE_DATA_VIEWPORT_COL: Type = 6;
pub const GHOSTTY_RENDER_STATE_IMAGE_DATA_VIEWPORT_ROW: Type = 7;
pub const GHOSTTY_RENDER_STATE_IMAGE_DATA_GRID_COLS: Type = 8;
pub const GHOSTTY_RENDER_STATE_IMAGE_DATA_GRID_ROWS: Type = 9;
pub const GHOSTTY_RENDER_STATE_IMAGE_DATA_CELL_OFFSET_X: Type = 10;
pub const GHOSTTY_RENDER_STATE_IMAGE_DATA_CELL_OFFSET_Y: Type = 11;
pub const GHOSTTY_RENDER_STATE_IMAGE_DATA_PIXEL_WIDTH: Type = 12;
pub const GHOSTTY_RENDER_STATE_IMAGE_DATA_PIXEL_HEIGHT: Type = 13;
pub const GHOSTTY_RENDER_STATE_IMAGE_DATA_SOURCE_X: Type = 14;
pub const GHOSTTY_RENDER_STATE_IMAGE_DATA_SOURCE_Y: Type = 15;
pub const GHOSTTY_RENDER_STATE_IMAGE_DATA_SOURCE_WIDTH: Type = 16;
pub const GHOSTTY_RENDER_STATE_IMAGE_DATA_SOURCE_HEIGHT: Type = 17;
pub const GHOSTTY_RENDER_STATE_IMAGE_DATA_KITTY_PLACEMENT_ID: Type = 18;
pub const GHOSTTY_RENDER_STATE_IMAGE_DATA_KITTY_KIND: Type = 19;
pub const GHOSTTY_RENDER_STATE_IMAGE_DATA_MAX_VALUE: Type = 2147483647;
}
pub mod GhosttyRenderStateRowData {
#[allow(unused_imports)]
use super::*;
pub type Type = ::std::os::raw::c_uint;
pub const GHOSTTY_RENDER_STATE_ROW_DATA_INVALID: Type = 0;
pub const GHOSTTY_RENDER_STATE_ROW_DATA_DIRTY: Type = 1;
pub const GHOSTTY_RENDER_STATE_ROW_DATA_RAW: Type = 2;
pub const GHOSTTY_RENDER_STATE_ROW_DATA_CELLS: Type = 3;
pub const GHOSTTY_RENDER_STATE_ROW_DATA_SELECTION: Type = 4;
pub const GHOSTTY_RENDER_STATE_ROW_DATA_CELLS_RAW: Type = 5;
pub const GHOSTTY_RENDER_STATE_ROW_DATA_VIEWPORT_Y: Type = 6;
pub const GHOSTTY_RENDER_STATE_ROW_DATA_ID: Type = 7;
pub const GHOSTTY_RENDER_STATE_ROW_DATA_MAX_VALUE: Type = 2147483647;
}
pub mod GhosttyRenderStateRowOption {
#[allow(unused_imports)]
use super::*;
pub type Type = ::std::os::raw::c_uint;
pub const GHOSTTY_RENDER_STATE_ROW_OPT_INVALID: Type = 0;
pub const GHOSTTY_RENDER_STATE_ROW_OPT_DIRTY: Type = 1;
pub const GHOSTTY_RENDER_STATE_ROW_OPT_MAX_VALUE: Type = 2147483647;
}
#[repr(C)]
#[derive(Debug, Default, Copy, Clone)]
pub struct GhosttyRenderStateRowSelection {
pub size: usize,
pub start_x: u16,
pub end_x: u16,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
["Size of GhosttyRenderStateRowSelection"]
[::std::mem::size_of::<GhosttyRenderStateRowSelection>() - 16usize];
["Alignment of GhosttyRenderStateRowSelection"]
[::std::mem::align_of::<GhosttyRenderStateRowSelection>() - 8usize];
["Offset of field: GhosttyRenderStateRowSelection::size"]
[::std::mem::offset_of!(GhosttyRenderStateRowSelection, size) - 0usize];
["Offset of field: GhosttyRenderStateRowSelection::start_x"]
[::std::mem::offset_of!(GhosttyRenderStateRowSelection, start_x) - 8usize];
["Offset of field: GhosttyRenderStateRowSelection::end_x"]
[::std::mem::offset_of!(GhosttyRenderStateRowSelection, end_x) - 10usize];
};
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct GhosttyRenderStateCursor {
pub size: usize,
pub viewport_has_value: bool,
pub viewport_x: u16,
pub viewport_y: u16,
pub wide_tail: bool,
pub visible: bool,
pub blinking: bool,
pub password_input: bool,
pub visual_style: GhosttyCursorStyle::Type,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
["Size of GhosttyRenderStateCursor"]
[::std::mem::size_of::<GhosttyRenderStateCursor>() - 24usize];
["Alignment of GhosttyRenderStateCursor"]
[::std::mem::align_of::<GhosttyRenderStateCursor>() - 8usize];
["Offset of field: GhosttyRenderStateCursor::size"]
[::std::mem::offset_of!(GhosttyRenderStateCursor, size) - 0usize];
["Offset of field: GhosttyRenderStateCursor::viewport_has_value"]
[::std::mem::offset_of!(GhosttyRenderStateCursor, viewport_has_value) - 8usize];
["Offset of field: GhosttyRenderStateCursor::viewport_x"]
[::std::mem::offset_of!(GhosttyRenderStateCursor, viewport_x) - 10usize];
["Offset of field: GhosttyRenderStateCursor::viewport_y"]
[::std::mem::offset_of!(GhosttyRenderStateCursor, viewport_y) - 12usize];
["Offset of field: GhosttyRenderStateCursor::wide_tail"]
[::std::mem::offset_of!(GhosttyRenderStateCursor, wide_tail) - 14usize];
["Offset of field: GhosttyRenderStateCursor::visible"]
[::std::mem::offset_of!(GhosttyRenderStateCursor, visible) - 15usize];
["Offset of field: GhosttyRenderStateCursor::blinking"]
[::std::mem::offset_of!(GhosttyRenderStateCursor, blinking) - 16usize];
["Offset of field: GhosttyRenderStateCursor::password_input"]
[::std::mem::offset_of!(GhosttyRenderStateCursor, password_input) - 17usize];
["Offset of field: GhosttyRenderStateCursor::visual_style"]
[::std::mem::offset_of!(GhosttyRenderStateCursor, visual_style) - 20usize];
};
impl Default for GhosttyRenderStateCursor {
fn default() -> Self {
let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
unsafe {
::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
s.assume_init()
}
}
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct GhosttyRenderStateColors {
pub size: usize,
pub background: GhosttyColorRgb,
pub foreground: GhosttyColorRgb,
pub cursor: GhosttyColorRgb,
pub cursor_has_value: bool,
pub palette: [GhosttyColorRgb; 256usize],
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
["Size of GhosttyRenderStateColors"]
[::std::mem::size_of::<GhosttyRenderStateColors>() - 792usize];
["Alignment of GhosttyRenderStateColors"]
[::std::mem::align_of::<GhosttyRenderStateColors>() - 8usize];
["Offset of field: GhosttyRenderStateColors::size"]
[::std::mem::offset_of!(GhosttyRenderStateColors, size) - 0usize];
["Offset of field: GhosttyRenderStateColors::background"]
[::std::mem::offset_of!(GhosttyRenderStateColors, background) - 8usize];
["Offset of field: GhosttyRenderStateColors::foreground"]
[::std::mem::offset_of!(GhosttyRenderStateColors, foreground) - 11usize];
["Offset of field: GhosttyRenderStateColors::cursor"]
[::std::mem::offset_of!(GhosttyRenderStateColors, cursor) - 14usize];
["Offset of field: GhosttyRenderStateColors::cursor_has_value"]
[::std::mem::offset_of!(GhosttyRenderStateColors, cursor_has_value) - 17usize];
["Offset of field: GhosttyRenderStateColors::palette"]
[::std::mem::offset_of!(GhosttyRenderStateColors, palette) - 18usize];
};
impl Default for GhosttyRenderStateColors {
fn default() -> Self {
let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
unsafe {
::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
s.assume_init()
}
}
}
unsafe extern "C" {
pub fn ghostty_render_state_new(
allocator: *const GhosttyAllocator,
state: *mut GhosttyRenderState,
) -> GhosttyResult::Type;
}
unsafe extern "C" {
pub fn ghostty_render_state_free(state: GhosttyRenderState);
}
unsafe extern "C" {
pub fn ghostty_render_state_update(
state: GhosttyRenderState,
terminal: GhosttyTerminal,
) -> GhosttyResult::Type;
}
unsafe extern "C" {
pub fn ghostty_render_state_begin_update(
state: GhosttyRenderState,
terminal: GhosttyTerminal,
) -> GhosttyResult::Type;
}
unsafe extern "C" {
pub fn ghostty_render_state_end_update(state: GhosttyRenderState) -> GhosttyResult::Type;
}
unsafe extern "C" {
pub fn ghostty_render_state_clean(state: GhosttyRenderState) -> GhosttyResult::Type;
}
unsafe extern "C" {
pub fn ghostty_render_state_get(
state: GhosttyRenderState,
data: GhosttyRenderStateData::Type,
out: *mut ::std::os::raw::c_void,
) -> GhosttyResult::Type;
}
unsafe extern "C" {
pub fn ghostty_render_state_get_multi(
state: GhosttyRenderState,
count: usize,
keys: *const GhosttyRenderStateData::Type,
values: *mut *mut ::std::os::raw::c_void,
out_written: *mut usize,
) -> GhosttyResult::Type;
}
unsafe extern "C" {
pub fn ghostty_render_state_set(
state: GhosttyRenderState,
option: GhosttyRenderStateOption::Type,
value: *const ::std::os::raw::c_void,
) -> GhosttyResult::Type;
}
unsafe extern "C" {
pub fn ghostty_render_state_row_iterator_new(
allocator: *const GhosttyAllocator,
out_iterator: *mut GhosttyRenderStateRowIterator,
) -> GhosttyResult::Type;
}
unsafe extern "C" {
pub fn ghostty_render_state_row_iterator_free(iterator: GhosttyRenderStateRowIterator);
}
unsafe extern "C" {
pub fn ghostty_render_state_row_iterator_next(iterator: GhosttyRenderStateRowIterator) -> bool;
}
unsafe extern "C" {
pub fn ghostty_render_state_row_iterator_next_dirty(
iterator: GhosttyRenderStateRowIterator,
out_y: *mut u16,
) -> bool;
}
unsafe extern "C" {
pub fn ghostty_render_state_row_get(
iterator: GhosttyRenderStateRowIterator,
data: GhosttyRenderStateRowData::Type,
out: *mut ::std::os::raw::c_void,
) -> GhosttyResult::Type;
}
unsafe extern "C" {
pub fn ghostty_render_state_row_get_multi(
iterator: GhosttyRenderStateRowIterator,
count: usize,
keys: *const GhosttyRenderStateRowData::Type,
values: *mut *mut ::std::os::raw::c_void,
out_written: *mut usize,
) -> GhosttyResult::Type;
}
unsafe extern "C" {
pub fn ghostty_render_state_row_set(
iterator: GhosttyRenderStateRowIterator,
option: GhosttyRenderStateRowOption::Type,
value: *const ::std::os::raw::c_void,
) -> GhosttyResult::Type;
}
pub mod GhosttyRenderStateRowCellsData {
#[allow(unused_imports)]
use super::*;
pub type Type = ::std::os::raw::c_uint;
pub const GHOSTTY_RENDER_STATE_ROW_CELLS_DATA_INVALID: Type = 0;
pub const GHOSTTY_RENDER_STATE_ROW_CELLS_DATA_RAW: Type = 1;
pub const GHOSTTY_RENDER_STATE_ROW_CELLS_DATA_STYLE: Type = 2;
pub const GHOSTTY_RENDER_STATE_ROW_CELLS_DATA_GRAPHEMES_LEN: Type = 3;
pub const GHOSTTY_RENDER_STATE_ROW_CELLS_DATA_GRAPHEMES_BUF: Type = 4;
pub const GHOSTTY_RENDER_STATE_ROW_CELLS_DATA_BG_COLOR: Type = 5;
pub const GHOSTTY_RENDER_STATE_ROW_CELLS_DATA_FG_COLOR: Type = 6;
pub const GHOSTTY_RENDER_STATE_ROW_CELLS_DATA_SELECTED: Type = 7;
pub const GHOSTTY_RENDER_STATE_ROW_CELLS_DATA_HAS_STYLING: Type = 8;
pub const GHOSTTY_RENDER_STATE_ROW_CELLS_DATA_GRAPHEMES_UTF8: Type = 9;
pub const GHOSTTY_RENDER_STATE_ROW_CELLS_DATA_MAX_VALUE: Type = 2147483647;
}
unsafe extern "C" {
pub fn ghostty_render_state_row_cells_new(
allocator: *const GhosttyAllocator,
out_cells: *mut GhosttyRenderStateRowCells,
) -> GhosttyResult::Type;
}
unsafe extern "C" {
pub fn ghostty_render_state_row_cells_next(cells: GhosttyRenderStateRowCells) -> bool;
}
unsafe extern "C" {
pub fn ghostty_render_state_row_cells_select(
cells: GhosttyRenderStateRowCells,
x: u16,
) -> GhosttyResult::Type;
}
unsafe extern "C" {
pub fn ghostty_render_state_row_cells_get(
cells: GhosttyRenderStateRowCells,
data: GhosttyRenderStateRowCellsData::Type,
out: *mut ::std::os::raw::c_void,
) -> GhosttyResult::Type;
}
unsafe extern "C" {
pub fn ghostty_render_state_row_cells_get_multi(
cells: GhosttyRenderStateRowCells,
count: usize,
keys: *const GhosttyRenderStateRowCellsData::Type,
values: *mut *mut ::std::os::raw::c_void,
out_written: *mut usize,
) -> GhosttyResult::Type;
}
unsafe extern "C" {
pub fn ghostty_render_state_row_cells_free(cells: GhosttyRenderStateRowCells);
}
unsafe extern "C" {
pub fn ghostty_render_state_image_iterator_new(
allocator: *const GhosttyAllocator,
out_iterator: *mut GhosttyRenderStateImageIterator,
) -> GhosttyResult::Type;
}
unsafe extern "C" {
pub fn ghostty_render_state_image_iterator_free(iterator: GhosttyRenderStateImageIterator);
}
unsafe extern "C" {
pub fn ghostty_render_state_image_iterator_next(
iterator: GhosttyRenderStateImageIterator,
) -> bool;
}
unsafe extern "C" {
pub fn ghostty_render_state_image_get(
iterator: GhosttyRenderStateImageIterator,
data: GhosttyRenderStateImageData::Type,
out: *mut ::std::os::raw::c_void,
) -> GhosttyResult::Type;
}
unsafe extern "C" {
pub fn ghostty_render_state_image_get_multi(
iterator: GhosttyRenderStateImageIterator,
count: usize,
keys: *const GhosttyRenderStateImageData::Type,
values: *mut *mut ::std::os::raw::c_void,
out_written: *mut usize,
) -> GhosttyResult::Type;
}
unsafe extern "C" {
pub fn ghostty_tracked_grid_ref_free(ref_: GhosttyTrackedGridRef);
}
unsafe extern "C" {
pub fn ghostty_tracked_grid_ref_has_value(ref_: GhosttyTrackedGridRef) -> bool;
}
unsafe extern "C" {
pub fn ghostty_tracked_grid_ref_point(
ref_: GhosttyTrackedGridRef,
tag: GhosttyPointTag::Type,
out_point: *mut GhosttyPointCoordinate,
) -> GhosttyResult::Type;
}
unsafe extern "C" {
pub fn ghostty_tracked_grid_ref_set(
ref_: GhosttyTrackedGridRef,
terminal: GhosttyTerminal,
point: GhosttyPoint,
) -> GhosttyResult::Type;
}
unsafe extern "C" {
pub fn ghostty_tracked_grid_ref_snapshot(
ref_: GhosttyTrackedGridRef,
out_ref: *mut GhosttyGridRef,
) -> GhosttyResult::Type;
}
pub mod GhosttySgrAttributeTag {
#[allow(unused_imports)]
use super::*;
pub type Type = ::std::os::raw::c_uint;
pub const GHOSTTY_SGR_ATTR_UNSET: Type = 0;
pub const GHOSTTY_SGR_ATTR_UNKNOWN: Type = 1;
pub const GHOSTTY_SGR_ATTR_BOLD: Type = 2;
pub const GHOSTTY_SGR_ATTR_RESET_BOLD: Type = 3;
pub const GHOSTTY_SGR_ATTR_ITALIC: Type = 4;
pub const GHOSTTY_SGR_ATTR_RESET_ITALIC: Type = 5;
pub const GHOSTTY_SGR_ATTR_FAINT: Type = 6;
pub const GHOSTTY_SGR_ATTR_UNDERLINE: Type = 7;
pub const GHOSTTY_SGR_ATTR_UNDERLINE_COLOR: Type = 8;
pub const GHOSTTY_SGR_ATTR_UNDERLINE_COLOR_256: Type = 9;
pub const GHOSTTY_SGR_ATTR_RESET_UNDERLINE_COLOR: Type = 10;
pub const GHOSTTY_SGR_ATTR_OVERLINE: Type = 11;
pub const GHOSTTY_SGR_ATTR_RESET_OVERLINE: Type = 12;
pub const GHOSTTY_SGR_ATTR_BLINK: Type = 13;
pub const GHOSTTY_SGR_ATTR_RESET_BLINK: Type = 14;
pub const GHOSTTY_SGR_ATTR_INVERSE: Type = 15;
pub const GHOSTTY_SGR_ATTR_RESET_INVERSE: Type = 16;
pub const GHOSTTY_SGR_ATTR_INVISIBLE: Type = 17;
pub const GHOSTTY_SGR_ATTR_RESET_INVISIBLE: Type = 18;
pub const GHOSTTY_SGR_ATTR_STRIKETHROUGH: Type = 19;
pub const GHOSTTY_SGR_ATTR_RESET_STRIKETHROUGH: Type = 20;
pub const GHOSTTY_SGR_ATTR_DIRECT_COLOR_FG: Type = 21;
pub const GHOSTTY_SGR_ATTR_DIRECT_COLOR_BG: Type = 22;
pub const GHOSTTY_SGR_ATTR_BG_8: Type = 23;
pub const GHOSTTY_SGR_ATTR_FG_8: Type = 24;
pub const GHOSTTY_SGR_ATTR_RESET_FG: Type = 25;
pub const GHOSTTY_SGR_ATTR_RESET_BG: Type = 26;
pub const GHOSTTY_SGR_ATTR_BRIGHT_BG_8: Type = 27;
pub const GHOSTTY_SGR_ATTR_BRIGHT_FG_8: Type = 28;
pub const GHOSTTY_SGR_ATTR_BG_256: Type = 29;
pub const GHOSTTY_SGR_ATTR_FG_256: Type = 30;
pub const GHOSTTY_SGR_ATTR_MAX_VALUE: Type = 2147483647;
}
pub mod GhosttySgrUnderline {
#[allow(unused_imports)]
use super::*;
pub type Type = ::std::os::raw::c_uint;
pub const GHOSTTY_SGR_UNDERLINE_NONE: Type = 0;
pub const GHOSTTY_SGR_UNDERLINE_SINGLE: Type = 1;
pub const GHOSTTY_SGR_UNDERLINE_DOUBLE: Type = 2;
pub const GHOSTTY_SGR_UNDERLINE_CURLY: Type = 3;
pub const GHOSTTY_SGR_UNDERLINE_DOTTED: Type = 4;
pub const GHOSTTY_SGR_UNDERLINE_DASHED: Type = 5;
pub const GHOSTTY_SGR_UNDERLINE_MAX_VALUE: Type = 2147483647;
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct GhosttySgrUnknown {
pub full_ptr: *const u16,
pub full_len: usize,
pub partial_ptr: *const u16,
pub partial_len: usize,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
["Size of GhosttySgrUnknown"][::std::mem::size_of::<GhosttySgrUnknown>() - 32usize];
["Alignment of GhosttySgrUnknown"][::std::mem::align_of::<GhosttySgrUnknown>() - 8usize];
["Offset of field: GhosttySgrUnknown::full_ptr"]
[::std::mem::offset_of!(GhosttySgrUnknown, full_ptr) - 0usize];
["Offset of field: GhosttySgrUnknown::full_len"]
[::std::mem::offset_of!(GhosttySgrUnknown, full_len) - 8usize];
["Offset of field: GhosttySgrUnknown::partial_ptr"]
[::std::mem::offset_of!(GhosttySgrUnknown, partial_ptr) - 16usize];
["Offset of field: GhosttySgrUnknown::partial_len"]
[::std::mem::offset_of!(GhosttySgrUnknown, partial_len) - 24usize];
};
impl Default for GhosttySgrUnknown {
fn default() -> Self {
let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
unsafe {
::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
s.assume_init()
}
}
}
#[repr(C)]
#[derive(Copy, Clone)]
pub union GhosttySgrAttributeValue {
pub unknown: GhosttySgrUnknown,
pub underline: GhosttySgrUnderline::Type,
pub underline_color: GhosttyColorRgb,
pub underline_color_256: GhosttyColorPaletteIndex,
pub direct_color_fg: GhosttyColorRgb,
pub direct_color_bg: GhosttyColorRgb,
pub bg_8: GhosttyColorPaletteIndex,
pub fg_8: GhosttyColorPaletteIndex,
pub bright_bg_8: GhosttyColorPaletteIndex,
pub bright_fg_8: GhosttyColorPaletteIndex,
pub bg_256: GhosttyColorPaletteIndex,
pub fg_256: GhosttyColorPaletteIndex,
pub _padding: [u64; 8usize],
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
["Size of GhosttySgrAttributeValue"]
[::std::mem::size_of::<GhosttySgrAttributeValue>() - 64usize];
["Alignment of GhosttySgrAttributeValue"]
[::std::mem::align_of::<GhosttySgrAttributeValue>() - 8usize];
["Offset of field: GhosttySgrAttributeValue::unknown"]
[::std::mem::offset_of!(GhosttySgrAttributeValue, unknown) - 0usize];
["Offset of field: GhosttySgrAttributeValue::underline"]
[::std::mem::offset_of!(GhosttySgrAttributeValue, underline) - 0usize];
["Offset of field: GhosttySgrAttributeValue::underline_color"]
[::std::mem::offset_of!(GhosttySgrAttributeValue, underline_color) - 0usize];
["Offset of field: GhosttySgrAttributeValue::underline_color_256"]
[::std::mem::offset_of!(GhosttySgrAttributeValue, underline_color_256) - 0usize];
["Offset of field: GhosttySgrAttributeValue::direct_color_fg"]
[::std::mem::offset_of!(GhosttySgrAttributeValue, direct_color_fg) - 0usize];
["Offset of field: GhosttySgrAttributeValue::direct_color_bg"]
[::std::mem::offset_of!(GhosttySgrAttributeValue, direct_color_bg) - 0usize];
["Offset of field: GhosttySgrAttributeValue::bg_8"]
[::std::mem::offset_of!(GhosttySgrAttributeValue, bg_8) - 0usize];
["Offset of field: GhosttySgrAttributeValue::fg_8"]
[::std::mem::offset_of!(GhosttySgrAttributeValue, fg_8) - 0usize];
["Offset of field: GhosttySgrAttributeValue::bright_bg_8"]
[::std::mem::offset_of!(GhosttySgrAttributeValue, bright_bg_8) - 0usize];
["Offset of field: GhosttySgrAttributeValue::bright_fg_8"]
[::std::mem::offset_of!(GhosttySgrAttributeValue, bright_fg_8) - 0usize];
["Offset of field: GhosttySgrAttributeValue::bg_256"]
[::std::mem::offset_of!(GhosttySgrAttributeValue, bg_256) - 0usize];
["Offset of field: GhosttySgrAttributeValue::fg_256"]
[::std::mem::offset_of!(GhosttySgrAttributeValue, fg_256) - 0usize];
["Offset of field: GhosttySgrAttributeValue::_padding"]
[::std::mem::offset_of!(GhosttySgrAttributeValue, _padding) - 0usize];
};
impl Default for GhosttySgrAttributeValue {
fn default() -> Self {
let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
unsafe {
::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
s.assume_init()
}
}
}
#[repr(C)]
#[derive(Copy, Clone)]
pub struct GhosttySgrAttribute {
pub tag: GhosttySgrAttributeTag::Type,
pub value: GhosttySgrAttributeValue,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
["Size of GhosttySgrAttribute"][::std::mem::size_of::<GhosttySgrAttribute>() - 72usize];
["Alignment of GhosttySgrAttribute"][::std::mem::align_of::<GhosttySgrAttribute>() - 8usize];
["Offset of field: GhosttySgrAttribute::tag"]
[::std::mem::offset_of!(GhosttySgrAttribute, tag) - 0usize];
["Offset of field: GhosttySgrAttribute::value"]
[::std::mem::offset_of!(GhosttySgrAttribute, value) - 8usize];
};
impl Default for GhosttySgrAttribute {
fn default() -> Self {
let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
unsafe {
::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
s.assume_init()
}
}
}
unsafe extern "C" {
pub fn ghostty_sgr_new(
allocator: *const GhosttyAllocator,
parser: *mut GhosttySgrParser,
) -> GhosttyResult::Type;
}
unsafe extern "C" {
pub fn ghostty_sgr_free(parser: GhosttySgrParser);
}
unsafe extern "C" {
pub fn ghostty_sgr_reset(parser: GhosttySgrParser);
}
unsafe extern "C" {
pub fn ghostty_sgr_set_params(
parser: GhosttySgrParser,
params: *const u16,
separators: *const ::std::os::raw::c_char,
len: usize,
) -> GhosttyResult::Type;
}
unsafe extern "C" {
pub fn ghostty_sgr_next(parser: GhosttySgrParser, attr: *mut GhosttySgrAttribute) -> bool;
}
unsafe extern "C" {
pub fn ghostty_sgr_unknown_full(unknown: GhosttySgrUnknown, ptr: *mut *const u16) -> usize;
}
unsafe extern "C" {
pub fn ghostty_sgr_unknown_partial(unknown: GhosttySgrUnknown, ptr: *mut *const u16) -> usize;
}
unsafe extern "C" {
pub fn ghostty_sgr_attribute_tag(
attr: *const GhosttySgrAttribute,
) -> GhosttySgrAttributeTag::Type;
}
unsafe extern "C" {
pub fn ghostty_sgr_attribute_value(
attr: *mut GhosttySgrAttribute,
) -> *mut GhosttySgrAttributeValue;
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct GhosttySysImage {
pub width: u32,
pub height: u32,
pub data: *mut u8,
pub data_len: usize,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
["Size of GhosttySysImage"][::std::mem::size_of::<GhosttySysImage>() - 24usize];
["Alignment of GhosttySysImage"][::std::mem::align_of::<GhosttySysImage>() - 8usize];
["Offset of field: GhosttySysImage::width"]
[::std::mem::offset_of!(GhosttySysImage, width) - 0usize];
["Offset of field: GhosttySysImage::height"]
[::std::mem::offset_of!(GhosttySysImage, height) - 4usize];
["Offset of field: GhosttySysImage::data"]
[::std::mem::offset_of!(GhosttySysImage, data) - 8usize];
["Offset of field: GhosttySysImage::data_len"]
[::std::mem::offset_of!(GhosttySysImage, data_len) - 16usize];
};
impl Default for GhosttySysImage {
fn default() -> Self {
let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
unsafe {
::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
s.assume_init()
}
}
}
pub mod GhosttySysLogLevel {
#[allow(unused_imports)]
use super::*;
pub type Type = ::std::os::raw::c_uint;
pub const GHOSTTY_SYS_LOG_LEVEL_ERROR: Type = 0;
pub const GHOSTTY_SYS_LOG_LEVEL_WARNING: Type = 1;
pub const GHOSTTY_SYS_LOG_LEVEL_INFO: Type = 2;
pub const GHOSTTY_SYS_LOG_LEVEL_DEBUG: Type = 3;
pub const GHOSTTY_SYS_LOG_LEVEL_MAX_VALUE: Type = 2147483647;
}
pub type GhosttySysLogFn = ::std::option::Option<
unsafe extern "C" fn(
userdata: *mut ::std::os::raw::c_void,
level: GhosttySysLogLevel::Type,
scope: *const u8,
scope_len: usize,
message: *const u8,
message_len: usize,
),
>;
pub type GhosttySysDecodePngFn = ::std::option::Option<
unsafe extern "C" fn(
userdata: *mut ::std::os::raw::c_void,
allocator: *const GhosttyAllocator,
data: *const u8,
data_len: usize,
out: *mut GhosttySysImage,
) -> bool,
>;
pub type GhosttySysRandomSecureFn = ::std::option::Option<
unsafe extern "C" fn(userdata: *mut ::std::os::raw::c_void, buf: *mut u8, len: usize) -> bool,
>;
pub mod GhosttySysOption {
#[allow(unused_imports)]
use super::*;
pub type Type = ::std::os::raw::c_uint;
pub const GHOSTTY_SYS_OPT_INVALID: Type = 0;
pub const GHOSTTY_SYS_OPT_USERDATA: Type = 1;
pub const GHOSTTY_SYS_OPT_DECODE_PNG: Type = 2;
pub const GHOSTTY_SYS_OPT_LOG: Type = 3;
pub const GHOSTTY_SYS_OPT_RANDOM_SECURE: Type = 4;
pub const GHOSTTY_SYS_OPT_MAX_VALUE: Type = 2147483647;
}
unsafe extern "C" {
pub fn ghostty_sys_set(
option: GhosttySysOption::Type,
value: *const ::std::os::raw::c_void,
) -> GhosttyResult::Type;
}
unsafe extern "C" {
pub fn ghostty_sys_log_stderr(
userdata: *mut ::std::os::raw::c_void,
level: GhosttySysLogLevel::Type,
scope: *const u8,
scope_len: usize,
message: *const u8,
message_len: usize,
);
}
#[repr(C)]
#[derive(Debug)]
pub struct GhosttyKeyEventImpl {
_unused: [u8; 0],
}
pub type GhosttyKeyEvent = *mut GhosttyKeyEventImpl;
pub mod GhosttyKeyAction {
#[allow(unused_imports)]
use super::*;
pub type Type = ::std::os::raw::c_uint;
pub const GHOSTTY_KEY_ACTION_RELEASE: Type = 0;
pub const GHOSTTY_KEY_ACTION_PRESS: Type = 1;
pub const GHOSTTY_KEY_ACTION_REPEAT: Type = 2;
pub const GHOSTTY_KEY_ACTION_MAX_VALUE: Type = 2147483647;
}
pub type GhosttyMods = u16;
pub mod GhosttyKey {
#[allow(unused_imports)]
use super::*;
pub type Type = ::std::os::raw::c_uint;
pub const GHOSTTY_KEY_UNIDENTIFIED: Type = 0;
pub const GHOSTTY_KEY_BACKQUOTE: Type = 1;
pub const GHOSTTY_KEY_BACKSLASH: Type = 2;
pub const GHOSTTY_KEY_BRACKET_LEFT: Type = 3;
pub const GHOSTTY_KEY_BRACKET_RIGHT: Type = 4;
pub const GHOSTTY_KEY_COMMA: Type = 5;
pub const GHOSTTY_KEY_DIGIT_0: Type = 6;
pub const GHOSTTY_KEY_DIGIT_1: Type = 7;
pub const GHOSTTY_KEY_DIGIT_2: Type = 8;
pub const GHOSTTY_KEY_DIGIT_3: Type = 9;
pub const GHOSTTY_KEY_DIGIT_4: Type = 10;
pub const GHOSTTY_KEY_DIGIT_5: Type = 11;
pub const GHOSTTY_KEY_DIGIT_6: Type = 12;
pub const GHOSTTY_KEY_DIGIT_7: Type = 13;
pub const GHOSTTY_KEY_DIGIT_8: Type = 14;
pub const GHOSTTY_KEY_DIGIT_9: Type = 15;
pub const GHOSTTY_KEY_EQUAL: Type = 16;
pub const GHOSTTY_KEY_INTL_BACKSLASH: Type = 17;
pub const GHOSTTY_KEY_INTL_RO: Type = 18;
pub const GHOSTTY_KEY_INTL_YEN: Type = 19;
pub const GHOSTTY_KEY_A: Type = 20;
pub const GHOSTTY_KEY_B: Type = 21;
pub const GHOSTTY_KEY_C: Type = 22;
pub const GHOSTTY_KEY_D: Type = 23;
pub const GHOSTTY_KEY_E: Type = 24;
pub const GHOSTTY_KEY_F: Type = 25;
pub const GHOSTTY_KEY_G: Type = 26;
pub const GHOSTTY_KEY_H: Type = 27;
pub const GHOSTTY_KEY_I: Type = 28;
pub const GHOSTTY_KEY_J: Type = 29;
pub const GHOSTTY_KEY_K: Type = 30;
pub const GHOSTTY_KEY_L: Type = 31;
pub const GHOSTTY_KEY_M: Type = 32;
pub const GHOSTTY_KEY_N: Type = 33;
pub const GHOSTTY_KEY_O: Type = 34;
pub const GHOSTTY_KEY_P: Type = 35;
pub const GHOSTTY_KEY_Q: Type = 36;
pub const GHOSTTY_KEY_R: Type = 37;
pub const GHOSTTY_KEY_S: Type = 38;
pub const GHOSTTY_KEY_T: Type = 39;
pub const GHOSTTY_KEY_U: Type = 40;
pub const GHOSTTY_KEY_V: Type = 41;
pub const GHOSTTY_KEY_W: Type = 42;
pub const GHOSTTY_KEY_X: Type = 43;
pub const GHOSTTY_KEY_Y: Type = 44;
pub const GHOSTTY_KEY_Z: Type = 45;
pub const GHOSTTY_KEY_MINUS: Type = 46;
pub const GHOSTTY_KEY_PERIOD: Type = 47;
pub const GHOSTTY_KEY_QUOTE: Type = 48;
pub const GHOSTTY_KEY_SEMICOLON: Type = 49;
pub const GHOSTTY_KEY_SLASH: Type = 50;
pub const GHOSTTY_KEY_ALT_LEFT: Type = 51;
pub const GHOSTTY_KEY_ALT_RIGHT: Type = 52;
pub const GHOSTTY_KEY_BACKSPACE: Type = 53;
pub const GHOSTTY_KEY_CAPS_LOCK: Type = 54;
pub const GHOSTTY_KEY_CONTEXT_MENU: Type = 55;
pub const GHOSTTY_KEY_CONTROL_LEFT: Type = 56;
pub const GHOSTTY_KEY_CONTROL_RIGHT: Type = 57;
pub const GHOSTTY_KEY_ENTER: Type = 58;
pub const GHOSTTY_KEY_META_LEFT: Type = 59;
pub const GHOSTTY_KEY_META_RIGHT: Type = 60;
pub const GHOSTTY_KEY_SHIFT_LEFT: Type = 61;
pub const GHOSTTY_KEY_SHIFT_RIGHT: Type = 62;
pub const GHOSTTY_KEY_SPACE: Type = 63;
pub const GHOSTTY_KEY_TAB: Type = 64;
pub const GHOSTTY_KEY_CONVERT: Type = 65;
pub const GHOSTTY_KEY_KANA_MODE: Type = 66;
pub const GHOSTTY_KEY_NON_CONVERT: Type = 67;
pub const GHOSTTY_KEY_DELETE: Type = 68;
pub const GHOSTTY_KEY_END: Type = 69;
pub const GHOSTTY_KEY_HELP: Type = 70;
pub const GHOSTTY_KEY_HOME: Type = 71;
pub const GHOSTTY_KEY_INSERT: Type = 72;
pub const GHOSTTY_KEY_PAGE_DOWN: Type = 73;
pub const GHOSTTY_KEY_PAGE_UP: Type = 74;
pub const GHOSTTY_KEY_ARROW_DOWN: Type = 75;
pub const GHOSTTY_KEY_ARROW_LEFT: Type = 76;
pub const GHOSTTY_KEY_ARROW_RIGHT: Type = 77;
pub const GHOSTTY_KEY_ARROW_UP: Type = 78;
pub const GHOSTTY_KEY_NUM_LOCK: Type = 79;
pub const GHOSTTY_KEY_NUMPAD_0: Type = 80;
pub const GHOSTTY_KEY_NUMPAD_1: Type = 81;
pub const GHOSTTY_KEY_NUMPAD_2: Type = 82;
pub const GHOSTTY_KEY_NUMPAD_3: Type = 83;
pub const GHOSTTY_KEY_NUMPAD_4: Type = 84;
pub const GHOSTTY_KEY_NUMPAD_5: Type = 85;
pub const GHOSTTY_KEY_NUMPAD_6: Type = 86;
pub const GHOSTTY_KEY_NUMPAD_7: Type = 87;
pub const GHOSTTY_KEY_NUMPAD_8: Type = 88;
pub const GHOSTTY_KEY_NUMPAD_9: Type = 89;
pub const GHOSTTY_KEY_NUMPAD_ADD: Type = 90;
pub const GHOSTTY_KEY_NUMPAD_BACKSPACE: Type = 91;
pub const GHOSTTY_KEY_NUMPAD_CLEAR: Type = 92;
pub const GHOSTTY_KEY_NUMPAD_CLEAR_ENTRY: Type = 93;
pub const GHOSTTY_KEY_NUMPAD_COMMA: Type = 94;
pub const GHOSTTY_KEY_NUMPAD_DECIMAL: Type = 95;
pub const GHOSTTY_KEY_NUMPAD_DIVIDE: Type = 96;
pub const GHOSTTY_KEY_NUMPAD_ENTER: Type = 97;
pub const GHOSTTY_KEY_NUMPAD_EQUAL: Type = 98;
pub const GHOSTTY_KEY_NUMPAD_MEMORY_ADD: Type = 99;
pub const GHOSTTY_KEY_NUMPAD_MEMORY_CLEAR: Type = 100;
pub const GHOSTTY_KEY_NUMPAD_MEMORY_RECALL: Type = 101;
pub const GHOSTTY_KEY_NUMPAD_MEMORY_STORE: Type = 102;
pub const GHOSTTY_KEY_NUMPAD_MEMORY_SUBTRACT: Type = 103;
pub const GHOSTTY_KEY_NUMPAD_MULTIPLY: Type = 104;
pub const GHOSTTY_KEY_NUMPAD_PAREN_LEFT: Type = 105;
pub const GHOSTTY_KEY_NUMPAD_PAREN_RIGHT: Type = 106;
pub const GHOSTTY_KEY_NUMPAD_SUBTRACT: Type = 107;
pub const GHOSTTY_KEY_NUMPAD_SEPARATOR: Type = 108;
pub const GHOSTTY_KEY_NUMPAD_UP: Type = 109;
pub const GHOSTTY_KEY_NUMPAD_DOWN: Type = 110;
pub const GHOSTTY_KEY_NUMPAD_RIGHT: Type = 111;
pub const GHOSTTY_KEY_NUMPAD_LEFT: Type = 112;
pub const GHOSTTY_KEY_NUMPAD_BEGIN: Type = 113;
pub const GHOSTTY_KEY_NUMPAD_HOME: Type = 114;
pub const GHOSTTY_KEY_NUMPAD_END: Type = 115;
pub const GHOSTTY_KEY_NUMPAD_INSERT: Type = 116;
pub const GHOSTTY_KEY_NUMPAD_DELETE: Type = 117;
pub const GHOSTTY_KEY_NUMPAD_PAGE_UP: Type = 118;
pub const GHOSTTY_KEY_NUMPAD_PAGE_DOWN: Type = 119;
pub const GHOSTTY_KEY_ESCAPE: Type = 120;
pub const GHOSTTY_KEY_F1: Type = 121;
pub const GHOSTTY_KEY_F2: Type = 122;
pub const GHOSTTY_KEY_F3: Type = 123;
pub const GHOSTTY_KEY_F4: Type = 124;
pub const GHOSTTY_KEY_F5: Type = 125;
pub const GHOSTTY_KEY_F6: Type = 126;
pub const GHOSTTY_KEY_F7: Type = 127;
pub const GHOSTTY_KEY_F8: Type = 128;
pub const GHOSTTY_KEY_F9: Type = 129;
pub const GHOSTTY_KEY_F10: Type = 130;
pub const GHOSTTY_KEY_F11: Type = 131;
pub const GHOSTTY_KEY_F12: Type = 132;
pub const GHOSTTY_KEY_F13: Type = 133;
pub const GHOSTTY_KEY_F14: Type = 134;
pub const GHOSTTY_KEY_F15: Type = 135;
pub const GHOSTTY_KEY_F16: Type = 136;
pub const GHOSTTY_KEY_F17: Type = 137;
pub const GHOSTTY_KEY_F18: Type = 138;
pub const GHOSTTY_KEY_F19: Type = 139;
pub const GHOSTTY_KEY_F20: Type = 140;
pub const GHOSTTY_KEY_F21: Type = 141;
pub const GHOSTTY_KEY_F22: Type = 142;
pub const GHOSTTY_KEY_F23: Type = 143;
pub const GHOSTTY_KEY_F24: Type = 144;
pub const GHOSTTY_KEY_F25: Type = 145;
pub const GHOSTTY_KEY_FN: Type = 146;
pub const GHOSTTY_KEY_FN_LOCK: Type = 147;
pub const GHOSTTY_KEY_PRINT_SCREEN: Type = 148;
pub const GHOSTTY_KEY_SCROLL_LOCK: Type = 149;
pub const GHOSTTY_KEY_PAUSE: Type = 150;
pub const GHOSTTY_KEY_BROWSER_BACK: Type = 151;
pub const GHOSTTY_KEY_BROWSER_FAVORITES: Type = 152;
pub const GHOSTTY_KEY_BROWSER_FORWARD: Type = 153;
pub const GHOSTTY_KEY_BROWSER_HOME: Type = 154;
pub const GHOSTTY_KEY_BROWSER_REFRESH: Type = 155;
pub const GHOSTTY_KEY_BROWSER_SEARCH: Type = 156;
pub const GHOSTTY_KEY_BROWSER_STOP: Type = 157;
pub const GHOSTTY_KEY_EJECT: Type = 158;
pub const GHOSTTY_KEY_LAUNCH_APP_1: Type = 159;
pub const GHOSTTY_KEY_LAUNCH_APP_2: Type = 160;
pub const GHOSTTY_KEY_LAUNCH_MAIL: Type = 161;
pub const GHOSTTY_KEY_MEDIA_PLAY_PAUSE: Type = 162;
pub const GHOSTTY_KEY_MEDIA_SELECT: Type = 163;
pub const GHOSTTY_KEY_MEDIA_STOP: Type = 164;
pub const GHOSTTY_KEY_MEDIA_TRACK_NEXT: Type = 165;
pub const GHOSTTY_KEY_MEDIA_TRACK_PREVIOUS: Type = 166;
pub const GHOSTTY_KEY_POWER: Type = 167;
pub const GHOSTTY_KEY_SLEEP: Type = 168;
pub const GHOSTTY_KEY_AUDIO_VOLUME_DOWN: Type = 169;
pub const GHOSTTY_KEY_AUDIO_VOLUME_MUTE: Type = 170;
pub const GHOSTTY_KEY_AUDIO_VOLUME_UP: Type = 171;
pub const GHOSTTY_KEY_WAKE_UP: Type = 172;
pub const GHOSTTY_KEY_COPY: Type = 173;
pub const GHOSTTY_KEY_CUT: Type = 174;
pub const GHOSTTY_KEY_PASTE: Type = 175;
pub const GHOSTTY_KEY_MAX_VALUE: Type = 2147483647;
}
unsafe extern "C" {
pub fn ghostty_key_event_new(
allocator: *const GhosttyAllocator,
event: *mut GhosttyKeyEvent,
) -> GhosttyResult::Type;
}
unsafe extern "C" {
pub fn ghostty_key_event_free(event: GhosttyKeyEvent);
}
unsafe extern "C" {
pub fn ghostty_key_event_set_action(
event: GhosttyKeyEvent,
action: GhosttyKeyAction::Type,
) -> GhosttyResult::Type;
}
unsafe extern "C" {
pub fn ghostty_key_event_get_action(event: GhosttyKeyEvent) -> GhosttyKeyAction::Type;
}
unsafe extern "C" {
pub fn ghostty_key_event_set_key(
event: GhosttyKeyEvent,
key: GhosttyKey::Type,
) -> GhosttyResult::Type;
}
unsafe extern "C" {
pub fn ghostty_key_event_get_key(event: GhosttyKeyEvent) -> GhosttyKey::Type;
}
unsafe extern "C" {
pub fn ghostty_key_event_set_mods(
event: GhosttyKeyEvent,
mods: GhosttyMods,
) -> GhosttyResult::Type;
}
unsafe extern "C" {
pub fn ghostty_key_event_get_mods(event: GhosttyKeyEvent) -> GhosttyMods;
}
unsafe extern "C" {
pub fn ghostty_key_event_set_consumed_mods(
event: GhosttyKeyEvent,
consumed_mods: GhosttyMods,
) -> GhosttyResult::Type;
}
unsafe extern "C" {
pub fn ghostty_key_event_get_consumed_mods(event: GhosttyKeyEvent) -> GhosttyMods;
}
unsafe extern "C" {
pub fn ghostty_key_event_set_composing(
event: GhosttyKeyEvent,
composing: bool,
) -> GhosttyResult::Type;
}
unsafe extern "C" {
pub fn ghostty_key_event_get_composing(event: GhosttyKeyEvent) -> bool;
}
unsafe extern "C" {
pub fn ghostty_key_event_set_utf8(
event: GhosttyKeyEvent,
utf8: GhosttyString,
) -> GhosttyResult::Type;
}
unsafe extern "C" {
pub fn ghostty_key_event_get_utf8(event: GhosttyKeyEvent) -> GhosttyString;
}
unsafe extern "C" {
pub fn ghostty_key_event_set_unshifted_codepoint(
event: GhosttyKeyEvent,
codepoint: u32,
) -> GhosttyResult::Type;
}
unsafe extern "C" {
pub fn ghostty_key_event_get_unshifted_codepoint(event: GhosttyKeyEvent) -> u32;
}
#[repr(C)]
#[derive(Debug)]
pub struct GhosttyKeyEncoderImpl {
_unused: [u8; 0],
}
pub type GhosttyKeyEncoder = *mut GhosttyKeyEncoderImpl;
pub type GhosttyKittyKeyFlags = u8;
pub mod GhosttyOptionAsAlt {
#[allow(unused_imports)]
use super::*;
pub type Type = ::std::os::raw::c_uint;
pub const GHOSTTY_OPTION_AS_ALT_FALSE: Type = 0;
pub const GHOSTTY_OPTION_AS_ALT_TRUE: Type = 1;
pub const GHOSTTY_OPTION_AS_ALT_LEFT: Type = 2;
pub const GHOSTTY_OPTION_AS_ALT_RIGHT: Type = 3;
pub const GHOSTTY_OPTION_AS_ALT_MAX_VALUE: Type = 2147483647;
}
pub mod GhosttyKeyEncoderOption {
#[allow(unused_imports)]
use super::*;
pub type Type = ::std::os::raw::c_uint;
pub const GHOSTTY_KEY_ENCODER_OPT_INVALID: Type = 0;
pub const GHOSTTY_KEY_ENCODER_OPT_CURSOR_KEY_APPLICATION: Type = 1;
pub const GHOSTTY_KEY_ENCODER_OPT_KEYPAD_KEY_APPLICATION: Type = 2;
pub const GHOSTTY_KEY_ENCODER_OPT_IGNORE_KEYPAD_WITH_NUMLOCK: Type = 3;
pub const GHOSTTY_KEY_ENCODER_OPT_ALT_ESC_PREFIX: Type = 4;
pub const GHOSTTY_KEY_ENCODER_OPT_MODIFY_OTHER_KEYS_STATE_2: Type = 5;
pub const GHOSTTY_KEY_ENCODER_OPT_KITTY_FLAGS: Type = 6;
pub const GHOSTTY_KEY_ENCODER_OPT_MACOS_OPTION_AS_ALT: Type = 7;
pub const GHOSTTY_KEY_ENCODER_OPT_BACKARROW_KEY_MODE: Type = 8;
pub const GHOSTTY_KEY_ENCODER_OPT_MAX_VALUE: Type = 2147483647;
}
unsafe extern "C" {
pub fn ghostty_key_encoder_new(
allocator: *const GhosttyAllocator,
encoder: *mut GhosttyKeyEncoder,
) -> GhosttyResult::Type;
}
unsafe extern "C" {
pub fn ghostty_key_encoder_free(encoder: GhosttyKeyEncoder);
}
unsafe extern "C" {
pub fn ghostty_key_encoder_set(
encoder: GhosttyKeyEncoder,
option: GhosttyKeyEncoderOption::Type,
value: *const ::std::os::raw::c_void,
) -> GhosttyResult::Type;
}
unsafe extern "C" {
pub fn ghostty_key_encoder_set_from_terminal(
encoder: GhosttyKeyEncoder,
terminal: GhosttyTerminal,
) -> GhosttyResult::Type;
}
unsafe extern "C" {
pub fn ghostty_key_encoder_encode(
encoder: GhosttyKeyEncoder,
event: GhosttyKeyEvent,
buf: *mut u8,
buf_len: usize,
out_written: *mut usize,
) -> GhosttyResult::Type;
}
#[repr(C)]
#[derive(Debug)]
pub struct GhosttyMouseEventImpl {
_unused: [u8; 0],
}
pub type GhosttyMouseEvent = *mut GhosttyMouseEventImpl;
pub mod GhosttyMouseAction {
#[allow(unused_imports)]
use super::*;
pub type Type = ::std::os::raw::c_uint;
pub const GHOSTTY_MOUSE_ACTION_PRESS: Type = 0;
pub const GHOSTTY_MOUSE_ACTION_RELEASE: Type = 1;
pub const GHOSTTY_MOUSE_ACTION_MOTION: Type = 2;
pub const GHOSTTY_MOUSE_ACTION_MAX_VALUE: Type = 2147483647;
}
pub mod GhosttyMouseButton {
#[allow(unused_imports)]
use super::*;
pub type Type = ::std::os::raw::c_uint;
pub const GHOSTTY_MOUSE_BUTTON_UNKNOWN: Type = 0;
pub const GHOSTTY_MOUSE_BUTTON_LEFT: Type = 1;
pub const GHOSTTY_MOUSE_BUTTON_RIGHT: Type = 2;
pub const GHOSTTY_MOUSE_BUTTON_MIDDLE: Type = 3;
pub const GHOSTTY_MOUSE_BUTTON_FOUR: Type = 4;
pub const GHOSTTY_MOUSE_BUTTON_FIVE: Type = 5;
pub const GHOSTTY_MOUSE_BUTTON_SIX: Type = 6;
pub const GHOSTTY_MOUSE_BUTTON_SEVEN: Type = 7;
pub const GHOSTTY_MOUSE_BUTTON_EIGHT: Type = 8;
pub const GHOSTTY_MOUSE_BUTTON_NINE: Type = 9;
pub const GHOSTTY_MOUSE_BUTTON_TEN: Type = 10;
pub const GHOSTTY_MOUSE_BUTTON_ELEVEN: Type = 11;
pub const GHOSTTY_MOUSE_BUTTON_MAX_VALUE: Type = 2147483647;
}
#[repr(C)]
#[derive(Debug, Default, Copy, Clone)]
pub struct GhosttyMousePosition {
pub x: f32,
pub y: f32,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
["Size of GhosttyMousePosition"][::std::mem::size_of::<GhosttyMousePosition>() - 8usize];
["Alignment of GhosttyMousePosition"][::std::mem::align_of::<GhosttyMousePosition>() - 4usize];
["Offset of field: GhosttyMousePosition::x"]
[::std::mem::offset_of!(GhosttyMousePosition, x) - 0usize];
["Offset of field: GhosttyMousePosition::y"]
[::std::mem::offset_of!(GhosttyMousePosition, y) - 4usize];
};
unsafe extern "C" {
pub fn ghostty_mouse_event_new(
allocator: *const GhosttyAllocator,
event: *mut GhosttyMouseEvent,
) -> GhosttyResult::Type;
}
unsafe extern "C" {
pub fn ghostty_mouse_event_free(event: GhosttyMouseEvent);
}
unsafe extern "C" {
pub fn ghostty_mouse_event_set_action(
event: GhosttyMouseEvent,
action: GhosttyMouseAction::Type,
) -> GhosttyResult::Type;
}
unsafe extern "C" {
pub fn ghostty_mouse_event_get_action(event: GhosttyMouseEvent) -> GhosttyMouseAction::Type;
}
unsafe extern "C" {
pub fn ghostty_mouse_event_set_button(
event: GhosttyMouseEvent,
button: GhosttyMouseButton::Type,
) -> GhosttyResult::Type;
}
unsafe extern "C" {
pub fn ghostty_mouse_event_clear_button(event: GhosttyMouseEvent) -> GhosttyResult::Type;
}
unsafe extern "C" {
pub fn ghostty_mouse_event_get_button(
event: GhosttyMouseEvent,
out_button: *mut GhosttyMouseButton::Type,
) -> GhosttyResult::Type;
}
unsafe extern "C" {
pub fn ghostty_mouse_event_set_mods(
event: GhosttyMouseEvent,
mods: GhosttyMods,
) -> GhosttyResult::Type;
}
unsafe extern "C" {
pub fn ghostty_mouse_event_get_mods(event: GhosttyMouseEvent) -> GhosttyMods;
}
unsafe extern "C" {
pub fn ghostty_mouse_event_set_position(
event: GhosttyMouseEvent,
position: GhosttyMousePosition,
) -> GhosttyResult::Type;
}
unsafe extern "C" {
pub fn ghostty_mouse_event_get_position(event: GhosttyMouseEvent) -> GhosttyMousePosition;
}
#[repr(C)]
#[derive(Debug)]
pub struct GhosttyMouseEncoderImpl {
_unused: [u8; 0],
}
pub type GhosttyMouseEncoder = *mut GhosttyMouseEncoderImpl;
pub mod GhosttyMouseTrackingMode {
#[allow(unused_imports)]
use super::*;
pub type Type = ::std::os::raw::c_uint;
pub const GHOSTTY_MOUSE_TRACKING_NONE: Type = 0;
pub const GHOSTTY_MOUSE_TRACKING_X10: Type = 1;
pub const GHOSTTY_MOUSE_TRACKING_NORMAL: Type = 2;
pub const GHOSTTY_MOUSE_TRACKING_BUTTON: Type = 3;
pub const GHOSTTY_MOUSE_TRACKING_ANY: Type = 4;
pub const GHOSTTY_MOUSE_TRACKING_MAX_VALUE: Type = 2147483647;
}
pub mod GhosttyMouseFormat {
#[allow(unused_imports)]
use super::*;
pub type Type = ::std::os::raw::c_uint;
pub const GHOSTTY_MOUSE_FORMAT_X10: Type = 0;
pub const GHOSTTY_MOUSE_FORMAT_UTF8: Type = 1;
pub const GHOSTTY_MOUSE_FORMAT_SGR: Type = 2;
pub const GHOSTTY_MOUSE_FORMAT_URXVT: Type = 3;
pub const GHOSTTY_MOUSE_FORMAT_SGR_PIXELS: Type = 4;
pub const GHOSTTY_MOUSE_FORMAT_MAX_VALUE: Type = 2147483647;
}
#[repr(C)]
#[derive(Debug, Default, Copy, Clone)]
pub struct GhosttyMouseEncoderSize {
pub size: usize,
pub screen_width: u32,
pub screen_height: u32,
pub cell_width: u32,
pub cell_height: u32,
pub padding_top: u32,
pub padding_bottom: u32,
pub padding_right: u32,
pub padding_left: u32,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
["Size of GhosttyMouseEncoderSize"][::std::mem::size_of::<GhosttyMouseEncoderSize>() - 40usize];
["Alignment of GhosttyMouseEncoderSize"]
[::std::mem::align_of::<GhosttyMouseEncoderSize>() - 8usize];
["Offset of field: GhosttyMouseEncoderSize::size"]
[::std::mem::offset_of!(GhosttyMouseEncoderSize, size) - 0usize];
["Offset of field: GhosttyMouseEncoderSize::screen_width"]
[::std::mem::offset_of!(GhosttyMouseEncoderSize, screen_width) - 8usize];
["Offset of field: GhosttyMouseEncoderSize::screen_height"]
[::std::mem::offset_of!(GhosttyMouseEncoderSize, screen_height) - 12usize];
["Offset of field: GhosttyMouseEncoderSize::cell_width"]
[::std::mem::offset_of!(GhosttyMouseEncoderSize, cell_width) - 16usize];
["Offset of field: GhosttyMouseEncoderSize::cell_height"]
[::std::mem::offset_of!(GhosttyMouseEncoderSize, cell_height) - 20usize];
["Offset of field: GhosttyMouseEncoderSize::padding_top"]
[::std::mem::offset_of!(GhosttyMouseEncoderSize, padding_top) - 24usize];
["Offset of field: GhosttyMouseEncoderSize::padding_bottom"]
[::std::mem::offset_of!(GhosttyMouseEncoderSize, padding_bottom) - 28usize];
["Offset of field: GhosttyMouseEncoderSize::padding_right"]
[::std::mem::offset_of!(GhosttyMouseEncoderSize, padding_right) - 32usize];
["Offset of field: GhosttyMouseEncoderSize::padding_left"]
[::std::mem::offset_of!(GhosttyMouseEncoderSize, padding_left) - 36usize];
};
pub mod GhosttyMouseEncoderOption {
#[allow(unused_imports)]
use super::*;
pub type Type = ::std::os::raw::c_uint;
pub const GHOSTTY_MOUSE_ENCODER_OPT_INVALID: Type = 0;
pub const GHOSTTY_MOUSE_ENCODER_OPT_EVENT: Type = 1;
pub const GHOSTTY_MOUSE_ENCODER_OPT_FORMAT: Type = 2;
pub const GHOSTTY_MOUSE_ENCODER_OPT_SIZE: Type = 3;
pub const GHOSTTY_MOUSE_ENCODER_OPT_ANY_BUTTON_PRESSED: Type = 4;
pub const GHOSTTY_MOUSE_ENCODER_OPT_TRACK_LAST_CELL: Type = 5;
pub const GHOSTTY_MOUSE_ENCODER_OPT_MAX_VALUE: Type = 2147483647;
}
unsafe extern "C" {
pub fn ghostty_mouse_encoder_new(
allocator: *const GhosttyAllocator,
encoder: *mut GhosttyMouseEncoder,
) -> GhosttyResult::Type;
}
unsafe extern "C" {
pub fn ghostty_mouse_encoder_free(encoder: GhosttyMouseEncoder);
}
unsafe extern "C" {
pub fn ghostty_mouse_encoder_set(
encoder: GhosttyMouseEncoder,
option: GhosttyMouseEncoderOption::Type,
value: *const ::std::os::raw::c_void,
) -> GhosttyResult::Type;
}
unsafe extern "C" {
pub fn ghostty_mouse_encoder_set_from_terminal(
encoder: GhosttyMouseEncoder,
terminal: GhosttyTerminal,
) -> GhosttyResult::Type;
}
unsafe extern "C" {
pub fn ghostty_mouse_encoder_reset(encoder: GhosttyMouseEncoder) -> GhosttyResult::Type;
}
unsafe extern "C" {
pub fn ghostty_mouse_encoder_encode(
encoder: GhosttyMouseEncoder,
event: GhosttyMouseEvent,
buf: *mut u8,
buf_len: usize,
out_written: *mut usize,
) -> GhosttyResult::Type;
}
pub mod GhosttyMouseShape {
#[allow(unused_imports)]
use super::*;
pub type Type = ::std::os::raw::c_uint;
pub const GHOSTTY_MOUSE_SHAPE_DEFAULT: Type = 0;
pub const GHOSTTY_MOUSE_SHAPE_CONTEXT_MENU: Type = 1;
pub const GHOSTTY_MOUSE_SHAPE_HELP: Type = 2;
pub const GHOSTTY_MOUSE_SHAPE_POINTER: Type = 3;
pub const GHOSTTY_MOUSE_SHAPE_PROGRESS: Type = 4;
pub const GHOSTTY_MOUSE_SHAPE_WAIT: Type = 5;
pub const GHOSTTY_MOUSE_SHAPE_CELL: Type = 6;
pub const GHOSTTY_MOUSE_SHAPE_CROSSHAIR: Type = 7;
pub const GHOSTTY_MOUSE_SHAPE_TEXT: Type = 8;
pub const GHOSTTY_MOUSE_SHAPE_VERTICAL_TEXT: Type = 9;
pub const GHOSTTY_MOUSE_SHAPE_ALIAS: Type = 10;
pub const GHOSTTY_MOUSE_SHAPE_COPY: Type = 11;
pub const GHOSTTY_MOUSE_SHAPE_MOVE: Type = 12;
pub const GHOSTTY_MOUSE_SHAPE_NO_DROP: Type = 13;
pub const GHOSTTY_MOUSE_SHAPE_NOT_ALLOWED: Type = 14;
pub const GHOSTTY_MOUSE_SHAPE_GRAB: Type = 15;
pub const GHOSTTY_MOUSE_SHAPE_GRABBING: Type = 16;
pub const GHOSTTY_MOUSE_SHAPE_ALL_SCROLL: Type = 17;
pub const GHOSTTY_MOUSE_SHAPE_COL_RESIZE: Type = 18;
pub const GHOSTTY_MOUSE_SHAPE_ROW_RESIZE: Type = 19;
pub const GHOSTTY_MOUSE_SHAPE_N_RESIZE: Type = 20;
pub const GHOSTTY_MOUSE_SHAPE_E_RESIZE: Type = 21;
pub const GHOSTTY_MOUSE_SHAPE_S_RESIZE: Type = 22;
pub const GHOSTTY_MOUSE_SHAPE_W_RESIZE: Type = 23;
pub const GHOSTTY_MOUSE_SHAPE_NE_RESIZE: Type = 24;
pub const GHOSTTY_MOUSE_SHAPE_NW_RESIZE: Type = 25;
pub const GHOSTTY_MOUSE_SHAPE_SE_RESIZE: Type = 26;
pub const GHOSTTY_MOUSE_SHAPE_SW_RESIZE: Type = 27;
pub const GHOSTTY_MOUSE_SHAPE_EW_RESIZE: Type = 28;
pub const GHOSTTY_MOUSE_SHAPE_NS_RESIZE: Type = 29;
pub const GHOSTTY_MOUSE_SHAPE_NESW_RESIZE: Type = 30;
pub const GHOSTTY_MOUSE_SHAPE_NWSE_RESIZE: Type = 31;
pub const GHOSTTY_MOUSE_SHAPE_ZOOM_IN: Type = 32;
pub const GHOSTTY_MOUSE_SHAPE_ZOOM_OUT: Type = 33;
pub const GHOSTTY_MOUSE_SHAPE_MAX_VALUE: Type = 2147483647;
}
pub mod GhosttyPasteSource {
#[allow(unused_imports)]
use super::*;
pub type Type = ::std::os::raw::c_uint;
pub const GHOSTTY_PASTE_SOURCE_CLIPBOARD: Type = 0;
pub const GHOSTTY_PASTE_SOURCE_TEXT: Type = 1;
pub const GHOSTTY_PASTE_SOURCE_MAX_VALUE: Type = 2147483647;
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct GhosttyPaste {
pub size: usize,
pub location: GhosttyClipboardLocation::Type,
pub source: GhosttyPasteSource::Type,
pub mimes: *const GhosttyString,
pub mimes_len: usize,
pub reader: GhosttyMimeReader,
pub allow_unsafe: bool,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
["Size of GhosttyPaste"][::std::mem::size_of::<GhosttyPaste>() - 56usize];
["Alignment of GhosttyPaste"][::std::mem::align_of::<GhosttyPaste>() - 8usize];
["Offset of field: GhosttyPaste::size"][::std::mem::offset_of!(GhosttyPaste, size) - 0usize];
["Offset of field: GhosttyPaste::location"]
[::std::mem::offset_of!(GhosttyPaste, location) - 8usize];
["Offset of field: GhosttyPaste::source"]
[::std::mem::offset_of!(GhosttyPaste, source) - 12usize];
["Offset of field: GhosttyPaste::mimes"][::std::mem::offset_of!(GhosttyPaste, mimes) - 16usize];
["Offset of field: GhosttyPaste::mimes_len"]
[::std::mem::offset_of!(GhosttyPaste, mimes_len) - 24usize];
["Offset of field: GhosttyPaste::reader"]
[::std::mem::offset_of!(GhosttyPaste, reader) - 32usize];
["Offset of field: GhosttyPaste::allow_unsafe"]
[::std::mem::offset_of!(GhosttyPaste, allow_unsafe) - 48usize];
};
impl Default for GhosttyPaste {
fn default() -> Self {
let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
unsafe {
::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
s.assume_init()
}
}
}
unsafe extern "C" {
pub fn ghostty_terminal_paste(
terminal: GhosttyTerminal,
paste: *const GhosttyPaste,
out_pasted: *mut bool,
) -> GhosttyResult::Type;
}
unsafe extern "C" {
pub fn ghostty_paste_is_safe(data: *const ::std::os::raw::c_char, len: usize) -> bool;
}
unsafe extern "C" {
pub fn ghostty_paste_encode(
data: *mut ::std::os::raw::c_char,
data_len: usize,
bracketed: bool,
buf: *mut u8,
buf_len: usize,
out_written: *mut usize,
) -> GhosttyResult::Type;
}
pub mod GhosttySearchStatus {
#[allow(unused_imports)]
use super::*;
pub type Type = ::std::os::raw::c_uint;
pub const GHOSTTY_SEARCH_STATUS_RUNNING: Type = 0;
pub const GHOSTTY_SEARCH_STATUS_FEED_REQUIRED: Type = 1;
pub const GHOSTTY_SEARCH_STATUS_COMPLETE: Type = 2;
pub const GHOSTTY_SEARCH_STATUS_MAX_VALUE: Type = 2147483647;
}
pub mod GhosttySearchScroll {
#[allow(unused_imports)]
use super::*;
pub type Type = ::std::os::raw::c_uint;
pub const GHOSTTY_SEARCH_SCROLL_IF_NEEDED: Type = 0;
pub const GHOSTTY_SEARCH_SCROLL_NONE: Type = 1;
pub const GHOSTTY_SEARCH_SCROLL_MAX_VALUE: Type = 2147483647;
}
pub mod GhosttySearchData {
#[allow(unused_imports)]
use super::*;
pub type Type = ::std::os::raw::c_uint;
pub const GHOSTTY_SEARCH_DATA_INVALID: Type = 0;
pub const GHOSTTY_SEARCH_DATA_STATUS: Type = 1;
pub const GHOSTTY_SEARCH_DATA_NEEDLE: Type = 2;
pub const GHOSTTY_SEARCH_DATA_TOTAL_MATCHES: Type = 3;
pub const GHOSTTY_SEARCH_DATA_SELECTED_INDEX: Type = 4;
pub const GHOSTTY_SEARCH_DATA_SELECTED_MATCH: Type = 5;
pub const GHOSTTY_SEARCH_DATA_MATCHES: Type = 6;
pub const GHOSTTY_SEARCH_DATA_VIEWPORT_MATCHES: Type = 7;
pub const GHOSTTY_SEARCH_DATA_SELECT_SCROLL: Type = 8;
pub const GHOSTTY_SEARCH_DATA_MAX_VALUE: Type = 2147483647;
}
pub mod GhosttySearchOption {
#[allow(unused_imports)]
use super::*;
pub type Type = ::std::os::raw::c_uint;
pub const GHOSTTY_SEARCH_OPT_INVALID: Type = 0;
pub const GHOSTTY_SEARCH_OPT_NEEDLE: Type = 1;
pub const GHOSTTY_SEARCH_OPT_SELECT_SCROLL: Type = 4;
pub const GHOSTTY_SEARCH_OPT_MAX_VALUE: Type = 2147483647;
}
unsafe extern "C" {
pub fn ghostty_search_new(
allocator: *const GhosttyAllocator,
out_search: *mut GhosttySearch,
terminal: GhosttyTerminal,
) -> GhosttyResult::Type;
}
unsafe extern "C" {
pub fn ghostty_search_free(search: GhosttySearch);
}
unsafe extern "C" {
pub fn ghostty_search_tick(
search: GhosttySearch,
out_status: *mut GhosttySearchStatus::Type,
) -> GhosttyResult::Type;
}
unsafe extern "C" {
pub fn ghostty_search_feed(search: GhosttySearch) -> GhosttyResult::Type;
}
unsafe extern "C" {
pub fn ghostty_search_run(search: GhosttySearch) -> GhosttyResult::Type;
}
unsafe extern "C" {
pub fn ghostty_search_select_next(search: GhosttySearch) -> GhosttyResult::Type;
}
unsafe extern "C" {
pub fn ghostty_search_select_prev(search: GhosttySearch) -> GhosttyResult::Type;
}
unsafe extern "C" {
pub fn ghostty_search_set(
search: GhosttySearch,
option: GhosttySearchOption::Type,
value: *const ::std::os::raw::c_void,
) -> GhosttyResult::Type;
}
unsafe extern "C" {
pub fn ghostty_search_get(
search: GhosttySearch,
data: GhosttySearchData::Type,
value: *mut ::std::os::raw::c_void,
) -> GhosttyResult::Type;
}
unsafe extern "C" {
pub fn ghostty_search_get_multi(
search: GhosttySearch,
count: usize,
keys: *const GhosttySearchData::Type,
values: *mut *mut ::std::os::raw::c_void,
out_written: *mut usize,
) -> GhosttyResult::Type;
}
pub mod GhosttySnapshotDecoderOption {
#[allow(unused_imports)]
use super::*;
pub type Type = ::std::os::raw::c_uint;
pub const GHOSTTY_SNAPSHOT_DECODER_OPT_INVALID: Type = 0;
pub const GHOSTTY_SNAPSHOT_DECODER_OPT_MAX_CONTINUATION_BYTES: Type = 1;
pub const GHOSTTY_SNAPSHOT_DECODER_OPT_RETAIN_CONTINUATION: Type = 2;
pub const GHOSTTY_SNAPSHOT_DECODER_OPT_COMPRESS_HISTORY: Type = 3;
pub const GHOSTTY_SNAPSHOT_DECODER_OPT_KITTY_IMAGE_STORAGE_LIMIT: Type = 4;
pub const GHOSTTY_SNAPSHOT_DECODER_OPT_MAX_VALUE: Type = 2147483647;
}
pub mod GhosttySnapshotDecoderProgressKind {
#[allow(unused_imports)]
use super::*;
pub type Type = ::std::os::raw::c_uint;
pub const GHOSTTY_SNAPSHOT_DECODER_PROGRESS_KIND_PAGE: Type = 0;
pub const GHOSTTY_SNAPSHOT_DECODER_PROGRESS_KIND_IMAGE: Type = 1;
pub const GHOSTTY_SNAPSHOT_DECODER_PROGRESS_KIND_MAX_VALUE: Type = 2147483647;
}
pub mod GhosttySnapshotDecoderData {
#[allow(unused_imports)]
use super::*;
pub type Type = ::std::os::raw::c_uint;
pub const GHOSTTY_SNAPSHOT_DECODER_DATA_INVALID: Type = 0;
pub const GHOSTTY_SNAPSHOT_DECODER_DATA_MAX_CONTINUATION_BYTES: Type = 1;
pub const GHOSTTY_SNAPSHOT_DECODER_DATA_SOURCE_OFFSET: Type = 2;
pub const GHOSTTY_SNAPSHOT_DECODER_DATA_HISTORY_ROWS_PRIMARY: Type = 3;
pub const GHOSTTY_SNAPSHOT_DECODER_DATA_HISTORY_ROWS_ALTERNATE: Type = 4;
pub const GHOSTTY_SNAPSHOT_DECODER_DATA_PROGRESS_SCREEN: Type = 5;
pub const GHOSTTY_SNAPSHOT_DECODER_DATA_PROGRESS_ROWS: Type = 6;
pub const GHOSTTY_SNAPSHOT_DECODER_DATA_PROGRESS_REMAINING: Type = 7;
pub const GHOSTTY_SNAPSHOT_DECODER_DATA_RETAIN_CONTINUATION: Type = 8;
pub const GHOSTTY_SNAPSHOT_DECODER_DATA_COMPRESS_HISTORY: Type = 9;
pub const GHOSTTY_SNAPSHOT_DECODER_DATA_KITTY_IMAGE_STORAGE_LIMIT: Type = 10;
pub const GHOSTTY_SNAPSHOT_DECODER_DATA_PROGRESS_KIND: Type = 11;
pub const GHOSTTY_SNAPSHOT_DECODER_DATA_PROGRESS_IMAGE_ID: Type = 12;
pub const GHOSTTY_SNAPSHOT_DECODER_DATA_PROGRESS_IMAGE_FRAME: Type = 13;
pub const GHOSTTY_SNAPSHOT_DECODER_DATA_PROGRESS_IMAGE_BYTES: Type = 14;
pub const GHOSTTY_SNAPSHOT_DECODER_DATA_KITTY_IMAGES_PRIMARY: Type = 15;
pub const GHOSTTY_SNAPSHOT_DECODER_DATA_KITTY_IMAGES_ALTERNATE: Type = 16;
pub const GHOSTTY_SNAPSHOT_DECODER_DATA_KITTY_PENDING_BYTES_PRIMARY: Type = 17;
pub const GHOSTTY_SNAPSHOT_DECODER_DATA_KITTY_PENDING_BYTES_ALTERNATE: Type = 18;
pub const GHOSTTY_SNAPSHOT_DECODER_DATA_MAX_VALUE: Type = 2147483647;
}
unsafe extern "C" {
pub fn ghostty_snapshot_encode(
terminal: GhosttyTerminal,
writer: GhosttyWriter,
) -> GhosttyResult::Type;
}
unsafe extern "C" {
pub fn ghostty_snapshot_encode_buf(
terminal: GhosttyTerminal,
buf: *mut u8,
buf_len: usize,
out_written: *mut usize,
) -> GhosttyResult::Type;
}
unsafe extern "C" {
pub fn ghostty_snapshot_encode_alloc(
terminal: GhosttyTerminal,
allocator: *const GhosttyAllocator,
out_ptr: *mut *mut u8,
out_len: *mut usize,
) -> GhosttyResult::Type;
}
unsafe extern "C" {
pub fn ghostty_snapshot_decoder_new(
allocator: *const GhosttyAllocator,
decoder: *mut GhosttySnapshotDecoder,
reader: GhosttyReader,
) -> GhosttyResult::Type;
}
unsafe extern "C" {
pub fn ghostty_snapshot_decoder_new_buf(
allocator: *const GhosttyAllocator,
decoder: *mut GhosttySnapshotDecoder,
ptr: *const u8,
len: usize,
) -> GhosttyResult::Type;
}
unsafe extern "C" {
pub fn ghostty_snapshot_decoder_free(decoder: GhosttySnapshotDecoder);
}
unsafe extern "C" {
pub fn ghostty_snapshot_decoder_set(
decoder: GhosttySnapshotDecoder,
option: GhosttySnapshotDecoderOption::Type,
value: *const ::std::os::raw::c_void,
) -> GhosttyResult::Type;
}
unsafe extern "C" {
pub fn ghostty_snapshot_decoder_ready(
decoder: GhosttySnapshotDecoder,
terminal: *mut GhosttyTerminal,
) -> GhosttyResult::Type;
}
unsafe extern "C" {
pub fn ghostty_snapshot_decoder_next(decoder: GhosttySnapshotDecoder) -> GhosttyResult::Type;
}
unsafe extern "C" {
pub fn ghostty_snapshot_decoder_decode(
decoder: GhosttySnapshotDecoder,
terminal: *mut GhosttyTerminal,
) -> GhosttyResult::Type;
}
unsafe extern "C" {
pub fn ghostty_snapshot_decoder_get(
decoder: GhosttySnapshotDecoder,
data: GhosttySnapshotDecoderData::Type,
out: *mut ::std::os::raw::c_void,
) -> GhosttyResult::Type;
}
unsafe extern "C" {
pub fn ghostty_snapshot_decoder_get_multi(
decoder: GhosttySnapshotDecoder,
count: usize,
keys: *const GhosttySnapshotDecoderData::Type,
values: *mut *mut ::std::os::raw::c_void,
out_written: *mut usize,
) -> GhosttyResult::Type;
}
unsafe extern "C" {
pub fn ghostty_unicode_codepoint_width(cp: u32) -> u8;
}
unsafe extern "C" {
pub fn ghostty_unicode_grapheme_width(cps: *const u32, len: usize, width: *mut u8) -> usize;
}