core/sys/orca

orca

Types

115

arena

arena :: struct { // An allocator providing memory pages from the system base: ^base_allocator, // A list of `oc_arena_chunk` chunks. chunks: list, // The chunk new memory allocations are pulled from. currentChunk: ^arena_chunk, }Source

A memory arena, allowing to allocate memory in a linear or stack-like fashion.

arena_scope

arena_scope :: struct { // The arena which offset is stored. arena: ^arena, // The arena chunk to which the offset belongs. chunk: ^arena_chunk, // The offset to rewind the arena to. offset: u64, }Source

This struct provides a way to store the current offset in a given arena, in order to reset the arena to that offset later. This allows using arenas in a stack-like fashion, e.g. to create temporary "scratch" allocations

canvas_context

canvas_context :: u64Source

An opaque handle to a canvas context. Canvas contexts are used to hold contextual state about drawing commands, such as the current color or the current line width, and to record drawing commands. Once commands have been recorded, they can be rendered to a surface using oc_canvas_render().

char_event

char_event :: struct { // The unicode codepoint of the character. codepoint: utf32, // The utf8 sequence of the character. sequence: [8]char, // The utf8 sequence length. seqLen: u8, }Source

A structure describing a character input event.

clock_kind

clock_kind :: enum u32 { // A clock incrementing monotonically. MONOTONIC = 0, // A clock incrementing monotonically during uptime. UPTIME = 1, // A clock driven by the platform time. DATE = 2, }Source

////////////////////////////////////////////////////////////////////////////// API for sampling the system clock. //////////////////////////////////////////////////////////////////////////////

color_space

color_space :: enum u32 { // A linear RGB color space. RGB = 0, // An sRGB color space. SRGB = 1, }Source

An enum identifying possible color spaces.

event_type

event_type :: enum u32 { // No event. That could be used simply to wake up the application. NONE = 0, // A modifier key event. This event is sent when a key such as <kbd>Alt</kbd>, <kbd>Control</kbd>, <kbd>Command</kbd> or <kbd>Shift</kbd> are pressed, released, or repeated. The `key` field contains the event's details. KEYBOARD_MODS = 1, // A key event. This event is sent when a normal key is pressed, released, or repeated. The `key` field contains the event's details. KEYBOARD_KEY = 2, // A character input event. This event is sent when an input character is produced by the keyboard. The `character` field contains the event's details. KEYBOARD_CHAR = 3, // A mouse button event. This is event sent when one of the mouse buttons is pressed, released, or clicked. The `key` field contains the event's details. MOUSE_BUTTON = 4, // A mouse move event. This is event sent when the mouse is moved. The `mouse` field contains the event's details. MOUSE_MOVE = 5, // A mouse wheel event. This is event sent when the mouse wheel is moved (or when a trackpad is scrolled). The `mouse` field contains the event's details. MOUSE_WHEEL = 6, // A mouse enter event. This event is sent when the mouse enters the application's window. The `mouse` field contains the event's details. MOUSE_ENTER = 7, // A mouse leave event. This event is sent when the mouse leaves the application's window. MOUSE_LEAVE = 8, // A clipboard paste event. This event is sent when the user uses the paste shortcut while the application window has focus. CLIPBOARD_PASTE = 9, // A resize event. This event is sent when the application's window is resized. The `move` field contains the event's details. WINDOW_RESIZE = 10, // A move event. This event is sent when the window is moved. The `move` field contains the event's details. WINDOW_MOVE = 11, // A focus event. This event is sent when the application gains focus. WINDOW_FOCUS = 12, // An unfocus event. This event is sent when the application looses focus. WINDOW_UNFOCUS = 13, // A hide event. This event is sent when the application's window is hidden or minimized. WINDOW_HIDE = 14, // A show event. This event is sent when the application's window is shown or de-minimized. WINDOW_SHOW = 15, // A close event. This event is sent when the window is about to be closed. WINDOW_CLOSE = 16, // A path drop event. This event is sent when the user drops files onto the application's window. The `paths` field contains the event's details. PATHDROP = 17, // A frame event. This event is sent when the application should render a frame. FRAME = 18, // A quit event. This event is sent when the application has been requested to quit. QUIT = 19, }Source

////////////////////////////////////////////////////////////////////////////// Input, windowing, dialogs. ////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////// Application events. ////////////////////////////////////////////////////////////////////////////// This enum defines the type events that can be sent to the application by the runtime. This determines which member of the oc_event union field is active.

file

file :: u64Source

////////////////////////////////////////////////////////////////////////////// File input/output. ////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////// API for opening, reading and writing files. ////////////////////////////////////////////////////////////////////////////// An opaque handle identifying an opened file.

file_access_flag

file_access_flag :: enum u16 { // The file handle can be used for reading from the file. READ = 0, // The file handle can be used for writing to the file. WRITE = 1, }Source

This enum describes the access permissions of a file handle.

file_dialog_button

file_dialog_button :: enum u32 { // The user clicked the "Cancel" button, or closed the dialog box. CANCEL = 0, // The user clicked the "OK" button. OK = 1, }Source

An enum identifying the button clicked by the user when a file dialog returns.

file_dialog_desc

file_dialog_desc :: struct { // The kind of file dialog, see `oc_file_dialog_kind`. kind: file_dialog_kind, // A combination of file dialog flags used to enable file dialog options. flags: file_dialog_flags, // The title of the dialog, displayed in the dialog title bar. title: str8, // Optional. The label of the OK button, e.g. "Save" or "Open". okLabel: str8, // Optional. A file handle to the root directory for the dialog. If set to zero, the root directory is the application's default data directory. startAt: file, // Optional. The path of the starting directory of the dialog, relative to its root directory. If set to nil, the dialog starts at its root directory. startPath: str8, // A list of file extensions used to restrict which files can be selected in this dialog. An empty list allows all files to be selected. Extensions should be provided without a leading dot. filters: str8_list, }Source

A structure describing a file dialog.

file_dialog_flag

file_dialog_flag :: enum u32 { // This dialog allows selecting files. FILES = 0, // This dialog allows selecting directories. DIRECTORIES = 1, // This dialog allows selecting multiple items. MULTIPLE = 2, // This dialog allows creating directories. CREATE_DIRECTORIES = 3, }Source

A type for flags describing various file dialog options. File dialog flags.

file_dialog_result

file_dialog_result :: struct { // The button clicked by the user. button: file_dialog_button, // The path that was selected when the user clicked the OK button. If the dialog box had the `OC_FILE_DIALOG_MULTIPLE` flag set, this is the first file of the list of selected paths. path: str8, // If the dialog box had the `OC_FILE_DIALOG_MULTIPLE` flag set and the user clicked the OK button, this list contains the selected paths. selection: str8_list, }Source

A structure describing the result of a file dialog.

file_open_flag

file_open_flag :: enum u16 { // Open the file in 'append' mode. All writes append data at the end of the file. APPEND = 0, // Truncate the file to 0 bytes when opening. TRUNCATE = 1, // Create the file if it does not exist. CREATE = 2, // If the file is a symlink, open the symlink itself instead of following it. SYMLINK = 3, // If the file is a symlink, the call to open will fail. NO_FOLLOW = 4, // Reserved. RESTRICT = 5, }Source

The type of file open flags describing file open options. Flags for the oc_file_open() function.

file_open_with_dialog_elt

file_open_with_dialog_elt :: struct { listElt: list_elt, file: file, }Source

////////////////////////////////////////////////////////////////////////////// API for obtaining file capabilities through open/save dialogs. ////////////////////////////////////////////////////////////////////////////// An element of a list of file handles acquired through a file dialog.

file_open_with_dialog_result

file_open_with_dialog_result :: struct { // The button of the file dialog clicked by the user. button: file_dialog_button, // The file that was opened through the dialog. If the dialog had the `OC_FILE_DIALOG_MULTIPLE` flag set, this is equal to the first handle in the `selection` list. file: file, // If the dialog had the `OC_FILE_DIALOG_MULTIPLE` flag set, this list of `oc_file_open_with_dialog_elt` contains the handles of the opened files. selection: list, }Source

A structure describing the result of a call to oc_file_open_with_dialog().

file_perm_flag

file_perm_flag :: enum u16 { OTHER_EXEC = 0, OTHER_WRITE = 1, OTHER_READ = 2, GROUP_EXEC = 3, GROUP_WRITE = 4, GROUP_READ = 5, OWNER_EXEC = 6, OWNER_WRITE = 7, OWNER_READ = 8, STICKY_BIT = 9, SET_GID = 10, SET_UID = 11, }Source

A type describing file permissions.

file_type

file_type :: enum u32 { // The file is of unknown type. UNKNOWN = 0, // The file is a regular file. REGULAR = 1, // The file is a directory. DIRECTORY = 2, // The file is a symbolic link. SYMLINK = 3, // The file is a block device. BLOCK = 4, // The file is a character device. CHARACTER = 5, // The file is a FIFO pipe. FIFO = 6, // The file is a socket. SOCKET = 7, }Source

An enum identifying the type of a file.

file_whence

file_whence :: enum u32 { // Set the file position relative to the beginning of the file. SET = 0, // Set the file position relative to the end of the file. END = 1, // Set the file position relative to the current position. CURRENT = 2, }Source

This enum is used in oc_file_seek() to specify the starting point of the seek operation.

font_metrics

font_metrics :: struct { // The ascent from the baseline to the top of the line (a positive value means the top line is above the baseline). ascent: f32, // The descent from the baseline to the bottom line (a positive value means the bottom line is below the baseline). descent: f32, // The gap between two lines of text. lineGap: f32, // The height of the lowercase character 'x'. xHeight: f32, // The height of capital letters. capHeight: f32, // The maximum character width. width: f32, }Source

A struct describing the metrics of a font.

glyph_metrics

glyph_metrics :: struct { ink: rect, // The default amount from which to advance the cursor after drawing this glyph. advance: vec2, }Source

A struct describing the metrics of a single glyph.

gradient_blend_space

gradient_blend_space :: enum u32 { // The gradient colors are interpolated in linear space. LINEAR = 0, // The gradient colors are interpolated in sRGB space. SRGB = 1, }Source

This enum describes possible blending modes for color gradient.

io_cmp

io_cmp :: struct { // The request ID as passed in the `oc_io_req` request that generated this completion. id: io_req_id, // The error value for the operation. error: io_error, _: struct #raw_union { result: i64, size: u64, offset: i64, handle: file, }, }Source

A structure describing the completion of an I/O operation.

io_error

io_error :: enum u32 { // No error. OK = 0, // An unexpected error happened. UNKNOWN = 1, // The request had an invalid operation. OP = 2, // The request had an invalid handle. HANDLE = 3, // The operation was not carried out because the file handle has previous errors. PREV = 4, // The request contained wrong arguments. ARG = 5, // The operation requires permissions that the file handle doesn't have. PERM = 6, // The operation couldn't complete due to a lack of space in the result buffer. SPACE = 7, // One of the directory in the path does not exist or couldn't be traversed. NO_ENTRY = 8, // The file already exists. EXISTS = 9, // The file is not a directory. NOT_DIR = 10, // The file is a directory. DIR = 11, // There are too many opened files. MAX_FILES = 12, // The path contains too many symbolic links (this may be indicative of a symlink loop). MAX_LINKS = 13, // The path is too long. PATH_LENGTH = 14, // The file is too large. FILE_SIZE = 15, // The file is too large to be opened. OVERFLOW = 16, // The file is locked or the device on which it is stored is not ready. NOT_READY = 17, // The system is out of memory. MEM = 18, // The operation was interrupted by a signal. INTERRUPT = 19, // A physical error happened. PHYSICAL = 20, // The device on which the file is stored was not found. NO_DEVICE = 21, // One element along the path is outside the root directory subtree. WALKOUT = 22, }Source

A type identifying an I/O error. This enum declares all I/O error values.

io_op

io_op :: enum u32 { // ['Open a file at a path relative to a given root directory.', '', " - `handle` is the handle to the root directory. If it is nil, the application's default directory is used.", ' - `size` is the size of the path, in bytes.', ' - `buffer` points to an array containing the path of the file to open, relative to the directory identified by `handle`.', ' - `open` contains the permissions and flags for the open operation.'] OPEN_AT = 0, // ['Close a file handle.', '', ' - `handle` is the handle to close.'] CLOSE = 1, // ['Get status information for a file handle.', '', ' - `handle` is the handle to stat.', ' - `size` is the size of the result buffer. It should be at least `sizeof(oc_file_status)`.', ' - `buffer` is the result buffer.'] FSTAT = 2, // ['Move the file position in a file.', '', ' - `handle` is the handle of the file.', ' - `offset` specifies the offset of the new position, relative to the base position specified by `whence`.', ' - `whence` determines the base position for the seek operation.'] SEEK = 3, // ['Read data from a file.', '', ' - `handle` is the handle of the file.', ' - `size` is the number of bytes to read.', ' - `buffer` is the result buffer. It should be big enough to hold `size` bytes.'] READ = 4, // ['Write data to a file.', '', ' - `handle` is the handle of the file.', ' - `size` is the number of bytes to write.', ' - `buffer` contains the data to write to the file.'] WRITE = 5, // ['Get the error attached to a file handle.', '', ' - `handle` is the handle of the file.'] OC_OC_IO_ERROR = 6, }Source

A type used to identify I/O operations. This enum declares all I/O operations.

io_req

io_req :: struct { // An identifier for the request. You can set this to any value you want. It is passed back in the `oc_io_cmp` completion and can be used to match requests and completions. id: io_req_id, // The requested operation. op: io_op, // A file handle used by some operations. handle: file, // An offset used by some operations. offset: i64, // A size indicating the capacity of the buffer pointed to by `buffer`, in bytes. size: u64, _: struct #raw_union { buffer: [^]char, unused: u64, }, _: struct #raw_union { open: struct { // The access permissions requested on the file to open. rights: file_access, // The options to use when opening the file. flags: file_open_flags, }, whence: file_whence, }, }Source

A structure describing an I/O request.

joint_type

joint_type :: enum u32 { // Miter joint. MITER = 0, // Bevel joint. BEVEL = 1, // Don't join path segments. NONE = 2, }Source

Stroke joint types.

key_action

key_action :: enum u32 { // No action happened on that key. NO_ACTION = 0, // The key was pressed. PRESS = 1, // The key was released. RELEASE = 2, // The key was maintained pressed at least for the system's key repeat period. REPEAT = 3, }Source

This enum describes the actions that can happen to a key.

key_code

key_code :: enum u32 { UNKNOWN = 0, SPACE = 32, APOSTROPHE = 39, COMMA = 44, MINUS = 45, PERIOD = 46, SLASH = 47, _0 = 48, _1 = 49, _2 = 50, _3 = 51, _4 = 52, _5 = 53, _6 = 54, _7 = 55, _8 = 56, _9 = 57, SEMICOLON = 59, EQUAL = 61, LEFT_BRACKET = 91, BACKSLASH = 92, RIGHT_BRACKET = 93, GRAVE_ACCENT = 96, A = 97, B = 98, C = 99, D = 100, E = 101, F = 102, G = 103, H = 104, I = 105, J = 106, K = 107, L = 108, M = 109, N = 110, O = 111, P = 112, Q = 113, R = 114, S = 115, T = 116, U = 117, V = 118, W = 119, X = 120, Y = 121, Z = 122, WORLD_1 = 161, WORLD_2 = 162, ESCAPE = 256, ENTER = 257, TAB = 258, BACKSPACE = 259, INSERT = 260, DELETE = 261, RIGHT = 262, LEFT = 263, DOWN = 264, UP = 265, PAGE_UP = 266, PAGE_DOWN = 267, HOME = 268, END = 269, CAPS_LOCK = 280, SCROLL_LOCK = 281, NUM_LOCK = 282, PRINT_SCREEN = 283, PAUSE = 284, F1 = 290, F2 = 291, F3 = 292, F4 = 293, F5 = 294, F6 = 295, F7 = 296, F8 = 297, F9 = 298, F10 = 299, F11 = 300, F12 = 301, F13 = 302, F14 = 303, F15 = 304, F16 = 305, F17 = 306, F18 = 307, F19 = 308, F20 = 309, F21 = 310, F22 = 311, F23 = 312, F24 = 313, F25 = 314, KP_0 = 320, KP_1 = 321, KP_2 = 322, KP_3 = 323, KP_4 = 324, KP_5 = 325, KP_6 = 326, KP_7 = 327, KP_8 = 328, KP_9 = 329, KP_DECIMAL = 330, KP_DIVIDE = 331, KP_MULTIPLY = 332, KP_SUBTRACT = 333, KP_ADD = 334, KP_ENTER = 335, KP_EQUAL = 336, LEFT_SHIFT = 340, LEFT_CONTROL = 341, LEFT_ALT = 342, LEFT_SUPER = 343, RIGHT_SHIFT = 344, RIGHT_CONTROL = 345, RIGHT_ALT = 346, RIGHT_SUPER = 347, MENU = 348, COUNT = 349, }Source

A code identifying a key. The physical location of the key corresponding to a given key code depends on the system's keyboard layout.

key_event

key_event :: struct { // The action that was done on the key. action: key_action, // The scan code of the key. Only valid for key events. scanCode: scan_code, // The key code of the key. Only valid for key events. keyCode: key_code, // The button of the mouse. Only valid for mouse button events. button: mouse_button, // Modifier flags indicating which modifier keys where pressed at the time of the event. mods: keymod_flags, // The number of clicks that where detected for the button. Only valid for mouse button events. clickCount: u8, }Source

A structure describing a key event or a mouse button event.

key_state

key_state :: struct { lastUpdate: u64, transitionCount: u32, repeatCount: u32, down: bool, sysClicked: bool, sysDoubleClicked: bool, sysTripleClicked: bool, }Source

////////////////////////////////////////////////////////////////////////////// Application user input. //////////////////////////////////////////////////////////////////////////////

list

list :: struct { // Points to the first element in the list. first: ^list_elt, // Points to the last element in the list. last: ^list_elt, }Source

A doubly-linked list.

list_elt

list_elt :: struct { // Points to the previous element in the list. prev: ^list_elt, // Points to the next element in the list. next: ^list_elt, }Source

////////////////////////////////////////////////////////////////////////////// Types and helpers for doubly-linked lists. ////////////////////////////////////////////////////////////////////////////// An element of an intrusive doubly-linked list.

log_level

log_level :: enum u32 { // Only errors are logged. ERROR = 0, // Only warnings and errors are logged. WARNING = 1, // All messages are logged. INFO = 2, COUNT = 3, }Source

////////////////////////////////////////////////////////////////////////////// Helpers for logging, asserting and aborting. ////////////////////////////////////////////////////////////////////////////// Constants allowing to specify the level of logging verbosity.

mem_reserve_proc

mem_reserve_proc :: proc "c" (_context: ^base_allocator, size: u64) -> rawptrSource

////////////////////////////////////////////////////////////////////////////// Base allocator and memory arenas. ////////////////////////////////////////////////////////////////////////////// The prototype of a procedure to reserve memory from the system.

mouse_event

mouse_event :: struct { // The x coordinate of the mouse. x: f32, // The y coordinate of the mouse. y: f32, // The delta from the last x coordinate of the mouse, or the scroll value along the x coordinate. deltaX: f32, // The delta from the last y coordinate of the mouse, or the scoll value along the y coordinate. deltaY: f32, // Modifier flags indicating which modifier keys where pressed at the time of the event. mods: keymod_flags, }Source

A structure describing a mouse move or a mouse wheel event. Mouse coordinates have their origin at the top-left corner of the window, with the y axis going down.

move_event

move_event :: struct { // The position and dimension of the frame rectangle, i.e. including the window title bar and border. frame: rect, // The position and dimension of the content rectangle, relative to the frame rectangle. content: rect, }Source

A structure describing a window move or resize event.

rect_atlas

rect_atlas :: struct {}Source

An opaque struct representing a rectangle atlas. This is used to allocate rectangular regions of an image to make texture atlases.

scan_code

scan_code :: enum u32 { UNKNOWN = 0, SPACE = 32, APOSTROPHE = 39, COMMA = 44, MINUS = 45, PERIOD = 46, SLASH = 47, _0 = 48, _1 = 49, _2 = 50, _3 = 51, _4 = 52, _5 = 53, _6 = 54, _7 = 55, _8 = 56, _9 = 57, SEMICOLON = 59, EQUAL = 61, LEFT_BRACKET = 91, BACKSLASH = 92, RIGHT_BRACKET = 93, GRAVE_ACCENT = 96, A = 97, B = 98, C = 99, D = 100, E = 101, F = 102, G = 103, H = 104, I = 105, J = 106, K = 107, L = 108, M = 109, N = 110, O = 111, P = 112, Q = 113, R = 114, S = 115, T = 116, U = 117, V = 118, W = 119, X = 120, Y = 121, Z = 122, WORLD_1 = 161, WORLD_2 = 162, ESCAPE = 256, ENTER = 257, TAB = 258, BACKSPACE = 259, INSERT = 260, DELETE = 261, RIGHT = 262, LEFT = 263, DOWN = 264, UP = 265, PAGE_UP = 266, PAGE_DOWN = 267, HOME = 268, END = 269, CAPS_LOCK = 280, SCROLL_LOCK = 281, NUM_LOCK = 282, PRINT_SCREEN = 283, PAUSE = 284, F1 = 290, F2 = 291, F3 = 292, F4 = 293, F5 = 294, F6 = 295, F7 = 296, F8 = 297, F9 = 298, F10 = 299, F11 = 300, F12 = 301, F13 = 302, F14 = 303, F15 = 304, F16 = 305, F17 = 306, F18 = 307, F19 = 308, F20 = 309, F21 = 310, F22 = 311, F23 = 312, F24 = 313, F25 = 314, KP_0 = 320, KP_1 = 321, KP_2 = 322, KP_3 = 323, KP_4 = 324, KP_5 = 325, KP_6 = 326, KP_7 = 327, KP_8 = 328, KP_9 = 329, KP_DECIMAL = 330, KP_DIVIDE = 331, KP_MULTIPLY = 332, KP_SUBTRACT = 333, KP_ADD = 334, KP_ENTER = 335, KP_EQUAL = 336, LEFT_SHIFT = 340, LEFT_CONTROL = 341, LEFT_ALT = 342, LEFT_SUPER = 343, RIGHT_SHIFT = 344, RIGHT_CONTROL = 345, RIGHT_ALT = 346, RIGHT_SUPER = 347, MENU = 348, COUNT = 349, }Source

A code representing a key's physical location. This is independent of the system's keyboard layout.

str16

str16 :: []u16Source

A type describing a string of 16-bits characters (typically used for UTF-16).

str16_elt

str16_elt :: struct { // The string element is linked into its parent string list through this field. listElt: list_elt, // The string for this element. string: str16, }Source

A type representing an element of an oc_str16 list.

str16_list

str16_list :: struct { // A linked-list of `oc_str16_elt`. list: list, // The number of elements in `list`. eltCount: u64, // The total length of the string list, which is the sum of the lengths over all elements. len: u64, }Source

str32

str32 :: []runeSource

A type describing a string of 32-bits characters (typically used for UTF-32 codepoints).

str32_elt

str32_elt :: struct { // The string element is linked into its parent string list through this field. listElt: list_elt, // The string for this element. string: str32, }Source

A type representing an element of an oc_str32 list.

str32_list

str32_list :: struct { // A linked-list of `oc_str32_elt`. list: list, // The number of elements in `list`. eltCount: u64, // The total length of the string list, which is the sum of the lengths over all elements. len: u64, }Source

str8

str8 :: stringSource

////////////////////////////////////////////////////////////////////////////// String slices and string lists. ////////////////////////////////////////////////////////////////////////////// A type representing a string of bytes.

str8_elt

str8_elt :: struct { // The string element is linked into its parent string list through this field. listElt: list_elt, // The string for this element. string: str8, }Source

A type representing an element of a string list.

str8_list

str8_list :: struct { // A linked-list of `oc_str8_elt`. list: list, // The number of elements in `list`. eltCount: u64, // The total length of the string list, which is the sum of the lengths over all elements. len: u64, }Source

A type representing a string list.

surface

surface :: u64Source

////////////////////////////////////////////////////////////////////////////// 2D/3D rendering APIs. ////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////// A 2D Vector Graphics API. ////////////////////////////////////////////////////////////////////////////// An opaque handle to a graphics surface.

text_metrics

text_metrics :: struct { // The bounding box of the inked portion of the text. ink: rect, // The logical bounding box of the text (including ascents, descents, and line gaps). logical: rect, // The amount from which to advance the cursor after drawing the text. advance: vec2, }Source

A struct describing the metrics of a run of glyphs.

ui_attribute

ui_attribute :: enum u32 { WIDTH = 0, HEIGHT = 1, AXIS = 2, MARGIN_X = 3, MARGIN_Y = 4, SPACING = 5, ALIGN_X = 6, ALIGN_Y = 7, FLOATING_X = 8, FLOATING_Y = 9, FLOAT_TARGET_X = 10, FLOAT_TARGET_Y = 11, OVERFLOW_X = 12, OVERFLOW_Y = 13, CONSTRAIN_X = 14, CONSTRAIN_Y = 15, COLOR = 16, BG_COLOR = 17, BORDER_COLOR = 18, FONT = 19, TEXT_SIZE = 20, BORDER_SIZE = 21, ROUNDNESS = 22, DRAW_MASK = 23, ANIMATION_TIME = 24, ANIMATION_MASK = 25, CLICK_THROUGH = 26, ATTRIBUTE_COUNT = 27, }Source

ui_attribute_mask

ui_attribute_mask :: enum u32 { NONE = 0, SIZE_WIDTH = 1, SIZE_HEIGHT = 2, LAYOUT_AXIS = 4, LAYOUT_MARGIN_X = 8, LAYOUT_MARGIN_Y = 16, LAYOUT_SPACING = 32, LAYOUT_ALIGN_X = 64, LAYOUT_ALIGN_Y = 128, FLOATING_X = 256, FLOATING_Y = 512, FLOAT_TARGET_X = 1024, FLOAT_TARGET_Y = 2048, OVERFLOW_X = 4096, OVERFLOW_Y = 8192, CONSTRAIN_X = 16384, CONSTRAIN_Y = 32768, COLOR = 65536, BG_COLOR = 131072, BORDER_COLOR = 262144, FONT = 524288, FONT_SIZE = 1048576, BORDER_SIZE = 2097152, ROUNDNESS = 4194304, DRAW_MASK = 8388608, ANIMATION_TIME = 16777216, ANIMATION_MASK = 33554432, CLICK_THROUGH = 67108864, }Source

ui_axis

ui_axis :: enum u32 { X = 0, Y = 1, COUNT = 2, }Source

////////////////////////////////////////////////////////////////////////////// Graphical User Interface API. ////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////// Graphical User Interface Core API. //////////////////////////////////////////////////////////////////////////////

ui_box

ui_box :: struct { listElt: list_elt, children: list, parent: ^ui_box, overlayElt: list_elt, overlay: bool, bucketElt: list_elt, key: ui_key, frameCounter: u64, keyString: str8, text: str8, tags: list, drawProc: ui_box_draw_proc, drawData: rawptr, rules: list, targetStyle: ^ui_style, style: ui_style, z: u32, floatPos: vec2, childrenSum: [2]f32, spacing: [2]f32, minSize: [2]f32, rect: rect, styleVariables: list, sig: ui_sig, fresh: bool, closed: bool, parentClosed: bool, dragging: bool, hot: bool, active: bool, scroll: vec2, pressedMouse: vec2, hotTransition: f32, activeTransition: f32, }Source

ui_text_box_result

ui_text_box_result :: struct { changed: bool, accepted: bool, text: str8, box: ^ui_box, }Source

////////////////////////////////////////////////////////////////////////////// Graphical User Interface Widgets. //////////////////////////////////////////////////////////////////////////////

unicode_range

unicode_range :: struct { // The first codepoint of the range. firstCodePoint: utf32, // The number of codepoints in the range. count: u32, }Source

A type representing a contiguous range of unicode codepoints.

utf32

utf32 :: runeSource

////////////////////////////////////////////////////////////////////////////// UTF8 encoding/decoding. ////////////////////////////////////////////////////////////////////////////// A unicode codepoint.

utf8_dec

utf8_dec :: struct { // The status of the decoding operation. If not `OC_UTF8_OK`, it describes the error that was encountered during decoding. status: utf8_status, // The decoded codepoint. codepoint: utf32, // The size of the utf8 sequence encoding that codepoint. size: u32, }Source

A type representing the result of decoding of utf8-encoded codepoint.

utf8_status

utf8_status :: enum u32 { // The operation was successful. OK = 0, // The operation unexpectedly encountered the end of the utf8 sequence. OUT_OF_BOUNDS = 1, // A continuation byte was encountered where a leading byte was expected. UNEXPECTED_CONTINUATION_BYTE = 2, // A leading byte was encountered in the middle of the encoding of utf8 codepoint. UNEXPECTED_LEADING_BYTE = 3, // The utf8 sequence contains an invalid byte. INVALID_BYTE = 4, // The operation encountered an invalid utf8 codepoint. INVALID_CODEPOINT = 5, // The utf8 sequence contains an overlong encoding of a utf8 codepoint. OVERLONG_ENCODING = 6, }Source

This enum declares the possible return status of UTF8 decoding/encoding operations.

vec2

vec2 :: [2]f32Source

////////////////////////////////////////////////////////////////////////////// Utility data structures and helpers used throughout the Orca API. ////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////// Types and helpers for vectors and matrices. ////////////////////////////////////////////////////////////////////////////// A 2D vector type.

Constants

126

Procedures

37

arena_push_type

arena_push_type :: proc(arena: ^arena, T: typeid) -> (^T)Source

////////////////////////////////////////////////////////////////////////////// Base allocator and memory arenas. //////////////////////////////////////////////////////////////////////////////

list_entry

list_entry :: proc(elt: ^list_elt, T: typeid, member: string) -> (^T)Source

////////////////////////////////////////////////////////////////////////////// Types and helpers for doubly-linked lists. ////////////////////////////////////////////////////////////////////////////// Get the entry for a given list element.

log_error

log_error :: proc(msg: cstring, loc = #caller_location)Source

Implementations of the Orca API that are defined as macros in Orca. ////////////////////////////////////////////////////////////////////////////// Helpers for logging, asserting and aborting. //////////////////////////////////////////////////////////////////////////////

str8_list_first

str8_list_first :: proc(sl: ^str8_list) -> (str8)Source

////////////////////////////////////////////////////////////////////////////// String slices and string lists. //////////////////////////////////////////////////////////////////////////////

Reference search

Find anything

Documentation preferences

Settings

System theme variants

Used only while Theme is set to System.