GizStack
View .mdOpen in ChatGPTOpen in Claude

gizlang/libwayland

the Wayland client library of a Linux desktop (libwayland-client), beside the wire (client.giz). A window of gizlang/window speaks through it on Linux, so its wl_surface is one a GPU driver can draw into (Vulkan's and EGL's Wayland surfaces take libwayland objects). GizOS has no libwayland: its windows speak the wire themselves (gizlang/wayland). Each declaration has the C function's own types: a pointer is u64, an int i32, a uint32_t u32.

gizlang
import * as Libwayland from "gizlang/libwayland";

Functions

wl_display_connect

gizlang
function wl_display_connect(name: u64): u64 from LIBWAYLAND

Connects to the compositor named NAME (a C string; 0: WAYLAND_DISPLAY): the wl_display, or 0.

Effects: fail, io, alloc.

wl_display_connect_to_fd

gizlang
function wl_display_connect_to_fd(fd: i32): u64 from LIBWAYLAND

Connects over the open socket FD: the wl_display, or 0.

Effects: fail, io, alloc.

wl_display_disconnect

gizlang
function wl_display_disconnect(display: u64): void from LIBWAYLAND

Closes the connection of DISPLAY and frees it.

Effects: fail, io, alloc.

wl_display_get_fd

gizlang
function wl_display_get_fd(display: u64): i32 from LIBWAYLAND

The socket of DISPLAY, to poll for events.

Effects: fail, io, alloc.

wl_display_flush

gizlang
function wl_display_flush(display: u64): i32 from LIBWAYLAND

Sends the requests that DISPLAY holds: the bytes sent, or -1.

Effects: fail, io, alloc.

wl_display_prepare_read

gizlang
function wl_display_prepare_read(display: u64): i32 from LIBWAYLAND

Readies DISPLAY to read events from its socket: 0, or -1 when events wait to be dispatched first.

Effects: fail, io, alloc.

wl_display_read_events

gizlang
function wl_display_read_events(display: u64): i32 from LIBWAYLAND

Reads the events on the socket of DISPLAY after prepare_read: 0, or -1.

Effects: fail, io, alloc.

wl_display_cancel_read

gizlang
function wl_display_cancel_read(display: u64): void from LIBWAYLAND

Ends a prepare_read of DISPLAY that reads nothing.

Effects: fail, io, alloc.

wl_display_dispatch_pending

gizlang
function wl_display_dispatch_pending(display: u64): i32 from LIBWAYLAND

Runs the dispatchers of the events that DISPLAY has read: their count, or -1.

Effects: fail, io, alloc.

wl_display_get_error

gizlang
function wl_display_get_error(display: u64): i32 from LIBWAYLAND

The last error of DISPLAY (an errno), or 0.

Effects: fail, io, alloc.

wl_proxy_marshal_array_flags

gizlang
function wl_proxy_marshal_array_flags(proxy: u64, opcode: u32, made: u64, version: u32, flags: u32, args: u64): u64 from LIBWAYLAND

Sends request OPCODE of PROXY with the wl_argument array ARGS; MADE is the interface of a new object: it, or 0.

Effects: fail, io, alloc.

wl_proxy_add_dispatcher

gizlang
function wl_proxy_add_dispatcher(proxy: u64, dispatcher: (implementation: u64, proxy: u64, opcode: u32, message: u64, args: u64) => i32, implementation: u64, data: u64): i32 from LIBWAYLAND

Sets DISPATCHER for every event of PROXY: its opcode, its wl_message and its wl_argument array.

Effects: fail, io, alloc.

wl_proxy_get_version

gizlang
function wl_proxy_get_version(proxy: u64): u32 from LIBWAYLAND

The interface version of PROXY.

Effects: fail, io, alloc.

wl_proxy_set_user_data

gizlang
function wl_proxy_set_user_data(proxy: u64, data: u64): void from LIBWAYLAND

Keeps DATA with PROXY.

Effects: fail, io, alloc.

wl_proxy_get_user_data

gizlang
function wl_proxy_get_user_data(proxy: u64): u64 from LIBWAYLAND

The data kept with PROXY.

Effects: fail, io, alloc.