Skip to documentation
SLOP

tiny.wayland.runtime

Reference tiny.wayland runtime

Defined in tiny.wayland.

API (85)

Actions

Public operations.

Types and contracts

Public types and contracts.

Namespaces

Public namespaces.

Values and defaults

Public values and defaults.

No direct callersNo direct callstiny.waylandruntime
Static calls · unresolved targets: unknown · external targets: unknown.

Source

Source: lib/wayland/src/runtime/client.zig:36

zig
pub const Capacity = struct {    transport: wayland.TransportCapacity,    request_encoder: wayland.protocol.value.EncoderCapacity,    event_storage: event.Capacity,    event_creations: creation.Capacity,    client_ids: wayland.ids.Capacity,    objects: object_model.Capacity,    globals: global_state.Capacity,    total_requested_bytes: usize,    pub fn derive(limits: Limits) CapacityError!Capacity {        const transport = try wayland.TransportCapacity.derive(limits.transport);        const request_encoder = try wayland.protocol.value.EncoderCapacity.derive(.{            .payload_byte_count = @min(                transport.outbound_byte_count - wayland.wire.header_size,                wayland.protocol.value.maximum_payload_size,            ),            .descriptor_count = @min(                transport.outbound_descriptor_count,                sys.ancillary.maximum_descriptors,            ),        });        const event_storage = try event.Capacity.derive(.{            .payload_byte_count = @min(                transport.inbound_byte_count - wayland.wire.header_size,                wayland.protocol.value.maximum_payload_size,            ),            .descriptor_count = @min(                transport.inbound_descriptor_count,                event.maximum_descriptor_count,            ),        });        const event_creations = creation.default_capacity;        const client_ids = try wayland.ids.Capacity.derive(.{            .client_id_count = limits.client_object_count,        });        const objects = try object_model.Capacity.derive(.{            .client_object_count = limits.client_object_count,            .server_object_count = limits.server_object_count,        });        const globals = try global_state.Capacity.derive(.{            .retained_global_count = limits.retained_global_count,            .interface_name_byte_count_per_global = limits.global_interface_name_byte_count,        });        const total_requested_bytes = try totalRequestedBytes(&.{            transport.total_requested_bytes,            request_encoder.total_requested_bytes,            event_storage.total_requested_bytes,            event_creations.total_requested_bytes,            client_ids.total_requested_bytes,            objects.total_requested_bytes,            globals.total_requested_bytes,        });        return .{            .transport = transport,            .request_encoder = request_encoder,            .event_storage = event_storage,            .event_creations = event_creations,            .client_ids = client_ids,            .objects = objects,            .globals = globals,            .total_requested_bytes = total_requested_bytes,        };    }};

Source: lib/wayland/src/runtime/client.zig:175

zig
pub const Client = struct {    transport: wayland.Transport,    catalog: catalog_model.Catalog,    ids: wayland.ids.Pool,    objects: object_model.Table,    globals: global_state.Set,    encoder: wayland.protocol.value.Encoder,    event_storage: event.Storage,    event_creations: creation.Storage,    fatal_state: ?event.FatalView = null,    terminal_error: ?anyerror = null,    pub fn connect(        session_allocator: std.mem.Allocator,        capacity: Capacity,    ) !Client {        var initial_storage = try InitialStorage.init(session_allocator, capacity);        errdefer initial_storage.deinit();        const transport = try wayland.connect(session_allocator, capacity.transport);        return initOwnedParts(transport, &initial_storage);    }    pub fn connectNamed(        session_allocator: std.mem.Allocator,        display_name: []const u8,        capacity: Capacity,    ) !Client {        var initial_storage = try InitialStorage.init(session_allocator, capacity);        errdefer initial_storage.deinit();        const transport = try wayland.connectNamed(            session_allocator,            display_name,            capacity.transport,        );        return initOwnedParts(transport, &initial_storage);    }    pub fn initOwned(        session_allocator: std.mem.Allocator,        owned_descriptor: sys.fd.Descriptor,        capacity: Capacity,    ) !Client {        var initial_storage = InitialStorage.init(session_allocator, capacity) catch |err| {            sys.fd.close(owned_descriptor);            return err;        };        errdefer initial_storage.deinit();        const transport = try wayland.Transport.initOwned(            session_allocator,            owned_descriptor,            capacity.transport,        );        return initOwnedParts(transport, &initial_storage);    }    fn initOwnedParts(        transport: wayland.Transport,        initial_storage: *InitialStorage,    ) Client {        const catalog = catalog_model.Catalog.standard();        const client: Client = .{            .transport = transport,            .catalog = catalog,            .ids = initial_storage.ids,            .objects = initial_storage.objects,            .globals = initial_storage.globals,            .encoder = initial_storage.encoder,            .event_storage = initial_storage.event_storage,            .event_creations = initial_storage.event_creations,        };        initial_storage.* = undefined;        return client;    }    pub fn deinit(self: *Client) void {        self.event_creations.deinit();        self.event_storage.deinit();        self.encoder.deinit();        self.globals.deinit();        self.objects.deinit();        self.ids.deinit();        self.transport.deinit();        self.* = undefined;    }    pub fn fatal(self: *const Client) ?event.FatalView {        const state = self.fatal_state orelse return null;        return .{            .object_id = state.object_id,            .code = state.code,            .message = state.message,        };    }    pub fn descriptor(self: *const Client) sys.fd.Descriptor {        return self.transport.descriptor;    }    pub fn storageStatus(self: *const Client) StorageStatus {        return .{            .transport = self.transport.status(),            .request_encoder = self.encoder.status(),            .event_storage = self.event_storage.status(),            .event_creations = self.event_creations.status(),            .client_ids = self.ids.status(),            .objects = self.objects.status(),            .globals = self.globals.status(),        };    }    pub fn object(self: *const Client, id: u32) ?object_model.Entry {        return self.objects.getLive(id);    }    pub fn global(self: *const Client, registry_id: u32, name: u32) ?event.GlobalView {        const item = self.globals.get(registry_id, name) orelse return null;        return .{            .registry_id = item.registry_id,            .name = item.name,            .interface = item.interface,            .version = item.version,        };    }    pub fn sync(self: *Client) !u32 {        var created: [1]u32 = undefined;        try self.request(            wayland.ids.display_id,            0,            &.{.{ .new_id = .fixed }},            &created,        );        return created[0];    }    pub fn getRegistry(self: *Client) !u32 {        var created: [1]u32 = undefined;        try self.request(            wayland.ids.display_id,            1,            &.{.{ .new_id = .fixed }},            &created,        );        return created[0];    }    pub fn bind(        self: *Client,        registry_id: u32,        name: u32,        interface: *const wayland.protocol.schema.Interface,        version: u32,    ) !u32 {        try self.ensureActive();        const registry_interface = try self.catalog.require("wl_registry");        const registry = try self.objects.requireLive(registry_id);        if (registry.interface != registry_interface) return error.NotRegistry;        const canonical = try self.catalog.canonical(interface);        const advertised = try self.globals.require(registry_id, name);        if (!std.mem.eql(u8, advertised.interface, canonical.name)) {            return error.InterfaceMismatch;        }        if (version == 0 or version > advertised.version or version > canonical.version) {            return error.InvalidVersion;        }        var created: [1]u32 = undefined;        try self.request(            registry_id,            0,            &.{                .{ .uint = name },                .{ .new_id = .{ .dynamic = .{                    .interface = canonical.name,                    .version = version,                } } },            },            &created,        );        return created[0];    }    pub fn request(        self: *Client,        object_id: u32,        opcode: u16,        values: []const request_model.Value,        created_ids: []u32,    ) !void {        try self.ensureActive();        const parent = try self.objects.requireLive(object_id);        const metadata = parent.interface.request(opcode) orelse {            return error.UnknownRequestOpcode;        };        if (!metadata.supportedBy(parent.version)) return error.UnsupportedRequestVersion;        if (metadata.destructor and parent.origin == .display) return error.CannotDestroyDisplay;        const prepared = try request_model.prepare(            &self.ids,            &self.objects,            self.catalog,            &self.encoder,            parent,            metadata,            values,            created_ids,        );        errdefer request_model.rollback(&self.ids, &self.objects, prepared.created_ids);        try self.transport.queueOwned(            object_id,            metadata.opcode,            prepared.encoded.payload,            prepared.encoded.descriptors,        );        if (metadata.destructor) {            lifecycle.retire(                &self.ids,                &self.objects,                object_id,                parent,                .retired_request,            );        }    }    pub fn flush(self: *Client) !wayland.stream.FlushStatus {        try self.ensureActive();        return self.transport.flush() catch |err| {            self.terminal_error = err;            return err;        };    }    pub fn step(self: *Client) !event.Step {        try self.ensureActive();        self.event_storage.reset();        return dispatch.step(self);    }    fn ensureActive(self: *const Client) !void {        if (self.terminal_error) |err| return err;    }};

Source: lib/wayland/src/runtime/client.zig:19

zig
pub const Limits = struct {    transport: wayland.TransportLimits = .{},    client_object_count: usize = object_model.default_client_object_count,    server_object_count: usize = object_model.default_server_object_count,    retained_global_count: usize = global_state.default_retained_global_count,    global_interface_name_byte_count: usize =        global_state.default_interface_name_byte_count_per_global,};

Source: lib/wayland/src/runtime/client.zig:110

zig
pub const StorageStatus = struct {    transport: wayland.TransportStatus = .{},    request_encoder: wayland.protocol.value.EncoderStatus = .{},    event_storage: event.Status = .{},    event_creations: creation.Status = .{},    client_ids: wayland.ids.Status = .{},    objects: object_model.Status = .{},    globals: global_state.Status = .{},};

Source: lib/wayland/src/runtime/event.zig:21

zig
pub const Capacity = struct {    payload_byte_count: usize,    descriptor_count: usize,    descriptor_bytes: usize,    total_requested_bytes: usize,    pub fn derive(limits: Limits) CapacityError!Capacity {        if (limits.payload_byte_count > wayland.protocol.value.maximum_payload_size) {            return error.EventPayloadStorageTooLarge;        }        if (limits.descriptor_count > maximum_descriptor_count) {            return error.EventDescriptorStorageTooLarge;        }        const descriptor_bytes = std.math.mul(            usize,            limits.descriptor_count,            @sizeOf(sys.fd.Descriptor),        ) catch return error.CapacityOverflow;        const total_requested_bytes = std.math.add(            usize,            limits.payload_byte_count,            descriptor_bytes,        ) catch return error.CapacityOverflow;        return .{            .payload_byte_count = limits.payload_byte_count,            .descriptor_count = limits.descriptor_count,            .descriptor_bytes = descriptor_bytes,            .total_requested_bytes = total_requested_bytes,        };    }};

