aboutsummaryrefslogtreecommitdiff
path: root/vendor/libghostty-vt/src/terminal/c/selection.zig
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/libghostty-vt/src/terminal/c/selection.zig')
-rw-r--r--vendor/libghostty-vt/src/terminal/c/selection.zig16
1 files changed, 16 insertions, 0 deletions
diff --git a/vendor/libghostty-vt/src/terminal/c/selection.zig b/vendor/libghostty-vt/src/terminal/c/selection.zig
new file mode 100644
index 00000000..74e96598
--- /dev/null
+++ b/vendor/libghostty-vt/src/terminal/c/selection.zig
@@ -0,0 +1,16 @@
+const grid_ref = @import("grid_ref.zig");
+const Selection = @import("../Selection.zig");
+
+/// C: GhosttySelection
+pub const CSelection = extern struct {
+ size: usize = @sizeOf(CSelection),
+ start: grid_ref.CGridRef,
+ end: grid_ref.CGridRef,
+ rectangle: bool = false,
+
+ pub fn toZig(self: CSelection) ?Selection {
+ const start_pin = self.start.toPin() orelse return null;
+ const end_pin = self.end.toPin() orelse return null;
+ return Selection.init(start_pin, end_pin, self.rectangle);
+ }
+};