Skip to documentation
SLOP

tiny.windowing.Window

Reference tiny.windowing Window

Defined in tiny.windowing.

API (51)

Actions

Public operations.

Fields and members

Public fields and members.

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

Source

Source: lib/windowing/src/window.zig:83

zig
pub const Window = struct {    allocator: std.mem.Allocator,    backend: *Backend,    pub fn create(allocator: std.mem.Allocator, config: WindowConfig) CreateError!Window {        const backend = allocator.create(Backend) catch return error.OutOfMemory;        errdefer allocator.destroy(backend);        try backend.init(allocator, config);        return .{ .allocator = allocator, .backend = backend };    }    pub fn destroy(self: *Window) void {        self.backend.deinit();        self.allocator.destroy(self.backend);        self.* = undefined;    }    pub fn pollEvents(self: *Window) PollError!EventIterator {        return self.backend.pollEvents();    }    pub fn droppedEventCount(self: *const Window) u64 {        return self.backend.droppedEventCount();    }    pub fn eventSource(self: *const Window) ?EventSource {        return self.backend.eventSource();    }    pub fn shouldClose(self: *const Window) bool {        return self.backend.shouldClose();    }    pub fn getSize(self: *const Window) Size {        return self.backend.getSize();    }    pub fn getFramebufferSize(self: *const Window) Size {        return self.backend.getFramebufferSize();    }    pub fn getDrawArea(self: *const Window) sys.desktop.DrawArea {        return sizeToDrawArea(self.getSize());    }    pub fn getFramebufferArea(self: *const Window) sys.desktop.DrawArea {        return sizeToDrawArea(self.getFramebufferSize());    }    pub fn getNativeSurface(self: *Window) surface.Surface {        return self.backend.nativeSurface();    }    pub fn getScaleEvidence(self: *const Window) sys.desktop.WindowScaleEvidence {        return scaleEvidenceFromSizes(self.getSize(), self.getFramebufferSize(), self.getContentScale());    }    pub fn presentRgba8(        self: *Window,        rgba8: []const u8,        width: u32,        height: u32,    ) PresentError!void {        return self.backend.presentRgba8(rgba8, width, height);    }    pub fn presentRgba8Region(        self: *Window,        rgba8: []const u8,        width: u32,        height: u32,        region: PresentRegion,    ) PresentError!void {        return self.backend.presentRgba8Region(rgba8, width, height, region);    }    pub fn getContentScale(self: *const Window) Scale {        return self.backend.getContentScale();    }    pub fn isKeyDown(self: *const Window, key: Key) bool {        return self.backend.inputState().isKeyDown(key);    }    pub fn isKeyPressed(self: *const Window, key: Key) bool {        return self.backend.inputState().isKeyPressed(key);    }    pub fn isKeyReleased(self: *const Window, key: Key) bool {        return self.backend.inputState().isKeyReleased(key);    }    pub fn nextPressedKey(self: *Window) ?Key {        return self.backend.inputStateMut().nextPressedKey();    }    pub fn modifiers(self: *const Window) Modifier {        return self.backend.modifiers();    }    pub fn isMouseButtonDown(self: *const Window, button: MouseButton) bool {        return self.backend.inputState().isMouseButtonDown(button);    }    pub fn isMouseButtonPressed(self: *const Window, button: MouseButton) bool {        return self.backend.inputState().isMouseButtonPressed(button);    }    pub fn isMouseButtonReleased(self: *const Window, button: MouseButton) bool {        return self.backend.inputState().isMouseButtonReleased(button);    }    pub fn getMousePosition(self: *const Window) input.Point {        return self.backend.inputState().mouse_position;    }    pub fn getMouseDelta(self: *const Window) input.Point {        return self.backend.inputState().mouse_delta;    }    pub fn getMouseWheel(self: *const Window) input.Wheel {        return self.backend.inputState().mouse_wheel;    }    pub fn nextTextCodepoint(self: *Window) ?u21 {        return self.backend.inputStateMut().nextTextCodepoint();    }    pub fn inputStatus(self: *const Window) input.Status {        return self.backend.inputState().status();    }    pub fn setCursor(self: *Window, shape: CursorShape) void {        self.backend.setCursor(shape);    }    pub fn isCursorOnScreen(self: *const Window) bool {        return self.backend.isCursorOnScreen();    }    pub fn setTitle(self: *Window, title: [:0]const u8) void {        self.backend.setTitle(title);    }    pub fn setMinSize(self: *Window, width: u32, height: u32) void {        self.backend.setMinSize(width, height);    }    pub fn minimize(self: *Window) void {        self.backend.minimize();    }    pub fn maximize(self: *Window) void {        self.backend.maximize();    }    pub fn restore(self: *Window) void {        self.backend.restore();    }    pub fn isMaximized(self: *Window) bool {        return self.backend.isMaximized();    }    pub fn toggleMaximize(self: *Window) void {        if (self.isMaximized()) {            self.restore();        } else {            self.maximize();        }    }    pub fn getClipboardTextAlloc(self: *Window, allocator: std.mem.Allocator) !?[]u8 {        return self.backend.getClipboardTextAlloc(allocator);    }    pub fn setClipboardText(self: *Window, text: []const u8) clipboard.PublishError!void {        return self.backend.setClipboardText(text);    }    pub fn clipboardStatus(self: *const Window) clipboard.Status {        return self.backend.clipboardStatus();    }    pub fn x11StorageStatus(self: *const Window) sys.x11.Status {        return self.backend.x11StorageStatus();    }    /// The window's dma-buf presentation with explicit synchronization, when it is a Wayland    /// window and the compositor offers `zwp_linux_dmabuf_v1` 4 or later and    /// `wp_linux_drm_syncobj_manager_v1`. Its first commit makes shared-memory presents of the    /// window fail with `ExplicitSyncSurface`.    pub fn waylandDmabuf(self: *Window) ?WaylandDmabuf {        return self.backend.waylandDmabuf();    }    pub fn waylandStorageStatus(self: *const Window) WaylandStorageStatus {        return self.backend.waylandStorageStatus();    }    pub fn nextPresentationOutcome(self: *Window) ?presentation.Outcome {        return self.backend.nextPresentationOutcome();    }    pub fn presentationStatus(self: *const Window) presentation.Status {        return self.backend.presentationStatus();    }    pub fn presentationStorageStatus(self: *const Window) presentation.StorageStatus {        return self.backend.presentationStorageStatus();    }    pub fn gamepadCount(self: *const Window) usize {        return self.backend.gamepadState().connectedCount();    }    pub fn gamepad(self: *const Window, index: usize) *const gamepads.Gamepad {        return self.backend.gamepadState().gamepad(index);    }    pub fn gamepadStatus(self: *const Window) gamepads.Status {        return self.backend.gamepadState().status();    }};

Source: lib/windowing/src/root.zig:69

zig
pub const Window = window.Window;
Called byCallsNo direct callstest sourcelib.windowing.src.backendtest: live automatic unreachable Wayl...test sourcelib.windowing.src.testtest: window rejects invalid clipboar...test sourcelib.windowing.src.testtest: window rejects invalid event qu...test sourcelib.windowing.src.testtest: window rejects invalid frame st...test sourcelib.windowing.src.testtest: window rejects invalid gamepad ...+17 moreWindowcreate
Static calls · unresolved targets: 0 · external targets: 3.
Called byCallsNo direct callsWindowgetScaleEvidenceWindowgetContentScale
Static calls · unresolved targets: 1 · external targets: 0.
Called byCallsNo direct callersWindowgetSizeprivate sourcelib.windowing.src.windowsizeToDrawAreaWindowgetDrawArea
Static calls · unresolved targets: 0 · external targets: 0.
Called byCallsNo direct callersWindowgetFramebufferSizeprivate sourcelib.windowing.src.windowsizeToDrawAreaWindowgetFramebufferArea
Static calls · unresolved targets: 0 · external targets: 0.
Called byCallsNo direct callsWindowgetFramebufferAreaWindowgetScaleEvidenceWindowgetFramebufferSize
Static calls · unresolved targets: 1 · external targets: 0.
Called byCallsNo direct callersWindowgetContentScaleWindowgetFramebufferSizeWindowgetSizeprivate sourcelib.windowing.src.windowscaleEvidenceFromSizesWindowgetScaleEvidence
Static calls · unresolved targets: 0 · external targets: 0.
Called byCallsNo direct callsWindowgetDrawAreaWindowgetScaleEvidenceWindowgetSize
Static calls · unresolved targets: 1 · external targets: 0.
Called byCallsNo direct callsWindowtoggleMaximizeWindowisMaximized
Static calls · unresolved targets: 1 · external targets: 0.
Called byCallsNo direct callsWindowtoggleMaximizeWindowmaximize
Static calls · unresolved targets: 1 · external targets: 0.
Called byCallsNo direct callsWindowtoggleMaximizeWindowrestore
Static calls · unresolved targets: 1 · external targets: 0.
Called byCallsNo direct callersWindowisMaximizedWindowmaximizeWindowrestoreWindowtoggleMaximize
Static calls · unresolved targets: 0 · external targets: 0.

Complete caller list for Window.create

22 direct callers.

Audit

Definitions50
Public names50
Members2
Version26.7.0
Revisiondaab053ee433