core/sys/orca
orca
Types
115arena
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,
}SourceA memory arena, allowing to allocate memory in a linear or stack-like fashion.
arena_chunk
arena_chunk :: struct {
listElt: list_elt,
ptr: cstring,
offset: u64,
committed: u64,
cap: u64,
}SourceA contiguous chunk of memory managed by a memory arena.
arena_options
arena_options :: struct {
// The base allocator to use with this arena
base: ^base_allocator,
// The amount of memory to reserve up-front when creating the arena.
reserve: u64,
}SourceOptions for arena creation.
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,
}SourceThis 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
base_allocator
base_allocator :: struct {
// A procedure to reserve memory from the system.
reserve: mem_reserve_proc,
// A procedure to commit memory from the system.
commit: mem_modify_proc,
// A procedure to decommit memory from the system.
decommit: mem_modify_proc,
// A procedure to release memory previously reserved from the system.
release: mem_modify_proc,
}SourceA structure that defines how to allocate memory from the system.
canvas_context
canvas_context :: u64SourceAn 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().
canvas_renderer
canvas_renderer :: u64SourceAn opaque handle representing a rendering engine for the canvas API.
cap_type
cap_type :: enum u32 {
// Don't draw caps.
NONE = 0,
// Square caps.
SQUARE = 1,
}SourceCap types.
char
char :: charSourcechar_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,
}SourceA structure describing a character input event.
clipboard_state
clipboard_state :: struct {
lastUpdate: u64,
pastedText: str8,
}Sourceclock_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
color :: struct {
c: [4]f32,
f32: color_space,
colorSpace: color_space,
}SourceA struct representing a color.
color_space
color_space :: enum u32 {
// A linear RGB color space.
RGB = 0,
// An sRGB color space.
SRGB = 1,
}SourceAn enum identifying possible color spaces.
datestamp
datestamp :: struct {
seconds: i64,
fraction: u64,
}Sourceevent
event :: struct {
// The window in which this event happened.
window: window,
// The type of the event. This determines which member of the event union is active.
type: event_type,
_: struct #raw_union {
key: key_event,
character: char_event,
mouse: mouse_event,
move: move_event,
paths: str8_list,
},
}SourceA structure describing an event sent to the application.
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
file_access :: bit_set[file_access_flag; u16]Sourcefile_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,
}SourceThis 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,
}SourceAn 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,
}SourceA 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,
}SourceA type for flags describing various file dialog options. File dialog flags.
file_dialog_flags
file_dialog_flags :: bit_set[file_dialog_flag; u32]Sourcefile_dialog_kind
file_dialog_kind :: enum u32 {
// The file dialog is a save dialog.
SAVE = 0,
// The file dialog is an open dialog.
OPEN = 1,
}SourceThis enum describes the kinds of possible file dialogs.
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,
}SourceA structure describing the result of a file dialog.
file_list
file_list :: struct {
list: list,
eltCount: u64,
}SourceAn type describing a list of enumerated files in a given directory.
file_listdir_elt
file_listdir_elt :: struct {
listElt: list_elt,
basename: str8,
type: file_type,
}Sourcefile_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,
}SourceThe type of file open flags describing file open options. Flags for the oc_file_open() function.
file_open_flags
file_open_flags :: bit_set[file_open_flag; u16]Sourcefile_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,
}SourceA structure describing the result of a call to oc_file_open_with_dialog().
file_perm
file_perm :: bit_set[file_perm_flag; u16]Sourcefile_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,
}SourceA type describing file permissions.
file_status
file_status :: struct {
uid: u64,
type: file_type,
perm: file_perm,
size: u64,
creationDate: datestamp,
accessDate: datestamp,
modificationDate: datestamp,
}Sourcefile_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,
}SourceAn 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,
}SourceThis enum is used in oc_file_seek() to specify the starting point of the seek operation.
font
font :: u64SourceAn opaque font handle.
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,
}SourceA 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,
}SourceA 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,
}SourceThis enum describes possible blending modes for color gradient.
image
image :: u64SourceAn opaque image handle.
image_region
image_region :: struct {
// The image handle.
image: image,
// The rectangular region of the image.
rect: rect,
}SourceA struct describing a rectangular sub-region of an image.
input_state
input_state :: struct {
frameCounter: u64,
keyboard: keyboard_state,
mouse: mouse_state,
text: text_state,
clipboard: clipboard_state,
}Sourceio_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,
},
}SourceA 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,
}SourceA 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,
}SourceA 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,
},
}SourceA structure describing an I/O request.
io_req_id
io_req_id :: u64SourceA type used to identify I/O requests.
joint_type
joint_type :: enum u32 {
// Miter joint.
MITER = 0,
// Bevel joint.
BEVEL = 1,
// Don't join path segments.
NONE = 2,
}SourceStroke 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,
}SourceThis 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,
}SourceA 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,
}SourceA 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. //////////////////////////////////////////////////////////////////////////////
keyboard_state
keyboard_state :: struct {
keys: [349]key_state,
mods: keymod_flags,
}Sourcekeymod_flag
keymod_flag :: enum u32 {
ALT = 0,
SHIFT = 1,
CTRL = 2,
CMD = 3,
MAIN_MODIFIER = 4,
}Sourcekeymod_flags
keymod_flags :: bit_set[keymod_flag; u32]Sourcelist
list :: struct {
// Points to the first element in the list.
first: ^list_elt,
// Points to the last element in the list.
last: ^list_elt,
}SourceA 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.
mat2x3
mat2x3 :: [6]f32SourceA 2-by-3 matrix.
mem_modify_proc
mem_modify_proc :: proc "c" (_context: ^base_allocator, ptr: rawptr, size: u64)SourceThe prototype of a procedure to modify a memory reservation.
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_button
mouse_button :: enum u32 {
LEFT = 0,
RIGHT = 1,
MIDDLE = 2,
EXT1 = 3,
EXT2 = 4,
BUTTON_COUNT = 5,
}SourceA code identifying a mouse button.
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,
}SourceA 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.
mouse_state
mouse_state :: struct {
lastUpdate: u64,
posValid: bool,
pos: vec2,
delta: vec2,
wheel: vec2,
_: struct #raw_union {
buttons: [5]key_state,
_: struct {
left: key_state,
right: key_state,
middle: key_state,
ext1: key_state,
ext2: key_state,
},
},
}Sourcemove_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,
}SourceA structure describing a window move or resize event.
pool
pool :: struct {
arena: arena,
freeList: list,
blockSize: u64,
}Sourcecurrently missing in the api.json
rect
rect :: struct {
x: f32,
y: f32,
w: f32,
h: f32,
}SourceAn axis-aligned rectangle.
rect_atlas
rect_atlas :: struct {}SourceAn 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,
}SourceA code representing a key's physical location. This is independent of the system's keyboard layout.
str16
str16 :: []u16SourceA 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,
}SourceA 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,
}Sourcestr32
str32 :: []runeSourceA 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,
}SourceA 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,
}Sourcestr8
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,
}SourceA 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,
}SourceA 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,
}SourceA struct describing the metrics of a run of glyphs.
text_state
text_state :: struct {
lastUpdate: u64,
backing: [64]utf32,
codePoints: str32,
}Sourceui_align
ui_align :: enum u32 {
START = 0,
END = 1,
CENTER = 2,
}Sourceui_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,
}Sourceui_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,
}Sourceui_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,
}Sourceui_box_draw_proc
ui_box_draw_proc :: proc "c" (arg0: ^ui_box, arg1: rawptr)Sourceui_box_floating
ui_box_floating :: [2]boolSourceui_box_size
ui_box_size :: [2]ui_sizeSourceui_context
ui_context :: struct {}Sourceui_draw_mask
ui_draw_mask :: enum u32 {
BACKGROUND = 1,
BORDER = 2,
TEXT = 4,
PROC = 8,
}SourceThese bits disable the corresponding element when they're set.
ui_edit_move
ui_edit_move :: enum u32 {
NONE = 0,
CHAR = 1,
WORD = 2,
LINE = 3,
}Sourceui_key
ui_key :: struct {
hash: u64,
}Sourceui_layout
ui_layout :: struct {
axis: ui_axis,
spacing: f32,
margin: [2]f32,
align: ui_layout_align,
overflow: [2]ui_overflow,
constrain: [2]bool,
}Sourceui_layout_align
ui_layout_align :: [2]ui_alignSourceui_overflow
ui_overflow :: enum u32 {
CLIP = 0,
ALLOW = 1,
SCROLL = 2,
}Sourceui_radio_group_info
ui_radio_group_info :: struct {
changed: bool,
selectedIndex: i32,
optionCount: i32,
options: [^]str8,
}Sourceui_select_popup_info
ui_select_popup_info :: struct {
changed: bool,
selectedIndex: i32,
optionCount: i32,
options: [^]str8,
placeholder: str8,
}Sourceui_sig
ui_sig :: struct {
box: ^ui_box,
mouse: vec2,
delta: vec2,
wheel: vec2,
lastPressedMouse: vec2,
pressed: bool,
released: bool,
clicked: bool,
doubleClicked: bool,
tripleClicked: bool,
rightPressed: bool,
closed: bool,
active: bool,
hover: bool,
focus: bool,
pasted: bool,
}Sourceui_size
ui_size :: struct {
kind: ui_size_kind,
value: f32,
relax: f32,
minSize: f32,
}Sourceui_size_kind
ui_size_kind :: enum u32 {
CHILDREN = 0,
TEXT = 1,
PIXELS = 2,
PARENT = 3,
PARENT_MINUS_PIXELS = 4,
}Sourceui_style
ui_style :: struct {
size: ui_box_size,
layout: ui_layout,
floating: ui_box_floating,
floatTarget: vec2,
_color: color,
bgColor: color,
borderColor: color,
font: font,
fontSize: f32,
borderSize: f32,
roundness: f32,
drawMask: u32,
animationTime: f32,
animationMask: ui_attribute_mask,
clickThrough: bool,
}Sourceui_text_box_info
ui_text_box_info :: struct {
text: str8,
defaultText: str8,
cursor: i32,
mark: i32,
selectionMode: ui_edit_move,
wordSelectionInitialCursor: i32,
wordSelectionInitialMark: i32,
firstDisplayedChar: i32,
cursorBlinkStart: f64,
}Sourceui_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,
}SourceA 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,
}SourceA 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,
}SourceThis 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.
vec2i
vec2i :: [2]i32SourceA 2D integer vector type.
vec3
vec3 :: [3]f32SourceA 3D vector type.
vec4
vec4 :: [4]f32SourceA 4D vector type.
window
window :: u64SourceAn opaque handle identifying a window.
Constants
126BACKING_SIZE
BACKING_SIZE :: 64SourceUNICODE_AEGEAN_NUMBERS
UNICODE_AEGEAN_NUMBERS :: unicode_range = unicode_range { 0x10100, 63 }SourceUNICODE_ALPHABETIC_PRESENTATION_FORMS
UNICODE_ALPHABETIC_PRESENTATION_FORMS :: unicode_range = unicode_range { 0xfb00, 79 }SourceUNICODE_ARABIC
UNICODE_ARABIC :: unicode_range = unicode_range { 0x0600, 255 }SourceUNICODE_ARABIC_PRESENTATION_FORMS_A
UNICODE_ARABIC_PRESENTATION_FORMS_A :: unicode_range = unicode_range { 0xfb50, 687 }SourceUNICODE_ARABIC_PRESENTATION_FORMS_B
UNICODE_ARABIC_PRESENTATION_FORMS_B :: unicode_range = unicode_range { 0xfe70, 143 }SourceUNICODE_ARMENIAN
UNICODE_ARMENIAN :: unicode_range = unicode_range { 0x0530, 95 }SourceUNICODE_ARROWS
UNICODE_ARROWS :: unicode_range = unicode_range { 0x2190, 111 }SourceUNICODE_BASIC_LATIN
UNICODE_BASIC_LATIN :: unicode_range = unicode_range { 0x0000, 127 }SourceUNICODE_BENGALI_ASSAMESE
UNICODE_BENGALI_ASSAMESE :: unicode_range = unicode_range { 0x0980, 127 }SourceUNICODE_BLOCK_ELEMENTS
UNICODE_BLOCK_ELEMENTS :: unicode_range = unicode_range { 0x2580, 31 }SourceUNICODE_BOPOMOFO
UNICODE_BOPOMOFO :: unicode_range = unicode_range { 0x3100, 47 }SourceUNICODE_BOPOMOFO_EXTENDED
UNICODE_BOPOMOFO_EXTENDED :: unicode_range = unicode_range { 0x31a0, 31 }SourceUNICODE_BOX_DRAWING
UNICODE_BOX_DRAWING :: unicode_range = unicode_range { 0x2500, 127 }SourceUNICODE_BRAILLE_PATTERNS
UNICODE_BRAILLE_PATTERNS :: unicode_range = unicode_range { 0x2800, 255 }SourceUNICODE_BUHID
UNICODE_BUHID :: unicode_range = unicode_range { 0x1740, 31 }SourceUNICODE_BYZANTINE_MUSICAL_SYMBOLS
UNICODE_BYZANTINE_MUSICAL_SYMBOLS :: unicode_range = unicode_range { 0x1d000, 255 }SourceUNICODE_C1_CONTROLS_AND_LATIN_1_SUPPLEMENT
UNICODE_C1_CONTROLS_AND_LATIN_1_SUPPLEMENT :: unicode_range = unicode_range { 0x0080, 127 }SourceUNICODE_CHEROKEE
UNICODE_CHEROKEE :: unicode_range = unicode_range { 0x13a0, 95 }SourceUNICODE_CJK_COMPATIBILITY
UNICODE_CJK_COMPATIBILITY :: unicode_range = unicode_range { 0x3300, 255 }SourceUNICODE_CJK_COMPATIBILITY_FORMS
UNICODE_CJK_COMPATIBILITY_FORMS :: unicode_range = unicode_range { 0xfe30, 31 }SourceUNICODE_CJK_COMPATIBILITY_IDEOGRAPHS
UNICODE_CJK_COMPATIBILITY_IDEOGRAPHS :: unicode_range = unicode_range { 0xf900, 511 }SourceUNICODE_CJK_COMPATIBILITY_IDEOGRAPHS_SUPPLEMENT
UNICODE_CJK_COMPATIBILITY_IDEOGRAPHS_SUPPLEMENT :: unicode_range = unicode_range { 0x2f800, 543 }SourceUNICODE_CJK_RADICALS_SUPPLEMENT
UNICODE_CJK_RADICALS_SUPPLEMENT :: unicode_range = unicode_range { 0x2e80, 127 }SourceUNICODE_CJK_SYMBOLS_AND_PUNCTUATION
UNICODE_CJK_SYMBOLS_AND_PUNCTUATION :: unicode_range = unicode_range { 0x3000, 63 }SourceUNICODE_CJK_UNIFIED_IDEOGRAPHS
UNICODE_CJK_UNIFIED_IDEOGRAPHS :: unicode_range = unicode_range { 0x4e00, 20911 }SourceUNICODE_CJK_UNIFIED_IDEOGRAPHS_EXTENSION_A
UNICODE_CJK_UNIFIED_IDEOGRAPHS_EXTENSION_A :: unicode_range = unicode_range { 0x3400, 6591 }SourceUNICODE_CJK_UNIFIED_IDEOGRAPHS_EXTENSION_B
UNICODE_CJK_UNIFIED_IDEOGRAPHS_EXTENSION_B :: unicode_range = unicode_range { 0x20000, 42719 }SourceUNICODE_COMBINING_DIACRITICAL_MARKS
UNICODE_COMBINING_DIACRITICAL_MARKS :: unicode_range = unicode_range { 0x0300, 111 }SourceUNICODE_COMBINING_DIACRITICAL_MARKS_FOR_SYMBOLS
UNICODE_COMBINING_DIACRITICAL_MARKS_FOR_SYMBOLS :: unicode_range = unicode_range { 0x20d0, 47 }SourceUNICODE_COMBINING_HALF_MARKS
UNICODE_COMBINING_HALF_MARKS :: unicode_range = unicode_range { 0xfe20, 15 }SourceUNICODE_CONTROL_PICTURES
UNICODE_CONTROL_PICTURES :: unicode_range = unicode_range { 0x2400, 63 }SourceUNICODE_CURRENCY_SYMBOLS
UNICODE_CURRENCY_SYMBOLS :: unicode_range = unicode_range { 0x20a0, 47 }SourceUNICODE_CYPRIOT_SYLLABARY
UNICODE_CYPRIOT_SYLLABARY :: unicode_range = unicode_range { 0x10800, 63 }SourceUNICODE_CYRILLIC
UNICODE_CYRILLIC :: unicode_range = unicode_range { 0x0400, 255 }SourceUNICODE_CYRILLIC_SUPPLEMENT
UNICODE_CYRILLIC_SUPPLEMENT :: unicode_range = unicode_range { 0x0500, 47 }SourceUNICODE_DESERET
UNICODE_DESERET :: unicode_range = unicode_range { 0x10400, 79 }SourceUNICODE_DEVANAGARI
UNICODE_DEVANAGARI :: unicode_range = unicode_range { 0x0900, 127 }SourceUNICODE_DINGBATS
UNICODE_DINGBATS :: unicode_range = unicode_range { 0x2700, 191 }SourceUNICODE_ENCLOSED_ALPHANUMERICS
UNICODE_ENCLOSED_ALPHANUMERICS :: unicode_range = unicode_range { 0x2460, 159 }SourceUNICODE_ENCLOSED_CJK_LETTERS_AND_MONTHS
UNICODE_ENCLOSED_CJK_LETTERS_AND_MONTHS :: unicode_range = unicode_range { 0x3200, 255 }SourceUNICODE_ETHIOPIC
UNICODE_ETHIOPIC :: unicode_range = unicode_range { 0x1200, 383 }SourceUNICODE_GENERAL_PUNCTUATION
UNICODE_GENERAL_PUNCTUATION :: unicode_range = unicode_range { 0x2000, 111 }SourceUNICODE_GEOMETRIC_SHAPES
UNICODE_GEOMETRIC_SHAPES :: unicode_range = unicode_range { 0x25a0, 95 }SourceUNICODE_GEORGIAN
UNICODE_GEORGIAN :: unicode_range = unicode_range { 0x10a0, 95 }SourceUNICODE_GOTHIC
UNICODE_GOTHIC :: unicode_range = unicode_range { 0x10330, 31 }SourceUNICODE_GREEK_COPTIC
UNICODE_GREEK_COPTIC :: unicode_range = unicode_range { 0x0370, 143 }SourceUNICODE_GREEK_EXTENDED
UNICODE_GREEK_EXTENDED :: unicode_range = unicode_range { 0x1f00, 255 }SourceUNICODE_GUJARATI
UNICODE_GUJARATI :: unicode_range = unicode_range { 0x0a80, 127 }SourceUNICODE_GURMUKHI
UNICODE_GURMUKHI :: unicode_range = unicode_range { 0x0a00, 127 }SourceUNICODE_HALFWIDTH_AND_FULLWIDTH_FORMS
UNICODE_HALFWIDTH_AND_FULLWIDTH_FORMS :: unicode_range = unicode_range { 0xff00, 239 }SourceUNICODE_HANGUL_COMPATIBILITY_JAMO
UNICODE_HANGUL_COMPATIBILITY_JAMO :: unicode_range = unicode_range { 0x3130, 95 }SourceUNICODE_HANGUL_JAMO
UNICODE_HANGUL_JAMO :: unicode_range = unicode_range { 0x1100, 255 }SourceUNICODE_HANGUL_SYLLABLES
UNICODE_HANGUL_SYLLABLES :: unicode_range = unicode_range { 0xac00, 11183 }SourceUNICODE_HANUNOO
UNICODE_HANUNOO :: unicode_range = unicode_range { 0x1720, 31 }SourceUNICODE_HEBREW
UNICODE_HEBREW :: unicode_range = unicode_range { 0x0590, 111 }SourceUNICODE_HIGH_SURROGATE_AREA
UNICODE_HIGH_SURROGATE_AREA :: unicode_range = unicode_range { 0xd800, 1023 }SourceUNICODE_HIRAGANA
UNICODE_HIRAGANA :: unicode_range = unicode_range { 0x3040, 95 }SourceUNICODE_IDEOGRAPHIC_DESCRIPTION_CHARACTERS
UNICODE_IDEOGRAPHIC_DESCRIPTION_CHARACTERS :: unicode_range = unicode_range { 0x2ff0, 15 }SourceUNICODE_IPA_EXTENSIONS
UNICODE_IPA_EXTENSIONS :: unicode_range = unicode_range { 0x0250, 95 }SourceUNICODE_KANBUN_KUNTEN
UNICODE_KANBUN_KUNTEN :: unicode_range = unicode_range { 0x3190, 15 }SourceUNICODE_KANGXI_RADICALS
UNICODE_KANGXI_RADICALS :: unicode_range = unicode_range { 0x2f00, 223 }SourceUNICODE_KANNADA
UNICODE_KANNADA :: unicode_range = unicode_range { 0x0c80, 127 }SourceUNICODE_KATAKANA
UNICODE_KATAKANA :: unicode_range = unicode_range { 0x30a0, 95 }SourceUNICODE_KATAKANA_PHONETIC_EXTENSIONS
UNICODE_KATAKANA_PHONETIC_EXTENSIONS :: unicode_range = unicode_range { 0x31f0, 15 }SourceUNICODE_KHMER
UNICODE_KHMER :: unicode_range = unicode_range { 0x1780, 127 }SourceUNICODE_KHMER_SYMBOLS
UNICODE_KHMER_SYMBOLS :: unicode_range = unicode_range { 0x19e0, 31 }SourceUNICODE_LAO
UNICODE_LAO :: unicode_range = unicode_range { 0x0e80, 127 }SourceUNICODE_LATIN_EXTENDED_A
UNICODE_LATIN_EXTENDED_A :: unicode_range = unicode_range { 0x0100, 127 }SourceUNICODE_LATIN_EXTENDED_ADDITIONAL
UNICODE_LATIN_EXTENDED_ADDITIONAL :: unicode_range = unicode_range { 0x1e00, 255 }SourceUNICODE_LATIN_EXTENDED_B
UNICODE_LATIN_EXTENDED_B :: unicode_range = unicode_range { 0x0180, 207 }SourceUNICODE_LETTERLIKE_SYMBOLS
UNICODE_LETTERLIKE_SYMBOLS :: unicode_range = unicode_range { 0x2100, 79 }SourceUNICODE_LIMBU
UNICODE_LIMBU :: unicode_range = unicode_range { 0x1900, 79 }SourceUNICODE_LINEAR_B_IDEOGRAMS
UNICODE_LINEAR_B_IDEOGRAMS :: unicode_range = unicode_range { 0x10080, 127 }SourceUNICODE_LINEAR_B_SYLLABARY
UNICODE_LINEAR_B_SYLLABARY :: unicode_range = unicode_range { 0x10000, 127 }SourceUNICODE_LOW_SURROGATE_AREA
UNICODE_LOW_SURROGATE_AREA :: unicode_range = unicode_range { 0xdc00, 1023 }SourceUNICODE_MALAYALAM
UNICODE_MALAYALAM :: unicode_range = unicode_range { 0x0d00, 255 }SourceUNICODE_MATHEMATICAL_ALPHANUMERIC_SYMBOLS
UNICODE_MATHEMATICAL_ALPHANUMERIC_SYMBOLS :: unicode_range = unicode_range { 0x1d400, 1023 }SourceUNICODE_MATHEMATICAL_OPERATORS
UNICODE_MATHEMATICAL_OPERATORS :: unicode_range = unicode_range { 0x2200, 255 }SourceUNICODE_MISCELLANEOUS_MATHEMATICAL_SYMBOLS_A
UNICODE_MISCELLANEOUS_MATHEMATICAL_SYMBOLS_A :: unicode_range = unicode_range { 0x27c0, 47 }SourceUNICODE_MISCELLANEOUS_MATHEMATICAL_SYMBOLS_B
UNICODE_MISCELLANEOUS_MATHEMATICAL_SYMBOLS_B :: unicode_range = unicode_range { 0x2980, 127 }SourceUNICODE_MISCELLANEOUS_SYMBOLS
UNICODE_MISCELLANEOUS_SYMBOLS :: unicode_range = unicode_range { 0x2600, 255 }SourceUNICODE_MISCELLANEOUS_SYMBOLS_AND_ARROWS
UNICODE_MISCELLANEOUS_SYMBOLS_AND_ARROWS :: unicode_range = unicode_range { 0x2b00, 255 }SourceUNICODE_MISCELLANEOUS_TECHNICAL
UNICODE_MISCELLANEOUS_TECHNICAL :: unicode_range = unicode_range { 0x2300, 255 }SourceUNICODE_MONGOLIAN
UNICODE_MONGOLIAN :: unicode_range = unicode_range { 0x1800, 175 }SourceUNICODE_MUSICAL_SYMBOLS
UNICODE_MUSICAL_SYMBOLS :: unicode_range = unicode_range { 0x1d100, 255 }SourceUNICODE_MYANMAR
UNICODE_MYANMAR :: unicode_range = unicode_range { 0x1000, 159 }SourceUNICODE_NUMBER_FORMS
UNICODE_NUMBER_FORMS :: unicode_range = unicode_range { 0x2150, 63 }SourceUNICODE_OGHAM
UNICODE_OGHAM :: unicode_range = unicode_range { 0x1680, 31 }SourceUNICODE_OLD_ITALIC
UNICODE_OLD_ITALIC :: unicode_range = unicode_range { 0x10300, 47 }SourceUNICODE_OPTICAL_CHARACTER_RECOGNITION
UNICODE_OPTICAL_CHARACTER_RECOGNITION :: unicode_range = unicode_range { 0x2440, 31 }SourceUNICODE_ORIYA
UNICODE_ORIYA :: unicode_range = unicode_range { 0x0b00, 127 }SourceUNICODE_OSMANYA
UNICODE_OSMANYA :: unicode_range = unicode_range { 0x10480, 47 }SourceUNICODE_PHONETIC_EXTENSIONS
UNICODE_PHONETIC_EXTENSIONS :: unicode_range = unicode_range { 0x1d00, 127 }SourceUNICODE_PRIVATE_USE_AREA
UNICODE_PRIVATE_USE_AREA :: unicode_range = unicode_range { 0xe000, 6399 }SourceUNICODE_RUNIC
UNICODE_RUNIC :: unicode_range = unicode_range { 0x16a0, 95 }SourceUNICODE_SHAVIAN
UNICODE_SHAVIAN :: unicode_range = unicode_range { 0x10450, 47 }SourceUNICODE_SINHALA
UNICODE_SINHALA :: unicode_range = unicode_range { 0x0d80, 127 }SourceUNICODE_SMALL_FORM_VARIANTS
UNICODE_SMALL_FORM_VARIANTS :: unicode_range = unicode_range { 0xfe50, 31 }SourceUNICODE_SPACING_MODIFIER_LETTERS
UNICODE_SPACING_MODIFIER_LETTERS :: unicode_range = unicode_range { 0x02b0, 79 }SourceUNICODE_SPECIALS
UNICODE_SPECIALS :: unicode_range = unicode_range { 0xfff0, 15 }SourceUNICODE_SUPERSCRIPTS_AND_SUBSCRIPTS
UNICODE_SUPERSCRIPTS_AND_SUBSCRIPTS :: unicode_range = unicode_range { 0x2070, 47 }SourceUNICODE_SUPPLEMENTAL_ARROWS_A
UNICODE_SUPPLEMENTAL_ARROWS_A :: unicode_range = unicode_range { 0x27f0, 15 }SourceUNICODE_SUPPLEMENTAL_ARROWS_B
UNICODE_SUPPLEMENTAL_ARROWS_B :: unicode_range = unicode_range { 0x2900, 127 }SourceUNICODE_SUPPLEMENTAL_MATHEMATICAL_OPERATORS
UNICODE_SUPPLEMENTAL_MATHEMATICAL_OPERATORS :: unicode_range = unicode_range { 0x2a00, 255 }SourceUNICODE_SUPPLEMENTARY_PRIVATE_USE_AREA_A
UNICODE_SUPPLEMENTARY_PRIVATE_USE_AREA_A :: unicode_range = unicode_range { 0xf0000, 65533 }SourceUNICODE_SUPPLEMENTARY_PRIVATE_USE_AREA_B
UNICODE_SUPPLEMENTARY_PRIVATE_USE_AREA_B :: unicode_range = unicode_range { 0x100000, 65533 }SourceUNICODE_SYRIAC
UNICODE_SYRIAC :: unicode_range = unicode_range { 0x0700, 79 }SourceUNICODE_TAGALOG
UNICODE_TAGALOG :: unicode_range = unicode_range { 0x1700, 31 }SourceUNICODE_TAGBANWA
UNICODE_TAGBANWA :: unicode_range = unicode_range { 0x1760, 31 }SourceUNICODE_TAGS
UNICODE_TAGS :: unicode_range = unicode_range { 0xe0000, 127 }SourceUNICODE_TAI_LE
UNICODE_TAI_LE :: unicode_range = unicode_range { 0x1950, 47 }SourceUNICODE_TAI_XUAN_JING_SYMBOLS
UNICODE_TAI_XUAN_JING_SYMBOLS :: unicode_range = unicode_range { 0x1d300, 95 }SourceUNICODE_TAMIL
UNICODE_TAMIL :: unicode_range = unicode_range { 0x0b80, 127 }SourceUNICODE_TELUGU
UNICODE_TELUGU :: unicode_range = unicode_range { 0x0c00, 127 }SourceUNICODE_THAANA
UNICODE_THAANA :: unicode_range = unicode_range { 0x0780, 63 }SourceUNICODE_THAI
UNICODE_THAI :: unicode_range = unicode_range { 0x0e00, 127 }SourceUNICODE_TIBETAN
UNICODE_TIBETAN :: unicode_range = unicode_range { 0x0f00, 255 }SourceUNICODE_UGARITIC
UNICODE_UGARITIC :: unicode_range = unicode_range { 0x10380, 31 }SourceUNICODE_UNIFIED_CANADIAN_ABORIGINAL_SYLLABICS
UNICODE_UNIFIED_CANADIAN_ABORIGINAL_SYLLABICS :: unicode_range = unicode_range { 0x1400, 639 }SourceUNICODE_VARIATION_SELECTORS
UNICODE_VARIATION_SELECTORS :: unicode_range = unicode_range { 0xfe00, 15 }SourceUNICODE_VARIATION_SELECTORS_SUPPLEMENT
UNICODE_VARIATION_SELECTORS_SUPPLEMENT :: unicode_range = unicode_range { 0xe0100, 239 }SourceUNICODE_YIJING_HEXAGRAM_SYMBOLS
UNICODE_YIJING_HEXAGRAM_SYMBOLS :: unicode_range = unicode_range { 0x4dc0, 63 }SourceUNICODE_YI_RADICALS
UNICODE_YI_RADICALS :: unicode_range = unicode_range { 0xa490, 63 }SourceUNICODE_YI_SYLLABLES
UNICODE_YI_SYLLABLES :: unicode_range = unicode_range { 0xa000, 1167 }Sourcescratch_end
scratch_end :: arena_scope_endSourceProcedures
37abort
abort :: proc(msg: cstring, loc = #caller_location)Sourcearena_push_array
arena_push_array :: proc(arena: ^arena, T: typeid, count: u64) -> ([]T)Sourcearena_push_type
arena_push_type :: proc(arena: ^arena, T: typeid) -> (^T)Source////////////////////////////////////////////////////////////////////////////// Base allocator and memory arenas. //////////////////////////////////////////////////////////////////////////////
create_odin_logger
create_odin_logger :: proc(lowest = runtime.Logger_Level.Debug, ident: untyped string = "") -> (runtime.Logger)Sourcefile_read_slice
file_read_slice :: proc(file: file, slice: []char) -> (u64)Sourcefile_write_slice
file_write_slice :: proc(file: file, slice: []char) -> (u64)Sourcelist_checked_entry
list_checked_entry :: proc(elt: ^list_elt, T: typeid, member: string) -> (^T)SourceSame as list_entry but elt might be nil.
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.
list_first_entry
list_first_entry :: proc(list: ^list, T: typeid, member: string) -> (^T)Sourcelist_for
list_for :: proc(list: ^list, elt: ^^list_elt, T: typeid, member: string) -> (^T, bool)SourceExample:
_elt: ^list_elt
for elt in oc.list_for(list, &_elt, int, "elt") {
}list_for_reverse
list_for_reverse :: proc(list: ^list, elt: ^^list_elt, T: typeid, member: string) -> (^T, bool)Sourcelist_iter
list_iter :: proc(list: ^list, elt: ^^list_elt, T: typeid, member: string) -> (^T, bool)Sourcelist_iter_reverse
list_iter_reverse :: proc(list: ^list, elt: ^^list_elt, T: typeid, member: string) -> (^T, bool)Sourcelist_last_entry
list_last_entry :: proc(list: ^list, T: typeid, member: string) -> (^T)Sourcelist_next_entry
list_next_entry :: proc(list: ^list, elt: ^list_elt, T: typeid, member: string) -> (^T)SourceGet the next entry in a list.
list_pop_back_entry
list_pop_back_entry :: proc(list: ^list, T: typeid, member: string) -> (^T)Sourcelist_pop_front_entry
list_pop_front_entry :: proc(list: ^list, T: typeid, member: string) -> (^T)Sourcelist_prev_entry
list_prev_entry :: proc(list: ^list, elt: ^list_elt, T: typeid, member: string) -> (^T)SourceGet the previous entry in a list.
log_error
log_error :: proc(msg: cstring, loc = #caller_location)SourceImplementations of the Orca API that are defined as macros in Orca. ////////////////////////////////////////////////////////////////////////////// Helpers for logging, asserting and aborting. //////////////////////////////////////////////////////////////////////////////
log_info
log_info :: proc(msg: cstring, loc = #caller_location)Sourcelog_typed
log_typed :: proc(level: log_level, msg: cstring, loc = #caller_location)Sourcelog_warning
log_warning :: proc(msg: cstring, loc = #caller_location)Sourceodin_logger_proc
odin_logger_proc :: proc(logger_data: rawptr, level: runtime.Logger_Level, text: string, options: runtime.Logger_Options, location = #caller_location)Sourcestr16_list_first
str16_list_first :: proc(sl: ^str16_list) -> (str16)Sourcestr16_list_for
str16_list_for :: proc(list: ^str16_list, elt: ^^list_elt) -> (^str16_elt, bool)Sourcestr16_list_last
str16_list_last :: proc(sl: ^str16_list) -> (str16)Sourcestr32_list_first
str32_list_first :: proc(sl: ^str32_list) -> (str32)Sourcestr32_list_for
str32_list_for :: proc(list: ^str32_list, elt: ^^list_elt) -> (^str32_elt, bool)Sourcestr32_list_last
str32_list_last :: proc(sl: ^str32_list) -> (str32)Sourcestr8_list_empty
str8_list_empty :: proc(list: str8_list) -> (bool)Sourcestr8_list_first
str8_list_first :: proc(sl: ^str8_list) -> (str8)Source////////////////////////////////////////////////////////////////////////////// String slices and string lists. //////////////////////////////////////////////////////////////////////////////
str8_list_for
str8_list_for :: proc(list: ^str8_list, elt: ^^list_elt) -> (^str8_elt, bool)Sourcestr8_list_iter
str8_list_iter :: proc(list: ^str8_list, elt: ^^list_elt) -> (^str8_elt, bool)Sourcestr8_list_last
str8_list_last :: proc(sl: ^str8_list) -> (str8)Sourceui_container
ui_container :: proc(name: string) -> (^ui_box)Sourceui_menu
ui_menu :: proc(key: string, name: string)Sourceui_menu_bar
ui_menu_bar :: proc(key: string)Source