diff --git a/README.md b/README.md index 6e5bd54..3164916 100644 --- a/README.md +++ b/README.md @@ -22,7 +22,7 @@ request on [codeberg](https://codeberg.org/ifreund/zig-wlroots). ## Dependencies - [zig](https://ziglang.org/) 0.14 -- [wlroots](https://gitlab.freedesktop.org/wlroots/wlroots) 0.18 +- [wlroots](https://gitlab.freedesktop.org/wlroots/wlroots) 0.19 - [zig-wayland](https://codeberg.org/ifreund/zig-wayland) - [zig-xkbcommon](https://codeberg.org/ifreund/zig-xkbcommon) - [zig-pixman](https://codeberg.org/ifreund/zig-pixman) diff --git a/build.zig b/build.zig index e323ed3..2402b01 100644 --- a/build.zig +++ b/build.zig @@ -77,7 +77,7 @@ pub fn build(b: *std.Build) void { wlr_test.root_module.addImport("pixman", pixman); wlr_test.linkSystemLibrary("pixman-1"); - wlr_test.linkSystemLibrary("wlroots-0.18"); + wlr_test.linkSystemLibrary("wlroots-0.19"); const test_step = b.step("test", "Run the tests"); test_step.dependOn(&wlr_test.step); diff --git a/build.zig.zon b/build.zig.zon index 18f1f6e..6189868 100644 --- a/build.zig.zon +++ b/build.zig.zon @@ -1,6 +1,6 @@ .{ .name = .wlroots, - .version = "0.18.3-dev", + .version = "0.19.0-dev", .minimum_zig_version = "0.14.0", .paths = .{ "build.zig", diff --git a/src/backend.zig b/src/backend.zig index 89f8e83..9c5f385 100644 --- a/src/backend.zig +++ b/src/backend.zig @@ -12,6 +12,13 @@ pub const Backend = extern struct { }; impl: *const Impl, + + buffer_caps: u32, + + features: extern struct { + timeline: bool, + }, + events: extern struct { destroy: wl.Signal(*Backend), new_input: wl.Signal(*wlr.InputDevice), diff --git a/src/backend/session.zig b/src/backend/session.zig index dac94d5..54615b6 100644 --- a/src/backend/session.zig +++ b/src/backend/session.zig @@ -44,7 +44,6 @@ pub const Session = extern struct { active: bool, - vtnr: c_uint, seat: [256]u8, // TODO: do we need libudev bindings? @@ -58,7 +57,6 @@ pub const Session = extern struct { devices: wl.list.Head(Device, .link), event_loop: *wl.EventLoop, - event_loop_destroy: wl.Listener(*wl.EventLoop), events: extern struct { active: wl.Signal(void), diff --git a/src/render/drm_format_set.zig b/src/render/drm_format_set.zig index 54cfcc4..07e837d 100644 --- a/src/render/drm_format_set.zig +++ b/src/render/drm_format_set.zig @@ -19,6 +19,9 @@ pub const DrmFormatSet = extern struct { extern fn wlr_drm_format_set_get(set: *const DrmFormatSet, format: u32) *const DrmFormat; pub const get = wlr_drm_format_set_get; + extern fn wlr_drm_format_set_remove(set: *const DrmFormatSet, format: u32, modifier: u64) bool; + pub const remove = wlr_drm_format_set_remove; + extern fn wlr_drm_format_set_has(set: *const DrmFormatSet, format: u32, modifier: u64) bool; pub const has = wlr_drm_format_set_has; diff --git a/src/render/renderer.zig b/src/render/renderer.zig index 73cf89a..ffc225b 100644 --- a/src/render/renderer.zig +++ b/src/render/renderer.zig @@ -6,8 +6,6 @@ const wl = wayland.server.wl; const pixman = @import("pixman"); pub const Renderer = extern struct { - const Impl = opaque {}; - /// Bitmask of wlr.BufferCap render_buffer_caps: u32, @@ -18,12 +16,9 @@ pub const Renderer = extern struct { features: extern struct { output_color_transform: bool, + timeline: bool, }, - // private state - - impl: *const Impl, - extern fn wlr_renderer_autocreate(backend: *wlr.Backend) ?*Renderer; pub fn autocreate(backend: *wlr.Backend) !*Renderer { return wlr_renderer_autocreate(backend) orelse error.RendererCreateFailed; @@ -55,6 +50,8 @@ pub const Renderer = extern struct { pub const BufferPassOptions = extern struct { timer: ?*RenderTimer = null, color_transform: ?*wlr.ColorTransform = null, + signal_timeline: ?*wlr.DrmSyncobjTimeline = null, + signal_point: u64 = 0, }; extern fn wlr_renderer_begin_buffer_pass(renderer: *Renderer, buffer: *wlr.Buffer, options: ?*const BufferPassOptions) ?*RenderPass; pub fn beginBufferPass(renderer: *Renderer, buffer: *wlr.Buffer, options: ?*const BufferPassOptions) !*RenderPass { @@ -117,6 +114,8 @@ pub const RenderPass = opaque { transform: wl.Output.Transform, filter_mode: ScaleFilterMode, blend_mode: BlendMode, + wait_timeline: ?*wlr.DrmSyncobjTimeline = null, + wait_point: u64, }; pub const RectOptions = extern struct { diff --git a/src/types/buffer.zig b/src/types/buffer.zig index 73d4750..f91c35d 100644 --- a/src/types/buffer.zig +++ b/src/types/buffer.zig @@ -80,6 +80,9 @@ pub const Buffer = extern struct { extern fn wlr_buffer_try_from_resource(resource: *wl.Buffer) ?*Buffer; pub const tryFromWlBuffer = wlr_buffer_try_from_resource; + extern fn wlr_buffer_is_opaque(buffer: *Buffer) bool; + pub const isOpaque = wlr_buffer_is_opaque; + extern fn wlr_buffer_begin_data_ptr_access(buffer: *Buffer, flags: u32, data: **anyopaque, format: *u32, stride: *usize) bool; pub const beginDataPtrAccess = wlr_buffer_begin_data_ptr_access; @@ -93,13 +96,6 @@ pub const ClientBuffer = extern struct { texture: ?*wlr.Texture, source: ?*wlr.Buffer, - // private state - - source_destroy: wl.Listener(void), - renderer_destroy: wl.Listener(void), - - n_ignore_locks: usize, - extern fn wlr_client_buffer_get(buffer: *wlr.Buffer) ?*ClientBuffer; pub const get = wlr_client_buffer_get; }; diff --git a/src/types/compositor.zig b/src/types/compositor.zig index 7fd24a6..e2a54e4 100644 --- a/src/types/compositor.zig +++ b/src/types/compositor.zig @@ -11,9 +11,6 @@ pub const Compositor = extern struct { global: *wl.Global, renderer: ?*wlr.Renderer, - server_destroy: wl.Listener(*wl.Server), - renderer_destroy: wl.Listener(void), - events: extern struct { new_surface: wl.Signal(*wlr.Surface), destroy: wl.Signal(*wlr.Compositor), @@ -88,6 +85,7 @@ pub const Surface = extern struct { no_object: bool = false, client_commit: ?*const fn (surface: *Surface) callconv(.C) void = null, commit: ?*const fn (surface: *Surface) callconv(.C) void = null, + map: ?*const fn (surface: *Surface) callconv(.C) void = null, unmap: ?*const fn (surface: *Surface) callconv(.C) void = null, destroy: ?*const fn (surface: *Surface) callconv(.C) void = null, }; @@ -98,8 +96,6 @@ pub const Surface = extern struct { // Surface.current_outputs link: wl.list.Link, - bind: wl.Listener(*wlr.Output.event.Bind), - destroy: wl.Listener(*wlr.Output), }; pub const Synced = extern struct { @@ -108,6 +104,7 @@ pub const Surface = extern struct { init_state: ?*const fn (state: *anyopaque) callconv(.C) void, finish_state: ?*const fn (state: *anyopaque) callconv(.C) void, move_state: ?*const fn (dst: *anyopaque, src: *anyopaque) callconv(.C) void, + commit: ?*const fn (synced: *Synced) callconv(.C) void = null, }; surface: *Surface, @@ -173,36 +170,7 @@ pub const Surface = extern struct { current_outputs: wl.list.Head(Surface.Output, .link), addons: wlr.AddonSet, - data: usize, - - // private state - - role_resource_destroy: wl.Listener(*wl.Resource), - - previous: extern struct { - scale: i32, - transform: wl.Output.Transform, - width: c_int, - height: c_int, - buffer_width: c_int, - buffer_height: c_int, - }, - - unmap_commit: bool, - @"opaque": bool, - - handling_commit: bool, - pending_rejected: bool, - - preferred_buffer_scale: i32, - preferred_buffer_transform_sent: bool, - preferred_buffer_transform: wl.Output.Transform, - - synced: wl.list.Head(Synced, .link), - synced_len: usize, - - pending_buffer_resource: *wl.Resource, - pending_buffer_resource_destroy: wl.Listener(void), + data: ?*anyopaque, extern fn wlr_surface_set_role( surface: *Surface, @@ -245,8 +213,8 @@ pub const Surface = extern struct { extern fn wlr_surface_send_frame_done(surface: *Surface, when: *const posix.timespec) void; pub const sendFrameDone = wlr_surface_send_frame_done; - extern fn wlr_surface_get_extends(surface: *Surface, box: *wlr.Box) void; - pub const getExtends = wlr_surface_get_extends; + extern fn wlr_surface_get_extents(surface: *Surface, box: *wlr.Box) void; + pub const getExtents = wlr_surface_get_extents; extern fn wlr_surface_from_resource(resource: *wl.Surface) *Surface; pub const fromWlSurface = wlr_surface_from_resource; @@ -279,15 +247,11 @@ pub const Surface = extern struct { extern fn wlr_surface_get_buffer_source_box(surface: *Surface, box: *wlr.FBox) void; pub const getBufferSourceBox = wlr_surface_get_buffer_source_box; - extern fn wlr_surface_accepts_touch(seat: *wlr.Seat, surface: *Surface) bool; - pub fn acceptsTouch(surface: *Surface, seat: *wlr.Seat) bool { - return wlr_surface_accepts_touch(seat, surface); - } + extern fn wlr_surface_accepts_touch(surface: *Surface, seat: *wlr.Seat) bool; + pub const acceptsTouch = wlr_surface_accepts_touch; - extern fn wlr_surface_accepts_tablet_v2(tablet: *wlr.TabletV2Tablet, surface: *Surface) bool; - pub fn acceptsTabletV2(surface: *Surface, tablet: *wlr.TabletV2Tablet) bool { - return wlr_surface_accepts_tablet_v2(tablet, surface); - } + extern fn wlr_surface_accepts_tablet_v2(surface: *Surface, tablet: *wlr.TabletV2Tablet) bool; + pub const acceptsTabletV2 = wlr_surface_accepts_tablet_v2; extern fn wlr_surface_lock_pending(surface: *Surface) u32; pub const lockPending = wlr_surface_lock_pending; diff --git a/src/types/cursor.zig b/src/types/cursor.zig index 57877ee..981c274 100644 --- a/src/types/cursor.zig +++ b/src/types/cursor.zig @@ -37,7 +37,7 @@ pub const Cursor = extern struct { tablet_tool_button: wl.Signal(*wlr.Tablet.event.Button), }, - data: usize, + data: ?*anyopaque, extern fn wlr_cursor_create() ?*Cursor; pub fn create() !*Cursor { diff --git a/src/types/cursor_shape_v1.zig b/src/types/cursor_shape_v1.zig index d75f7ba..e7cd21c 100644 --- a/src/types/cursor_shape_v1.zig +++ b/src/types/cursor_shape_v1.zig @@ -12,9 +12,7 @@ pub const CursorShapeManagerV1 = extern struct { destroy: wl.Signal(void), }, - data: usize, - - server_destroy: wl.Listener(*wl.Server), + data: ?*anyopaque, pub const DeviceType = enum(c_int) { pointer, diff --git a/src/types/damage_ring.zig b/src/types/damage_ring.zig index 6eb7b54..e5dda7c 100644 --- a/src/types/damage_ring.zig +++ b/src/types/damage_ring.zig @@ -6,42 +6,23 @@ const wl = wayland.server.wl; const pixman = @import("pixman"); pub const DamageRing = extern struct { - width: i32, - height: i32, - current: pixman.Region32, - // private state - - previous: [2]pixman.Region32, - previous_idx: usize, - - buffers: wl.list.Link, - extern fn wlr_damage_ring_init(ring: *DamageRing) void; pub const init = wlr_damage_ring_init; extern fn wlr_damage_ring_finish(ring: *DamageRing) void; pub const finish = wlr_damage_ring_finish; - extern fn wlr_damage_ring_set_bounds(ring: *DamageRing, width: i32, height: i32) void; - pub const setBounds = wlr_damage_ring_set_bounds; - - extern fn wlr_damage_ring_add(ring: *DamageRing, damage: *const pixman.Region32) bool; + extern fn wlr_damage_ring_add(ring: *DamageRing, damage: *const pixman.Region32) void; pub const add = wlr_damage_ring_add; - extern fn wlr_damage_ring_add_box(ring: *DamageRing, box: ?*const wlr.Box) bool; + extern fn wlr_damage_ring_add_box(ring: *DamageRing, box: ?*const wlr.Box) void; pub const addBox = wlr_damage_ring_add_box; extern fn wlr_damage_ring_add_whole(ring: *DamageRing) void; pub const addWhole = wlr_damage_ring_add_whole; - extern fn wlr_damage_ring_rotate(ring: *DamageRing) void; - pub const rotate = wlr_damage_ring_rotate; - - extern fn wlr_damage_ring_get_buffer_damage(ring: *DamageRing, buffer_age: c_int, damage: *pixman.Region32) void; - pub const getBufferDamage = wlr_damage_ring_get_buffer_damage; - extern fn wlr_damage_ring_rotate_buffer(ring: *DamageRing, buffer: *wlr.Buffer, damage: *pixman.Region32) void; pub const rotateBuffer = wlr_damage_ring_rotate_buffer; }; diff --git a/src/types/data_control_v1.zig b/src/types/data_control_v1.zig index 3e6e651..218f013 100644 --- a/src/types/data_control_v1.zig +++ b/src/types/data_control_v1.zig @@ -12,8 +12,6 @@ pub const DataControlManagerV1 = extern struct { new_device: wl.Signal(*DataControlDeviceV1), }, - server_destroy: wl.Listener(*wl.Server), - extern fn wlr_data_control_manager_v1_create(server: *wl.Server) ?*DataControlManagerV1; pub fn create(server: *wl.Server) !*DataControlManagerV1 { return wlr_data_control_manager_v1_create(server) orelse error.OutOfMemory; @@ -30,10 +28,6 @@ pub const DataControlDeviceV1 = extern struct { selection_offer_resource: ?*wl.Resource, primary_selection_offer_resource: ?*wl.Resource, - seat_destroy: wl.Listener(*wlr.Seat), - seat_set_selection: wl.Listener(*wlr.Seat), - seat_set_primary_selection: wl.Listener(*wlr.Seat), - extern fn wlr_data_control_device_v1_destroy(device: *DataControlDeviceV1) void; pub const destroy = wlr_data_control_device_v1_destroy; }; diff --git a/src/types/data_device.zig b/src/types/data_device.zig index cc1e81d..0e49dd5 100644 --- a/src/types/data_device.zig +++ b/src/types/data_device.zig @@ -7,13 +7,11 @@ pub const DataDeviceManager = extern struct { global: *wl.Global, data_sources: wl.list.Head(wl.DataSource, null), - server_destroy: wl.Listener(*wl.Server), - events: extern struct { destroy: wl.Signal(*DataDeviceManager), }, - data: usize, + data: ?*anyopaque, extern fn wlr_data_device_manager_create(server: *wl.Server) ?*DataDeviceManager; pub fn create(server: *wl.Server) !*DataDeviceManager { @@ -36,8 +34,6 @@ pub const DataOffer = extern struct { actions: u32, preferred_action: wl.DataDeviceManager.DndAction.Enum, in_ask: bool, - - source_destroy: wl.Listener(*DataSource), }; pub const DataSource = extern struct { @@ -95,9 +91,7 @@ pub const Drag = extern struct { destroy: wl.Signal(*Drag.Icon), }, - surface_destroy: wl.Listener(*wlr.Surface), - - data: usize, + data: ?*anyopaque, }; pub const GrabType = enum(c_int) { @@ -146,11 +140,7 @@ pub const Drag = extern struct { destroy: wl.Signal(*Drag), }, - source_destroy: wl.Listener(*DataSource), - seat_client_destroy: wl.Listener(*wlr.Seat.Client), - icon_destroy: wl.Listener(*Drag.Icon), - - data: usize, + data: ?*anyopaque, extern fn wlr_drag_create( seat_client: *wlr.Seat.Client, diff --git a/src/types/drm.zig b/src/types/drm.zig index e899de5..38a521d 100644 --- a/src/types/drm.zig +++ b/src/types/drm.zig @@ -10,13 +10,6 @@ pub const Drm = extern struct { destroy: wl.Signal(void), }, - // private state - - node_name: [*:0]u8, - formats: wlr.DrmFormatSet, - - server_destroy: wl.Listener(*wl.Server), - extern fn wlr_drm_create(server: *wl.Server, renderer: *wlr.Renderer) ?*Drm; pub fn create(server: *wl.Server, renderer: *wlr.Renderer) !*Drm { return wlr_drm_create(server, renderer) orelse error.WlrDrmCreateFailed; diff --git a/src/types/drm_lease_v1.zig b/src/types/drm_lease_v1.zig index 0829627..09bf043 100644 --- a/src/types/drm_lease_v1.zig +++ b/src/types/drm_lease_v1.zig @@ -6,8 +6,9 @@ const wl = wayland.server.wl; pub const DrmLeaseManagerV1 = extern struct { devices: wl.list.Head(DrmLeaseDeviceV1, .link), server: *wl.Server, - server_destroy: wl.Listener(*wl.Server), + events: extern struct { + destroy: wl.Signal(void), request: wl.Signal(*DrmLeaseRequestV1), }, @@ -34,8 +35,6 @@ pub const DrmLeaseDeviceV1 = extern struct { /// DrmLeaseManagerV1.devices link: wl.list.Link, - backend_destroy: wl.Listener(*wlr.Backend), - data: ?*anyopaque, }; @@ -47,7 +46,6 @@ pub const DrmLeaseConnectorV1 = extern struct { active_lease: ?*DrmLeaseV1, - destroy: wl.Listener(void), /// DrmLeaseDeviceV1.connectors link: wl.list.Link, }; @@ -84,8 +82,6 @@ pub const DrmLeaseV1 = extern struct { /// DrmLeaseDeviceV1.leases link: wl.list.Link, - destroy: wl.Listener(void), - data: ?*anyopaque, extern fn wlr_drm_lease_v1_revoke(lease: *DrmLeaseV1) void; diff --git a/src/types/export_dmabuf_v1.zig b/src/types/export_dmabuf_v1.zig index 3dbc062..05ae7ce 100644 --- a/src/types/export_dmabuf_v1.zig +++ b/src/types/export_dmabuf_v1.zig @@ -7,8 +7,6 @@ pub const ExportDmabufManagerV1 = extern struct { global: *wl.Global, frames: wl.list.Head(ExportDmabufFrameV1, .link), - server_destroy: wl.Listener(*wl.Server), - events: extern struct { destroy: wl.Signal(*ExportDmabufManagerV1), }, @@ -28,7 +26,4 @@ pub const ExportDmabufFrameV1 = extern struct { output: ?*wlr.Output, cursor_locked: bool, - - output_commit: wl.Listener(*wlr.Output.event.Commit), - output_destroy: wl.Listener(*wlr.Output), }; diff --git a/src/types/foreign_toplevel_management_v1.zig b/src/types/foreign_toplevel_management_v1.zig index 76f8e05..096d3a1 100644 --- a/src/types/foreign_toplevel_management_v1.zig +++ b/src/types/foreign_toplevel_management_v1.zig @@ -9,13 +9,11 @@ pub const ForeignToplevelManagerV1 = extern struct { resources: wl.list.Head(wl.Resource, null), toplevels: wl.list.Head(ForeignToplevelHandleV1, .link), - server_destroy: wl.Listener(*wl.Server), - events: extern struct { destroy: wl.Signal(*ForeignToplevelManagerV1), }, - data: usize, + data: ?*anyopaque, extern fn wlr_foreign_toplevel_manager_v1_create(wl_server: *wl.Server) ?*ForeignToplevelManagerV1; pub fn create(wl_server: *wl.Server) !*ForeignToplevelManagerV1 { @@ -36,11 +34,6 @@ pub const ForeignToplevelHandleV1 = extern struct { link: wl.list.Link, output: *wlr.Output, toplevel: *ForeignToplevelHandleV1, - - // private state - - output_bind: wl.Listener(*wlr.Output.event.Bind), - output_destroy: wl.Listener(*wlr.Output), }; pub const event = struct { @@ -96,7 +89,7 @@ pub const ForeignToplevelHandleV1 = extern struct { destroy: wl.Signal(*ForeignToplevelHandleV1), }, - data: usize, + data: ?*anyopaque, extern fn wlr_foreign_toplevel_handle_v1_create(manager: *ForeignToplevelManagerV1) ?*ForeignToplevelHandleV1; pub fn create(manager: *ForeignToplevelManagerV1) !*ForeignToplevelHandleV1 { diff --git a/src/types/fractional_scale_v1.zig b/src/types/fractional_scale_v1.zig index baa6742..2449371 100644 --- a/src/types/fractional_scale_v1.zig +++ b/src/types/fractional_scale_v1.zig @@ -10,8 +10,6 @@ pub const FractionalScaleManagerV1 = extern struct { destroy: wl.Signal(void), }, - server_destroy: wl.Listener(*wl.Server), - extern fn wlr_fractional_scale_manager_v1_create(server: *wl.Server, version: u32) ?*FractionalScaleManagerV1; pub fn create(server: *wl.Server, version: u32) !*FractionalScaleManagerV1 { return wlr_fractional_scale_manager_v1_create(server, version) orelse error.OutOfMemory; diff --git a/src/types/gamma_control_v1.zig b/src/types/gamma_control_v1.zig index f245935..6cef0b0 100644 --- a/src/types/gamma_control_v1.zig +++ b/src/types/gamma_control_v1.zig @@ -14,14 +14,12 @@ pub const GammaControlManagerV1 = extern struct { global: *wl.Global, controls: wl.list.Head(GammaControlV1, .link), - server_destroy: wl.Listener(*wl.Server), - events: extern struct { destroy: wl.Signal(*GammaControlManagerV1), set_gamma: wl.Signal(*event.SetGamma), }, - data: usize, + data: ?*anyopaque, extern fn wlr_gamma_control_manager_v1_create(server: *wl.Server) ?*GammaControlManagerV1; pub fn create(server: *wl.Server) !*GammaControlManagerV1 { @@ -42,9 +40,7 @@ pub const GammaControlV1 = extern struct { table: *u16, ramp_size: usize, - output_destroy_listener: wl.Listener(*wlr.Output), - - data: usize, + data: ?*anyopaque, extern fn wlr_gamma_control_v1_apply(gamma_control: ?*GammaControlV1, output_state: *wlr.Output.State) bool; pub const apply = wlr_gamma_control_v1_apply; diff --git a/src/types/idle_inhibit_v1.zig b/src/types/idle_inhibit_v1.zig index 4818cf9..99bc80b 100644 --- a/src/types/idle_inhibit_v1.zig +++ b/src/types/idle_inhibit_v1.zig @@ -7,14 +7,12 @@ pub const IdleInhibitManagerV1 = extern struct { inhibitors: wl.list.Head(IdleInhibitorV1, .link), global: *wl.Global, - server_destroy: wl.Listener(*wl.Server), - events: extern struct { new_inhibitor: wl.Signal(*IdleInhibitorV1), destroy: wl.Signal(*IdleInhibitManagerV1), }, - data: usize, + data: ?*anyopaque, extern fn wlr_idle_inhibit_v1_create(server: *wl.Server) ?*IdleInhibitManagerV1; pub fn create(server: *wl.Server) !*IdleInhibitManagerV1 { @@ -25,7 +23,6 @@ pub const IdleInhibitManagerV1 = extern struct { pub const IdleInhibitorV1 = extern struct { surface: *wlr.Surface, resource: *wl.Resource, - surface_destroy: wl.Listener(*wlr.Surface), link: wl.list.Link, @@ -33,5 +30,5 @@ pub const IdleInhibitorV1 = extern struct { destroy: wl.Signal(*wlr.Surface), }, - data: usize, + data: ?*anyopaque, }; diff --git a/src/types/idle_notify_v1.zig b/src/types/idle_notify_v1.zig index d691534..e10f292 100644 --- a/src/types/idle_notify_v1.zig +++ b/src/types/idle_notify_v1.zig @@ -6,13 +6,6 @@ const wl = wayland.server.wl; pub const IdleNotifierV1 = extern struct { global: *wl.Global, - // private state - - inhibited: bool, - notifications: wl.list.Link, - - server_destroy: wl.Listener(*wl.Server), - extern fn wlr_idle_notifier_v1_create(server: *wl.Server) ?*IdleNotifierV1; pub fn create(server: *wl.Server) !*IdleNotifierV1 { return wlr_idle_notifier_v1_create(server) orelse error.OutOfMemory; diff --git a/src/types/input_device.zig b/src/types/input_device.zig index 8ec8400..7dff2a6 100644 --- a/src/types/input_device.zig +++ b/src/types/input_device.zig @@ -20,7 +20,7 @@ pub const InputDevice = extern struct { destroy: wl.Signal(*InputDevice), }, - data: usize, + data: ?*anyopaque, extern fn wlr_keyboard_from_input_device(wlr_dev: *InputDevice) *wlr.Keyboard; pub const toKeyboard = wlr_keyboard_from_input_device; diff --git a/src/types/input_method_v2.zig b/src/types/input_method_v2.zig index 0d52382..e3f00d6 100644 --- a/src/types/input_method_v2.zig +++ b/src/types/input_method_v2.zig @@ -7,8 +7,6 @@ pub const InputMethodManagerV2 = extern struct { global: *wl.Global, input_methods: wl.list.Head(InputMethodV2, .link), - server_destroy: wl.Listener(*wl.Server), - events: extern struct { input_method: wl.Signal(*wlr.InputMethodV2), destroy: wl.Signal(*wlr.InputMethodManagerV2), @@ -43,10 +41,6 @@ pub const InputMethodV2 = extern struct { input_method: *wlr.InputMethodV2, keyboard: ?*wlr.Keyboard, - keyboard_keymap: wl.Listener(*wlr.Keyboard), - keyboard_repeat_info: wl.Listener(*wlr.Keyboard), - keyboard_destroy: wl.Listener(*wlr.Keyboard), - events: extern struct { destroy: wl.Signal(*wlr.InputMethodV2.KeyboardGrab), }, @@ -81,8 +75,6 @@ pub const InputMethodV2 = extern struct { link: wl.list.Link, - seat_client_destroy: wl.Listener(*wlr.Seat.Client), - events: extern struct { commit: wl.Signal(*wlr.InputMethodV2), new_popup_surface: wl.Signal(*wlr.InputPopupSurfaceV2), @@ -123,7 +115,7 @@ pub const InputPopupSurfaceV2 = extern struct { destroy: wl.Signal(void), }, - data: usize, + data: ?*anyopaque, extern fn wlr_input_popup_surface_v2_try_from_wlr_surface(surface: *wlr.Surface) ?*wlr.InputPopupSurfaceV2; pub const tryFromWlrSurface = wlr_input_popup_surface_v2_try_from_wlr_surface; diff --git a/src/types/keyboard.zig b/src/types/keyboard.zig index 8e03e1d..214d6fd 100644 --- a/src/types/keyboard.zig +++ b/src/types/keyboard.zig @@ -74,7 +74,7 @@ pub const Keyboard = extern struct { repeat_info: wl.Signal(*Keyboard), }, - data: usize, + data: ?*anyopaque, extern fn wlr_keyboard_set_keymap(kb: *Keyboard, keymap: ?*xkb.Keymap) bool; pub const setKeymap = wlr_keyboard_set_keymap; diff --git a/src/types/keyboard_group.zig b/src/types/keyboard_group.zig index b77bdd4..03f82fa 100644 --- a/src/types/keyboard_group.zig +++ b/src/types/keyboard_group.zig @@ -16,7 +16,7 @@ pub const KeyboardGroup = extern struct { leave: wl.Signal(*wl.Array), }, - data: usize, + data: ?*anyopaque, extern fn wlr_keyboard_group_create() ?*KeyboardGroup; pub fn create() !*KeyboardGroup { diff --git a/src/types/keyboard_shortcuts_inhibit_v1.zig b/src/types/keyboard_shortcuts_inhibit_v1.zig index cc076de..da515dd 100644 --- a/src/types/keyboard_shortcuts_inhibit_v1.zig +++ b/src/types/keyboard_shortcuts_inhibit_v1.zig @@ -7,14 +7,12 @@ pub const KeyboardShortcutsInhibitManagerV1 = extern struct { inhibitors: wl.list.Head(wlr.KeyboardShortcutsInhibitorV1, .link), global: *wl.Global, - server_destroy: wl.Listener(*wl.Server), - events: extern struct { new_inhibitor: wl.Signal(*wlr.KeyboardShortcutsInhibitorV1), destroy: wl.Signal(*wlr.KeyboardShortcutsInhibitManagerV1), }, - data: usize, + data: ?*anyopaque, extern fn wlr_keyboard_shortcuts_inhibit_v1_create(server: *wl.Server) ?*wlr.KeyboardShortcutsInhibitManagerV1; pub fn create(server: *wl.Server) !*wlr.KeyboardShortcutsInhibitManagerV1 { @@ -28,16 +26,13 @@ pub const KeyboardShortcutsInhibitorV1 = extern struct { active: bool, resource: *wl.Resource, - surface_destroy: wl.Listener(*wlr.Surface), - seat_destroy: wl.Listener(*wlr.Seat), - link: wl.list.Link, events: extern struct { destroy: wl.Signal(*wlr.KeyboardShortcutsInhibitorV1), }, - data: usize, + data: ?*anyopaque, extern fn wlr_keyboard_shortcuts_inhibitor_v1_activate(inhibitor: *wlr.KeyboardShortcutsInhibitorV1) void; pub const activate = wlr_keyboard_shortcuts_inhibitor_v1_activate; diff --git a/src/types/layer_shell_v1.zig b/src/types/layer_shell_v1.zig index 6dc9f6c..665166a 100644 --- a/src/types/layer_shell_v1.zig +++ b/src/types/layer_shell_v1.zig @@ -7,14 +7,12 @@ const zwlr = wayland.server.zwlr; pub const LayerShellV1 = extern struct { global: *wl.Global, - server_destroy: wl.Listener(*wl.Server), - events: extern struct { new_surface: wl.Signal(*LayerSurfaceV1), destroy: wl.Signal(*LayerShellV1), }, - data: usize, + data: ?*anyopaque, extern fn wlr_layer_shell_v1_create(server: *wl.Server, version: u32) ?*LayerShellV1; pub fn create(server: *wl.Server, version: u32) !*LayerShellV1 { @@ -31,7 +29,8 @@ pub const LayerSurfaceV1 = extern struct { margin: bool = false, keyboard_interactivity: bool = false, layer: bool = false, - _: u26 = 0, + exclusive_edge: bool = false, + _: u25 = 0, }; committed: Fields, @@ -47,6 +46,7 @@ pub const LayerSurfaceV1 = extern struct { desired_width: u32, desired_height: u32, layer: zwlr.LayerShellV1.Layer, + exclusive_edge: u32, configure_serial: u32, actual_width: u32, @@ -86,11 +86,7 @@ pub const LayerSurfaceV1 = extern struct { new_popup: wl.Signal(*wlr.XdgPopup), }, - data: usize, - - // private state - - synced: wlr.Surface.Synced, + data: ?*anyopaque, extern fn wlr_layer_surface_v1_configure(surface: *LayerSurfaceV1, width: u32, height: u32) u32; pub const configure = wlr_layer_surface_v1_configure; diff --git a/src/types/linux_dmabuf_v1.zig b/src/types/linux_dmabuf_v1.zig index 645bc81..c6691b4 100644 --- a/src/types/linux_dmabuf_v1.zig +++ b/src/types/linux_dmabuf_v1.zig @@ -13,10 +13,6 @@ pub const DmabufBufferV1 = extern struct { resource: ?*wl.Resource, attributes: wlr.DmabufAttributes, - // private state - - release: wl.Listener(void), - extern fn wlr_dmabuf_v1_buffer_try_from_buffer_resource(buffer_resource: *wl.Resource) ?*DmabufBufferV1; pub const tryFromBufferResource = wlr_dmabuf_v1_buffer_try_from_buffer_resource; }; @@ -58,19 +54,6 @@ pub const LinuxDmabufV1 = extern struct { destroy: wl.Signal(*LinuxDmabufV1), }, - // private state - - default_feedback: *LinuxDmabufFeedbackV1Compiled, - default_formats: wlr.DrmFormatSet, - surfaces: wl.list.Link, - - main_device_fd: c_int, - - server_destroy: wl.Listener(*wl.Server), - - check_dmabuf_callback: *const fn (attribs: *wlr.DmabufAttributes, data: ?*anyopaque) callconv(.C) bool, - check_dmabuf_callback_data: ?*anyopaque, - extern fn wlr_linux_dmabuf_v1_create(server: *wl.Server, version: u32, default_feedback: *const LinuxDmabufFeedbackV1) ?*LinuxDmabufV1; pub fn create(server: *wl.Server, version: u32, default_feedback: *const LinuxDmabufFeedbackV1) !*LinuxDmabufV1 { return wlr_linux_dmabuf_v1_create(server, version, default_feedback) orelse error.OutOfMemory; diff --git a/src/types/matrix.zig b/src/types/matrix.zig deleted file mode 100644 index 5f487a2..0000000 --- a/src/types/matrix.zig +++ /dev/null @@ -1,28 +0,0 @@ -const wlr = @import("../wlroots.zig"); - -const wayland = @import("wayland"); -const wl = wayland.server.wl; - -extern fn wlr_matrix_identity(mat: *[9]f32) void; -pub const identity = wlr_matrix_identity; - -extern fn wlr_matrix_multiply(mat: *[9]f32, a: *const [9]f32, b: *const [9]f32) void; -pub const multiply = wlr_matrix_multiply; - -extern fn wlr_matrix_transpose(mat: *[9]f32, a: *const [9]f32) void; -pub const transpose = wlr_matrix_transpose; - -extern fn wlr_matrix_translate(mat: *[9]f32, x: f32, y: f32) void; -pub const translate = wlr_matrix_translate; - -extern fn wlr_matrix_scale(mat: *[9]f32, x: f32, y: f32) void; -pub const scale = wlr_matrix_scale; - -extern fn wlr_matrix_rotate(mat: *[9]f32, rad: f32) void; -pub const rotate = wlr_matrix_rotate; - -extern fn wlr_matrix_transform(mat: *[9]f32, transform: wl.Output.Transform) void; -pub const transform = wlr_matrix_transform; - -extern fn wlr_matrix_project_box(mat: *[9]f32, box: *const wlr.Box, transform: wl.Output.Transform, rotation: f32, projection: *const [9]f32) void; -pub const projectBox = wlr_matrix_project_box; diff --git a/src/types/output.zig b/src/types/output.zig index b91ed16..03b5e88 100644 --- a/src/types/output.zig +++ b/src/types/output.zig @@ -46,7 +46,9 @@ pub const Output = extern struct { render_format: bool = false, subpixel: bool = false, layers: bool = false, - _: u21 = 0, + wait_timeline: bool = false, + signal_timeline: bool = false, + _: u19 = 0, }; pub const ModeType = enum(c_int) { @@ -65,6 +67,9 @@ pub const Output = extern struct { subpixel: wl.Output.Subpixel, buffer: ?*wlr.Buffer, + buffer_src_box: wlr.FBox, + buffer_dst_box: wlr.FBox, + tearing_page_flip: bool, mode_type: ModeType, @@ -82,6 +87,12 @@ pub const Output = extern struct { layers: ?*anyopaque, layers_len: usize, + wait_timeline: *wlr.DrmSyncobjTimeline, + wait_point: u64, + + signal_timeline: *wlr.DrmSyncobjTimeline, + signal_point: u64, + extern fn wlr_output_state_init(state: *State) void; pub fn init() State { var state: State = undefined; @@ -170,7 +181,7 @@ pub const Output = extern struct { output: *wlr.Output, commit_seq: u32, presented: bool, - when: *posix.timespec, + when: posix.timespec, seq: c_uint, refresh: c_int, flags: Flags, @@ -258,11 +269,9 @@ pub const Output = extern struct { renderer: ?*wlr.Renderer, swapchain: ?*wlr.Swapchain, - server_destroy: wl.Listener(*wl.Server), - addons: wlr.AddonSet, - data: usize, + data: ?*anyopaque, extern fn wlr_output_create_global(output: *Output, server: *wl.Server) void; pub const createGlobal = wlr_output_create_global; @@ -378,7 +387,8 @@ pub const OutputCursor = extern struct { hotspot_y: i32, texture: ?*wlr.Texture, own_texture: bool, - renderer_destroy: wl.Listener(void), + wait_timeline: ?*wlr.DrmSyncobjTimeline, + wait_point: u64, /// Output.cursors link: wl.list.Link, diff --git a/src/types/output_layout.zig b/src/types/output_layout.zig index d29e219..d6452b3 100644 --- a/src/types/output_layout.zig +++ b/src/types/output_layout.zig @@ -18,12 +18,6 @@ pub const OutputLayout = extern struct { events: extern struct { destroy: wl.Signal(*OutputLayout.Output), }, - - // private state - - addon: *wlr.Addon, - - commit: wl.Listener(*wlr.Output.event.Commit), }; pub const Direction = enum(c_int) { @@ -42,10 +36,7 @@ pub const OutputLayout = extern struct { destroy: wl.Signal(*OutputLayout), }, - data: usize, - - // private state - server_destroy: wl.Listener(*wl.Server), + data: ?*anyopaque, extern fn wlr_output_layout_create(server: *wl.Server) ?*OutputLayout; pub fn create(server: *wl.Server) !*OutputLayout { diff --git a/src/types/output_management_v1.zig b/src/types/output_management_v1.zig index 682ae7a..d4fca9e 100644 --- a/src/types/output_management_v1.zig +++ b/src/types/output_management_v1.zig @@ -16,9 +16,7 @@ pub const OutputManagerV1 = extern struct { destroy: wl.Signal(*OutputManagerV1), }, - server_destroy: wl.Listener(*wl.Server), - - data: usize, + data: ?*anyopaque, extern fn wlr_output_manager_v1_create(server: *wl.Server) ?*OutputManagerV1; pub fn create(server: *wl.Server) !*OutputManagerV1 { @@ -56,8 +54,6 @@ pub const OutputHeadV1 = extern struct { resources: wl.list.Head(wl.Resource, null), mode_resources: wl.list.Head(wl.Resource, null), - - output_destroy: wl.Listener(*wlr.Output), }; pub const OutputConfigurationV1 = extern struct { @@ -68,8 +64,6 @@ pub const OutputConfigurationV1 = extern struct { resource: ?*wl.Resource, - output_destroy: wl.Listener(*wlr.Output), - extern fn wlr_output_configuration_head_v1_create(config: *OutputConfigurationV1, output: *wlr.Output) ?*Head; pub fn create(config: *OutputConfigurationV1, output: *wlr.Output) !*Head { return wlr_output_configuration_head_v1_create(config, output) orelse error.OutOfMemory; diff --git a/src/types/output_power_management_v1.zig b/src/types/output_power_management_v1.zig index 5787d7a..470bea3 100644 --- a/src/types/output_power_management_v1.zig +++ b/src/types/output_power_management_v1.zig @@ -15,14 +15,12 @@ pub const OutputPowerManagerV1 = extern struct { global: *wl.Global, output_powers: wl.list.Head(OutputPowerV1, .link), - server_destroy: wl.Listener(*wl.Server), - events: extern struct { set_mode: wl.Signal(*event.SetMode), destroy: wl.Signal(*OutputPowerManagerV1), }, - data: usize, + data: ?*anyopaque, extern fn wlr_output_power_manager_v1_create(server: *wl.Server) ?*OutputPowerManagerV1; pub fn create(server: *wl.Server) !*OutputPowerManagerV1 { @@ -37,8 +35,5 @@ pub const OutputPowerV1 = extern struct { /// OutputPowerManagerV1.output_powers link: wl.list.Link, - output_destroy_listener: wl.Listener(*wlr.Output), - output_commit_listener: wl.Listener(*wlr.Output.event.Commit), - - data: usize, + data: ?*anyopaque, }; diff --git a/src/types/output_swapchain_manager.zig b/src/types/output_swapchain_manager.zig index 8fc48f6..3bb1ab3 100644 --- a/src/types/output_swapchain_manager.zig +++ b/src/types/output_swapchain_manager.zig @@ -6,10 +6,6 @@ const wl = wayland.server.wl; pub const OutputSwapchainManager = extern struct { backend: *wlr.Backend, - // private state - - outputs: wl.Array, - extern fn wlr_output_swapchain_manager_init(manager: *OutputSwapchainManager, backend: *wlr.Backend) void; pub const init = wlr_output_swapchain_manager_init; diff --git a/src/types/pointer.zig b/src/types/pointer.zig index 28f08cb..30eb72c 100644 --- a/src/types/pointer.zig +++ b/src/types/pointer.zig @@ -101,6 +101,9 @@ pub const Pointer = extern struct { output_name: [*:0]u8, + buttons: [16]u32, + button_count: usize, + events: extern struct { motion: wl.Signal(*event.Motion), motion_absolute: wl.Signal(*event.MotionAbsolute), diff --git a/src/types/pointer_constraints_v1.zig b/src/types/pointer_constraints_v1.zig index 6ec3618..7480482 100644 --- a/src/types/pointer_constraints_v1.zig +++ b/src/types/pointer_constraints_v1.zig @@ -48,15 +48,7 @@ pub const PointerConstraintV1 = extern struct { destroy: wl.Signal(*PointerConstraintV1), }, - data: usize, - - // private state - - surface_commit: wl.Listener(*wlr.Surface), - surface_destroy: wl.Listener(*wlr.Surface), - seat_destroy: wl.Listener(*wl.Seat), - - synced: wlr.Surface.Synced, + data: ?*anyopaque, extern fn wlr_pointer_constraint_v1_send_activated(constraint: *PointerConstraintV1) void; pub const sendActivated = wlr_pointer_constraint_v1_send_activated; @@ -70,12 +62,11 @@ pub const PointerConstraintsV1 = extern struct { constraints: wl.list.Head(PointerConstraintV1, .link), events: extern struct { + destroy: wl.Signal(void), new_constraint: wl.Signal(*PointerConstraintV1), }, - server_destroy: wl.Listener(*wl.Server), - - data: usize, + data: ?*anyopaque, extern fn wlr_pointer_constraints_v1_create(server: *wl.Server) ?*PointerConstraintsV1; pub fn create(server: *wl.Server) !*PointerConstraintsV1 { diff --git a/src/types/pointer_gestures_v1.zig b/src/types/pointer_gestures_v1.zig index ba48a70..e21228f 100644 --- a/src/types/pointer_gestures_v1.zig +++ b/src/types/pointer_gestures_v1.zig @@ -11,13 +11,11 @@ pub const PointerGesturesV1 = extern struct { pinches: wl.list.Head(zwp.PointerGesturePinchV1, null), holds: wl.list.Head(zwp.PointerGestureHoldV1, null), - server_destroy: wl.Listener(*wl.Server), - events: extern struct { destroy: wl.Signal(*PointerGesturesV1), }, - data: usize, + data: ?*anyopaque, extern fn wlr_pointer_gestures_v1_create(server: *wl.Server) ?*PointerGesturesV1; pub fn create(server: *wl.Server) !*PointerGesturesV1 { diff --git a/src/types/presentation_time.zig b/src/types/presentation_time.zig index 00d50b6..e266d43 100644 --- a/src/types/presentation_time.zig +++ b/src/types/presentation_time.zig @@ -12,9 +12,7 @@ pub const Presentation = extern struct { destroy: wl.Signal(*wlr.Presentation), }, - server_destroy: wl.Listener(*wl.Server), - - extern fn wlr_presentation_create(server: *wl.Server, backend: *wlr.Backend) ?*wlr.Presentation; + extern fn wlr_presentation_create(server: *wl.Server, backend: *wlr.Backend, version: c_int) ?*wlr.Presentation; pub fn create(server: *wl.Server, backend: *wlr.Backend) !*wlr.Presentation { return wlr_presentation_create(server, backend) orelse error.OutOfMemory; } @@ -37,10 +35,6 @@ pub const PresentationFeedback = extern struct { output_commit_seq: u32, zero_copy: bool, - output_commit: wl.Listener(*wlr.Output.event.Commit), - output_present: wl.Listener(*wlr.Output.event.Present), - output_destroy: wl.Listener(*wlr.Output), - extern fn wlr_presentation_feedback_send_presented(feedback: *wlr.PresentationFeedback, event: *const wlr.PresentationEvent) void; pub const sendPresented = wlr_presentation_feedback_send_presented; diff --git a/src/types/primary_selection.zig b/src/types/primary_selection.zig index 7ad79fd..42fea66 100644 --- a/src/types/primary_selection.zig +++ b/src/types/primary_selection.zig @@ -16,7 +16,7 @@ pub const PrimarySelectionSource = extern struct { destroy: wl.Signal(*PrimarySelectionSource), }, - data: usize, + data: ?*anyopaque, extern fn wlr_primary_selection_source_init(source: *PrimarySelectionSource, impl: *const PrimarySelectionSource.Impl) void; pub const init = wlr_primary_selection_source_init; diff --git a/src/types/primary_selection_v1.zig b/src/types/primary_selection_v1.zig index 5773e5e..38775af 100644 --- a/src/types/primary_selection_v1.zig +++ b/src/types/primary_selection_v1.zig @@ -8,13 +8,11 @@ pub const PrimarySelectionDeviceManagerV1 = extern struct { /// PrimarySelectionV1Device.link devices: wl.list.Head(PrimarySelectionDeviceV1, .link), - server_destroy: wl.Listener(*wl.Server), - events: extern struct { destroy: wl.Signal(*PrimarySelectionDeviceManagerV1), }, - data: usize, + data: ?*anyopaque, extern fn wlr_primary_selection_v1_device_manager_create(server: *wl.Server) ?*PrimarySelectionDeviceManagerV1; pub fn create(server: *wl.Server) !*PrimarySelectionDeviceManagerV1 { @@ -31,9 +29,5 @@ pub const PrimarySelectionDeviceV1 = extern struct { offers: wl.list.Head(wl.Resource, null), - seat_destroy: wl.Listener(*wlr.Seat), - seat_focus_change: wl.Listener(*wlr.Seat.event.KeyboardFocusChange), - seat_set_primary_selection: wl.Listener(*wlr.Seat.event.RequestSetPrimarySelection), - - data: usize, + data: ?*anyopaque, }; diff --git a/src/types/relative_pointer_v1.zig b/src/types/relative_pointer_v1.zig index c039351..f669815 100644 --- a/src/types/relative_pointer_v1.zig +++ b/src/types/relative_pointer_v1.zig @@ -12,9 +12,7 @@ pub const RelativePointerManagerV1 = extern struct { new_relative_pointer: wl.Signal(*RelativePointerV1), }, - server_destroy: wl.Listener(*wl.Server), - - data: usize, + data: ?*anyopaque, extern fn wlr_relative_pointer_manager_v1_create(server: *wl.Server) ?*RelativePointerManagerV1; pub fn create(server: *wl.Server) !*RelativePointerManagerV1 { @@ -43,10 +41,7 @@ pub const RelativePointerV1 = extern struct { destroy: wl.Signal(*RelativePointerV1), }, - seat_destroy: wl.Listener(*wlr.Seat), - pointer_destroy: wl.Listener(*wlr.Pointer), - - data: usize, + data: ?*anyopaque, extern fn wlr_relative_pointer_v1_from_resource(resource: *wl.Resource) ?*RelativePointerV1; pub const fromResource = wlr_relative_pointer_v1_from_resource; diff --git a/src/types/scene.zig b/src/types/scene.zig index 1636e8d..ae31ad4 100644 --- a/src/types/scene.zig +++ b/src/types/scene.zig @@ -28,14 +28,10 @@ pub const SceneNode = extern struct { destroy: wl.Signal(void), }, - data: usize, + data: ?*anyopaque, addons: wlr.AddonSet, - // private state - - visible: pixman.Region32, - extern fn wlr_scene_node_at(node: *SceneNode, lx: f64, ly: f64, nx: *f64, ny: *f64) ?*SceneNode; pub const at = wlr_scene_node_at; @@ -147,20 +143,7 @@ pub const Scene = extern struct { outputs: wl.list.Head(SceneOutput, .link), linux_dmabuf_v1: ?*wlr.LinuxDmabufV1, - - // private state - - linux_dmabuf_v1_destroy: wl.Listener(*wlr.LinuxDmabufV1), - - debug_damage_option: enum(c_int) { - none, - rerender, - highlight, - }, - - direct_scanout: bool, - calculate_visibility: bool, - highlight_transparent_region: bool, + gamma_control_manager_v1: ?*wlr.GammaControlManagerV1, extern fn wlr_scene_create() ?*Scene; pub fn create() !*Scene { @@ -178,6 +161,9 @@ pub const Scene = extern struct { extern fn wlr_scene_set_linux_dmabuf_v1(scene: *Scene, linux_dmabuf_v1: *wlr.LinuxDmabufV1) void; pub const setLinuxDmabufV1 = wlr_scene_set_linux_dmabuf_v1; + extern fn wlr_scene_set_gamma_control_manager_v1(scene: *Scene, gamma_control: *wlr.GammaControlManagerV1) void; + pub const setGammaControlManagerV1 = wlr_scene_set_gamma_control_manager_v1; + extern fn wlr_scene_output_create(scene: *Scene, output: *wlr.Output) ?*SceneOutput; pub fn createSceneOutput(scene: *Scene, output: *wlr.Output) !*SceneOutput { return wlr_scene_output_create(scene, output) orelse error.OutOfMemory; @@ -193,20 +179,6 @@ pub const SceneSurface = extern struct { buffer: *SceneBuffer, surface: *wlr.Surface, - // private state - - clip: wlr.Box, - - addon: wlr.Addon, - - outputs_update: wl.Listener(*SceneBuffer.event.OutputsUpdate), - output_enter: wl.Listener(*SceneOutput), - output_leave: wl.Listener(*SceneOutput), - output_sample: wl.Listener(*SceneBuffer.event.OutputSample), - frame_done: wl.Listener(*posix.timespec), - surface_destroy: wl.Listener(void), - surface_commit: wl.Listener(void), - extern fn wlr_scene_surface_try_from_buffer(buffer: *SceneBuffer) ?*SceneSurface; pub const tryFromBuffer = wlr_scene_surface_try_from_buffer; }; @@ -262,20 +234,6 @@ pub const SceneBuffer = extern struct { transform: wl.Output.Transform, opaque_region: pixman.Region32, - // private state - - active_outputs: u64, - texture: ?*wlr.Texture, - prev_feedback_options: wlr.LinuxDmabufFeedbackV1.InitOptions, - - own_buffer: bool, - buffer_width: c_int, - buffer_height: c_int, - buffer_is_opaque: bool, - - buffer_release: wl.Listener(void), - renderer_destroy: wl.Listener(void), - extern fn wlr_scene_buffer_from_node(node: *SceneNode) *SceneBuffer; pub const fromNode = wlr_scene_buffer_from_node; @@ -323,27 +281,15 @@ pub const SceneOutput = extern struct { destroy: wl.Signal(void), }, - // private state - - pending_commit_damage: pixman.Region32, - - index: u8, - prev_scanout: bool, - - output_commit: wl.Listener(*wlr.Output.event.Commit), - output_damage: wl.Listener(void), - output_needs_frame: wl.Listener(void), - - damage_highlight_regions: wl.list.Link, - - render_list: wl.Array, - pub const StateOptions = extern struct { timer: ?*wlr.SceneTimer = null, color_transform: ?*wlr.ColorTransform = null, swapchain: ?*wlr.Swapchain = null, }; + extern fn wlr_scene_output_needs_frame(scene_output: *SceneOutput) bool; + pub const needsFrame = wlr_scene_output_needs_frame; + extern fn wlr_scene_output_commit(scene_output: *SceneOutput, options: ?*const StateOptions) bool; pub const commit = wlr_scene_output_commit; @@ -397,13 +343,6 @@ pub const SceneLayerSurfaceV1 = extern struct { tree: *SceneTree, layer_surface: *wlr.LayerSurfaceV1, - // private state - - tree_destroy: wl.Listener(void), - layer_surface_destroy: wl.Listener(*wlr.LayerSurfaceV1), - layer_surface_map: wl.Listener(*wlr.LayerSurfaceV1), - layer_surface_unmap: wl.Listener(*wlr.LayerSurfaceV1), - extern fn wlr_scene_layer_surface_v1_configure( scene_layer_surface: *SceneLayerSurfaceV1, full_area: *const wlr.Box, diff --git a/src/types/screencopy_v1.zig b/src/types/screencopy_v1.zig index 85c537f..1055321 100644 --- a/src/types/screencopy_v1.zig +++ b/src/types/screencopy_v1.zig @@ -6,11 +6,12 @@ const wl = wayland.server.wl; pub const ScreencopyManagerV1 = extern struct { global: *wl.Global, frames: wl.list.Head(ScreencopyFrameV1, .link), - server_destroy: wl.Listener(*wl.Server), + events: extern struct { destroy: wl.Signal(*ScreencopyManagerV1), }, - data: usize, + + data: ?*anyopaque, extern fn wlr_screencopy_manager_v1_create(server: *wl.Server) ?*ScreencopyManagerV1; pub fn create(server: *wl.Server) !*ScreencopyManagerV1 { @@ -45,9 +46,6 @@ pub const ScreencopyFrameV1 = extern struct { buffer: *wlr.Buffer, output: *wlr.Output, - output_commit: wl.Listener(*wlr.Output.event.Commit), - output_destroy: wl.Listener(*wlr.Output), - output_enable: wl.Listener(*wlr.Output), - data: usize, + data: ?*anyopaque, }; diff --git a/src/types/seat.zig b/src/types/seat.zig index d6566de..82a33ac 100644 --- a/src/types/seat.zig +++ b/src/types/seat.zig @@ -26,10 +26,6 @@ pub const TouchPoint = extern struct { sx: f64, sy: f64, - surface_destroy: wl.Listener(*wlr.Surface), - focus_surface_destroy: wl.Listener(*wlr.Surface), - client_destroy: wl.Listener(*Seat.Client), - events: extern struct { destroy: wl.Signal(*TouchPoint), }, @@ -108,7 +104,7 @@ pub const Seat = extern struct { interface: *const Interface, seat: *Seat, - data: usize, + data: ?*anyopaque, }; pub const KeyboardGrab = extern struct { @@ -128,7 +124,7 @@ pub const Seat = extern struct { interface: *const Interface, seat: *Seat, - data: usize, + data: ?*anyopaque, }; pub const TouchGrab = extern struct { @@ -144,10 +140,15 @@ pub const Seat = extern struct { interface: *const Interface, seat: *Seat, - data: usize, + data: ?*anyopaque, }; pub const PointerState = extern struct { + pub const Button = extern struct { + button: u32, + n_pressed: usize, + }; + seat: *Seat, focused_client: ?*Seat.Client, focused_surface: ?*wlr.Surface, @@ -160,14 +161,12 @@ pub const Seat = extern struct { sent_axis_source: bool, cached_axis_source: wl.Pointer.AxisSource, - buttons: [16]u32, + buttons: [16]Button, button_count: usize, grab_button: u32, grab_serial: u32, grab_time: u32, - surface_destroy: wl.Listener(*wlr.Surface), - events: extern struct { focus_change: wl.Signal(*event.PointerFocusChange), }, @@ -180,12 +179,6 @@ pub const Seat = extern struct { focused_client: ?*Seat.Client, focused_surface: ?*wlr.Surface, - keyboard_destroy: wl.Listener(*wlr.Keyboard), - keyboard_keymap: wl.Listener(*wlr.Keyboard), - keyboard_repeat_info: wl.Listener(*wlr.Keyboard), - - surface_destroy: wl.Listener(*wlr.Surface), - grab: *KeyboardGrab, default_grab: *KeyboardGrab, @@ -253,7 +246,6 @@ pub const Seat = extern struct { capabilities: u32, accumulated_capabilities: u32, - last_event: posix.timespec, selection_source: ?*wlr.DataSource, selection_serial: u32, @@ -273,11 +265,6 @@ pub const Seat = extern struct { keyboard_state: KeyboardState, touch_state: TouchState, - server_destroy: wl.Listener(*wl.Server), - selection_source_destroy: wl.Listener(*wlr.DataSource), - primary_selection_source_destroy: wl.Listener(*wlr.PrimarySelectionSource), - drag_source_destroy: wl.Listener(*wlr.DataSource), - events: extern struct { pointer_grab_begin: wl.Signal(*PointerGrab), pointer_grab_end: wl.Signal(*PointerGrab), @@ -302,7 +289,7 @@ pub const Seat = extern struct { destroy: wl.Signal(*wlr.Seat), }, - data: usize, + data: ?*anyopaque, extern fn wlr_seat_create(server: *wl.Server, name: [*:0]const u8) ?*Seat; pub fn create(server: *wl.Server, name: [*:0]const u8) !*Seat { diff --git a/src/types/security_context_v1.zig b/src/types/security_context_v1.zig index e68d9ba..7bea8a4 100644 --- a/src/types/security_context_v1.zig +++ b/src/types/security_context_v1.zig @@ -20,11 +20,6 @@ pub const SecurityContextManagerV1 = extern struct { data: ?*anyopaque, - // private state - - contexts: wl.list.Link, - server_destroy: wl.Listener(void), - extern fn wlr_security_context_manager_v1_create(server: *wl.Server) ?*SecurityContextManagerV1; pub fn create(server: *wl.Server) error{OutOfMemory}!*SecurityContextManagerV1 { return wlr_security_context_manager_v1_create(server) orelse error.OutOfMemory; diff --git a/src/types/session_lock_v1.zig b/src/types/session_lock_v1.zig index baa0688..e0f6b95 100644 --- a/src/types/session_lock_v1.zig +++ b/src/types/session_lock_v1.zig @@ -12,11 +12,7 @@ pub const SessionLockManagerV1 = extern struct { destroy: wl.Signal(void), }, - data: usize, - - // private state - - server_destroy: wl.Listener(*wl.Server), + data: ?*anyopaque, extern fn wlr_session_lock_manager_v1_create(server: *wl.Server) ?*SessionLockManagerV1; pub fn create(server: *wl.Server) !*SessionLockManagerV1 { @@ -35,11 +31,7 @@ pub const SessionLockV1 = extern struct { destroy: wl.Signal(void), }, - data: usize, - - // private state - - locked_sent: bool, + data: ?*anyopaque, extern fn wlr_session_lock_v1_send_locked(lock: *SessionLockV1) void; pub const sendLocked = wlr_session_lock_v1_send_locked; @@ -81,13 +73,7 @@ pub const SessionLockSurfaceV1 = extern struct { destroy: wl.Signal(void), }, - data: usize, - - // private state - - synced: wlr.Surface.Synced, - - output_destroy: wl.Listener(*wlr.Output), + data: ?*anyopaque, extern fn wlr_session_lock_surface_v1_configure(lock_surface: *SessionLockSurfaceV1, width: u32, height: u32) u32; pub const configure = wlr_session_lock_surface_v1_configure; diff --git a/src/types/shm.zig b/src/types/shm.zig index 69a3c8e..ed3a2f1 100644 --- a/src/types/shm.zig +++ b/src/types/shm.zig @@ -6,13 +6,6 @@ const wl = wayland.server.wl; pub const Shm = extern struct { global: *wl.Global, - // private state - - formats: [*]u32, - formats_len: usize, - - server_destroy: wl.Listener(*wl.Server), - extern fn wlr_shm_create(server: *wl.Server, version: u32, formats: [*]const u32, formats_len: usize) ?*Shm; pub fn create(server: *wl.Server, version: u32, formats: []const u32) error{OutOfMemory}!*Shm { return wlr_shm_create(server, version, formats.ptr, formats.len) orelse error.OutOfMemory; diff --git a/src/types/single_pixel_buffer_v1.zig b/src/types/single_pixel_buffer_v1.zig index 9d47e8a..54a7850 100644 --- a/src/types/single_pixel_buffer_v1.zig +++ b/src/types/single_pixel_buffer_v1.zig @@ -3,10 +3,6 @@ const wl = @import("wayland").server.wl; pub const SinglePixelBufferManagerV1 = extern struct { global: *wl.Global, - // private state - - server_destroy: wl.Listener(*wl.Server), - extern fn wlr_single_pixel_buffer_manager_v1_create(server: *wl.Server) ?*SinglePixelBufferManagerV1; pub fn create(server: *wl.Server) !*SinglePixelBufferManagerV1 { return wlr_single_pixel_buffer_manager_v1_create(server) orelse error.OutOfMemory; diff --git a/src/types/subcompositor.zig b/src/types/subcompositor.zig index 8fd1372..d537d0d 100644 --- a/src/types/subcompositor.zig +++ b/src/types/subcompositor.zig @@ -6,8 +6,6 @@ const wl = wayland.server.wl; pub const Subcompositor = extern struct { global: *wl.Global, - server_destroy: wl.Listener(*wl.Server), - events: extern struct { destroy: wl.Signal(*wlr.Compositor), }, @@ -24,10 +22,6 @@ pub const Subsurface = extern struct { y: i32, /// wlr.Surface.State.subsurfaces_above/subsurfaces_below link: wl.list.Link, - - // private state - - synced: *wlr.Surface.Synced, }; resource: *wl.Subsurface, @@ -44,23 +38,11 @@ pub const Subsurface = extern struct { reordered: bool, added: bool, - surface_client_commit: wl.Listener(void), - parent_destroy: wl.Listener(*wlr.Surface), - events: extern struct { destroy: wl.Signal(*Subsurface), }, - data: usize, - - // private state - - parent_synced: wlr.Surface.Synced, - - previous: extern struct { - x: i32, - y: i32, - }, + data: ?*anyopaque, extern fn wlr_subsurface_try_from_wlr_surface(surface: *wlr.Surface) ?*wlr.Subsurface; pub const tryFromWlrSurface = wlr_subsurface_try_from_wlr_surface; diff --git a/src/types/switch.zig b/src/types/switch.zig index b69b6d0..0f8b6d9 100644 --- a/src/types/switch.zig +++ b/src/types/switch.zig @@ -32,5 +32,5 @@ pub const Switch = extern struct { toggle: wl.Signal(*event.Toggle), }, - data: usize, + data: ?*anyopaque, }; diff --git a/src/types/tablet_tool.zig b/src/types/tablet_tool.zig index 16aff77..525c438 100644 --- a/src/types/tablet_tool.zig +++ b/src/types/tablet_tool.zig @@ -44,7 +44,7 @@ pub const TabletTool = extern struct { destroy: wl.Signal(*TabletTool), }, - data: usize, + data: ?*anyopaque, }; pub const Tablet = extern struct { @@ -132,5 +132,5 @@ pub const Tablet = extern struct { paths: wl.Array, - data: usize, + data: ?*anyopaque, }; diff --git a/src/types/tablet_v2.zig b/src/types/tablet_v2.zig index 11ab35a..806dd50 100644 --- a/src/types/tablet_v2.zig +++ b/src/types/tablet_v2.zig @@ -9,8 +9,6 @@ pub const TabletManagerV2 = extern struct { clients: wl.list.Link, // private to wlroots seats: wl.list.Link, // private to wlroots - server_destroy: wl.Listener(void), - events: extern struct { destroy: wl.Listener(void), }, @@ -44,8 +42,6 @@ pub const TabletV2Tablet = extern struct { wlr_device: *wlr.InputDevice, clients: wl.list.Link, // private to wlroots - tablet_destroy: wl.Listener(void), - current_client: ?*opaque {}, }; @@ -85,11 +81,8 @@ pub const TabletV2TabletTool = extern struct { wlr_tool: *wlr.TabletTool, clients: wl.list.Link, // private to wlroots - tool_destroy: wl.Listener(void), - current_client: ?*opaque {}, focused_surface: ?*wlr.Surface, - surface_destroy: wl.Listener(void), grab: *Grab, default_grab: Grab, @@ -223,8 +216,6 @@ pub const TabletV2TabletPad = extern struct { group_count: usize, groups: [*]u32, - pad_destroy: wl.Listener(void), - current_client: ?*opaque {}, grab: *Grab, diff --git a/src/types/tearing_control_v1.zig b/src/types/tearing_control_v1.zig index bc16fa3..550eec1 100644 --- a/src/types/tearing_control_v1.zig +++ b/src/types/tearing_control_v1.zig @@ -24,8 +24,6 @@ pub const TearingControlManagerV1 = extern struct { global: *wl.Global, surface_hints: wl.list.Head(TearingControlV1, .link), - server_destroy: wl.Listener(*wl.Server), - events: extern struct { new_object: wl.Signal(*TearingControlV1), destroy: wl.Signal(void), diff --git a/src/types/text_input_v3.zig b/src/types/text_input_v3.zig index bed2233..2c70e02 100644 --- a/src/types/text_input_v3.zig +++ b/src/types/text_input_v3.zig @@ -7,8 +7,6 @@ pub const TextInputManagerV3 = extern struct { global: *wl.Global, text_inputs: wl.list.Head(TextInputV3, .link), - server_destroy: wl.Listener(*wl.Server), - events: extern struct { text_input: wl.Signal(*wlr.TextInputV3), destroy: wl.Signal(*wlr.TextInputManagerV3), @@ -59,9 +57,6 @@ pub const TextInputV3 = extern struct { link: wl.list.Link, - surface_destroy: wl.Listener(*wlr.Surface), - seat_destroy: wl.Listener(*wlr.Seat), - events: extern struct { enable: wl.Signal(*wlr.TextInputV3), commit: wl.Signal(*wlr.TextInputV3), diff --git a/src/types/touch.zig b/src/types/touch.zig index 802077c..b8d37d0 100644 --- a/src/types/touch.zig +++ b/src/types/touch.zig @@ -55,5 +55,5 @@ pub const Touch = extern struct { frame: wl.Signal(void), }, - data: usize, + data: ?*anyopaque, }; diff --git a/src/types/transient_seat_v1.zig b/src/types/transient_seat_v1.zig index 92b6c57..9d4cd3c 100644 --- a/src/types/transient_seat_v1.zig +++ b/src/types/transient_seat_v1.zig @@ -5,7 +5,7 @@ const wl = wayland.server.wl; pub const TransientSeatManagerV1 = extern struct { global: *wl.Global, - server_destroy: wl.Listener(*wl.Server), + events: extern struct { create_seat: wl.Signal(*TransientSeatV1), }, diff --git a/src/types/viewporter.zig b/src/types/viewporter.zig index dc5f031..2ad9c98 100644 --- a/src/types/viewporter.zig +++ b/src/types/viewporter.zig @@ -10,8 +10,6 @@ pub const Viewporter = extern struct { destroy: wl.Signal(void), }, - server_destroy: wl.Listener(*wl.Server), - extern fn wlr_viewporter_create(server: *wl.Server) ?*Viewporter; pub fn create(server: *wl.Server) !*Viewporter { return wlr_viewporter_create(server) orelse error.OutOfMemory; diff --git a/src/types/virtual_keyboard_v1.zig b/src/types/virtual_keyboard_v1.zig index 13d519b..b96d116 100644 --- a/src/types/virtual_keyboard_v1.zig +++ b/src/types/virtual_keyboard_v1.zig @@ -7,8 +7,6 @@ pub const VirtualKeyboardManagerV1 = extern struct { global: *wl.Global, virtual_keyboards: wl.list.Head(VirtualKeyboardV1, .link), - server_destroy: wl.Listener(*wl.Server), - events: extern struct { new_virtual_keyboard: wl.Signal(*VirtualKeyboardV1), destroy: wl.Signal(*VirtualKeyboardManagerV1), diff --git a/src/types/virtual_pointer_v1.zig b/src/types/virtual_pointer_v1.zig index 3863e59..2e93975 100644 --- a/src/types/virtual_pointer_v1.zig +++ b/src/types/virtual_pointer_v1.zig @@ -15,8 +15,6 @@ pub const VirtualPointerManagerV1 = extern struct { global: *wl.Global, virtual_pointers: wl.list.Head(VirtualPointerV1, .link), - server_destroy: wl.Listener(*wl.Server), - events: extern struct { new_virtual_pointer: wl.Signal(*event.NewPointer), destroy: wl.Signal(*VirtualPointerManagerV1), diff --git a/src/types/xdg_activation_v1.zig b/src/types/xdg_activation_v1.zig index 3b49e85..638ea9e 100644 --- a/src/types/xdg_activation_v1.zig +++ b/src/types/xdg_activation_v1.zig @@ -12,6 +12,9 @@ pub const XdgActivationV1 = extern struct { }; }; + // XXX https://gitlab.freedesktop.org/wlroots/wlroots/-/merge_requests/5049 + //global: *wl.Global, + /// token timeout in milliseconds (0 to disable) token_timeout_msec: u32, @@ -23,14 +26,6 @@ pub const XdgActivationV1 = extern struct { new_token: wl.Signal(*XdgActivationTokenV1), }, - // Private state - - server: *wl.Server, - - global: *wl.Global, - - server_destroy: wl.Listener(*wl.Server), - extern fn wlr_xdg_activation_v1_create(server: *wl.Server) ?*XdgActivationV1; pub fn create(server: *wl.Server) !*XdgActivationV1 { return wlr_xdg_activation_v1_create(server) orelse error.OutOfMemory; @@ -57,20 +52,12 @@ pub const XdgActivationTokenV1 = extern struct { link: wl.list.Link, - data: usize, + data: ?*anyopaque, events: extern struct { destroy: wl.Signal(void), }, - // Private state - token: [*:0]u8, - resource: ?*wl.Resource, - timeout: ?*wl.EventSource, - - seat_destroy: wl.Listener(*wlr.Seat), - surface_destroy: wl.Listener(*wlr.Surface), - extern fn wlr_xdg_activation_token_v1_destroy(token: *XdgActivationTokenV1) void; pub const destroy = wlr_xdg_activation_token_v1_destroy; diff --git a/src/types/xdg_decoration_v1.zig b/src/types/xdg_decoration_v1.zig index 3f2ff29..8008e99 100644 --- a/src/types/xdg_decoration_v1.zig +++ b/src/types/xdg_decoration_v1.zig @@ -8,14 +8,12 @@ pub const XdgDecorationManagerV1 = extern struct { global: *wl.Global, decorations: wl.list.Head(XdgToplevelDecorationV1, .link), - server_destroy: wl.Listener(*wl.Server), - events: extern struct { new_toplevel_decoration: wl.Signal(*XdgToplevelDecorationV1), destroy: wl.Signal(*XdgDecorationManagerV1), }, - data: usize, + data: ?*anyopaque, extern fn wlr_xdg_decoration_manager_v1_create(server: *wl.Server) ?*XdgDecorationManagerV1; pub fn create(server: *wl.Server) !*XdgDecorationManagerV1 { @@ -60,15 +58,7 @@ pub const XdgToplevelDecorationV1 = extern struct { request_mode: wl.Signal(*XdgToplevelDecorationV1), }, - data: usize, - - // private state - - toplevel_destroy: wl.Listener(void), - surface_configure: wl.Listener(*wlr.XdgSurface.Configure), - surface_ack_configure: wl.Listener(*wlr.XdgSurface.Configure), - - synced: wlr.Surface.Synced, + data: ?*anyopaque, extern fn wlr_xdg_toplevel_decoration_v1_set_mode(decoration: *XdgToplevelDecorationV1, mode: Mode) u32; pub const setMode = wlr_xdg_toplevel_decoration_v1_set_mode; diff --git a/src/types/xdg_output_v1.zig b/src/types/xdg_output_v1.zig index 65469a4..3b76d00 100644 --- a/src/types/xdg_output_v1.zig +++ b/src/types/xdg_output_v1.zig @@ -13,11 +13,6 @@ pub const XdgOutputManagerV1 = extern struct { destroy: wl.Signal(*XdgOutputManagerV1), }, - server_destroy: wl.Listener(*wl.Server), - layout_add: wl.Listener(*wlr.OutputLayout), - layout_change: wl.Listener(*wlr.OutputLayout), - layout_destroy: wl.Listener(*wlr.OutputLayout), - extern fn wlr_xdg_output_manager_v1_create(server: *wl.Server, layout: *wlr.OutputLayout) ?*XdgOutputManagerV1; pub fn create(server: *wl.Server, layout: *wlr.OutputLayout) !*XdgOutputManagerV1 { return wlr_xdg_output_manager_v1_create(server, layout) orelse error.OutOfMemory; @@ -36,7 +31,4 @@ pub const XdgOutputV1 = extern struct { y: i32, width: i32, height: i32, - - destroy: wl.Listener(*wlr.OutputLayout.Output), - description: wl.Listener(*wlr.Output), }; diff --git a/src/types/xdg_shell.zig b/src/types/xdg_shell.zig index 019f4e5..acc77a0 100644 --- a/src/types/xdg_shell.zig +++ b/src/types/xdg_shell.zig @@ -11,8 +11,6 @@ pub const XdgShell = extern struct { popup_grabs: wl.list.Head(XdgPopupGrab, .link), ping_timeout: u32, - server_destroy: wl.Listener(*wl.Server), - events: extern struct { new_surface: wl.Signal(*wlr.XdgSurface), new_toplevel: wl.Signal(*wlr.XdgToplevel), @@ -20,7 +18,7 @@ pub const XdgShell = extern struct { destroy: wl.Signal(*wlr.XdgShell), }, - data: usize, + data: ?*anyopaque, extern fn wlr_xdg_shell_create(server: *wl.Server, version: u32) ?*wlr.XdgShell; pub fn create(server: *wl.Server, version: u32) !*wlr.XdgShell { @@ -91,8 +89,6 @@ pub const XdgPopupGrab = extern struct { popups: wl.list.Head(XdgPopup, .grab_link), /// XdgShell.popup_grabs link: wl.list.Link, - - seat_destroy: wl.Listener(*wlr.Seat), }; pub const XdgPopup = extern struct { @@ -129,10 +125,6 @@ pub const XdgPopup = extern struct { /// Grab.popups grab_link: wl.list.Link, - // private state - - synced: wlr.Surface.Synced, - extern fn wlr_xdg_popup_from_resource(resource: *xdg.Popup) ?*wlr.XdgPopup; pub const fromResource = wlr_xdg_popup_from_resource; @@ -202,7 +194,6 @@ pub const XdgToplevel = extern struct { fullscreen: bool, fullscreen_output: ?*wlr.Output, - fullscreen_output_destroy: wl.Listener(*wlr.Output), }; pub const event = struct { @@ -231,7 +222,6 @@ pub const XdgToplevel = extern struct { resource: *xdg.Toplevel, base: *wlr.XdgSurface, parent: ?*wlr.XdgToplevel, - parent_unmap: wl.Listener(*XdgSurface), current: State, pending: State, @@ -256,6 +246,9 @@ pub const XdgToplevel = extern struct { extern fn wlr_xdg_toplevel_from_resource(resource: *xdg.Toplevel) ?*wlr.XdgToplevel; pub const fromResource = wlr_xdg_toplevel_from_resource; + extern fn wlr_xdg_toplevel_configure(toplevel: *wlr.XdgToplevel, configure: *const Configure) u32; + pub const configure = wlr_xdg_toplevel_configure; + extern fn wlr_xdg_toplevel_set_size(toplevel: *wlr.XdgToplevel, width: i32, height: i32) u32; pub const setSize = wlr_xdg_toplevel_set_size; @@ -300,8 +293,14 @@ pub const XdgSurface = extern struct { }; pub const State = extern struct { - configure_serial: u32, + committed: packed struct(u32) { + geometry: bool = false, + _: u31 = 0, + }, + geometry: wlr.Box, + + configure_serial: u32, }; pub const Configure = extern struct { @@ -342,6 +341,8 @@ pub const XdgSurface = extern struct { initialized: bool, initial_commit: bool, + geometry: wlr.Box, + events: extern struct { destroy: wl.Signal(void), ping_timeout: wl.Signal(void), @@ -350,13 +351,7 @@ pub const XdgSurface = extern struct { ack_configure: wl.Signal(*wlr.XdgSurface.Configure), }, - data: usize, - - // private state - - synced: wlr.Surface.Synced, - - role_resource_destroy: wl.Listener(*wl.Resource), + data: ?*anyopaque, extern fn wlr_xdg_surface_from_resource(resource: *xdg.Surface) ?*wlr.XdgSurface; pub const fromResource = wlr_xdg_surface_from_resource; @@ -373,9 +368,6 @@ pub const XdgSurface = extern struct { extern fn wlr_xdg_surface_try_from_wlr_surface(surface: *wlr.Surface) ?*wlr.XdgSurface; pub const tryFromWlrSurface = wlr_xdg_surface_try_from_wlr_surface; - extern fn wlr_xdg_surface_get_geometry(surface: *wlr.XdgSurface, box: *wlr.Box) void; - pub const getGeometry = wlr_xdg_surface_get_geometry; - extern fn wlr_xdg_surface_for_each_surface( surface: *wlr.XdgSurface, iterator: *const fn (surface: *wlr.Surface, sx: c_int, sy: c_int, data: ?*anyopaque) callconv(.C) void, diff --git a/src/util/box.zig b/src/util/box.zig index de9b762..64b0b1f 100644 --- a/src/util/box.zig +++ b/src/util/box.zig @@ -16,6 +16,9 @@ pub const Box = extern struct { extern fn wlr_box_contains_point(box: ?*const Box, x: f64, y: f64) bool; pub const containsPoint = wlr_box_contains_point; + extern fn wlr_box_contains_box(bigger: *const Box, smaller: *const Box) bool; + pub const containsBox = wlr_box_contains_box; + extern fn wlr_box_empty(box: ?*const Box) bool; pub const empty = wlr_box_empty; diff --git a/src/wlroots.zig b/src/wlroots.zig index 8d827d0..1b24897 100644 --- a/src/wlroots.zig +++ b/src/wlroots.zig @@ -185,8 +185,6 @@ pub usingnamespace if (config.has_xwayland) struct { pub const XwaylandSurfaceV1 = @import("xwayland/shell.zig").XwaylandSurfaceV1; } else struct {}; -pub const matrix = @import("types/matrix.zig"); - pub const AddonSet = @import("util/addon.zig").AddonSet; pub const Addon = @import("util/addon.zig").Addon; pub const Box = @import("util/box.zig").Box; @@ -222,8 +220,8 @@ pub const config = @import("config.zig"); pub const version = @import("version.zig"); comptime { - if (version.major != 0 or version.minor != 18) { - @compileError("zig-wlroots requires wlroots version 0.18, found version " ++ version.str); + if (version.major != 0 or version.minor != 19) { + @compileError("zig-wlroots requires wlroots version 0.19, found version " ++ version.str); } } test { diff --git a/src/xwayland/server.zig b/src/xwayland/server.zig index 3d8f90d..df6fa76 100644 --- a/src/xwayland/server.zig +++ b/src/xwayland/server.zig @@ -43,10 +43,7 @@ pub const XwaylandServer = extern struct { destroy: wl.Signal(void), }, - client_destroy: wl.Listener(*wl.Client), - display_destroy: wl.Listener(*wl.Server), - - data: usize, + data: ?*anyopaque, extern fn wlr_xwayland_server_create(server: *wl.Server, options: *Options) ?*XwaylandServer; pub fn create(server: *wl.Server, options: *Options) !*XwaylandServer { diff --git a/src/xwayland/shell.zig b/src/xwayland/shell.zig index 3da1f08..645e908 100644 --- a/src/xwayland/shell.zig +++ b/src/xwayland/shell.zig @@ -14,14 +14,6 @@ pub const XwaylandShellV1 = extern struct { new_surface: wl.Signal(*XwaylandSurfaceV1), }, - // private state - - client: ?*wl.Client, - surfaces: wl.list.Head(XwaylandSurfaceV1, .link), - - display_destroy: wl.Listener(void), - client_destroy: wl.Listener(void), - extern fn wlr_xwayland_shell_v1_create(server: *wl.Server, version: u32) ?*XwaylandShellV1; pub fn create(server: *wl.Server, version: u32) !*XwaylandShellV1 { return wlr_xwayland_shell_v1_create(server, version) orelse error.OutOfMemory; @@ -40,12 +32,4 @@ pub const XwaylandShellV1 = extern struct { pub const XwaylandSurfaceV1 = extern struct { surface: *wlr.Surface, serial: u64, - - // private state - - resource: *wl.Resource, - /// XwaylandShellV1.surfaces - link: wl.list.Link, - shell: *XwaylandShellV1, - added: bool, }; diff --git a/src/xwayland/xwayland.zig b/src/xwayland/xwayland.zig index 9ca990d..8edd5ab 100644 --- a/src/xwayland/xwayland.zig +++ b/src/xwayland/xwayland.zig @@ -110,22 +110,15 @@ pub const Xwayland = extern struct { seat: ?*wlr.Seat, events: extern struct { + destroy: wl.Singal(void), ready: wl.Signal(void), new_surface: wl.Signal(*XwaylandSurface), remove_startup_info: wl.Signal(*event.RemoveStartupInfo), }, - user_event_handler: ?*const fn (*Xwm, *xcb.GenericEvent) callconv(.C) c_int, + user_event_handler: ?*const fn (*Xwayland, *xcb.GenericEvent) callconv(.C) bool, - data: usize, - - // private state - - server_start: wl.Listener(void), - server_ready: wl.Listener(*wlr.XwaylandServer.event.Ready), - server_destroy: wl.Listener(void), - seat_destroy: wl.Listener(*wlr.Seat), - shell_destroy: wl.Listener(void), + data: ?*anyopaque, extern fn wlr_xwayland_create(server: *wl.Server, compositor: *wlr.Compositor, lazy: bool) ?*Xwayland; pub fn create(server: *wl.Server, compositor: *wlr.Compositor, lazy: bool) !*Xwayland { @@ -194,15 +187,13 @@ pub const XwaylandSurface = extern struct { surface: ?*wlr.Surface, surface_addon: wlr.Addon, - surface_commit: wl.Listener(*wlr.Surface), - surface_map: wl.Listener(void), - surface_unmap: wl.Listener(void), x: i16, y: i16, width: u16, height: u16, override_redirect: bool, + opacity: f32, title: ?[*:0]u8, class: ?[*:0]u8, @@ -237,6 +228,13 @@ pub const XwaylandSurface = extern struct { maximized_horz: bool, minimized: bool, withdrawn: bool, + sticky: bool, + shaded: bool, + skip_taskbar: bool, + skip_pager: bool, + above: bool, + below: bool, + demands_attention: bool, has_alpha: bool, @@ -249,6 +247,14 @@ pub const XwaylandSurface = extern struct { request_maximize: wl.Signal(void), request_fullscreen: wl.Signal(void), request_activate: wl.Signal(void), + request_close: wl.Signal(void), + request_sticky: wl.Signal(void), + request_shaded: wl.Signal(void), + request_skip_taskbar: wl.Signal(void), + request_skip_pager: wl.Signal(void), + request_above: wl.Signal(void), + request_below: wl.Signal(void), + request_demands_attention: wl.Signal(void), associate: wl.Signal(void), dissociate: wl.Signal(void), @@ -264,13 +270,16 @@ pub const XwaylandSurface = extern struct { set_strut_partial: wl.Signal(void), set_override_redirect: wl.Signal(void), set_geometry: wl.Signal(void), + set_opacity: wl.Signal(void), + focus_in: wl.Signal(void), + grab_focus: wl.Signal(void), map_request: wl.Signal(void), ping_timeout: wl.Signal(void), }, - data: usize, + data: ?*anyopaque, extern fn wlr_xwayland_surface_activate(surface: *XwaylandSurface, activated: bool) void; pub const activate = wlr_xwayland_surface_activate; @@ -290,7 +299,7 @@ pub const XwaylandSurface = extern struct { extern fn wlr_xwayland_surface_set_minimized(surface: *XwaylandSurface, minimized: bool) void; pub const setMinimized = wlr_xwayland_surface_set_minimized; - extern fn wlr_xwayland_surface_set_maximized(surface: *XwaylandSurface, maximized: bool) void; + extern fn wlr_xwayland_surface_set_maximized(surface: *XwaylandSurface, maximized_horz: bool, maximized_vert: bool) void; pub const setMaximized = wlr_xwayland_surface_set_maximized; extern fn wlr_xwayland_surface_set_fullscreen(surface: *XwaylandSurface, fullscreen: bool) void; @@ -302,9 +311,9 @@ pub const XwaylandSurface = extern struct { extern fn wlr_xwayland_surface_ping(surface: *XwaylandSurface) void; pub const ping = wlr_xwayland_surface_ping; - extern fn wlr_xwayland_or_surface_wants_focus(surface: *const XwaylandSurface) bool; - pub const overrideRedirectWantsFocus = wlr_xwayland_or_surface_wants_focus; + extern fn wlr_xwayland_surface_override_redirect_wants_focus(surface: *const XwaylandSurface) bool; + pub const overrideRedirectWantsFocus = wlr_xwayland_surface_override_redirect_wants_focus; - extern fn wlr_xwayland_icccm_input_model(surface: *const XwaylandSurface) IcccmInputModel; + extern fn wlr_xwayland_surface_icccm_input_model(surface: *const XwaylandSurface) IcccmInputModel; pub const icccmInputModel = wlr_xwayland_icccm_input_model; }; diff --git a/tinywl/build.zig b/tinywl/build.zig index 57eaff9..7d26495 100644 --- a/tinywl/build.zig +++ b/tinywl/build.zig @@ -37,7 +37,7 @@ pub fn build(b: *std.Build) void { // exposed to the wlroots module for @cImport() to work. This seems to be // the best way to do so with the current std.Build API. wlroots.resolved_target = target; - wlroots.linkSystemLibrary("wlroots-0.18", .{}); + wlroots.linkSystemLibrary("wlroots-0.19", .{}); const tinywl = b.addExecutable(.{ .name = "tinywl",