lib/windowing/src/config.zig
daab053ee43316e1809a84551d573ddd1e5bf3d2
1 const sys = @import("sys");
2 const native_wayland = @import("wayland");
3 const native_xkb = @import("xkb");
4 const clipboard = @import("clipboard.zig");
5 const event = @import("event.zig");
6 const gamepad = @import("gamepad.zig");
7 const input = @import("input.zig");
8 const presentation = @import("presentation.zig");
9
10 pub const BackendPreference = enum {
11 auto,
12 wayland,
13 x11,
14 };
15
16 pub const default_wayland_output_count: usize = 16;
17 pub const default_wayland_compose_limits = native_xkb.compose.Limits{
18 .sequence_symbols = 8 * 1024,
19 .text_bytes = 24 * 1024,
20 };
21 pub const default_wayland_compose_scratch_limits = native_xkb.compose.default_scratch_limits;
22
23 pub const WindowConfig = struct {
24 title: [:0]const u8 = "windowing",
25 app_id: [:0]const u8 = "tiny.windowing",
26 width: u32 = 800,
27 height: u32 = 600,
28 resizable: bool = true,
29 visible: bool = true,
30 backend: BackendPreference = .auto,
31 clipboard: clipboard.Limits = .{},
32 events: event.Limits = .{},
33 gamepads: gamepad.Limits = .{},
34 input: input.Limits = .{},
35 presentation: presentation.Limits = .{},
36 wayland_runtime: native_wayland.runtime.Limits = .{},
37 wayland_compose: native_xkb.compose.Limits = default_wayland_compose_limits,
38 wayland_compose_scratch: native_xkb.compose.ScratchLimits =
39 default_wayland_compose_scratch_limits,
40 wayland_output_count: usize = default_wayland_output_count,
41 x11_request_byte_count: usize = sys.x11.protocol.maximum_request_byte_count,
42 x11_reply_byte_count: usize = sys.x11.default_reply_byte_count,
43 };