-
-
Save LordMZTE/fc0466e366dfb009f5e73ee9c31f265a to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
install | |
└─ install mzteriver | |
└─ zig build-exe mzteriver Debug native 1 errors | |
/home/lordmzte/.local/share/zupper/installs/0.13.0/lib/std/posix.zig:222:27: error: @bitCast size mismatch: destination type 'isize' has 64 bits but source type 'c_int' has 32 bits | |
const signed: isize = @bitCast(rc); | |
^~~~~~~~~~~~ | |
referenced by: | |
dispatch: .zig-cache/o/5a42d6e10a7fabfe7f5d9fda802425d3/wayland_client.zig:72:23 | |
runCommand: src/Connection.zig:51:21 | |
remaining reference traces hidden; use '-freference-trace' to see all reference traces |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Generated by zig-wayland | |
// Copyright © 2008-2011 Kristian Høgsberg | |
// Copyright © 2010-2011 Intel Corporation | |
// Copyright © 2012-2013 Collabora, Ltd. | |
// | |
// Permission is hereby granted, free of charge, to any person | |
// obtaining a copy of this software and associated documentation files | |
// (the "Software"), to deal in the Software without restriction, | |
// including without limitation the rights to use, copy, modify, merge, | |
// publish, distribute, sublicense, and/or sell copies of the Software, | |
// and to permit persons to whom the Software is furnished to do so, | |
// subject to the following conditions: | |
// | |
// The above copyright notice and this permission notice (including the | |
// next paragraph) shall be included in all copies or substantial | |
// portions of the Software. | |
// | |
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, | |
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF | |
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND | |
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS | |
// BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN | |
// ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN | |
// CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | |
// SOFTWARE. | |
// | |
const std = @import("std"); | |
const posix = std.posix; | |
const client = @import("wayland.zig").client; | |
const common = @import("common.zig");pub const Display = opaque { | |
pub const generated_version = 1; | |
pub const getInterface = common.wl.display.getInterface;pub const Error = common.wl.display.Error; | |
pub fn setQueue(_display: *Display, _queue: *client.wl.EventQueue) void { | |
const _proxy: *client.wl.Proxy = @ptrCast(_display); | |
_proxy.setQueue(_queue); | |
}pub const Event = union(enum) {@"error": struct {object_id:?*common.Object,code:u32,message:[*:0]const u8,}, | |
delete_id: struct {id:u32,}, | |
}; | |
pub inline fn setListener( | |
_display: *Display, | |
comptime T: type, | |
_listener: *const fn (display: *Display, event: Event, data: T) void, | |
_data: T, | |
) void { | |
const _proxy: *client.wl.Proxy = @ptrCast(_display); | |
const _mut_data: ?*anyopaque = @ptrFromInt(@intFromPtr(_data)); | |
_proxy.addDispatcher(common.Dispatcher(Display, T).dispatcher, _listener, _mut_data); | |
}pub fn sync(_display: *Display) !*client.wl.Callback{const _proxy: *client.wl.Proxy = @ptrCast(_display);var _args = [_]common.Argument{.{ .o = null },}; | |
return @ptrCast(try _proxy.marshalConstructor(0, &_args, client.wl.Callback.getInterface()));} | |
pub fn getRegistry(_display: *Display) !*client.wl.Registry{const _proxy: *client.wl.Proxy = @ptrCast(_display);var _args = [_]common.Argument{.{ .o = null },}; | |
return @ptrCast(try _proxy.marshalConstructor(1, &_args, client.wl.Registry.getInterface()));} | |
extern fn wl_display_connect(name: ?[*:0]const u8) ?*Display; | |
pub inline fn connect(name: ?[*:0]const u8) error{ConnectFailed}!*Display { | |
return wl_display_connect(name) orelse return error.ConnectFailed; | |
} | |
extern fn wl_display_connect_to_fd(fd: c_int) ?*Display; | |
pub inline fn connectToFd(fd: c_int) error{ConnectFailed}!*Display { | |
return wl_display_connect_to_fd(fd) orelse return error.ConnectFailed; | |
} | |
extern fn wl_display_disconnect(display: *Display) void; | |
pub const disconnect = wl_display_disconnect; | |
extern fn wl_display_get_fd(display: *Display) c_int; | |
pub const getFd = wl_display_get_fd; | |
extern fn wl_display_dispatch(display: *Display) c_int; | |
pub inline fn dispatch(display: *Display) posix.E { | |
return posix.errno(wl_display_dispatch(display)); | |
} | |
extern fn wl_display_dispatch_queue(display: *Display, queue: *client.wl.EventQueue) c_int; | |
pub inline fn dispatchQueue(display: *Display, queue: *client.wl.EventQueue) posix.E { | |
return posix.errno(wl_display_dispatch_queue(display, queue)); | |
} | |
extern fn wl_display_dispatch_pending(display: *Display) c_int; | |
pub inline fn dispatchPending(display: *Display) posix.E { | |
return posix.errno(wl_display_dispatch_pending(display)); | |
} | |
extern fn wl_display_dispatch_queue_pending(display: *Display, queue: *client.wl.EventQueue) c_int; | |
pub inline fn dispatchQueuePending(display: *Display, queue: *client.wl.EventQueue) posix.E { | |
return posix.errno(wl_display_dispatch_queue_pending(display, queue)); | |
} | |
extern fn wl_display_roundtrip(display: *Display) c_int; | |
pub inline fn roundtrip(display: *Display) posix.E { | |
return posix.errno(wl_display_roundtrip(display)); | |
} | |
extern fn wl_display_roundtrip_queue(display: *Display, queue: *client.wl.EventQueue) c_int; | |
pub inline fn roundtripQueue(display: *Display, queue: *client.wl.EventQueue) posix.E { | |
return posix.errno(wl_display_roundtrip_queue(display, queue)); | |
} | |
extern fn wl_display_flush(display: *Display) c_int; | |
pub inline fn flush(display: *Display) posix.E { | |
return posix.errno(wl_display_flush(display)); | |
} | |
extern fn wl_display_create_queue(display: *Display) ?*client.wl.EventQueue; | |
pub inline fn createQueue(display: *Display) error{OutOfMemory}!*client.wl.EventQueue { | |
return wl_display_create_queue(display) orelse error.OutOfMemory; | |
} | |
extern fn wl_display_get_error(display: *Display) c_int; | |
pub const getError = wl_display_get_error; | |
extern fn wl_display_prepare_read_queue(display: *Display, queue: *client.wl.EventQueue) c_int; | |
/// Succeeds if the queue is empty and returns true. | |
/// Fails and returns false if the queue was not empty. | |
pub inline fn prepareReadQueue(display: *Display, queue: *client.wl.EventQueue) bool { | |
switch (wl_display_prepare_read_queue(display, queue)) { | |
0 => return true, | |
-1 => return false, | |
else => unreachable, | |
} | |
} | |
extern fn wl_display_prepare_read(display: *Display) c_int; | |
/// Succeeds if the queue is empty and returns true. | |
/// Fails and returns false if the queue was not empty. | |
pub inline fn prepareRead(display: *Display) bool { | |
switch (wl_display_prepare_read(display)) { | |
0 => return true, | |
-1 => return false, | |
else => unreachable, | |
} | |
} | |
extern fn wl_display_cancel_read(display: *Display) void; | |
pub const cancelRead = wl_display_cancel_read; | |
extern fn wl_display_read_events(display: *Display) c_int; | |
pub inline fn readEvents(display: *Display) posix.E { | |
return posix.errno(wl_display_read_events(display)); | |
} | |
}; | |
pub const Registry = opaque { | |
pub const generated_version = 1; | |
pub const getInterface = common.wl.registry.getInterface;pub fn setQueue(_registry: *Registry, _queue: *client.wl.EventQueue) void { | |
const _proxy: *client.wl.Proxy = @ptrCast(_registry); | |
_proxy.setQueue(_queue); | |
}pub const Event = union(enum) {global: struct {name:u32,interface:[*:0]const u8,version:u32,}, | |
global_remove: struct {name:u32,}, | |
}; | |
pub inline fn setListener( | |
_registry: *Registry, | |
comptime T: type, | |
_listener: *const fn (registry: *Registry, event: Event, data: T) void, | |
_data: T, | |
) void { | |
const _proxy: *client.wl.Proxy = @ptrCast(_registry); | |
const _mut_data: ?*anyopaque = @ptrFromInt(@intFromPtr(_data)); | |
_proxy.addDispatcher(common.Dispatcher(Registry, T).dispatcher, _listener, _mut_data); | |
}pub fn bind(_registry: *Registry, _name:u32, comptime T: type, _version: u32) !*T {const version_to_construct = @min(T.generated_version, _version);const _proxy: *client.wl.Proxy = @ptrCast(_registry);var _args = [_]common.Argument{.{ .u = _name},.{ .s = T.getInterface().name }, | |
.{ .u = version_to_construct },.{ .o = null },}; | |
return @ptrCast(try _proxy.marshalConstructorVersioned(0, &_args, T.getInterface(), version_to_construct));} | |
pub fn destroy(_registry: *Registry) void { | |
const _proxy: *client.wl.Proxy = @ptrCast(_registry); | |
_proxy.destroy(); | |
}}; | |
pub const Callback = opaque { | |
pub const generated_version = 1; | |
pub const getInterface = common.wl.callback.getInterface;pub fn setQueue(_callback: *Callback, _queue: *client.wl.EventQueue) void { | |
const _proxy: *client.wl.Proxy = @ptrCast(_callback); | |
_proxy.setQueue(_queue); | |
}pub const Event = union(enum) {done: struct {callback_data:u32,}, | |
}; | |
pub inline fn setListener( | |
_callback: *Callback, | |
comptime T: type, | |
_listener: *const fn (callback: *Callback, event: Event, data: T) void, | |
_data: T, | |
) void { | |
const _proxy: *client.wl.Proxy = @ptrCast(_callback); | |
const _mut_data: ?*anyopaque = @ptrFromInt(@intFromPtr(_data)); | |
_proxy.addDispatcher(common.Dispatcher(Callback, T).dispatcher, _listener, _mut_data); | |
}pub fn destroy(_callback: *Callback) void { | |
const _proxy: *client.wl.Proxy = @ptrCast(_callback); | |
_proxy.destroy(); | |
}}; | |
pub const Buffer = opaque { | |
pub const generated_version = 1; | |
pub const getInterface = common.wl.buffer.getInterface;pub fn setQueue(_buffer: *Buffer, _queue: *client.wl.EventQueue) void { | |
const _proxy: *client.wl.Proxy = @ptrCast(_buffer); | |
_proxy.setQueue(_queue); | |
}pub const Event = union(enum) {release: void,}; | |
pub inline fn setListener( | |
_buffer: *Buffer, | |
comptime T: type, | |
_listener: *const fn (buffer: *Buffer, event: Event, data: T) void, | |
_data: T, | |
) void { | |
const _proxy: *client.wl.Proxy = @ptrCast(_buffer); | |
const _mut_data: ?*anyopaque = @ptrFromInt(@intFromPtr(_data)); | |
_proxy.addDispatcher(common.Dispatcher(Buffer, T).dispatcher, _listener, _mut_data); | |
}pub fn destroy(_buffer: *Buffer) void {const _proxy: *client.wl.Proxy = @ptrCast(_buffer);_proxy.marshal(0, null);_proxy.destroy();} | |
}; | |
pub const Seat = opaque { | |
pub const generated_version = 7; | |
pub const getInterface = common.wl.seat.getInterface;pub const Capability = common.wl.seat.Capability; | |
pub const Error = common.wl.seat.Error; | |
pub fn setQueue(_seat: *Seat, _queue: *client.wl.EventQueue) void { | |
const _proxy: *client.wl.Proxy = @ptrCast(_seat); | |
_proxy.setQueue(_queue); | |
}pub const Event = union(enum) {capabilities: struct {capabilities:Capability,}, | |
name: struct {name:[*:0]const u8,}, | |
}; | |
pub inline fn setListener( | |
_seat: *Seat, | |
comptime T: type, | |
_listener: *const fn (seat: *Seat, event: Event, data: T) void, | |
_data: T, | |
) void { | |
const _proxy: *client.wl.Proxy = @ptrCast(_seat); | |
const _mut_data: ?*anyopaque = @ptrFromInt(@intFromPtr(_data)); | |
_proxy.addDispatcher(common.Dispatcher(Seat, T).dispatcher, _listener, _mut_data); | |
}pub fn getPointer(_seat: *Seat) !*client.wl.Pointer{const _proxy: *client.wl.Proxy = @ptrCast(_seat);var _args = [_]common.Argument{.{ .o = null },}; | |
return @ptrCast(try _proxy.marshalConstructor(0, &_args, client.wl.Pointer.getInterface()));} | |
pub fn getKeyboard(_seat: *Seat) !*client.wl.Keyboard{const _proxy: *client.wl.Proxy = @ptrCast(_seat);var _args = [_]common.Argument{.{ .o = null },}; | |
return @ptrCast(try _proxy.marshalConstructor(1, &_args, client.wl.Keyboard.getInterface()));} | |
pub fn getTouch(_seat: *Seat) !*client.wl.Touch{const _proxy: *client.wl.Proxy = @ptrCast(_seat);var _args = [_]common.Argument{.{ .o = null },}; | |
return @ptrCast(try _proxy.marshalConstructor(2, &_args, client.wl.Touch.getInterface()));} | |
pub fn release(_seat: *Seat) void {const _proxy: *client.wl.Proxy = @ptrCast(_seat);_proxy.marshal(3, null);_proxy.destroy();} | |
pub fn destroy(_seat: *Seat) void { | |
const _proxy: *client.wl.Proxy = @ptrCast(_seat); | |
_proxy.destroy(); | |
}}; | |
pub const Pointer = opaque { | |
pub const generated_version = 7; | |
pub const getInterface = common.wl.pointer.getInterface;pub const Error = common.wl.pointer.Error; | |
pub const ButtonState = common.wl.pointer.ButtonState; | |
pub const Axis = common.wl.pointer.Axis; | |
pub const AxisSource = common.wl.pointer.AxisSource; | |
pub const AxisRelativeDirection = common.wl.pointer.AxisRelativeDirection; | |
pub fn setQueue(_pointer: *Pointer, _queue: *client.wl.EventQueue) void { | |
const _proxy: *client.wl.Proxy = @ptrCast(_pointer); | |
_proxy.setQueue(_queue); | |
}pub const Event = union(enum) {enter: struct {serial:u32,surface:?*client.wl.Surface,surface_x:common.Fixed,surface_y:common.Fixed,}, | |
leave: struct {serial:u32,surface:?*client.wl.Surface,}, | |
motion: struct {time:u32,surface_x:common.Fixed,surface_y:common.Fixed,}, | |
button: struct {serial:u32,time:u32,button:u32,state:ButtonState,}, | |
axis: struct {time:u32,axis:Axis,value:common.Fixed,}, | |
frame: void,axis_source: struct {axis_source:AxisSource,}, | |
axis_stop: struct {time:u32,axis:Axis,}, | |
axis_discrete: struct {axis:Axis,discrete:i32,}, | |
}; | |
pub inline fn setListener( | |
_pointer: *Pointer, | |
comptime T: type, | |
_listener: *const fn (pointer: *Pointer, event: Event, data: T) void, | |
_data: T, | |
) void { | |
const _proxy: *client.wl.Proxy = @ptrCast(_pointer); | |
const _mut_data: ?*anyopaque = @ptrFromInt(@intFromPtr(_data)); | |
_proxy.addDispatcher(common.Dispatcher(Pointer, T).dispatcher, _listener, _mut_data); | |
}pub fn setCursor(_pointer: *Pointer, _serial:u32, _surface:?*client.wl.Surface, _hotspot_x:i32, _hotspot_y:i32) void {const _proxy: *client.wl.Proxy = @ptrCast(_pointer);var _args = [_]common.Argument{.{ .u = _serial},.{ .o = @ptrCast(_surface) },.{ .i = _hotspot_x},.{ .i = _hotspot_y},}; | |
_proxy.marshal(0, &_args);} | |
pub fn release(_pointer: *Pointer) void {const _proxy: *client.wl.Proxy = @ptrCast(_pointer);_proxy.marshal(1, null);_proxy.destroy();} | |
pub fn destroy(_pointer: *Pointer) void { | |
const _proxy: *client.wl.Proxy = @ptrCast(_pointer); | |
_proxy.destroy(); | |
}}; | |
pub const Keyboard = opaque { | |
pub const generated_version = 7; | |
pub const getInterface = common.wl.keyboard.getInterface;pub const KeymapFormat = common.wl.keyboard.KeymapFormat; | |
pub const KeyState = common.wl.keyboard.KeyState; | |
pub fn setQueue(_keyboard: *Keyboard, _queue: *client.wl.EventQueue) void { | |
const _proxy: *client.wl.Proxy = @ptrCast(_keyboard); | |
_proxy.setQueue(_queue); | |
}pub const Event = union(enum) {keymap: struct {format:KeymapFormat,fd:i32,size:u32,}, | |
enter: struct {serial:u32,surface:?*client.wl.Surface,keys:*common.Array,}, | |
leave: struct {serial:u32,surface:?*client.wl.Surface,}, | |
key: struct {serial:u32,time:u32,key:u32,state:KeyState,}, | |
modifiers: struct {serial:u32,mods_depressed:u32,mods_latched:u32,mods_locked:u32,group:u32,}, | |
repeat_info: struct {rate:i32,delay:i32,}, | |
}; | |
pub inline fn setListener( | |
_keyboard: *Keyboard, | |
comptime T: type, | |
_listener: *const fn (keyboard: *Keyboard, event: Event, data: T) void, | |
_data: T, | |
) void { | |
const _proxy: *client.wl.Proxy = @ptrCast(_keyboard); | |
const _mut_data: ?*anyopaque = @ptrFromInt(@intFromPtr(_data)); | |
_proxy.addDispatcher(common.Dispatcher(Keyboard, T).dispatcher, _listener, _mut_data); | |
}pub fn release(_keyboard: *Keyboard) void {const _proxy: *client.wl.Proxy = @ptrCast(_keyboard);_proxy.marshal(0, null);_proxy.destroy();} | |
pub fn destroy(_keyboard: *Keyboard) void { | |
const _proxy: *client.wl.Proxy = @ptrCast(_keyboard); | |
_proxy.destroy(); | |
}}; | |
pub const Touch = opaque { | |
pub const generated_version = 7; | |
pub const getInterface = common.wl.touch.getInterface;pub fn setQueue(_touch: *Touch, _queue: *client.wl.EventQueue) void { | |
const _proxy: *client.wl.Proxy = @ptrCast(_touch); | |
_proxy.setQueue(_queue); | |
}pub const Event = union(enum) {down: struct {serial:u32,time:u32,surface:?*client.wl.Surface,id:i32,x:common.Fixed,y:common.Fixed,}, | |
up: struct {serial:u32,time:u32,id:i32,}, | |
motion: struct {time:u32,id:i32,x:common.Fixed,y:common.Fixed,}, | |
frame: void,cancel: void,shape: struct {id:i32,major:common.Fixed,minor:common.Fixed,}, | |
orientation: struct {id:i32,orientation:common.Fixed,}, | |
}; | |
pub inline fn setListener( | |
_touch: *Touch, | |
comptime T: type, | |
_listener: *const fn (touch: *Touch, event: Event, data: T) void, | |
_data: T, | |
) void { | |
const _proxy: *client.wl.Proxy = @ptrCast(_touch); | |
const _mut_data: ?*anyopaque = @ptrFromInt(@intFromPtr(_data)); | |
_proxy.addDispatcher(common.Dispatcher(Touch, T).dispatcher, _listener, _mut_data); | |
}pub fn release(_touch: *Touch) void {const _proxy: *client.wl.Proxy = @ptrCast(_touch);_proxy.marshal(0, null);_proxy.destroy();} | |
pub fn destroy(_touch: *Touch) void { | |
const _proxy: *client.wl.Proxy = @ptrCast(_touch); | |
_proxy.destroy(); | |
}}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment