Module: ui.backend.platform

Source: ./ui/backend/platform.reef


Overview

ui/backend/platform.reef - Platform abstraction for windowing systems Part of reef-stdlib UI module

This module defines the platform abstraction that all windowing backends implement. It provides common types and interfaces for window management, event handling, and system integration.


Types

Cursor (enum)

Variants:

  • Default
  • Arrow
  • IBeam
  • Crosshair
  • Hand
  • ResizeNS
  • ResizeEW
  • ResizeNWSE
  • ResizeNESW
  • Move
  • NotAllowed
  • Wait
  • Hidden

PlatformWindowConfig

Fields:

Name Type
title string
width int
height int
x int
y int
resizable bool
decorated bool
transparent bool
always_on_top bool
fullscreen bool

PlatformEventKind (enum)

Variants:

  • None
  • Quit
  • Window
  • Mouse
  • Key
  • Focus

PlatformEvent

Fields:

Name Type
kind PlatformEventKind
window_id int
window_event event.WindowEvent
mouse_event event.MouseEvent
key_event event.KeyEvent
focus_event event.FocusEvent

PlatformCapabilities

Fields:

Name Type
name string
supports_transparency bool
supports_multiple_windows bool
supports_clipboard bool
supports_drag_drop bool
supports_cursor_shapes bool
supports_high_dpi bool

WindowHandle

Fields:

Name Type
ptr pointer

Functions

fn cursor_default(): Cursor

fn cursor_arrow(): Cursor

fn cursor_ibeam(): Cursor

fn cursor_crosshair(): Cursor

fn cursor_hand(): Cursor

fn cursor_resize_ns(): Cursor

fn cursor_resize_ew(): Cursor

fn cursor_resize_nwse(): Cursor

fn cursor_resize_nesw(): Cursor

fn cursor_move(): Cursor

fn cursor_not_allowed(): Cursor

fn cursor_wait(): Cursor

fn cursor_hidden(): Cursor

fn is_cursor_default(c: Cursor): bool

fn cursor_name(c: Cursor): string

fn platform_window_config(title: string, width: int, height: int): PlatformWindowConfig

fn platform_window_config_full(title: string, width: int, height: int, x: int, y: int, resizable: bool, decorated: bool, transparent: bool, always_on_top: bool, fullscreen: bool): PlatformWindowConfig

fn pwc_title(c: PlatformWindowConfig): string

fn pwc_width(c: PlatformWindowConfig): int

fn pwc_height(c: PlatformWindowConfig): int

fn pwc_x(c: PlatformWindowConfig): int

fn pwc_y(c: PlatformWindowConfig): int

fn pwc_resizable(c: PlatformWindowConfig): bool

fn pwc_decorated(c: PlatformWindowConfig): bool

fn pwc_transparent(c: PlatformWindowConfig): bool

fn pwc_always_on_top(c: PlatformWindowConfig): bool

fn pwc_fullscreen(c: PlatformWindowConfig): bool

fn default_mouse_event(): event.MouseEvent

Helper to create default mouse event

fn default_key_event(): event.KeyEvent

Helper to create default key event

fn platform_event_none(): PlatformEvent

fn platform_event_quit(): PlatformEvent

fn platform_event_window_resize(window_id: int, width: int, height: int): PlatformEvent

fn platform_event_window_close(window_id: int): PlatformEvent

fn platform_event_window_expose(window_id: int): PlatformEvent

fn platform_event_mouse(window_id: int, me: event.MouseEvent): PlatformEvent

fn platform_event_key(window_id: int, ke: event.KeyEvent): PlatformEvent

fn platform_event_focus(window_id: int, fe: event.FocusEvent): PlatformEvent

fn pe_kind(e: PlatformEvent): PlatformEventKind

fn pe_window_id(e: PlatformEvent): int

fn pe_is_none(e: PlatformEvent): bool

fn pe_is_quit(e: PlatformEvent): bool

fn platform_capabilities(name: string, supports_transparency: bool, supports_multiple_windows: bool, supports_clipboard: bool, supports_drag_drop: bool, supports_cursor_shapes: bool, supports_high_dpi: bool): PlatformCapabilities

fn pc_name(c: PlatformCapabilities): string

fn pc_supports_transparency(c: PlatformCapabilities): bool

fn pc_supports_multiple_windows(c: PlatformCapabilities): bool

fn pc_supports_clipboard(c: PlatformCapabilities): bool

fn pc_supports_drag_drop(c: PlatformCapabilities): bool

fn pc_supports_cursor_shapes(c: PlatformCapabilities): bool

fn pc_supports_high_dpi(c: PlatformCapabilities): bool

fn window_handle_null(): WindowHandle

fn window_handle_from_pointer(p: pointer): WindowHandle

fn window_handle_is_null(h: WindowHandle): bool

fn window_handle_to_pointer(h: WindowHandle): pointer


Generated by reefc doc