xdg_shell_client.zig(1)

glfmn.io xdg_shell_client.zig(1)
Name

xdg_shell_client.zig

generated by zig-wayland via a build.zig file.

Description

This file gets generated using the zig-wayland Scanner at build time and placed in the zig-cache/o directory.

build.zig
27const scanner = Scanner.create(b, .{});
28const wayland = b.createModule(.{ .source_file = scanner.result });
29
30scanner.addSystemProtocol("stable/xdg-shell/xdg-shell.xml");
31scanner.generate("xdg_wm_base", 1);
32
33exe.addModule("wayland", wayland);
34exe.linkLibC();
35exe.linkSystemLibrary("wayland-client");

It is generated from xdg-shell.xml.

Contents

1// Generated by zig-wayland
2
3// Copyright © 2008-2013 Kristian Høgsberg
4// Copyright © 2013 Rafael Antognolli
5// Copyright © 2013 Jasper St. Pierre
6// Copyright © 2010-2013 Intel Corporation
7// Copyright © 2015-2017 Samsung Electronics Co., Ltd
8// Copyright © 2015-2017 Red Hat Inc.
9//
10// Permission is hereby granted, free of charge, to any person obtaining a
11// copy of this software and associated documentation files (the "Software"),
12// to deal in the Software without restriction, including without limitation
13// the rights to use, copy, modify, merge, publish, distribute, sublicense,
14// and/or sell copies of the Software, and to permit persons to whom the
15// Software is furnished to do so, subject to the following conditions:
16//
17// The above copyright notice and this permission notice (including the next
18// paragraph) shall be included in all copies or substantial portions of the
19// Software.
20//
21// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
22// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
23// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
24// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
25// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
26// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
27// DEALINGS IN THE SOFTWARE.
28//
29
30const std = @import("std");
31const os = std.os;
32const client = @import("wayland.zig").client;
33const common = @import("common.zig");
34pub const WmBase = opaque {
35 pub const generated_version = 1;
36 pub const getInterface = common.xdg.wm_base.getInterface;
37 pub const Error = common.xdg.wm_base.Error;
38 pub fn setQueue(_wm_base: *WmBase, _queue: *client.wl.EventQueue) void {
39 const _proxy: *client.wl.Proxy = @ptrCast(_wm_base);
40 _proxy.setQueue(_queue);
41 }
42 pub const Event = union(enum) {
43 ping: struct {
44 serial: u32,
45 },
46 };
47 pub inline fn setListener(
48 _wm_base: *WmBase,
49 comptime T: type,
50 _listener: *const fn (wm_base: *WmBase, event: Event, data: T) void,
51 _data: T,
52 ) void {
53 const _proxy: *client.wl.Proxy = @ptrCast(_wm_base);
54 const _mut_data: ?*anyopaque = @ptrFromInt(@intFromPtr(_data));
55 _proxy.addDispatcher(common.Dispatcher(WmBase, T).dispatcher, _listener, _mut_data);
56 }
57 pub fn destroy(_wm_base: *WmBase) void {
58 const _proxy: *client.wl.Proxy = @ptrCast(_wm_base);
59 _proxy.marshal(0, null);
60 _proxy.destroy();
61 }
62 pub fn createPositioner(_wm_base: *WmBase) !*client.xdg.Positioner {
63 const _proxy: *client.wl.Proxy = @ptrCast(_wm_base);
64 var _args = [_]common.Argument{
65 .{ .o = null },
66 };
67 return @ptrCast(try _proxy.marshalConstructor(1, &_args, client.xdg.Positioner.getInterface()));
68 }
69 pub fn getXdgSurface(_wm_base: *WmBase, _surface: *client.wl.Surface) !*client.xdg.Surface {
70 const _proxy: *client.wl.Proxy = @ptrCast(_wm_base);
71 var _args = [_]common.Argument{
72 .{ .o = null },
73 .{ .o = @ptrCast(_surface) },
74 };
75 return @ptrCast(try _proxy.marshalConstructor(2, &_args, client.xdg.Surface.getInterface()));
76 }
77 pub fn pong(_wm_base: *WmBase, _serial: u32) void {
78 const _proxy: *client.wl.Proxy = @ptrCast(_wm_base);
79 var _args = [_]common.Argument{
80 .{ .u = _serial },
81 };
82 _proxy.marshal(3, &_args);
83 }
84};
85pub const Positioner = opaque {
86 pub const generated_version = 1;
87 pub const getInterface = common.xdg.positioner.getInterface;
88 pub const Error = common.xdg.positioner.Error;
89 pub const Anchor = common.xdg.positioner.Anchor;
90 pub const Gravity = common.xdg.positioner.Gravity;
91 pub const ConstraintAdjustment = common.xdg.positioner.ConstraintAdjustment;
92 pub fn setQueue(_positioner: *Positioner, _queue: *client.wl.EventQueue) void {
93 const _proxy: *client.wl.Proxy = @ptrCast(_positioner);
94 _proxy.setQueue(_queue);
95 }
96 pub fn destroy(_positioner: *Positioner) void {
97 const _proxy: *client.wl.Proxy = @ptrCast(_positioner);
98 _proxy.marshal(0, null);
99 _proxy.destroy();
100 }
101 pub fn setSize(_positioner: *Positioner, _width: i32, _height: i32) void {
102 const _proxy: *client.wl.Proxy = @ptrCast(_positioner);
103 var _args = [_]common.Argument{
104 .{ .i = _width },
105 .{ .i = _height },
106 };
107 _proxy.marshal(1, &_args);
108 }
109 pub fn setAnchorRect(_positioner: *Positioner, _x: i32, _y: i32, _width: i32, _height: i32) void {
110 const _proxy: *client.wl.Proxy = @ptrCast(_positioner);
111 var _args = [_]common.Argument{
112 .{ .i = _x },
113 .{ .i = _y },
114 .{ .i = _width },
115 .{ .i = _height },
116 };
117 _proxy.marshal(2, &_args);
118 }
119 pub fn setAnchor(_positioner: *Positioner, _anchor: Anchor) void {
120 const _proxy: *client.wl.Proxy = @ptrCast(_positioner);
121 var _args = [_]common.Argument{
122 .{ .u = switch (@typeInfo(Anchor)) {
123 .Enum => @as(u32, @intCast(@intFromEnum(_anchor))),
124 .Struct => @bitCast(_anchor),
125 else => unreachable,
126 } },
127 };
128 _proxy.marshal(3, &_args);
129 }
130 pub fn setGravity(_positioner: *Positioner, _gravity: Gravity) void {
131 const _proxy: *client.wl.Proxy = @ptrCast(_positioner);
132 var _args = [_]common.Argument{
133 .{ .u = switch (@typeInfo(Gravity)) {
134 .Enum => @as(u32, @intCast(@intFromEnum(_gravity))),
135 .Struct => @bitCast(_gravity),
136 else => unreachable,
137 } },
138 };
139 _proxy.marshal(4, &_args);
140 }
141 pub fn setConstraintAdjustment(_positioner: *Positioner, _constraint_adjustment: u32) void {
142 const _proxy: *client.wl.Proxy = @ptrCast(_positioner);
143 var _args = [_]common.Argument{
144 .{ .u = _constraint_adjustment },
145 };
146 _proxy.marshal(5, &_args);
147 }
148 pub fn setOffset(_positioner: *Positioner, _x: i32, _y: i32) void {
149 const _proxy: *client.wl.Proxy = @ptrCast(_positioner);
150 var _args = [_]common.Argument{
151 .{ .i = _x },
152 .{ .i = _y },
153 };
154 _proxy.marshal(6, &_args);
155 }
156};
157pub const Surface = opaque {
158 pub const generated_version = 1;
159 pub const getInterface = common.xdg.surface.getInterface;
160 pub const Error = common.xdg.surface.Error;
161 pub fn setQueue(_surface: *Surface, _queue: *client.wl.EventQueue) void {
162 const _proxy: *client.wl.Proxy = @ptrCast(_surface);
163 _proxy.setQueue(_queue);
164 }
165 pub const Event = union(enum) {
166 configure: struct {
167 serial: u32,
168 },
169 };
170 pub inline fn setListener(
171 _surface: *Surface,
172 comptime T: type,
173 _listener: *const fn (surface: *Surface, event: Event, data: T) void,
174 _data: T,
175 ) void {
176 const _proxy: *client.wl.Proxy = @ptrCast(_surface);
177 const _mut_data: ?*anyopaque = @ptrFromInt(@intFromPtr(_data));
178 _proxy.addDispatcher(common.Dispatcher(Surface, T).dispatcher, _listener, _mut_data);
179 }
180 pub fn destroy(_surface: *Surface) void {
181 const _proxy: *client.wl.Proxy = @ptrCast(_surface);
182 _proxy.marshal(0, null);
183 _proxy.destroy();
184 }
185 pub fn getToplevel(_surface: *Surface) !*client.xdg.Toplevel {
186 const _proxy: *client.wl.Proxy = @ptrCast(_surface);
187 var _args = [_]common.Argument{
188 .{ .o = null },
189 };
190 return @ptrCast(try _proxy.marshalConstructor(1, &_args, client.xdg.Toplevel.getInterface()));
191 }
192 pub fn getPopup(_surface: *Surface, _parent: ?*client.xdg.Surface, _positioner: *client.xdg.Positioner) !*client.xdg.Popup {
193 const _proxy: *client.wl.Proxy = @ptrCast(_surface);
194 var _args = [_]common.Argument{
195 .{ .o = null },
196 .{ .o = @ptrCast(_parent) },
197 .{ .o = @ptrCast(_positioner) },
198 };
199 return @ptrCast(try _proxy.marshalConstructor(2, &_args, client.xdg.Popup.getInterface()));
200 }
201 pub fn setWindowGeometry(_surface: *Surface, _x: i32, _y: i32, _width: i32, _height: i32) void {
202 const _proxy: *client.wl.Proxy = @ptrCast(_surface);
203 var _args = [_]common.Argument{
204 .{ .i = _x },
205 .{ .i = _y },
206 .{ .i = _width },
207 .{ .i = _height },
208 };
209 _proxy.marshal(3, &_args);
210 }
211 pub fn ackConfigure(_surface: *Surface, _serial: u32) void {
212 const _proxy: *client.wl.Proxy = @ptrCast(_surface);
213 var _args = [_]common.Argument{
214 .{ .u = _serial },
215 };
216 _proxy.marshal(4, &_args);
217 }
218};
219pub const Toplevel = opaque {
220 pub const generated_version = 1;
221 pub const getInterface = common.xdg.toplevel.getInterface;
222 pub const Error = common.xdg.toplevel.Error;
223 pub const ResizeEdge = common.xdg.toplevel.ResizeEdge;
224 pub const State = common.xdg.toplevel.State;
225 pub fn setQueue(_toplevel: *Toplevel, _queue: *client.wl.EventQueue) void {
226 const _proxy: *client.wl.Proxy = @ptrCast(_toplevel);
227 _proxy.setQueue(_queue);
228 }
229 pub const Event = union(enum) {
230 configure: struct {
231 width: i32,
232 height: i32,
233 states: *common.Array,
234 },
235 close: void,
236 };
237 pub inline fn setListener(
238 _toplevel: *Toplevel,
239 comptime T: type,
240 _listener: *const fn (toplevel: *Toplevel, event: Event, data: T) void,
241 _data: T,
242 ) void {
243 const _proxy: *client.wl.Proxy = @ptrCast(_toplevel);
244 const _mut_data: ?*anyopaque = @ptrFromInt(@intFromPtr(_data));
245 _proxy.addDispatcher(common.Dispatcher(Toplevel, T).dispatcher, _listener, _mut_data);
246 }
247 pub fn destroy(_toplevel: *Toplevel) void {
248 const _proxy: *client.wl.Proxy = @ptrCast(_toplevel);
249 _proxy.marshal(0, null);
250 _proxy.destroy();
251 }
252 pub fn setParent(_toplevel: *Toplevel, _parent: ?*client.xdg.Toplevel) void {
253 const _proxy: *client.wl.Proxy = @ptrCast(_toplevel);
254 var _args = [_]common.Argument{
255 .{ .o = @ptrCast(_parent) },
256 };
257 _proxy.marshal(1, &_args);
258 }
259 pub fn setTitle(_toplevel: *Toplevel, _title: [*:0]const u8) void {
260 const _proxy: *client.wl.Proxy = @ptrCast(_toplevel);
261 var _args = [_]common.Argument{
262 .{ .s = _title },
263 };
264 _proxy.marshal(2, &_args);
265 }
266 pub fn setAppId(_toplevel: *Toplevel, _app_id: [*:0]const u8) void {
267 const _proxy: *client.wl.Proxy = @ptrCast(_toplevel);
268 var _args = [_]common.Argument{
269 .{ .s = _app_id },
270 };
271 _proxy.marshal(3, &_args);
272 }
273 pub fn showWindowMenu(_toplevel: *Toplevel, _seat: *client.wl.Seat, _serial: u32, _x: i32, _y: i32) void {
274 const _proxy: *client.wl.Proxy = @ptrCast(_toplevel);
275 var _args = [_]common.Argument{
276 .{ .o = @ptrCast(_seat) },
277 .{ .u = _serial },
278 .{ .i = _x },
279 .{ .i = _y },
280 };
281 _proxy.marshal(4, &_args);
282 }
283 pub fn move(_toplevel: *Toplevel, _seat: *client.wl.Seat, _serial: u32) void {
284 const _proxy: *client.wl.Proxy = @ptrCast(_toplevel);
285 var _args = [_]common.Argument{
286 .{ .o = @ptrCast(_seat) },
287 .{ .u = _serial },
288 };
289 _proxy.marshal(5, &_args);
290 }
291 pub fn resize(_toplevel: *Toplevel, _seat: *client.wl.Seat, _serial: u32, _edges: ResizeEdge) void {
292 const _proxy: *client.wl.Proxy = @ptrCast(_toplevel);
293 var _args = [_]common.Argument{
294 .{ .o = @ptrCast(_seat) }, .{ .u = _serial }, .{ .u = switch (@typeInfo(ResizeEdge)) {
295 .Enum => @as(u32, @intCast(@intFromEnum(_edges))),
296 .Struct => @bitCast(_edges),
297 else => unreachable,
298 } },
299 };
300 _proxy.marshal(6, &_args);
301 }
302 pub fn setMaxSize(_toplevel: *Toplevel, _width: i32, _height: i32) void {
303 const _proxy: *client.wl.Proxy = @ptrCast(_toplevel);
304 var _args = [_]common.Argument{
305 .{ .i = _width },
306 .{ .i = _height },
307 };
308 _proxy.marshal(7, &_args);
309 }
310 pub fn setMinSize(_toplevel: *Toplevel, _width: i32, _height: i32) void {
311 const _proxy: *client.wl.Proxy = @ptrCast(_toplevel);
312 var _args = [_]common.Argument{
313 .{ .i = _width },
314 .{ .i = _height },
315 };
316 _proxy.marshal(8, &_args);
317 }
318 pub fn setMaximized(_toplevel: *Toplevel) void {
319 const _proxy: *client.wl.Proxy = @ptrCast(_toplevel);
320 _proxy.marshal(9, null);
321 }
322 pub fn unsetMaximized(_toplevel: *Toplevel) void {
323 const _proxy: *client.wl.Proxy = @ptrCast(_toplevel);
324 _proxy.marshal(10, null);
325 }
326 pub fn setFullscreen(_toplevel: *Toplevel, _output: ?*client.wl.Output) void {
327 const _proxy: *client.wl.Proxy = @ptrCast(_toplevel);
328 var _args = [_]common.Argument{
329 .{ .o = @ptrCast(_output) },
330 };
331 _proxy.marshal(11, &_args);
332 }
333 pub fn unsetFullscreen(_toplevel: *Toplevel) void {
334 const _proxy: *client.wl.Proxy = @ptrCast(_toplevel);
335 _proxy.marshal(12, null);
336 }
337 pub fn setMinimized(_toplevel: *Toplevel) void {
338 const _proxy: *client.wl.Proxy = @ptrCast(_toplevel);
339 _proxy.marshal(13, null);
340 }
341};
342pub const Popup = opaque {
343 pub const generated_version = 1;
344 pub const getInterface = common.xdg.popup.getInterface;
345 pub const Error = common.xdg.popup.Error;
346 pub fn setQueue(_popup: *Popup, _queue: *client.wl.EventQueue) void {
347 const _proxy: *client.wl.Proxy = @ptrCast(_popup);
348 _proxy.setQueue(_queue);
349 }
350 pub const Event = union(enum) {
351 configure: struct {
352 x: i32,
353 y: i32,
354 width: i32,
355 height: i32,
356 },
357 popup_done: void,
358 };
359 pub inline fn setListener(
360 _popup: *Popup,
361 comptime T: type,
362 _listener: *const fn (popup: *Popup, event: Event, data: T) void,
363 _data: T,
364 ) void {
365 const _proxy: *client.wl.Proxy = @ptrCast(_popup);
366 const _mut_data: ?*anyopaque = @ptrFromInt(@intFromPtr(_data));
367 _proxy.addDispatcher(common.Dispatcher(Popup, T).dispatcher, _listener, _mut_data);
368 }
369 pub fn destroy(_popup: *Popup) void {
370 const _proxy: *client.wl.Proxy = @ptrCast(_popup);
371 _proxy.marshal(0, null);
372 _proxy.destroy();
373 }
374 pub fn grab(_popup: *Popup, _seat: *client.wl.Seat, _serial: u32) void {
375 const _proxy: *client.wl.Proxy = @ptrCast(_popup);
376 var _args = [_]common.Argument{
377 .{ .o = @ptrCast(_seat) },
378 .{ .u = _serial },
379 };
380 _proxy.marshal(1, &_args);
381 }
382};

References

This page is referenced by the following documents: