mirror of
https://github.com/ghostty-org/ghostty.git
synced 2025-07-24 12:46:10 +03:00

In practice, the primary and selection clipboards are treated exactly the same, but this allows OSC 52 sequences to use either 's' or 'p' as the clipboard target.
54 lines
1.2 KiB
Zig
54 lines
1.2 KiB
Zig
/// ContentScale is the ratio between the current DPI and the platform's
|
|
/// default DPI. This is used to determine how much certain rendered elements
|
|
/// need to be scaled up or down.
|
|
pub const ContentScale = struct {
|
|
x: f32,
|
|
y: f32,
|
|
};
|
|
|
|
/// The size of the surface in pixels.
|
|
pub const SurfaceSize = struct {
|
|
width: u32,
|
|
height: u32,
|
|
};
|
|
|
|
/// The position of the cursor in pixels.
|
|
pub const CursorPos = struct {
|
|
x: f32,
|
|
y: f32,
|
|
};
|
|
|
|
/// Input Method Editor (IME) position.
|
|
pub const IMEPos = struct {
|
|
x: f64,
|
|
y: f64,
|
|
};
|
|
|
|
/// The clipboard type.
|
|
///
|
|
/// If this is changed, you must also update ghostty.h
|
|
pub const Clipboard = enum(u2) {
|
|
standard = 0, // ctrl+c/v
|
|
selection = 1,
|
|
primary = 2,
|
|
};
|
|
|
|
pub const ClipboardRequestType = enum(u8) {
|
|
paste,
|
|
osc_52_read,
|
|
osc_52_write,
|
|
};
|
|
|
|
/// Clipboard request. This is used to request clipboard contents and must
|
|
/// be sent as a response to a ClipboardRequest event.
|
|
pub const ClipboardRequest = union(ClipboardRequestType) {
|
|
/// A direct paste of clipboard contents.
|
|
paste: void,
|
|
|
|
/// A request to read clipboard contents via OSC 52.
|
|
osc_52_read: Clipboard,
|
|
|
|
/// A request to write clipboard contents via OSC 52.
|
|
osc_52_write: Clipboard,
|
|
};
|