Source: lib/wayland/src/runtime/event.zig:15

zig
pub const CapacityError = error{    EventPayloadStorageTooLarge,    EventDescriptorStorageTooLarge,    CapacityOverflow,};

Source: lib/wayland/src/runtime/event.zig:88

zig
pub const EventView = union(enum) {    fatal: FatalView,    delete_id: u32,    callback_done: CallbackDone,    global: GlobalView,    global_remove: GlobalRemoved,    routed: message.RoutedView,};

Source: lib/wayland/src/runtime/event.zig:71

zig
pub const GlobalView = struct {    registry_id: u32,    name: u32,    interface: []const u8,    version: u32,};

Source: lib/wayland/src/runtime/event.zig:10

zig
pub const Limits = struct {    payload_byte_count: usize = wayland.protocol.value.maximum_payload_size,    descriptor_count: usize = maximum_descriptor_count,};

Source: lib/wayland/src/runtime/event.zig:58

zig
pub const Status = struct {    event_payload_capacity_rejection_count: u64 = 0,    event_descriptor_capacity_rejection_count: u64 = 0,};

Source: lib/wayland/src/runtime/event.zig:97

zig
pub const Step = union(enum) {    event: EventView,    pending,    closed,};

Source: lib/wayland/src/runtime/event.zig:108

zig
pub const Storage = struct {    session_allocator: std.mem.Allocator,    payload: []u8,    descriptors: []sys.fd.Descriptor,    payload_count: usize = 0,    descriptor_count: usize = 0,    payload_capacity_rejection_count: u64 = 0,    descriptor_capacity_rejection_count: u64 = 0,    pub fn init(        session_allocator: std.mem.Allocator,        capacity: Capacity,    ) std.mem.Allocator.Error!Storage {        const payload = try session_allocator.alloc(u8, capacity.payload_byte_count);        errdefer if (payload.len != 0) session_allocator.free(payload);        return .{            .session_allocator = session_allocator,            .payload = payload,            .descriptors = try session_allocator.alloc(                sys.fd.Descriptor,                capacity.descriptor_count,            ),        };    }    pub fn deinit(self: *Storage) void {        self.reset();        if (self.payload.len != 0) self.session_allocator.free(self.payload);        if (self.descriptors.len != 0) self.session_allocator.free(self.descriptors);        self.* = undefined;    }    pub fn reset(self: *Storage) void {        self.assertValid();        for (self.descriptors[0..self.descriptor_count]) |descriptor| {            if (descriptor >= 0) sys.fd.close(descriptor);        }        self.payload_count = 0;        self.descriptor_count = 0;        self.assertValid();    }    pub fn admit(        self: *Storage,        payload_byte_count: usize,        descriptor_count: usize,    ) StorageError!void {        self.assertValid();        std.debug.assert(self.payload_count == 0);        std.debug.assert(self.descriptor_count == 0);        var failure: ?StorageError = null;        if (payload_byte_count > self.payload.len) {            self.payload_capacity_rejection_count +|= 1;            failure = error.EventPayloadCapacityExceeded;        }        if (descriptor_count > self.descriptors.len) {            self.descriptor_capacity_rejection_count +|= 1;            if (failure == null) failure = error.EventDescriptorCapacityExceeded;        }        if (failure) |err| return err;    }    pub fn storePayloadAssumeCapacity(        self: *Storage,        payload: []const u8,    ) []const u8 {        self.assertValid();        std.debug.assert(self.payload_count == 0);        std.debug.assert(self.descriptor_count == 0);        std.debug.assert(payload.len <= self.payload.len);        @memcpy(self.payload[0..payload.len], payload);        self.payload_count = payload.len;        self.assertValid();        return self.payload[0..self.payload_count];    }    pub fn storeRoutedAssumeCapacity(        self: *Storage,        payload: []const u8,        owned_descriptors: []const sys.fd.Descriptor,    ) StoredRouted {        const stored_payload = self.storePayloadAssumeCapacity(payload);        std.debug.assert(owned_descriptors.len <= self.descriptors.len);        @memcpy(self.descriptors[0..owned_descriptors.len], owned_descriptors);        self.descriptor_count = owned_descriptors.len;        self.assertValid();        return .{            .payload = stored_payload,            .descriptors = self.descriptors[0..self.descriptor_count],        };    }    pub fn status(self: *const Storage) Status {        self.assertValid();        return .{            .event_payload_capacity_rejection_count = self.payload_capacity_rejection_count,            .event_descriptor_capacity_rejection_count = self.descriptor_capacity_rejection_count,        };    }    fn assertValid(self: *const Storage) void {        std.debug.assert(self.payload_count <= self.payload.len);        std.debug.assert(self.descriptor_count <= self.descriptors.len);    }};

Source: lib/wayland/src/runtime/event.zig:53

zig
pub const StorageError = error{    EventPayloadCapacityExceeded,    EventDescriptorCapacityExceeded,};

Source: lib/wayland/src/runtime/global.zig:31

zig
pub const Capacity = struct {    retained_global_count: usize,    interface_name_byte_count_per_global: usize,    retained_global_bytes: usize,    interface_name_bytes: usize,    total_requested_bytes: usize,    pub fn derive(limits: Limits) CapacityError!Capacity {        const retained_global_bytes = std.math.mul(            usize,            limits.retained_global_count,            @sizeOf(Slot),        ) catch return error.CapacityOverflow;        const interface_name_bytes = std.math.mul(            usize,            limits.retained_global_count,            limits.interface_name_byte_count_per_global,        ) catch return error.CapacityOverflow;        const total_requested_bytes = std.math.add(            usize,            retained_global_bytes,            interface_name_bytes,        ) catch return error.CapacityOverflow;        return .{            .retained_global_count = limits.retained_global_count,            .interface_name_byte_count_per_global = limits.interface_name_byte_count_per_global,            .retained_global_bytes = retained_global_bytes,            .interface_name_bytes = interface_name_bytes,            .total_requested_bytes = total_requested_bytes,        };    }};

Source: lib/wayland/src/runtime/global.zig:29

zig
pub const CapacityError = error{CapacityOverflow};

Source: lib/wayland/src/runtime/global.zig:23

zig
pub const Limits = struct {    retained_global_count: usize = default_retained_global_count,    interface_name_byte_count_per_global: usize =        default_interface_name_byte_count_per_global,};

Source: lib/wayland/src/runtime/global.zig:92

zig
pub const Set = struct {    session_allocator: std.mem.Allocator,    slots: []Slot,    interface_names: []u8,    interface_name_byte_count_per_global: usize,    count: usize = 0,    capacity_rejection_count: u64 = 0,    interface_name_capacity_rejection_count: u64 = 0,    pub fn init(        session_allocator: std.mem.Allocator,        capacity: Capacity,    ) std.mem.Allocator.Error!Set {        const slots = try session_allocator.alloc(Slot, capacity.retained_global_count);        errdefer if (slots.len != 0) session_allocator.free(slots);        @memset(slots, null);        return .{            .session_allocator = session_allocator,            .slots = slots,            .interface_names = try session_allocator.alloc(                u8,                capacity.interface_name_bytes,            ),            .interface_name_byte_count_per_global = capacity.interface_name_byte_count_per_global,        };    }    pub fn deinit(self: *Set) void {        self.assertValid();        if (self.interface_names.len != 0) self.session_allocator.free(self.interface_names);        if (self.slots.len != 0) self.session_allocator.free(self.slots);        self.* = undefined;    }    pub fn prepareAdd(        self: *Set,        registry_id: u32,        name: u32,        interface: []const u8,        version: u32,    ) Error!Admission {        self.assertValid();        if (version == 0) return error.InvalidVersion;        var available_slot: ?usize = null;        for (self.slots, 0..) |slot, slot_index| {            const entry = slot orelse {                if (available_slot == null) available_slot = slot_index;                continue;            };            if (entry.registry_id == registry_id and entry.name == name) {                return error.DuplicateGlobal;            }        }        if (interface.len > self.interface_name_byte_count_per_global) {            self.interface_name_capacity_rejection_count +|= 1;            return error.GlobalInterfaceNameCapacityExceeded;        }        const slot_index = available_slot orelse {            self.capacity_rejection_count +|= 1;            return error.GlobalCapacityExceeded;        };        return .{            .slot_index = slot_index,            .registry_id = registry_id,            .name = name,            .interface_len = interface.len,            .version = version,        };    }    pub fn commitAdd(        self: *Set,        admission: Admission,        interface: []const u8,    ) Global {        self.assertValid();        std.debug.assert(admission.slot_index < self.slots.len);        std.debug.assert(self.slots[admission.slot_index] == null);        std.debug.assert(interface.len == admission.interface_len);        std.debug.assert(interface.len <= self.interface_name_byte_count_per_global);        std.debug.assert(admission.version != 0);        const storage = self.interfaceStorage(admission.slot_index);        @memcpy(storage[0..interface.len], interface);        self.slots[admission.slot_index] = .{            .registry_id = admission.registry_id,            .name = admission.name,            .interface_len = interface.len,            .version = admission.version,        };        self.count += 1;        self.assertValid();        return self.globalAt(admission.slot_index);    }    pub fn add(        self: *Set,        registry_id: u32,        name: u32,        interface: []const u8,        version: u32,    ) Error!Global {        return self.commitAdd(            try self.prepareAdd(registry_id, name, interface, version),            interface,        );    }    pub fn get(self: *const Set, registry_id: u32, name: u32) ?Global {        self.assertValid();        for (self.slots, 0..) |slot, slot_index| {            const entry = slot orelse continue;            if (entry.registry_id == registry_id and entry.name == name) {                return self.globalAt(slot_index);            }        }        return null;    }    pub fn require(self: *const Set, registry_id: u32, name: u32) ModelError!Global {        return self.get(registry_id, name) orelse error.UnknownGlobal;    }    pub fn remove(self: *Set, registry_id: u32, name: u32) ModelError!void {        self.assertValid();        for (self.slots) |*slot| {            const entry = slot.* orelse continue;            if (entry.registry_id != registry_id or entry.name != name) continue;            slot.* = null;            std.debug.assert(self.count != 0);            self.count -= 1;            self.assertValid();            return;        }        return error.UnknownGlobal;    }    pub fn status(self: *const Set) Status {        self.assertValid();        const name_rejections = self.interface_name_capacity_rejection_count;        return .{            .global_capacity_rejection_count = self.capacity_rejection_count,            .global_interface_name_capacity_rejection_count = name_rejections,        };    }    fn globalAt(self: *const Set, slot_index: usize) Global {        const entry = self.slots[slot_index].?;        const storage = self.interfaceStorage(slot_index);        return .{            .registry_id = entry.registry_id,            .name = entry.name,            .interface = storage[0..entry.interface_len],            .version = entry.version,        };    }    fn interfaceStorage(self: *const Set, slot_index: usize) []u8 {        const offset = slot_index * self.interface_name_byte_count_per_global;        const end = offset + self.interface_name_byte_count_per_global;        std.debug.assert(end <= self.interface_names.len);        return self.interface_names[offset..end];    }    fn assertValid(self: *const Set) void {        std.debug.assert(self.count <= self.slots.len);        std.debug.assert(            self.interface_names.len ==                self.slots.len * self.interface_name_byte_count_per_global,        );        var count: usize = 0;        for (self.slots, 0..) |slot, slot_index| {            const entry = slot orelse continue;            count += 1;            std.debug.assert(entry.interface_len <= self.interface_name_byte_count_per_global);            for (self.slots[slot_index + 1 ..]) |other_slot| {                const other = other_slot orelse continue;                if (entry.registry_id == other.registry_id) {                    std.debug.assert(entry.name != other.name);                }            }        }        std.debug.assert(count == self.count);    }};

