aboutsummaryrefslogtreecommitdiff
path: root/src/pointer.zig
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/pointer.zig5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/pointer.zig b/src/pointer.zig
index 0c516be..ce188f8 100644
--- a/src/pointer.zig
+++ b/src/pointer.zig
@@ -11,6 +11,8 @@ const pointerReturn = struct {
code: ?i64 = null,
};
+const PointerInfo = struct { x: i64, y: i64, dx: i64, dy: i64 };
+
pub const Pointer = struct {
allocator: std.mem.Allocator,
field: *field.Field,
@@ -350,6 +352,9 @@ pub const Pointer = struct {
self.step();
return result;
}
+ pub inline fn getInfo(self: *Pointer) PointerInfo {
+ return .{ .x = self.x, .y = self.y, .dx = self.dx, .dy = self.dy };
+ }
pub fn init(allocator: std.mem.Allocator, f: *field.Field, timestamp: ?i64, argv: []const []const u8, env: []const [*:0]const u8) !*Pointer {
var p = try allocator.create(Pointer);
errdefer allocator.destroy(p);