diff options
Diffstat (limited to 'src/box.zig')
| -rw-r--r-- | src/box.zig | 23 |
1 files changed, 17 insertions, 6 deletions
diff --git a/src/box.zig b/src/box.zig index 5d33f98..2d28a1c 100644 --- a/src/box.zig +++ b/src/box.zig @@ -1,6 +1,17 @@ -pub const Box = struct { - x: i32, - y: i32, - width: u32, - height: u32, -}; +const Self = @This(); + +const c = @import("c.zig"); + +x: i32, +y: i32, +width: u32, +height: u32, + +pub fn toWlrBox(self: Self) c.wlr_box { + return c.wlr_box{ + .x = @intCast(c_int, self.x), + .y = @intCast(c_int, self.y), + .width = @intCast(c_int, self.width), + .height = @intCast(c_int, self.height), + }; +} |