Source: lib/wayland/src/runtime/global.zig:77

zig
pub const Status = struct {    global_capacity_rejection_count: u64 = 0,    global_interface_name_capacity_rejection_count: u64 = 0,};

Source: lib/wayland/src/runtime/global.zig:64

zig
pub const StorageError = error{    GlobalCapacityExceeded,    GlobalInterfaceNameCapacityExceeded,};

Source: lib/wayland/src/runtime/message.zig:5

zig
pub const RoutedView = struct {    object_id: u32,    interface: *const wayland.protocol.schema.Interface,    version: u32,    metadata: *const wayland.protocol.schema.Message,    payload: []const u8,    descriptors: []sys.fd.Descriptor,    pub fn borrowedDecoder(        self: *const RoutedView,    ) wayland.protocol.value.DecodeError!wayland.protocol.value.Decoder {        return .init(self.metadata, self.payload, self.descriptors);    }    pub fn takeDescriptor(        self: *RoutedView,        index: usize,    ) error{ InvalidIndex, DescriptorAlreadyTaken }!sys.fd.Descriptor {        if (index >= self.descriptors.len) return error.InvalidIndex;        const descriptor = self.descriptors[index];        if (descriptor < 0) return error.DescriptorAlreadyTaken;        self.descriptors[index] = -1;        return descriptor;    }};

Source: lib/wayland/src/runtime/object.zig:47

zig
pub const Capacity = struct {    client_object_count: usize,    server_object_count: usize,    client_slot_bytes: usize,    server_slot_bytes: usize,    total_requested_bytes: usize,    pub fn derive(limits: Limits) CapacityError!Capacity {        if (limits.client_object_count > maximum_client_object_count) {            return error.ClientObjectStorageTooLarge;        }        if (limits.server_object_count > maximum_server_object_count) {            return error.ServerObjectStorageTooLarge;        }        const client_slot_bytes = std.math.mul(            usize,            limits.client_object_count,            @sizeOf(ClientSlot),        ) catch return error.CapacityOverflow;        const server_slot_bytes = std.math.mul(            usize,            limits.server_object_count,            @sizeOf(ServerSlot),        ) catch return error.CapacityOverflow;        const total_requested_bytes = std.math.add(            usize,            client_slot_bytes,            server_slot_bytes,        ) catch return error.CapacityOverflow;        return .{            .client_object_count = limits.client_object_count,            .server_object_count = limits.server_object_count,            .client_slot_bytes = client_slot_bytes,            .server_slot_bytes = server_slot_bytes,            .total_requested_bytes = total_requested_bytes,        };    }};

Source: lib/wayland/src/runtime/object.zig:41

zig
pub const CapacityError = error{    ClientObjectStorageTooLarge,    ServerObjectStorageTooLarge,    CapacityOverflow,};

Source: lib/wayland/src/runtime/object.zig:22

zig
pub const Entry = struct {    interface: *const wayland.protocol.schema.Interface,    version: u32,    origin: Origin,    state: State = .live,};

Source: lib/wayland/src/runtime/object.zig:36

zig
pub const Limits = struct {    client_object_count: usize = default_client_object_count,    server_object_count: usize = default_server_object_count,};

Source: lib/wayland/src/runtime/object.zig:31

zig
pub const ServerSlot = struct {    id: u32,    entry: Entry,};

Source: lib/wayland/src/runtime/object.zig:102

zig
pub const Status = struct {    client_object_capacity_rejection_count: u64 = 0,    server_object_capacity_rejection_count: u64 = 0,};

Source: lib/wayland/src/runtime/object.zig:86

zig
pub const StorageError = error{    ClientObjectCapacityExceeded,    ServerObjectCapacityExceeded,};

Source: lib/wayland/src/runtime/request.zig:7

zig
pub const NewId = union(enum) {    fixed,    dynamic: Dynamic,    pub const Dynamic = struct {        interface: []const u8,        version: u32,    };};

Source: lib/wayland/src/runtime/request.zig:17

