aboutsummaryrefslogtreecommitdiff
path: root/src/xdg/surface.zig
diff options
context:
space:
mode:
authorNathan Reiner <nathan@nathanreiner.xyz>2025-08-30 15:49:18 +0200
committerNathan Reiner <nathan@nathanreiner.xyz>2025-08-30 15:49:18 +0200
commita46436e58beaaa322c082af5e886f96fd31d7a08 (patch)
tree05a05b149c2f18cb0562aef94fe41bd5aaad9fbc /src/xdg/surface.zig
parent4feb8c7dab2b0a3492b8248ee12c3f0a475106f1 (diff)
Use mix-in design for interface abstraction.HEADmaster
Diffstat (limited to 'src/xdg/surface.zig')
-rw-r--r--src/xdg/surface.zig25
1 files changed, 25 insertions, 0 deletions
diff --git a/src/xdg/surface.zig b/src/xdg/surface.zig
new file mode 100644
index 0000000..fc9d838
--- /dev/null
+++ b/src/xdg/surface.zig
@@ -0,0 +1,25 @@
+const wayland = @import("../root.zig");
+const wl = wayland.wl;
+
+const Self = @This();
+
+pub const Request = union(enum) {
+ destroy: void,
+ get_toplevel: struct { wayland.Object.Ref },
+ get_popup: struct { wayland.Object.Ref, ?wayland.Object.Ref, wayland.Object.Ref },
+ set_window_geometry: struct { i32, i32, i32, i32 },
+ ack_configure: struct { u32 },
+};
+
+pub const Events = wayland.EventSet(Self, .{ configure });
+
+handle: wayland.Object.Ref,
+init: wayland.Object.interface.Init(Self) = .{},
+
+fn configure(
+ self: *Self,
+ ctx: wayland.Context,
+ payload: u32
+) !void {
+ try ctx.display.request(self, .{ .ack_configure = .{ payload } });
+}