aboutsummaryrefslogtreecommitdiff
path: root/vendor/libghostty-vt/src/terminal/point.zig
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/libghostty-vt/src/terminal/point.zig')
-rw-r--r--vendor/libghostty-vt/src/terminal/point.zig10
1 files changed, 10 insertions, 0 deletions
diff --git a/vendor/libghostty-vt/src/terminal/point.zig b/vendor/libghostty-vt/src/terminal/point.zig
index 4297bf5b..f6bf25c3 100644
--- a/vendor/libghostty-vt/src/terminal/point.zig
+++ b/vendor/libghostty-vt/src/terminal/point.zig
@@ -76,6 +76,16 @@ pub const Point = union(Tag) {
pub const C = c_union.C;
pub const CValue = c_union.CValue;
pub const cval = c_union.cval;
+
+ /// Convert a C ABI point into the native Zig tagged union.
+ pub fn fromC(pt: C) Point {
+ return switch (pt.tag) {
+ .active => .{ .active = pt.value.active },
+ .viewport => .{ .viewport = pt.value.viewport },
+ .screen => .{ .screen = pt.value.screen },
+ .history => .{ .history = pt.value.history },
+ };
+ }
};
pub const Coordinate = extern struct {