zig
pub const Value = union(enum) {    int: i32,    uint: u32,    fixed: wayland.protocol.value.Fixed,    string: ?[]const u8,    object: ?u32,    new_id: NewId,    array: []const u8,    descriptor_owned: sys.fd.Descriptor,};
Called byCallstest sourcelib.wayland.src.runtime.clienttest: owned descriptor closes when an...test sourcelib.wayland.src.runtime.clienttest: runtime capacity derives reques...test sourcelib.wayland.src.runtime.clienttest: runtime request scratch caps at...test sourcelib.wayland.src.runtime.clienttest: runtime storage status composes...test sourcelib.wayland.src.runtime.clienttest: runtime storage status composes...private sourcelib.wayland.src.runtime.clienttotalRequestedBytesruntime.Capacityderive
Static calls · unresolved targets: 0 · external targets: 6.

Source: lib/wayland/src/runtime/client.zig:28

zig
pub const CapacityError = wayland.TransportCapacityError ||    wayland.protocol.value.EncoderCapacityError ||    event.CapacityError ||    wayland.ids.CapacityError ||    object_model.CapacityError ||    global_state.CapacityError ||    error{CapacityOverflow};
Called byCallsNo direct callersprivate sourcelib.wayland.src.runtime.client.ClientensureActiveruntime.Clientrequestruntime.Clientbind
Static calls · unresolved targets: 0 · external targets: 4.
Called byCallsNo direct callersprivate sourcelib.wayland.src.runtime.client.ClientinitOwnedPartsprivate sourcelib.wayland.src.runtime.client.InitialStoragedeinitprivate sourcelib.wayland.src.runtime.client.InitialStorageinitruntime.Clientconnect
Static calls · unresolved targets: 0 · external targets: 1.
Called byCallsNo direct callersprivate sourcelib.wayland.src.runtime.client.ClientinitOwnedPartsprivate sourcelib.wayland.src.runtime.client.InitialStoragedeinitprivate sourcelib.wayland.src.runtime.client.InitialStorageinitruntime.ClientconnectNamed
Static calls · unresolved targets: 0 · external targets: 1.
Called byCallsNo direct callersruntime.creation.Storagedeinitruntime.EventStoragedeinitruntime.Clientdeinit
Static calls · unresolved targets: 0 · external targets: 5.
Called byCallsNo direct callersprivate sourcelib.wayland.src.runtime.client.ClientensureActiveruntime.Clientflush
Static calls · unresolved targets: 0 · external targets: 1.
Called byCallsNo direct callersruntime.Clientrequestruntime.ClientgetRegistry
Static calls · unresolved targets: 0 · external targets: 0.
Called byCallstest sourcelib.wayland.src.runtime.clienttest: owned descriptor closes when an...test sourcelib.wayland.src.runtime.clienttest: runtime storage status composes...test sourcelib.wayland.src.runtime.clienttest: runtime storage status composes...private sourcelib.wayland.src.runtime.client.ClientinitOwnedPartsprivate sourcelib.wayland.src.runtime.client.InitialStoragedeinitprivate sourcelib.wayland.src.runtime.client.InitialStorageinitruntime.ClientinitOwned
Static calls · unresolved targets: 1 · external targets: 1.
Called byCallsruntime.Clientbindruntime.ClientgetRegistryruntime.Clientsyncprivate sourcelib.wayland.src.runtime.client.ClientensureActiveprivate sourcelib.wayland.src.runtime.lifecycleretireruntime.Clientrequest
Static calls · unresolved targets: 0 · external targets: 6.
Called byCallsNo direct callersprivate sourcelib.wayland.src.runtime.client.ClientensureActiveprivate sourcelib.wayland.src.runtime.dispatchstepruntime.EventStorageresetruntime.Clientstep
Static calls · unresolved targets: 0 · external targets: 0.
Called byCallsNo direct callersruntime.creation.Storagestatusruntime.EventStoragestatusruntime.ClientstorageStatus
Static calls · unresolved targets: 0 · external targets: 5.
Called byCallsNo direct callersruntime.Clientrequestruntime.Clientsync
Static calls · unresolved targets: 0 · external targets: 0.
Called byCallsNo direct callstest sourcelib.wayland.src.runtime.eventtest: runtime event capacity derives ...test sourcelib.wayland.src.runtime.eventtest: runtime event storage acquires ...test sourcelib.wayland.src.runtime.eventtest: runtime event storage closes on...test sourcelib.wayland.src.runtime.eventtest: runtime event storage rejects m...runtime.EventStorageCapacityderive
Static calls · unresolved targets: 0 · external targets: 0.
Called byCallstest sourcelib.wayland.src.runtime.eventtest: runtime event storage closes on...test sourcelib.wayland.src.runtime.eventtest: runtime event storage rejects m...private sourcelib.wayland.src.runtime.event.StorageassertValidruntime.EventStorageadmit
Static calls · unresolved targets: 0 · external targets: 0.
Called byCallsruntime.Clientdeinitprivate sourcelib.wayland.src.runtime.client.InitialStoragedeinitprivate sourcelib.wayland.src.runtime.client.InitialStorageinittest sourcelib.wayland.src.runtime.eventtest: runtime event storage acquires ...test sourcelib.wayland.src.runtime.eventtest: runtime event storage closes on...test sourcelib.wayland.src.runtime.eventtest: runtime event storage rejects m...runtime.EventStorageresetruntime.EventStoragedeinit
Static calls · unresolved targets: 0 · external targets: 1.
Called byCallsNo direct callsprivate sourcelib.wayland.src.runtime.client.InitialStorageinittest sourcelib.wayland.src.runtime.eventtest: runtime event storage acquires ...test sourcelib.wayland.src.runtime.eventtest: runtime event storage closes on...test sourcelib.wayland.src.runtime.eventtest: runtime event storage rejects m...runtime.EventStorageinit
Static calls · unresolved targets: 0 · external targets: 2.
Called byCallsruntime.Clientstepruntime.EventStoragedeinittest sourcelib.wayland.src.runtime.eventtest: runtime event storage closes on...private sourcelib.wayland.src.runtime.event.StorageassertValidruntime.EventStoragereset
Static calls · unresolved targets: 1 · external targets: 0.
Called byCallsruntime.ClientstorageStatustest sourcelib.wayland.src.runtime.eventtest: runtime event storage rejects m...private sourcelib.wayland.src.runtime.event.StorageassertValidruntime.EventStoragestatus
Static calls · unresolved targets: 0 · external targets: 0.
Called byCallsruntime.EventStoragestoreRoutedAssumeCapacityprivate sourcelib.wayland.src.runtime.event.StorageassertValidruntime.EventStoragestorePayloadAssumeCapacity
Static calls · unresolved targets: 0 · external targets: 0.
Called byCallstest sourcelib.wayland.src.runtime.eventtest: runtime event storage closes on...private sourcelib.wayland.src.runtime.event.StorageassertValidruntime.EventStoragestorePayloadAssumeCapacityruntime.EventStoragestoreRoutedAssumeCapacity
Static calls · unresolved targets: 0 · external targets: 0.

Source: lib/wayland/src/runtime/event.zig:63

zig
pub const default_capacity = Capacity.derive(.{}) catch unreachable;

Source: lib/wayland/src/runtime/event.zig:6

zig
pub const maximum_descriptor_count = maximumDescriptorCount(    &wayland.protocol.interfaces,);
Called byCallsNo direct callstest sourcelib.wayland.src.runtime.globaltest: global admission does not mutat...test sourcelib.wayland.src.runtime.globaltest: global capacity derives exact e...test sourcelib.wayland.src.runtime.globaltest: global max plus one preserves s...test sourcelib.wayland.src.runtime.globaltest: global storage acquires both re...test sourcelib.wayland.src.runtime.globaltest: unrelated removal and slot reus...runtime.GlobalCapacityderive
Static calls · unresolved targets: 0 · external targets: 0.
Called byCallstest sourcelib.wayland.src.runtime.globaltest: global max plus one preserves s...test sourcelib.wayland.src.runtime.globaltest: globals are scoped to the regis...test sourcelib.wayland.src.runtime.globaltest: unrelated removal and slot reus...runtime.GlobalStoragecommitAddruntime.GlobalStorageprepareAddruntime.GlobalStorageadd
Static calls · unresolved targets: 0 · external targets: 0.
Called byCallsruntime.GlobalStorageaddtest sourcelib.wayland.src.runtime.globaltest: global admission does not mutat...private sourcelib.wayland.src.runtime.global.SetassertValidprivate sourcelib.wayland.src.runtime.global.SetglobalAtprivate sourcelib.wayland.src.runtime.global.SetinterfaceStorageruntime.GlobalStoragecommitAdd
Static calls · unresolved targets: 0 · external targets: 0.
Called byCallstest sourcelib.wayland.src.runtime.globaltest: global admission does not mutat...test sourcelib.wayland.src.runtime.globaltest: global max plus one preserves s...test sourcelib.wayland.src.runtime.globaltest: global storage acquires both re...test sourcelib.wayland.src.runtime.globaltest: globals are scoped to the regis...test sourcelib.wayland.src.runtime.globaltest: unrelated removal and slot reus...private sourcelib.wayland.src.runtime.global.SetassertValidruntime.GlobalStoragedeinit
Static calls · unresolved targets: 0 · external targets: 1.
Called byCallsruntime.GlobalStoragerequiretest sourcelib.wayland.src.runtime.globaltest: global admission does not mutat...private sourcelib.wayland.src.runtime.global.SetassertValidprivate sourcelib.wayland.src.runtime.global.SetglobalAtruntime.GlobalStorageget
Static calls · unresolved targets: 0 · external targets: 0.
Called byCallsNo direct callstest sourcelib.wayland.src.runtime.globaltest: global admission does not mutat...test sourcelib.wayland.src.runtime.globaltest: global max plus one preserves s...test sourcelib.wayland.src.runtime.globaltest: global storage acquires both re...test sourcelib.wayland.src.runtime.globaltest: globals are scoped to the regis...test sourcelib.wayland.src.runtime.globaltest: unrelated removal and slot reus...runtime.GlobalStorageinit
Static calls · unresolved targets: 0 · external targets: 2.
Called byCallsruntime.GlobalStorageaddtest sourcelib.wayland.src.runtime.globaltest: global admission does not mutat...private sourcelib.wayland.src.runtime.global.SetassertValidruntime.GlobalStorageprepareAdd
Static calls · unresolved targets: 0 · external targets: 0.
Called byCallstest sourcelib.wayland.src.runtime.globaltest: global max plus one preserves s...test sourcelib.wayland.src.runtime.globaltest: globals are scoped to the regis...test sourcelib.wayland.src.runtime.globaltest: unrelated removal and slot reus...private sourcelib.wayland.src.runtime.global.SetassertValidruntime.GlobalStorageremove
Static calls · unresolved targets: 0 · external targets: 0.
Called byCallstest sourcelib.wayland.src.runtime.globaltest: global admission does not mutat...test sourcelib.wayland.src.runtime.globaltest: globals are scoped to the regis...test sourcelib.wayland.src.runtime.globaltest: unrelated removal and slot reus...runtime.GlobalStoragegetruntime.GlobalStoragerequire
Static calls · unresolved targets: 0 · external targets: 0.
Called byCallstest sourcelib.wayland.src.runtime.globaltest: global max plus one preserves s...private sourcelib.wayland.src.runtime.global.SetassertValidruntime.GlobalStoragestatus
Static calls · unresolved targets: 0 · external targets: 0.

Source: lib/wayland/src/runtime/global.zig:21

zig
pub const Slot = ?Entry;

Source: lib/wayland/src/runtime/global.zig:5

zig
pub const default_interface_name_byte_count_per_global: usize = 128;

Source: lib/wayland/src/runtime/global.zig:4

zig
pub const default_retained_global_count: usize = 256;
Called byCallsNo direct callstest sourcelib.wayland.src.runtime.messagetest: routed messages transfer descri...runtime.RoutedViewborrowedDecoder
Static calls · unresolved targets: 0 · external targets: 0.
Called byCallsNo direct callstest sourcelib.wayland.src.runtime.eventtest: runtime event storage closes on...test sourcelib.wayland.src.runtime.messagetest: routed messages transfer descri...runtime.RoutedViewtakeDescriptor
Static calls · unresolved targets: 0 · external targets: 0.
Called byCallsNo direct callstest sourcelib.wayland.src.runtime.objecttest: object capacity derives exact c...test sourcelib.wayland.src.runtime.objecttest: object max plus one preserves s...test sourcelib.wayland.src.runtime.objecttest: object table acquires both regi...test sourcelib.wayland.src.runtime.objecttest: server object storage reclaims ...test sourcelib.wayland.src.runtime.requesttest: constructor capacity failure ro...test sourcelib.wayland.src.runtime.semantictest: server object capacity rejects ...runtime.ObjectCapacityderive
Static calls · unresolved targets: 0 · external targets: 0.

Source: lib/wayland/src/runtime/object.zig:29

zig
pub const ClientSlot = ?Entry;

Source: lib/wayland/src/runtime/object.zig:5

zig
pub const default_server_object_count: usize = 256;

Source: lib/wayland/src/runtime/object.zig:7

zig
pub const maximum_server_object_count: usize =    @as(usize, std.math.maxInt(u32) - wayland.ids.first_server_id) + 1;

Source: lib/wayland/src/runtime/object.zig:4

zig
pub const default_client_object_count: usize = wayland.ids.default_client_id_count;

Source: lib/wayland/src/runtime/object.zig:6

zig
pub const maximum_client_object_count: usize = wayland.ids.maximum_client_id_count;

Source: lib/wayland/src/root.zig:65

zig
pub const runtime = @import("runtime/root.zig");

Source: lib/wayland/src/runtime/root.zig

zig
const client = @import("client.zig");pub const creation = @import("creation.zig");const event = @import("event.zig");const global = @import("global.zig");const message = @import("message.zig");const object = @import("object.zig");const request = @import("request.zig");pub const Client = client.Client;pub const Limits = client.Limits;pub const Capacity = client.Capacity;pub const CapacityError = client.CapacityError;pub const StorageStatus = client.StorageStatus;pub const default_client_object_count = client.default_client_object_count;pub const default_server_object_count = client.default_server_object_count;pub const default_retained_global_count = client.default_retained_global_count;pub const default_global_interface_name_byte_count =    client.default_global_interface_name_byte_count;pub const maximum_client_object_count = object.maximum_client_object_count;pub const maximum_server_object_count = object.maximum_server_object_count;pub const ObjectLimits = object.Limits;pub const ObjectCapacity = object.Capacity;pub const ObjectCapacityError = object.CapacityError;pub const ObjectStorageError = object.StorageError;pub const ObjectStorageStatus = object.Status;pub const ObjectClientSlot = object.ClientSlot;pub const ObjectServerSlot = object.ServerSlot;pub const GlobalLimits = global.Limits;pub const GlobalCapacity = global.Capacity;pub const GlobalCapacityError = global.CapacityError;pub const GlobalStorageError = global.StorageError;pub const GlobalStorageStatus = global.Status;pub const GlobalStorageSlot = global.Slot;pub const GlobalStorage = global.Set;pub const EventCreationLimits = creation.Limits;pub const EventCreationCapacity = creation.Capacity;pub const EventCreationCapacityError = creation.CapacityError;pub const EventCreationStorageError = creation.StorageError;pub const EventCreationStatus = creation.Status;pub const maximum_event_creation_count = creation.maximum_event_creation_count;pub const EventStorageLimits = event.Limits;pub const EventStorageCapacity = event.Capacity;pub const EventStorageCapacityError = event.CapacityError;pub const EventStorageError = event.StorageError;pub const EventStorageStatus = event.Status;pub const EventStorage = event.Storage;pub const default_event_storage_capacity = event.default_capacity;pub const maximum_event_descriptor_count = event.maximum_descriptor_count;pub const EventView = event.EventView;pub const GlobalView = event.GlobalView;pub const NewId = request.NewId;pub const Object = object.Entry;pub const RoutedView = message.RoutedView;pub const Step = event.Step;pub const Value = request.Value;

Audit

Definitions79
Public names79
Members120
Version26.7.0
Revisiondaab053ee433