diff --git a/.github/workflows/build-doc-site.yml b/.github/workflows/build-doc-site.yml index a18dc144..f4f56330 100644 --- a/.github/workflows/build-doc-site.yml +++ b/.github/workflows/build-doc-site.yml @@ -15,6 +15,9 @@ jobs: - uses: actions/setup-python@v5 with: python-version: 3.x + - name: buid api doc + run: | + python gen_doc.py src/api.json doc/mkdocs - name: build site run: | pip install mkdocs diff --git a/doc/mkdocs/docs/api/Application.md b/doc/mkdocs/docs/api/Application.md deleted file mode 100644 index 8a7dd64e..00000000 --- a/doc/mkdocs/docs/api/Application.md +++ /dev/null @@ -1,10 +0,0 @@ -# Application - -Input, windowing, dialogs. - -## Modules - -- [Events](Application/Events.md) Application events. - ---- - diff --git a/doc/mkdocs/docs/api/Application/Events.md b/doc/mkdocs/docs/api/Application/Events.md deleted file mode 100644 index f788b63a..00000000 --- a/doc/mkdocs/docs/api/Application/Events.md +++ /dev/null @@ -1,945 +0,0 @@ -# Events - -Application events. - -## Types - -####
oc_event_type
- -``` -typedef enum oc_event_type -{ - OC_EVENT_NONE = 0, - OC_EVENT_KEYBOARD_MODS = 1, - OC_EVENT_KEYBOARD_KEY = 2, - OC_EVENT_KEYBOARD_CHAR = 3, - OC_EVENT_MOUSE_BUTTON = 4, - OC_EVENT_MOUSE_MOVE = 5, - OC_EVENT_MOUSE_WHEEL = 6, - OC_EVENT_MOUSE_ENTER = 7, - OC_EVENT_MOUSE_LEAVE = 8, - OC_EVENT_CLIPBOARD_PASTE = 9, - OC_EVENT_WINDOW_RESIZE = 10, - OC_EVENT_WINDOW_MOVE = 11, - OC_EVENT_WINDOW_FOCUS = 12, - OC_EVENT_WINDOW_UNFOCUS = 13, - OC_EVENT_WINDOW_HIDE = 14, - OC_EVENT_WINDOW_SHOW = 15, - OC_EVENT_WINDOW_CLOSE = 16, - OC_EVENT_PATHDROP = 17, - OC_EVENT_FRAME = 18, - OC_EVENT_QUIT = 19 -} oc_event_type; -``` - -**Enum Constants** - -- OC_EVENT_NONE -- OC_EVENT_KEYBOARD_MODS -- OC_EVENT_KEYBOARD_KEY -- OC_EVENT_KEYBOARD_CHAR -- OC_EVENT_MOUSE_BUTTON -- OC_EVENT_MOUSE_MOVE -- OC_EVENT_MOUSE_WHEEL -- OC_EVENT_MOUSE_ENTER -- OC_EVENT_MOUSE_LEAVE -- OC_EVENT_CLIPBOARD_PASTE -- OC_EVENT_WINDOW_RESIZE -- OC_EVENT_WINDOW_MOVE -- OC_EVENT_WINDOW_FOCUS -- OC_EVENT_WINDOW_UNFOCUS -- OC_EVENT_WINDOW_HIDE -- OC_EVENT_WINDOW_SHOW -- OC_EVENT_WINDOW_CLOSE -- OC_EVENT_PATHDROP -- OC_EVENT_FRAME -- OC_EVENT_QUIT - - ---- - -####
oc_key_action
- -``` -typedef enum oc_key_action -{ - OC_KEY_NO_ACTION = 0, - OC_KEY_PRESS = 1, - OC_KEY_RELEASE = 2, - OC_KEY_REPEAT = 3 -} oc_key_action; -``` - -**Enum Constants** - -- OC_KEY_NO_ACTION -- OC_KEY_PRESS -- OC_KEY_RELEASE -- OC_KEY_REPEAT - - ---- - -####
oc_scan_code
- -``` -typedef enum oc_scan_code -{ - OC_SCANCODE_UNKNOWN = 0, - OC_SCANCODE_SPACE = 32, - OC_SCANCODE_APOSTROPHE = 39, - OC_SCANCODE_COMMA = 44, - OC_SCANCODE_MINUS = 45, - OC_SCANCODE_PERIOD = 46, - OC_SCANCODE_SLASH = 47, - OC_SCANCODE_0 = 48, - OC_SCANCODE_1 = 49, - OC_SCANCODE_2 = 50, - OC_SCANCODE_3 = 51, - OC_SCANCODE_4 = 52, - OC_SCANCODE_5 = 53, - OC_SCANCODE_6 = 54, - OC_SCANCODE_7 = 55, - OC_SCANCODE_8 = 56, - OC_SCANCODE_9 = 57, - OC_SCANCODE_SEMICOLON = 59, - OC_SCANCODE_EQUAL = 61, - OC_SCANCODE_LEFT_BRACKET = 91, - OC_SCANCODE_BACKSLASH = 92, - OC_SCANCODE_RIGHT_BRACKET = 93, - OC_SCANCODE_GRAVE_ACCENT = 96, - OC_SCANCODE_A = 97, - OC_SCANCODE_B = 98, - OC_SCANCODE_C = 99, - OC_SCANCODE_D = 100, - OC_SCANCODE_E = 101, - OC_SCANCODE_F = 102, - OC_SCANCODE_G = 103, - OC_SCANCODE_H = 104, - OC_SCANCODE_I = 105, - OC_SCANCODE_J = 106, - OC_SCANCODE_K = 107, - OC_SCANCODE_L = 108, - OC_SCANCODE_M = 109, - OC_SCANCODE_N = 110, - OC_SCANCODE_O = 111, - OC_SCANCODE_P = 112, - OC_SCANCODE_Q = 113, - OC_SCANCODE_R = 114, - OC_SCANCODE_S = 115, - OC_SCANCODE_T = 116, - OC_SCANCODE_U = 117, - OC_SCANCODE_V = 118, - OC_SCANCODE_W = 119, - OC_SCANCODE_X = 120, - OC_SCANCODE_Y = 121, - OC_SCANCODE_Z = 122, - OC_SCANCODE_WORLD_1 = 161, - OC_SCANCODE_WORLD_2 = 162, - OC_SCANCODE_ESCAPE = 256, - OC_SCANCODE_ENTER = 257, - OC_SCANCODE_TAB = 258, - OC_SCANCODE_BACKSPACE = 259, - OC_SCANCODE_INSERT = 260, - OC_SCANCODE_DELETE = 261, - OC_SCANCODE_RIGHT = 262, - OC_SCANCODE_LEFT = 263, - OC_SCANCODE_DOWN = 264, - OC_SCANCODE_UP = 265, - OC_SCANCODE_PAGE_UP = 266, - OC_SCANCODE_PAGE_DOWN = 267, - OC_SCANCODE_HOME = 268, - OC_SCANCODE_END = 269, - OC_SCANCODE_CAPS_LOCK = 280, - OC_SCANCODE_SCROLL_LOCK = 281, - OC_SCANCODE_NUM_LOCK = 282, - OC_SCANCODE_PRINT_SCREEN = 283, - OC_SCANCODE_PAUSE = 284, - OC_SCANCODE_F1 = 290, - OC_SCANCODE_F2 = 291, - OC_SCANCODE_F3 = 292, - OC_SCANCODE_F4 = 293, - OC_SCANCODE_F5 = 294, - OC_SCANCODE_F6 = 295, - OC_SCANCODE_F7 = 296, - OC_SCANCODE_F8 = 297, - OC_SCANCODE_F9 = 298, - OC_SCANCODE_F10 = 299, - OC_SCANCODE_F11 = 300, - OC_SCANCODE_F12 = 301, - OC_SCANCODE_F13 = 302, - OC_SCANCODE_F14 = 303, - OC_SCANCODE_F15 = 304, - OC_SCANCODE_F16 = 305, - OC_SCANCODE_F17 = 306, - OC_SCANCODE_F18 = 307, - OC_SCANCODE_F19 = 308, - OC_SCANCODE_F20 = 309, - OC_SCANCODE_F21 = 310, - OC_SCANCODE_F22 = 311, - OC_SCANCODE_F23 = 312, - OC_SCANCODE_F24 = 313, - OC_SCANCODE_F25 = 314, - OC_SCANCODE_KP_0 = 320, - OC_SCANCODE_KP_1 = 321, - OC_SCANCODE_KP_2 = 322, - OC_SCANCODE_KP_3 = 323, - OC_SCANCODE_KP_4 = 324, - OC_SCANCODE_KP_5 = 325, - OC_SCANCODE_KP_6 = 326, - OC_SCANCODE_KP_7 = 327, - OC_SCANCODE_KP_8 = 328, - OC_SCANCODE_KP_9 = 329, - OC_SCANCODE_KP_DECIMAL = 330, - OC_SCANCODE_KP_DIVIDE = 331, - OC_SCANCODE_KP_MULTIPLY = 332, - OC_SCANCODE_KP_SUBTRACT = 333, - OC_SCANCODE_KP_ADD = 334, - OC_SCANCODE_KP_ENTER = 335, - OC_SCANCODE_KP_EQUAL = 336, - OC_SCANCODE_LEFT_SHIFT = 340, - OC_SCANCODE_LEFT_CONTROL = 341, - OC_SCANCODE_LEFT_ALT = 342, - OC_SCANCODE_LEFT_SUPER = 343, - OC_SCANCODE_RIGHT_SHIFT = 344, - OC_SCANCODE_RIGHT_CONTROL = 345, - OC_SCANCODE_RIGHT_ALT = 346, - OC_SCANCODE_RIGHT_SUPER = 347, - OC_SCANCODE_MENU = 348, - OC_SCANCODE_COUNT = 349 -} oc_scan_code; -``` - -**Enum Constants** - -- OC_SCANCODE_UNKNOWN -- OC_SCANCODE_SPACE -- OC_SCANCODE_APOSTROPHE -- OC_SCANCODE_COMMA -- OC_SCANCODE_MINUS -- OC_SCANCODE_PERIOD -- OC_SCANCODE_SLASH -- OC_SCANCODE_0 -- OC_SCANCODE_1 -- OC_SCANCODE_2 -- OC_SCANCODE_3 -- OC_SCANCODE_4 -- OC_SCANCODE_5 -- OC_SCANCODE_6 -- OC_SCANCODE_7 -- OC_SCANCODE_8 -- OC_SCANCODE_9 -- OC_SCANCODE_SEMICOLON -- OC_SCANCODE_EQUAL -- OC_SCANCODE_LEFT_BRACKET -- OC_SCANCODE_BACKSLASH -- OC_SCANCODE_RIGHT_BRACKET -- OC_SCANCODE_GRAVE_ACCENT -- OC_SCANCODE_A -- OC_SCANCODE_B -- OC_SCANCODE_C -- OC_SCANCODE_D -- OC_SCANCODE_E -- OC_SCANCODE_F -- OC_SCANCODE_G -- OC_SCANCODE_H -- OC_SCANCODE_I -- OC_SCANCODE_J -- OC_SCANCODE_K -- OC_SCANCODE_L -- OC_SCANCODE_M -- OC_SCANCODE_N -- OC_SCANCODE_O -- OC_SCANCODE_P -- OC_SCANCODE_Q -- OC_SCANCODE_R -- OC_SCANCODE_S -- OC_SCANCODE_T -- OC_SCANCODE_U -- OC_SCANCODE_V -- OC_SCANCODE_W -- OC_SCANCODE_X -- OC_SCANCODE_Y -- OC_SCANCODE_Z -- OC_SCANCODE_WORLD_1 -- OC_SCANCODE_WORLD_2 -- OC_SCANCODE_ESCAPE -- OC_SCANCODE_ENTER -- OC_SCANCODE_TAB -- OC_SCANCODE_BACKSPACE -- OC_SCANCODE_INSERT -- OC_SCANCODE_DELETE -- OC_SCANCODE_RIGHT -- OC_SCANCODE_LEFT -- OC_SCANCODE_DOWN -- OC_SCANCODE_UP -- OC_SCANCODE_PAGE_UP -- OC_SCANCODE_PAGE_DOWN -- OC_SCANCODE_HOME -- OC_SCANCODE_END -- OC_SCANCODE_CAPS_LOCK -- OC_SCANCODE_SCROLL_LOCK -- OC_SCANCODE_NUM_LOCK -- OC_SCANCODE_PRINT_SCREEN -- OC_SCANCODE_PAUSE -- OC_SCANCODE_F1 -- OC_SCANCODE_F2 -- OC_SCANCODE_F3 -- OC_SCANCODE_F4 -- OC_SCANCODE_F5 -- OC_SCANCODE_F6 -- OC_SCANCODE_F7 -- OC_SCANCODE_F8 -- OC_SCANCODE_F9 -- OC_SCANCODE_F10 -- OC_SCANCODE_F11 -- OC_SCANCODE_F12 -- OC_SCANCODE_F13 -- OC_SCANCODE_F14 -- OC_SCANCODE_F15 -- OC_SCANCODE_F16 -- OC_SCANCODE_F17 -- OC_SCANCODE_F18 -- OC_SCANCODE_F19 -- OC_SCANCODE_F20 -- OC_SCANCODE_F21 -- OC_SCANCODE_F22 -- OC_SCANCODE_F23 -- OC_SCANCODE_F24 -- OC_SCANCODE_F25 -- OC_SCANCODE_KP_0 -- OC_SCANCODE_KP_1 -- OC_SCANCODE_KP_2 -- OC_SCANCODE_KP_3 -- OC_SCANCODE_KP_4 -- OC_SCANCODE_KP_5 -- OC_SCANCODE_KP_6 -- OC_SCANCODE_KP_7 -- OC_SCANCODE_KP_8 -- OC_SCANCODE_KP_9 -- OC_SCANCODE_KP_DECIMAL -- OC_SCANCODE_KP_DIVIDE -- OC_SCANCODE_KP_MULTIPLY -- OC_SCANCODE_KP_SUBTRACT -- OC_SCANCODE_KP_ADD -- OC_SCANCODE_KP_ENTER -- OC_SCANCODE_KP_EQUAL -- OC_SCANCODE_LEFT_SHIFT -- OC_SCANCODE_LEFT_CONTROL -- OC_SCANCODE_LEFT_ALT -- OC_SCANCODE_LEFT_SUPER -- OC_SCANCODE_RIGHT_SHIFT -- OC_SCANCODE_RIGHT_CONTROL -- OC_SCANCODE_RIGHT_ALT -- OC_SCANCODE_RIGHT_SUPER -- OC_SCANCODE_MENU -- OC_SCANCODE_COUNT - - ---- - -####
oc_key_code
- -``` -typedef enum oc_key_code -{ - OC_KEY_UNKNOWN = 0, - OC_KEY_SPACE = 32, - OC_KEY_APOSTROPHE = 39, - OC_KEY_COMMA = 44, - OC_KEY_MINUS = 45, - OC_KEY_PERIOD = 46, - OC_KEY_SLASH = 47, - OC_KEY_0 = 48, - OC_KEY_1 = 49, - OC_KEY_2 = 50, - OC_KEY_3 = 51, - OC_KEY_4 = 52, - OC_KEY_5 = 53, - OC_KEY_6 = 54, - OC_KEY_7 = 55, - OC_KEY_8 = 56, - OC_KEY_9 = 57, - OC_KEY_SEMICOLON = 59, - OC_KEY_EQUAL = 61, - OC_KEY_LEFT_BRACKET = 91, - OC_KEY_BACKSLASH = 92, - OC_KEY_RIGHT_BRACKET = 93, - OC_KEY_GRAVE_ACCENT = 96, - OC_KEY_A = 97, - OC_KEY_B = 98, - OC_KEY_C = 99, - OC_KEY_D = 100, - OC_KEY_E = 101, - OC_KEY_F = 102, - OC_KEY_G = 103, - OC_KEY_H = 104, - OC_KEY_I = 105, - OC_KEY_J = 106, - OC_KEY_K = 107, - OC_KEY_L = 108, - OC_KEY_M = 109, - OC_KEY_N = 110, - OC_KEY_O = 111, - OC_KEY_P = 112, - OC_KEY_Q = 113, - OC_KEY_R = 114, - OC_KEY_S = 115, - OC_KEY_T = 116, - OC_KEY_U = 117, - OC_KEY_V = 118, - OC_KEY_W = 119, - OC_KEY_X = 120, - OC_KEY_Y = 121, - OC_KEY_Z = 122, - OC_KEY_WORLD_1 = 161, - OC_KEY_WORLD_2 = 162, - OC_KEY_ESCAPE = 256, - OC_KEY_ENTER = 257, - OC_KEY_TAB = 258, - OC_KEY_BACKSPACE = 259, - OC_KEY_INSERT = 260, - OC_KEY_DELETE = 261, - OC_KEY_RIGHT = 262, - OC_KEY_LEFT = 263, - OC_KEY_DOWN = 264, - OC_KEY_UP = 265, - OC_KEY_PAGE_UP = 266, - OC_KEY_PAGE_DOWN = 267, - OC_KEY_HOME = 268, - OC_KEY_END = 269, - OC_KEY_CAPS_LOCK = 280, - OC_KEY_SCROLL_LOCK = 281, - OC_KEY_NUM_LOCK = 282, - OC_KEY_PRINT_SCREEN = 283, - OC_KEY_PAUSE = 284, - OC_KEY_F1 = 290, - OC_KEY_F2 = 291, - OC_KEY_F3 = 292, - OC_KEY_F4 = 293, - OC_KEY_F5 = 294, - OC_KEY_F6 = 295, - OC_KEY_F7 = 296, - OC_KEY_F8 = 297, - OC_KEY_F9 = 298, - OC_KEY_F10 = 299, - OC_KEY_F11 = 300, - OC_KEY_F12 = 301, - OC_KEY_F13 = 302, - OC_KEY_F14 = 303, - OC_KEY_F15 = 304, - OC_KEY_F16 = 305, - OC_KEY_F17 = 306, - OC_KEY_F18 = 307, - OC_KEY_F19 = 308, - OC_KEY_F20 = 309, - OC_KEY_F21 = 310, - OC_KEY_F22 = 311, - OC_KEY_F23 = 312, - OC_KEY_F24 = 313, - OC_KEY_F25 = 314, - OC_KEY_KP_0 = 320, - OC_KEY_KP_1 = 321, - OC_KEY_KP_2 = 322, - OC_KEY_KP_3 = 323, - OC_KEY_KP_4 = 324, - OC_KEY_KP_5 = 325, - OC_KEY_KP_6 = 326, - OC_KEY_KP_7 = 327, - OC_KEY_KP_8 = 328, - OC_KEY_KP_9 = 329, - OC_KEY_KP_DECIMAL = 330, - OC_KEY_KP_DIVIDE = 331, - OC_KEY_KP_MULTIPLY = 332, - OC_KEY_KP_SUBTRACT = 333, - OC_KEY_KP_ADD = 334, - OC_KEY_KP_ENTER = 335, - OC_KEY_KP_EQUAL = 336, - OC_KEY_LEFT_SHIFT = 340, - OC_KEY_LEFT_CONTROL = 341, - OC_KEY_LEFT_ALT = 342, - OC_KEY_LEFT_SUPER = 343, - OC_KEY_RIGHT_SHIFT = 344, - OC_KEY_RIGHT_CONTROL = 345, - OC_KEY_RIGHT_ALT = 346, - OC_KEY_RIGHT_SUPER = 347, - OC_KEY_MENU = 348, - OC_KEY_COUNT = 349 -} oc_key_code; -``` - -**Enum Constants** - -- OC_KEY_UNKNOWN -- OC_KEY_SPACE -- OC_KEY_APOSTROPHE -- OC_KEY_COMMA -- OC_KEY_MINUS -- OC_KEY_PERIOD -- OC_KEY_SLASH -- OC_KEY_0 -- OC_KEY_1 -- OC_KEY_2 -- OC_KEY_3 -- OC_KEY_4 -- OC_KEY_5 -- OC_KEY_6 -- OC_KEY_7 -- OC_KEY_8 -- OC_KEY_9 -- OC_KEY_SEMICOLON -- OC_KEY_EQUAL -- OC_KEY_LEFT_BRACKET -- OC_KEY_BACKSLASH -- OC_KEY_RIGHT_BRACKET -- OC_KEY_GRAVE_ACCENT -- OC_KEY_A -- OC_KEY_B -- OC_KEY_C -- OC_KEY_D -- OC_KEY_E -- OC_KEY_F -- OC_KEY_G -- OC_KEY_H -- OC_KEY_I -- OC_KEY_J -- OC_KEY_K -- OC_KEY_L -- OC_KEY_M -- OC_KEY_N -- OC_KEY_O -- OC_KEY_P -- OC_KEY_Q -- OC_KEY_R -- OC_KEY_S -- OC_KEY_T -- OC_KEY_U -- OC_KEY_V -- OC_KEY_W -- OC_KEY_X -- OC_KEY_Y -- OC_KEY_Z -- OC_KEY_WORLD_1 -- OC_KEY_WORLD_2 -- OC_KEY_ESCAPE -- OC_KEY_ENTER -- OC_KEY_TAB -- OC_KEY_BACKSPACE -- OC_KEY_INSERT -- OC_KEY_DELETE -- OC_KEY_RIGHT -- OC_KEY_LEFT -- OC_KEY_DOWN -- OC_KEY_UP -- OC_KEY_PAGE_UP -- OC_KEY_PAGE_DOWN -- OC_KEY_HOME -- OC_KEY_END -- OC_KEY_CAPS_LOCK -- OC_KEY_SCROLL_LOCK -- OC_KEY_NUM_LOCK -- OC_KEY_PRINT_SCREEN -- OC_KEY_PAUSE -- OC_KEY_F1 -- OC_KEY_F2 -- OC_KEY_F3 -- OC_KEY_F4 -- OC_KEY_F5 -- OC_KEY_F6 -- OC_KEY_F7 -- OC_KEY_F8 -- OC_KEY_F9 -- OC_KEY_F10 -- OC_KEY_F11 -- OC_KEY_F12 -- OC_KEY_F13 -- OC_KEY_F14 -- OC_KEY_F15 -- OC_KEY_F16 -- OC_KEY_F17 -- OC_KEY_F18 -- OC_KEY_F19 -- OC_KEY_F20 -- OC_KEY_F21 -- OC_KEY_F22 -- OC_KEY_F23 -- OC_KEY_F24 -- OC_KEY_F25 -- OC_KEY_KP_0 -- OC_KEY_KP_1 -- OC_KEY_KP_2 -- OC_KEY_KP_3 -- OC_KEY_KP_4 -- OC_KEY_KP_5 -- OC_KEY_KP_6 -- OC_KEY_KP_7 -- OC_KEY_KP_8 -- OC_KEY_KP_9 -- OC_KEY_KP_DECIMAL -- OC_KEY_KP_DIVIDE -- OC_KEY_KP_MULTIPLY -- OC_KEY_KP_SUBTRACT -- OC_KEY_KP_ADD -- OC_KEY_KP_ENTER -- OC_KEY_KP_EQUAL -- OC_KEY_LEFT_SHIFT -- OC_KEY_LEFT_CONTROL -- OC_KEY_LEFT_ALT -- OC_KEY_LEFT_SUPER -- OC_KEY_RIGHT_SHIFT -- OC_KEY_RIGHT_CONTROL -- OC_KEY_RIGHT_ALT -- OC_KEY_RIGHT_SUPER -- OC_KEY_MENU -- OC_KEY_COUNT - - ---- - -####
oc_keymod_flags
- -``` -typedef enum oc_keymod_flags -{ - OC_KEYMOD_NONE = 0, - OC_KEYMOD_ALT = 1, - OC_KEYMOD_SHIFT = 2, - OC_KEYMOD_CTRL = 4, - OC_KEYMOD_CMD = 8, - OC_KEYMOD_MAIN_MODIFIER = 16 -} oc_keymod_flags; -``` - -**Enum Constants** - -- OC_KEYMOD_NONE -- OC_KEYMOD_ALT -- OC_KEYMOD_SHIFT -- OC_KEYMOD_CTRL -- OC_KEYMOD_CMD -- OC_KEYMOD_MAIN_MODIFIER - - ---- - -####
oc_mouse_button
- -``` -typedef enum oc_mouse_button -{ - OC_MOUSE_LEFT = 0, - OC_MOUSE_RIGHT = 1, - OC_MOUSE_MIDDLE = 2, - OC_MOUSE_EXT1 = 3, - OC_MOUSE_EXT2 = 4, - OC_MOUSE_BUTTON_COUNT = 5 -} oc_mouse_button; -``` - -**Enum Constants** - -- OC_MOUSE_LEFT -- OC_MOUSE_RIGHT -- OC_MOUSE_MIDDLE -- OC_MOUSE_EXT1 -- OC_MOUSE_EXT2 -- OC_MOUSE_BUTTON_COUNT - - ---- - -####
oc_key_event
- -``` -typedef struct oc_key_event -{ - oc_key_action action; - oc_scan_code scanCode; - oc_key_code keyCode; - oc_mouse_button button; - oc_keymod_flags mods; - u8 clickCount; -} oc_key_event; -``` - -**Fields** - -- action -- scanCode -- keyCode -- button -- mods -- clickCount - - ---- - -####
oc_char_event
- -``` -typedef struct oc_char_event -{ - oc_utf32 codepoint; - char sequence[8]; - u8 seqLen; -} oc_char_event; -``` - -**Fields** - -- codepoint -- sequence -- seqLen - - ---- - -####
oc_mouse_event
- -``` -typedef struct oc_mouse_event -{ - f32 x; - f32 y; - f32 deltaX; - f32 deltaY; - oc_keymod_flags mods; -} oc_mouse_event; -``` - -**Fields** - -- x -- y -- deltaX -- deltaY -- mods - - ---- - -####
oc_move_event
- -``` -typedef struct oc_move_event -{ - oc_rect frame; - oc_rect content; -} oc_move_event; -``` - -**Fields** - -- frame -- content - - ---- - -####
oc_event
- -``` -typedef struct oc_event -{ - oc_window window; - oc_event_type type; - union - { - oc_key_event key; - oc_char_event character; - oc_mouse_event mouse; - oc_move_event move; - oc_str8_list paths; - }; -} oc_event; -``` - -**Fields** - -- window -- type -- Anonymous union - - key - - character - - mouse - - move - - paths - - - ---- - -####
oc_file_dialog_kind
- -``` -typedef enum oc_file_dialog_kind -{ - OC_FILE_DIALOG_SAVE = 0, - OC_FILE_DIALOG_OPEN = 1 -} oc_file_dialog_kind; -``` - -**Enum Constants** - -- OC_FILE_DIALOG_SAVE -- OC_FILE_DIALOG_OPEN - - ---- - -####
oc_file_dialog_flags
- -``` -typedef u32 oc_file_dialog_flags; -``` - - ---- - -####
_oc_file_dialog_flags
- -``` -typedef enum _oc_file_dialog_flags -{ - OC_FILE_DIALOG_FILES = 1, - OC_FILE_DIALOG_DIRECTORIES = 2, - OC_FILE_DIALOG_MULTIPLE = 4, - OC_FILE_DIALOG_CREATE_DIRECTORIES = 8 -} _oc_file_dialog_flags; -``` - -**Enum Constants** - -- OC_FILE_DIALOG_FILES -- OC_FILE_DIALOG_DIRECTORIES -- OC_FILE_DIALOG_MULTIPLE -- OC_FILE_DIALOG_CREATE_DIRECTORIES - - ---- - -####
oc_file_dialog_desc
- -``` -typedef struct oc_file_dialog_desc -{ - oc_file_dialog_kind kind; - oc_file_dialog_flags flags; - oc_str8 title; - oc_str8 okLabel; - oc_file startAt; - oc_str8 startPath; - oc_str8_list filters; -} oc_file_dialog_desc; -``` - -**Fields** - -- kind -- flags -- title -- okLabel -- startAt -- startPath -- filters - - ---- - -####
oc_file_dialog_button
- -``` -typedef enum oc_file_dialog_button -{ - OC_FILE_DIALOG_CANCEL = 0, - OC_FILE_DIALOG_OK = 1 -} oc_file_dialog_button; -``` - -**Enum Constants** - -- OC_FILE_DIALOG_CANCEL -- OC_FILE_DIALOG_OK - - ---- - -####
oc_file_dialog_result
- -``` -typedef struct oc_file_dialog_result -{ - oc_file_dialog_button button; - oc_str8 path; - oc_str8_list selection; -} oc_file_dialog_result; -``` - -**Fields** - -- button -- path -- selection - - ---- - -## Functions - -####
oc_window_set_title
- -``` -void oc_window_set_title(oc_str8 title); -``` - -**Parameters** - -- title - ---- - -####
oc_window_set_size
- -``` -void oc_window_set_size(oc_vec2 size); -``` - -**Parameters** - -- size - ---- - -####
oc_request_quit
- -``` -void oc_request_quit(); -``` - - ---- - -####
oc_scancode_to_keycode
- -``` -oc_key_code oc_scancode_to_keycode(oc_scan_code scanCode); -``` - -**Parameters** - -- scanCode - ---- - -####
oc_clipboard_set_string
- -``` -void oc_clipboard_set_string(oc_str8 string); -``` - -**Parameters** - -- string - ---- - diff --git a/doc/mkdocs/docs/api/Graphics.md b/doc/mkdocs/docs/api/Graphics.md deleted file mode 100644 index 806d0674..00000000 --- a/doc/mkdocs/docs/api/Graphics.md +++ /dev/null @@ -1,11 +0,0 @@ -# Graphics - -2D/3D rendering APIs. - -## Modules - -- [Canvas API](Graphics/Canvas API.md) A 2D Vector Graphics API. -- [GLES Surface](Graphics/GLES Surface.md) A surface for rendering using the GLES API. - ---- - diff --git a/doc/mkdocs/docs/api/Graphics/Canvas API.md b/doc/mkdocs/docs/api/Graphics/Canvas API.md deleted file mode 100644 index e4394aae..00000000 --- a/doc/mkdocs/docs/api/Graphics/Canvas API.md +++ /dev/null @@ -1,1696 +0,0 @@ -# Canvas API - -A 2D Vector Graphics API. - -## Types - -####
oc_surface
- -``` -typedef struct oc_surface -{ - u64 h; -} oc_surface; -``` - -**Fields** - -- h - - ---- - -####
oc_canvas_renderer
- -``` -typedef struct oc_canvas_renderer -{ - u64 h; -} oc_canvas_renderer; -``` - -**Fields** - -- h - - ---- - -####
oc_canvas_context
- -``` -typedef struct oc_canvas_context -{ - u64 h; -} oc_canvas_context; -``` - -**Fields** - -- h - - ---- - -####
oc_font
- -``` -typedef struct oc_font -{ - u64 h; -} oc_font; -``` - -**Fields** - -- h - - ---- - -####
oc_image
- -``` -typedef struct oc_image -{ - u64 h; -} oc_image; -``` - -**Fields** - -- h - - ---- - -####
oc_gradient_blend_space
- -``` -typedef enum oc_gradient_blend_space -{ - OC_GRADIENT_BLEND_LINEAR = 0, - OC_GRADIENT_BLEND_SRGB = 1 -} oc_gradient_blend_space; -``` - -**Enum Constants** - -- OC_GRADIENT_BLEND_LINEAR -- OC_GRADIENT_BLEND_SRGB - - ---- - -####
oc_color_space
- -``` -typedef enum oc_color_space -{ - OC_COLOR_SPACE_RGB = 0, - OC_COLOR_SPACE_SRGB = 1 -} oc_color_space; -``` - -**Enum Constants** - -- OC_COLOR_SPACE_RGB -- OC_COLOR_SPACE_SRGB - - ---- - -####
oc_color
- -``` -typedef struct oc_color -{ - union - { - struct - { - f32 r; - f32 g; - f32 b; - f32 a; - }; - f32 c[4]; - }; - oc_color_space colorSpace; -} oc_color; -``` - -**Fields** - -- Anonymous union - - Anonymous struct - - r - - g - - b - - a - - - c - -- colorSpace - - ---- - -####
oc_joint_type
- -``` -typedef enum oc_joint_type -{ - OC_JOINT_MITER = 0, - OC_JOINT_BEVEL = 1, - OC_JOINT_NONE = 2 -} oc_joint_type; -``` - -**Enum Constants** - -- OC_JOINT_MITER -- OC_JOINT_BEVEL -- OC_JOINT_NONE - - ---- - -####
oc_cap_type
- -``` -typedef enum oc_cap_type -{ - OC_CAP_NONE = 0, - OC_CAP_SQUARE = 1 -} oc_cap_type; -``` - -**Enum Constants** - -- OC_CAP_NONE -- OC_CAP_SQUARE - - ---- - -####
oc_font_metrics
- -``` -typedef struct oc_font_metrics -{ - f32 ascent; - f32 descent; - f32 lineGap; - f32 xHeight; - f32 capHeight; - f32 width; -} oc_font_metrics; -``` - -**Fields** - -- ascent -- descent -- lineGap -- xHeight -- capHeight -- width - - ---- - -####
oc_glyph_metrics
- -``` -typedef struct oc_glyph_metrics -{ - oc_rect ink; - oc_vec2 advance; -} oc_glyph_metrics; -``` - -**Fields** - -- ink -- advance - - ---- - -####
oc_text_metrics
- -``` -typedef struct oc_text_metrics -{ - oc_rect ink; - oc_rect logical; - oc_vec2 advance; -} oc_text_metrics; -``` - -**Fields** - -- ink -- logical -- advance - - ---- - -####
oc_rect_atlas
- -``` -typedef struct oc_rect_atlas -{ -} oc_rect_atlas; -``` - - ---- - -####
oc_image_region
- -``` -typedef struct oc_image_region -{ - oc_image image; - oc_rect rect; -} oc_image_region; -``` - -**Fields** - -- image -- rect - - ---- - -## Functions - -####
oc_surface_nil
- -``` -oc_surface oc_surface_nil(); -``` - - ---- - -####
oc_surface_is_nil
- -``` -bool oc_surface_is_nil(oc_surface surface); -``` - -**Parameters** - -- surface - ---- - -####
oc_surface_destroy
- -``` -void oc_surface_destroy(oc_surface surface); -``` - -**Parameters** - -- surface - ---- - -####
oc_surface_get_size
- -``` -oc_vec2 oc_surface_get_size(oc_surface surface); -``` - -**Parameters** - -- surface - ---- - -####
oc_surface_contents_scaling
- -``` -oc_vec2 oc_surface_contents_scaling(oc_surface surface); -``` - -**Parameters** - -- surface - ---- - -####
oc_surface_bring_to_front
- -``` -void oc_surface_bring_to_front(oc_surface surface); -``` - -**Parameters** - -- surface - ---- - -####
oc_surface_send_to_back
- -``` -void oc_surface_send_to_back(oc_surface surface); -``` - -**Parameters** - -- surface - ---- - -####
oc_surface_get_hidden
- -``` -bool oc_surface_get_hidden(oc_surface surface); -``` - -**Parameters** - -- surface - ---- - -####
oc_surface_set_hidden
- -``` -void oc_surface_set_hidden(oc_surface surface, bool hidden); -``` - -**Parameters** - -- surface -- hidden - ---- - -####
oc_color_rgba
- -``` -oc_color oc_color_rgba(f32 r, f32 g, f32 b, f32 a); -``` - -**Parameters** - -- r -- g -- b -- a - ---- - -####
oc_color_srgba
- -``` -oc_color oc_color_srgba(f32 r, f32 g, f32 b, f32 a); -``` - -**Parameters** - -- r -- g -- b -- a - ---- - -####
oc_color_convert
- -``` -oc_color oc_color_convert(oc_color color, oc_color_space colorSpace); -``` - -**Parameters** - -- color -- colorSpace - ---- - -####
oc_canvas_renderer_nil
- -``` -oc_canvas_renderer oc_canvas_renderer_nil(); -``` - - ---- - -####
oc_canvas_renderer_is_nil
- -``` -bool oc_canvas_renderer_is_nil(oc_canvas_renderer renderer); -``` - -**Parameters** - -- renderer - ---- - -####
oc_canvas_renderer_create
- -``` -oc_canvas_renderer oc_canvas_renderer_create(); -``` - - ---- - -####
oc_canvas_renderer_destroy
- -``` -void oc_canvas_renderer_destroy(oc_canvas_renderer renderer); -``` - -**Parameters** - -- renderer - ---- - -####
oc_canvas_render
- -``` -void oc_canvas_render(oc_canvas_renderer renderer, oc_canvas_context context, oc_surface surface); -``` - -**Parameters** - -- renderer -- context -- surface - ---- - -####
oc_canvas_present
- -``` -void oc_canvas_present(oc_canvas_renderer renderer, oc_surface surface); -``` - -**Parameters** - -- renderer -- surface - ---- - -####
oc_canvas_surface_create
- -``` -oc_surface oc_canvas_surface_create(oc_canvas_renderer renderer); -``` - -**Parameters** - -- renderer - ---- - -####
oc_canvas_surface_swap_interval
- -``` -void oc_canvas_surface_swap_interval(oc_surface surface, i32 swap); -``` - -**Parameters** - -- surface -- swap - ---- - -####
oc_canvas_context_nil
- -``` -oc_canvas_context oc_canvas_context_nil(); -``` - - ---- - -####
oc_canvas_context_is_nil
- -``` -bool oc_canvas_context_is_nil(oc_canvas_context context); -``` - -**Parameters** - -- context - ---- - -####
oc_canvas_context_create
- -``` -oc_canvas_context oc_canvas_context_create(); -``` - - ---- - -####
oc_canvas_context_destroy
- -``` -void oc_canvas_context_destroy(oc_canvas_context context); -``` - -**Parameters** - -- context - ---- - -####
oc_canvas_context_select
- -``` -oc_canvas_context oc_canvas_context_select(oc_canvas_context context); -``` - -**Parameters** - -- context - ---- - -####
oc_canvas_context_set_msaa_sample_count
- -``` -void oc_canvas_context_set_msaa_sample_count(oc_canvas_context context, u32 sampleCount); -``` - -**Parameters** - -- context -- sampleCount - ---- - -####
oc_font_nil
- -``` -oc_font oc_font_nil(); -``` - - ---- - -####
oc_font_is_nil
- -``` -bool oc_font_is_nil(oc_font font); -``` - -**Parameters** - -- font - ---- - -####
oc_font_create_from_memory
- -``` -oc_font oc_font_create_from_memory(oc_str8 mem, u32 rangeCount, oc_unicode_range* ranges); -``` - -**Parameters** - -- mem -- rangeCount -- ranges - ---- - -####
oc_font_create_from_file
- -``` -oc_font oc_font_create_from_file(oc_file file, u32 rangeCount, oc_unicode_range* ranges); -``` - -**Parameters** - -- file -- rangeCount -- ranges - ---- - -####
oc_font_create_from_path
- -``` -oc_font oc_font_create_from_path(oc_str8 path, u32 rangeCount, oc_unicode_range* ranges); -``` - -**Parameters** - -- path -- rangeCount -- ranges - ---- - -####
oc_font_destroy
- -``` -void oc_font_destroy(oc_font font); -``` - -**Parameters** - -- font - ---- - -####
oc_font_get_glyph_indices
- -``` -oc_str32 oc_font_get_glyph_indices(oc_font font, oc_str32 codePoints, oc_str32 backing); -``` - -**Parameters** - -- font -- codePoints -- backing - ---- - -####
oc_font_push_glyph_indices
- -``` -oc_str32 oc_font_push_glyph_indices(oc_arena* arena, oc_font font, oc_str32 codePoints); -``` - -**Parameters** - -- arena -- font -- codePoints - ---- - -####
oc_font_get_glyph_index
- -``` -u32 oc_font_get_glyph_index(oc_font font, oc_utf32 codePoint); -``` - -**Parameters** - -- font -- codePoint - ---- - -####
oc_font_get_metrics
- -``` -oc_font_metrics oc_font_get_metrics(oc_font font, f32 emSize); -``` - -**Parameters** - -- font -- emSize - ---- - -####
oc_font_get_metrics_unscaled
- -``` -oc_font_metrics oc_font_get_metrics_unscaled(oc_font font); -``` - -**Parameters** - -- font - ---- - -####
oc_font_get_scale_for_em_pixels
- -``` -f32 oc_font_get_scale_for_em_pixels(oc_font font, f32 emSize); -``` - -**Parameters** - -- font -- emSize - ---- - -####
oc_font_text_metrics_utf32
- -``` -oc_text_metrics oc_font_text_metrics_utf32(oc_font font, f32 fontSize, oc_str32 codepoints); -``` - -**Parameters** - -- font -- fontSize -- codepoints - ---- - -####
oc_font_text_metrics
- -``` -oc_text_metrics oc_font_text_metrics(oc_font font, f32 fontSize, oc_str8 text); -``` - -**Parameters** - -- font -- fontSize -- text - ---- - -####
oc_image_nil
- -``` -oc_image oc_image_nil(); -``` - - ---- - -####
oc_image_is_nil
- -``` -bool oc_image_is_nil(oc_image a); -``` - -**Parameters** - -- a - ---- - -####
oc_image_create
- -``` -oc_image oc_image_create(oc_canvas_renderer renderer, u32 width, u32 height); -``` - -**Parameters** - -- renderer -- width -- height - ---- - -####
oc_image_create_from_rgba8
- -``` -oc_image oc_image_create_from_rgba8(oc_canvas_renderer renderer, u32 width, u32 height, u8* pixels); -``` - -**Parameters** - -- renderer -- width -- height -- pixels - ---- - -####
oc_image_create_from_memory
- -``` -oc_image oc_image_create_from_memory(oc_canvas_renderer renderer, oc_str8 mem, bool flip); -``` - -**Parameters** - -- renderer -- mem -- flip - ---- - -####
oc_image_create_from_file
- -``` -oc_image oc_image_create_from_file(oc_canvas_renderer renderer, oc_file file, bool flip); -``` - -**Parameters** - -- renderer -- file -- flip - ---- - -####
oc_image_create_from_path
- -``` -oc_image oc_image_create_from_path(oc_canvas_renderer renderer, oc_str8 path, bool flip); -``` - -**Parameters** - -- renderer -- path -- flip - ---- - -####
oc_image_destroy
- -``` -void oc_image_destroy(oc_image image); -``` - -**Parameters** - -- image - ---- - -####
oc_image_upload_region_rgba8
- -``` -void oc_image_upload_region_rgba8(oc_image image, oc_rect region, u8* pixels); -``` - -**Parameters** - -- image -- region -- pixels - ---- - -####
oc_image_size
- -``` -oc_vec2 oc_image_size(oc_image image); -``` - -**Parameters** - -- image - ---- - -####
oc_rect_atlas_create
- -``` -oc_rect_atlas* oc_rect_atlas_create(oc_arena* arena, i32 width, i32 height); -``` - -**Parameters** - -- arena -- width -- height - ---- - -####
oc_rect_atlas_alloc
- -``` -oc_rect oc_rect_atlas_alloc(oc_rect_atlas* atlas, i32 width, i32 height); -``` - -**Parameters** - -- atlas -- width -- height - ---- - -####
oc_rect_atlas_recycle
- -``` -void oc_rect_atlas_recycle(oc_rect_atlas* atlas, oc_rect rect); -``` - -**Parameters** - -- atlas -- rect - ---- - -####
oc_image_atlas_alloc_from_rgba8
- -``` -oc_image_region oc_image_atlas_alloc_from_rgba8(oc_rect_atlas* atlas, oc_image backingImage, u32 width, u32 height, u8* pixels); -``` - -**Parameters** - -- atlas -- backingImage -- width -- height -- pixels - ---- - -####
oc_image_atlas_alloc_from_memory
- -``` -oc_image_region oc_image_atlas_alloc_from_memory(oc_rect_atlas* atlas, oc_image backingImage, oc_str8 mem, bool flip); -``` - -**Parameters** - -- atlas -- backingImage -- mem -- flip - ---- - -####
oc_image_atlas_alloc_from_file
- -``` -oc_image_region oc_image_atlas_alloc_from_file(oc_rect_atlas* atlas, oc_image backingImage, oc_file file, bool flip); -``` - -**Parameters** - -- atlas -- backingImage -- file -- flip - ---- - -####
oc_image_atlas_alloc_from_path
- -``` -oc_image_region oc_image_atlas_alloc_from_path(oc_rect_atlas* atlas, oc_image backingImage, oc_str8 path, bool flip); -``` - -**Parameters** - -- atlas -- backingImage -- path -- flip - ---- - -####
oc_image_atlas_recycle
- -``` -void oc_image_atlas_recycle(oc_rect_atlas* atlas, oc_image_region imageRgn); -``` - -**Parameters** - -- atlas -- imageRgn - ---- - -####
oc_matrix_push
- -``` -void oc_matrix_push(oc_mat2x3 matrix); -``` - -**Parameters** - -- matrix - ---- - -####
oc_matrix_multiply_push
- -``` -void oc_matrix_multiply_push(oc_mat2x3 matrix); -``` - -**Parameters** - -- matrix - ---- - -####
oc_matrix_pop
- -``` -void oc_matrix_pop(); -``` - - ---- - -####
oc_matrix_top
- -``` -oc_mat2x3 oc_matrix_top(); -``` - - ---- - -####
oc_clip_push
- -``` -void oc_clip_push(f32 x, f32 y, f32 w, f32 h); -``` - -**Parameters** - -- x -- y -- w -- h - ---- - -####
oc_clip_pop
- -``` -void oc_clip_pop(); -``` - - ---- - -####
oc_clip_top
- -``` -oc_rect oc_clip_top(); -``` - - ---- - -####
oc_set_color
- -``` -void oc_set_color(oc_color color); -``` - -**Parameters** - -- color - ---- - -####
oc_set_color_rgba
- -``` -void oc_set_color_rgba(f32 r, f32 g, f32 b, f32 a); -``` - -**Parameters** - -- r -- g -- b -- a - ---- - -####
oc_set_color_srgba
- -``` -void oc_set_color_srgba(f32 r, f32 g, f32 b, f32 a); -``` - -**Parameters** - -- r -- g -- b -- a - ---- - -####
oc_set_gradient
- -``` -void oc_set_gradient(oc_gradient_blend_space blendSpace, oc_color bottomLeft, oc_color bottomRight, oc_color topRight, oc_color topLeft); -``` - -**Parameters** - -- blendSpace -- bottomLeft -- bottomRight -- topRight -- topLeft - ---- - -####
oc_set_width
- -``` -void oc_set_width(f32 width); -``` - -**Parameters** - -- width - ---- - -####
oc_set_tolerance
- -``` -void oc_set_tolerance(f32 tolerance); -``` - -**Parameters** - -- tolerance - ---- - -####
oc_set_joint
- -``` -void oc_set_joint(oc_joint_type joint); -``` - -**Parameters** - -- joint - ---- - -####
oc_set_max_joint_excursion
- -``` -void oc_set_max_joint_excursion(f32 maxJointExcursion); -``` - -**Parameters** - -- maxJointExcursion - ---- - -####
oc_set_cap
- -``` -void oc_set_cap(oc_cap_type cap); -``` - -**Parameters** - -- cap - ---- - -####
oc_set_font
- -``` -void oc_set_font(oc_font font); -``` - -**Parameters** - -- font - ---- - -####
oc_set_font_size
- -``` -void oc_set_font_size(f32 size); -``` - -**Parameters** - -- size - ---- - -####
oc_set_text_flip
- -``` -void oc_set_text_flip(bool flip); -``` - -**Parameters** - -- flip - ---- - -####
oc_set_image
- -``` -void oc_set_image(oc_image image); -``` - -**Parameters** - -- image - ---- - -####
oc_set_image_source_region
- -``` -void oc_set_image_source_region(oc_rect region); -``` - -**Parameters** - -- region - ---- - -####
oc_get_color
- -``` -oc_color oc_get_color(); -``` - - ---- - -####
oc_get_width
- -``` -f32 oc_get_width(); -``` - - ---- - -####
oc_get_tolerance
- -``` -f32 oc_get_tolerance(); -``` - - ---- - -####
oc_get_joint
- -``` -oc_joint_type oc_get_joint(); -``` - - ---- - -####
oc_get_max_joint_excursion
- -``` -f32 oc_get_max_joint_excursion(); -``` - - ---- - -####
oc_get_cap
- -``` -oc_cap_type oc_get_cap(); -``` - - ---- - -####
oc_get_font
- -``` -oc_font oc_get_font(); -``` - - ---- - -####
oc_get_font_size
- -``` -f32 oc_get_font_size(); -``` - - ---- - -####
oc_get_text_flip
- -``` -bool oc_get_text_flip(); -``` - - ---- - -####
oc_get_image
- -``` -oc_image oc_get_image(); -``` - - ---- - -####
oc_get_image_source_region
- -``` -oc_rect oc_get_image_source_region(); -``` - - ---- - -####
oc_get_position
- -``` -oc_vec2 oc_get_position(); -``` - - ---- - -####
oc_move_to
- -``` -void oc_move_to(f32 x, f32 y); -``` - -**Parameters** - -- x -- y - ---- - -####
oc_line_to
- -``` -void oc_line_to(f32 x, f32 y); -``` - -**Parameters** - -- x -- y - ---- - -####
oc_quadratic_to
- -``` -void oc_quadratic_to(f32 x1, f32 y1, f32 x2, f32 y2); -``` - -**Parameters** - -- x1 -- y1 -- x2 -- y2 - ---- - -####
oc_cubic_to
- -``` -void oc_cubic_to(f32 x1, f32 y1, f32 x2, f32 y2, f32 x3, f32 y3); -``` - -**Parameters** - -- x1 -- y1 -- x2 -- y2 -- x3 -- y3 - ---- - -####
oc_close_path
- -``` -void oc_close_path(); -``` - - ---- - -####
oc_glyph_outlines
- -``` -oc_rect oc_glyph_outlines(oc_str32 glyphIndices); -``` - -**Parameters** - -- glyphIndices - ---- - -####
oc_codepoints_outlines
- -``` -void oc_codepoints_outlines(oc_str32 string); -``` - -**Parameters** - -- string - ---- - -####
oc_text_outlines
- -``` -void oc_text_outlines(oc_str8 string); -``` - -**Parameters** - -- string - ---- - -####
oc_clear
- -``` -void oc_clear(); -``` - - ---- - -####
oc_fill
- -``` -void oc_fill(); -``` - - ---- - -####
oc_stroke
- -``` -void oc_stroke(); -``` - - ---- - -####
oc_rectangle_fill
- -``` -void oc_rectangle_fill(f32 x, f32 y, f32 w, f32 h); -``` - -**Parameters** - -- x -- y -- w -- h - ---- - -####
oc_rectangle_stroke
- -``` -void oc_rectangle_stroke(f32 x, f32 y, f32 w, f32 h); -``` - -**Parameters** - -- x -- y -- w -- h - ---- - -####
oc_rounded_rectangle_fill
- -``` -void oc_rounded_rectangle_fill(f32 x, f32 y, f32 w, f32 h, f32 r); -``` - -**Parameters** - -- x -- y -- w -- h -- r - ---- - -####
oc_rounded_rectangle_stroke
- -``` -void oc_rounded_rectangle_stroke(f32 x, f32 y, f32 w, f32 h, f32 r); -``` - -**Parameters** - -- x -- y -- w -- h -- r - ---- - -####
oc_ellipse_fill
- -``` -void oc_ellipse_fill(f32 x, f32 y, f32 rx, f32 ry); -``` - -**Parameters** - -- x -- y -- rx -- ry - ---- - -####
oc_ellipse_stroke
- -``` -void oc_ellipse_stroke(f32 x, f32 y, f32 rx, f32 ry); -``` - -**Parameters** - -- x -- y -- rx -- ry - ---- - -####
oc_circle_fill
- -``` -void oc_circle_fill(f32 x, f32 y, f32 r); -``` - -**Parameters** - -- x -- y -- r - ---- - -####
oc_circle_stroke
- -``` -void oc_circle_stroke(f32 x, f32 y, f32 r); -``` - -**Parameters** - -- x -- y -- r - ---- - -####
oc_arc
- -``` -void oc_arc(f32 x, f32 y, f32 r, f32 arcAngle, f32 startAngle); -``` - -**Parameters** - -- x -- y -- r -- arcAngle -- startAngle - ---- - -####
oc_text_fill
- -``` -void oc_text_fill(f32 x, f32 y, oc_str8 text); -``` - -**Parameters** - -- x -- y -- text - ---- - -####
oc_image_draw
- -``` -void oc_image_draw(oc_image image, oc_rect rect); -``` - -**Parameters** - -- image -- rect - ---- - -####
oc_image_draw_region
- -``` -void oc_image_draw_region(oc_image image, oc_rect srcRegion, oc_rect dstRegion); -``` - -**Parameters** - -- image -- srcRegion -- dstRegion - ---- - diff --git a/doc/mkdocs/docs/api/Graphics/GLES Surface.md b/doc/mkdocs/docs/api/Graphics/GLES Surface.md deleted file mode 100644 index d392e7c7..00000000 --- a/doc/mkdocs/docs/api/Graphics/GLES Surface.md +++ /dev/null @@ -1,52 +0,0 @@ -# GLES Surface - -A surface for rendering using the GLES API. - -## Functions - -####
oc_gles_surface_create
- -``` -oc_surface oc_gles_surface_create(); -``` - - ---- - -####
oc_gles_surface_make_current
- -``` -void oc_gles_surface_make_current(oc_surface surface); -``` - -**Parameters** - -- surface - ---- - -####
oc_gles_surface_swap_interval
- -``` -void oc_gles_surface_swap_interval(oc_surface surface, i32 interval); -``` - -**Parameters** - -- surface -- interval - ---- - -####
oc_gles_surface_swap_buffers
- -``` -void oc_gles_surface_swap_buffers(oc_surface surface); -``` - -**Parameters** - -- surface - ---- - diff --git a/doc/mkdocs/docs/api/I_O.md b/doc/mkdocs/docs/api/I_O.md deleted file mode 100644 index fcd3244b..00000000 --- a/doc/mkdocs/docs/api/I_O.md +++ /dev/null @@ -1,12 +0,0 @@ -# I/O - -File input/output. - -## Modules - -- [File API](I_O/File API.md) API for opening, reading and writing files. -- [Dialogs](I_O/Dialogs.md) API for obtaining file capabilities through open/save dialogs. -- [Paths](I_O/Paths.md) API for handling filesystem paths. - ---- - diff --git a/doc/mkdocs/docs/api/I_O/Dialogs.md b/doc/mkdocs/docs/api/I_O/Dialogs.md deleted file mode 100644 index 049cff92..00000000 --- a/doc/mkdocs/docs/api/I_O/Dialogs.md +++ /dev/null @@ -1,61 +0,0 @@ -# Dialogs - -API for obtaining file capabilities through open/save dialogs. - -## Types - -####
oc_file_open_with_dialog_elt
- -``` -typedef struct oc_file_open_with_dialog_elt -{ - oc_list_elt listElt; - oc_file file; -} oc_file_open_with_dialog_elt; -``` - -**Fields** - -- listElt -- file - - ---- - -####
oc_file_open_with_dialog_result
- -``` -typedef struct oc_file_open_with_dialog_result -{ - oc_file_dialog_button button; - oc_file file; - oc_list selection; -} oc_file_open_with_dialog_result; -``` - -**Fields** - -- button -- file -- selection - - ---- - -## Functions - -####
oc_file_open_with_dialog
- -``` -oc_file_open_with_dialog_result oc_file_open_with_dialog(oc_arena* arena, oc_file_access rights, oc_file_open_flags flags, oc_file_dialog_desc* desc); -``` - -**Parameters** - -- arena -- rights -- flags -- desc - ---- - diff --git a/doc/mkdocs/docs/api/I_O/File API.md b/doc/mkdocs/docs/api/I_O/File API.md deleted file mode 100644 index 2a699d83..00000000 --- a/doc/mkdocs/docs/api/I_O/File API.md +++ /dev/null @@ -1,615 +0,0 @@ -# File API - -API for opening, reading and writing files. - -## Types - -####
oc_file
- -``` -typedef struct oc_file -{ - u64 h; -} oc_file; -``` - -**Fields** - -- h - - ---- - -####
oc_file_open_flags
- -``` -typedef u16 oc_file_open_flags; -``` - - ---- - -####
oc_file_open_flags_enum
- -``` -typedef enum oc_file_open_flags_enum -{ - OC_FILE_OPEN_NONE = 0, - OC_FILE_OPEN_APPEND = 2, - OC_FILE_OPEN_TRUNCATE = 4, - OC_FILE_OPEN_CREATE = 8, - OC_FILE_OPEN_SYMLINK = 16, - OC_FILE_OPEN_NO_FOLLOW = 32, - OC_FILE_OPEN_RESTRICT = 64 -} oc_file_open_flags_enum; -``` - -**Enum Constants** - -- OC_FILE_OPEN_NONE -- OC_FILE_OPEN_APPEND -- OC_FILE_OPEN_TRUNCATE -- OC_FILE_OPEN_CREATE -- OC_FILE_OPEN_SYMLINK -- OC_FILE_OPEN_NO_FOLLOW -- OC_FILE_OPEN_RESTRICT - - ---- - -####
oc_file_access
- -``` -typedef u16 oc_file_access; -``` - - ---- - -####
oc_file_access_enum
- -``` -typedef enum oc_file_access_enum -{ - OC_FILE_ACCESS_NONE = 0, - OC_FILE_ACCESS_READ = 2, - OC_FILE_ACCESS_WRITE = 4 -} oc_file_access_enum; -``` - -**Enum Constants** - -- OC_FILE_ACCESS_NONE -- OC_FILE_ACCESS_READ -- OC_FILE_ACCESS_WRITE - - ---- - -####
oc_file_whence
- -``` -typedef enum oc_file_whence -{ - OC_FILE_SEEK_SET = 0, - OC_FILE_SEEK_END = 1, - OC_FILE_SEEK_CURRENT = 2 -} oc_file_whence; -``` - -**Enum Constants** - -- OC_FILE_SEEK_SET -- OC_FILE_SEEK_END -- OC_FILE_SEEK_CURRENT - - ---- - -####
oc_io_req_id
- -``` -typedef u64 oc_io_req_id; -``` - - ---- - -####
oc_io_op
- -``` -typedef u32 oc_io_op; -``` - - ---- - -####
oc_io_op_enum
- -``` -typedef enum oc_io_op_enum -{ - OC_IO_OPEN_AT = 0, - OC_IO_CLOSE = 1, - OC_IO_FSTAT = 2, - OC_IO_SEEK = 3, - OC_IO_READ = 4, - OC_IO_WRITE = 5, - OC_OC_IO_ERROR = 6 -} oc_io_op_enum; -``` - -**Enum Constants** - -- OC_IO_OPEN_AT -- OC_IO_CLOSE -- OC_IO_FSTAT -- OC_IO_SEEK -- OC_IO_READ -- OC_IO_WRITE -- OC_OC_IO_ERROR - - ---- - -####
oc_io_req
- -``` -typedef struct oc_io_req -{ - oc_io_req_id id; - oc_io_op op; - oc_file handle; - i64 offset; - u64 size; - union - { - char* buffer; - u64 unused; - }; - union - { - struct - { - oc_file_access rights; - oc_file_open_flags flags; - }; - struct - { - oc_file_access rights; - oc_file_open_flags flags; - } open; - oc_file_whence whence; - }; -} oc_io_req; -``` - -**Fields** - -- id -- op -- handle -- offset -- size -- Anonymous union - - buffer - - unused - -- Anonymous union - - Anonymous struct - - rights - - flags - - - open - - rights - - flags - - - whence - - - ---- - -####
oc_io_error
- -``` -typedef i32 oc_io_error; -``` - - ---- - -####
oc_io_error_enum
- -``` -typedef enum oc_io_error_enum -{ - OC_IO_OK = 0, - OC_IO_ERR_UNKNOWN = 1, - OC_IO_ERR_OP = 2, - OC_IO_ERR_HANDLE = 3, - OC_IO_ERR_PREV = 4, - OC_IO_ERR_ARG = 5, - OC_IO_ERR_PERM = 6, - OC_IO_ERR_SPACE = 7, - OC_IO_ERR_NO_ENTRY = 8, - OC_IO_ERR_EXISTS = 9, - OC_IO_ERR_NOT_DIR = 10, - OC_IO_ERR_DIR = 11, - OC_IO_ERR_MAX_FILES = 12, - OC_IO_ERR_MAX_LINKS = 13, - OC_IO_ERR_PATH_LENGTH = 14, - OC_IO_ERR_FILE_SIZE = 15, - OC_IO_ERR_OVERFLOW = 16, - OC_IO_ERR_NOT_READY = 17, - OC_IO_ERR_MEM = 18, - OC_IO_ERR_INTERRUPT = 19, - OC_IO_ERR_PHYSICAL = 20, - OC_IO_ERR_NO_DEVICE = 21, - OC_IO_ERR_WALKOUT = 22 -} oc_io_error_enum; -``` - -**Enum Constants** - -- OC_IO_OK -- OC_IO_ERR_UNKNOWN -- OC_IO_ERR_OP -- OC_IO_ERR_HANDLE -- OC_IO_ERR_PREV -- OC_IO_ERR_ARG -- OC_IO_ERR_PERM -- OC_IO_ERR_SPACE -- OC_IO_ERR_NO_ENTRY -- OC_IO_ERR_EXISTS -- OC_IO_ERR_NOT_DIR -- OC_IO_ERR_DIR -- OC_IO_ERR_MAX_FILES -- OC_IO_ERR_MAX_LINKS -- OC_IO_ERR_PATH_LENGTH -- OC_IO_ERR_FILE_SIZE -- OC_IO_ERR_OVERFLOW -- OC_IO_ERR_NOT_READY -- OC_IO_ERR_MEM -- OC_IO_ERR_INTERRUPT -- OC_IO_ERR_PHYSICAL -- OC_IO_ERR_NO_DEVICE -- OC_IO_ERR_WALKOUT - - ---- - -####
oc_io_cmp
- -``` -typedef struct oc_io_cmp -{ - oc_io_req_id id; - oc_io_error error; - union - { - i64 result; - u64 size; - i64 offset; - oc_file handle; - }; -} oc_io_cmp; -``` - -**Fields** - -- id -- error -- Anonymous union - - result - - size - - offset - - handle - - - ---- - -####
oc_file_type
- -``` -typedef enum oc_file_type -{ - OC_FILE_UNKNOWN = 0, - OC_FILE_REGULAR = 1, - OC_FILE_DIRECTORY = 2, - OC_FILE_SYMLINK = 3, - OC_FILE_BLOCK = 4, - OC_FILE_CHARACTER = 5, - OC_FILE_FIFO = 6, - OC_FILE_SOCKET = 7 -} oc_file_type; -``` - -**Enum Constants** - -- OC_FILE_UNKNOWN -- OC_FILE_REGULAR -- OC_FILE_DIRECTORY -- OC_FILE_SYMLINK -- OC_FILE_BLOCK -- OC_FILE_CHARACTER -- OC_FILE_FIFO -- OC_FILE_SOCKET - - ---- - -####
oc_file_perm
- -``` -typedef u16 oc_file_perm; -``` - - ---- - -####
oc_file_perm_enum
- -``` -typedef enum oc_file_perm_enum -{ - OC_FILE_OTHER_EXEC = 1, - OC_FILE_OTHER_WRITE = 2, - OC_FILE_OTHER_READ = 4, - OC_FILE_GROUP_EXEC = 8, - OC_FILE_GROUP_WRITE = 16, - OC_FILE_GROUP_READ = 32, - OC_FILE_OWNER_EXEC = 64, - OC_FILE_OWNER_WRITE = 128, - OC_FILE_OWNER_READ = 256, - OC_FILE_STICKY_BIT = 512, - OC_FILE_SET_GID = 1024, - OC_FILE_SET_UID = 2048 -} oc_file_perm_enum; -``` - -**Enum Constants** - -- OC_FILE_OTHER_EXEC -- OC_FILE_OTHER_WRITE -- OC_FILE_OTHER_READ -- OC_FILE_GROUP_EXEC -- OC_FILE_GROUP_WRITE -- OC_FILE_GROUP_READ -- OC_FILE_OWNER_EXEC -- OC_FILE_OWNER_WRITE -- OC_FILE_OWNER_READ -- OC_FILE_STICKY_BIT -- OC_FILE_SET_GID -- OC_FILE_SET_UID - - ---- - -####
oc_datestamp
- -``` -typedef struct oc_datestamp -{ - i64 seconds; - u64 fraction; -} oc_datestamp; -``` - -**Fields** - -- seconds -- fraction - - ---- - -####
oc_file_status
- -``` -typedef struct oc_file_status -{ - u64 uid; - oc_file_type type; - oc_file_perm perm; - u64 size; - oc_datestamp creationDate; - oc_datestamp accessDate; - oc_datestamp modificationDate; -} oc_file_status; -``` - -**Fields** - -- uid -- type -- perm -- size -- creationDate -- accessDate -- modificationDate - - ---- - -## Functions - -####
oc_io_wait_single_req
- -``` -oc_io_cmp oc_io_wait_single_req(oc_io_req* req); -``` - -**Parameters** - -- req - ---- - -####
oc_file_nil
- -``` -oc_file oc_file_nil(); -``` - - ---- - -####
oc_file_is_nil
- -``` -bool oc_file_is_nil(oc_file handle); -``` - -**Parameters** - -- handle - ---- - -####
oc_file_open
- -``` -oc_file oc_file_open(oc_str8 path, oc_file_access rights, oc_file_open_flags flags); -``` - -**Parameters** - -- path -- rights -- flags - ---- - -####
oc_file_open_at
- -``` -oc_file oc_file_open_at(oc_file dir, oc_str8 path, oc_file_access rights, oc_file_open_flags flags); -``` - -**Parameters** - -- dir -- path -- rights -- flags - ---- - -####
oc_file_close
- -``` -void oc_file_close(oc_file file); -``` - -**Parameters** - -- file - ---- - -####
oc_file_pos
- -``` -i64 oc_file_pos(oc_file file); -``` - -**Parameters** - -- file - ---- - -####
oc_file_seek
- -``` -i64 oc_file_seek(oc_file file, i64 offset, oc_file_whence whence); -``` - -**Parameters** - -- file -- offset -- whence - ---- - -####
oc_file_write
- -``` -u64 oc_file_write(oc_file file, u64 size, char* buffer); -``` - -**Parameters** - -- file -- size -- buffer - ---- - -####
oc_file_read
- -``` -u64 oc_file_read(oc_file file, u64 size, char* buffer); -``` - -**Parameters** - -- file -- size -- buffer - ---- - -####
oc_file_last_error
- -``` -oc_io_error oc_file_last_error(oc_file handle); -``` - -**Parameters** - -- handle - ---- - -####
oc_file_get_status
- -``` -oc_file_status oc_file_get_status(oc_file file); -``` - -**Parameters** - -- file - ---- - -####
oc_file_size
- -``` -u64 oc_file_size(oc_file file); -``` - -**Parameters** - -- file - ---- - -####
oc_file_open_with_request
- -``` -oc_file oc_file_open_with_request(oc_str8 path, oc_file_access rights, oc_file_open_flags flags); -``` - -**Parameters** - -- path -- rights -- flags - ---- - diff --git a/doc/mkdocs/docs/api/I_O/Paths.md b/doc/mkdocs/docs/api/I_O/Paths.md deleted file mode 100644 index 916c389d..00000000 --- a/doc/mkdocs/docs/api/I_O/Paths.md +++ /dev/null @@ -1,158 +0,0 @@ -# Paths - -API for handling filesystem paths. - -## Functions - -####
oc_path_slice_directory
- -``` -oc_str8 oc_path_slice_directory(oc_str8 path); -``` - -**Parameters** - -- path - ---- - -####
oc_path_slice_filename
- -``` -oc_str8 oc_path_slice_filename(oc_str8 path); -``` - -**Parameters** - -- path - ---- - -####
oc_path_split
- -``` -oc_str8_list oc_path_split(oc_arena* arena, oc_str8 path); -``` - -**Parameters** - -- arena -- path - ---- - -####
oc_path_join
- -``` -oc_str8 oc_path_join(oc_arena* arena, oc_str8_list elements); -``` - -**Parameters** - -- arena -- elements - ---- - -####
oc_path_append
- -``` -oc_str8 oc_path_append(oc_arena* arena, oc_str8 parent, oc_str8 relPath); -``` - -**Parameters** - -- arena -- parent -- relPath - ---- - -####
oc_path_is_absolute
- -``` -bool oc_path_is_absolute(oc_str8 path); -``` - -**Parameters** - -- path - ---- - -####
oc_path_slice_directory
- -``` -oc_str8 oc_path_slice_directory(oc_str8 path); -``` - -**Parameters** - -- path - ---- - -####
oc_path_slice_filename
- -``` -oc_str8 oc_path_slice_filename(oc_str8 path); -``` - -**Parameters** - -- path - ---- - -####
oc_path_split
- -``` -oc_str8_list oc_path_split(oc_arena* arena, oc_str8 path); -``` - -**Parameters** - -- arena -- path - ---- - -####
oc_path_join
- -``` -oc_str8 oc_path_join(oc_arena* arena, oc_str8_list elements); -``` - -**Parameters** - -- arena -- elements - ---- - -####
oc_path_append
- -``` -oc_str8 oc_path_append(oc_arena* arena, oc_str8 parent, oc_str8 relPath); -``` - -**Parameters** - -- arena -- parent -- relPath - ---- - -####
oc_path_is_absolute
- -``` -bool oc_path_is_absolute(oc_str8 path); -``` - -**Parameters** - -- path - ---- - diff --git a/doc/mkdocs/docs/api/UI.md b/doc/mkdocs/docs/api/UI.md deleted file mode 100644 index ca8e7aa8..00000000 --- a/doc/mkdocs/docs/api/UI.md +++ /dev/null @@ -1,2449 +0,0 @@ -# UI - -Graphical User Interface API. - -## Types - -####
oc_key_state
- -``` -typedef struct oc_key_state -{ - u64 lastUpdate; - u32 transitionCount; - u32 repeatCount; - bool down; - bool sysClicked; - bool sysDoubleClicked; - bool sysTripleClicked; -} oc_key_state; -``` - -**Fields** - -- lastUpdate -- transitionCount -- repeatCount -- down -- sysClicked -- sysDoubleClicked -- sysTripleClicked - - ---- - -####
oc_keyboard_state
- -``` -typedef struct oc_keyboard_state -{ - oc_key_state keys[349]; - oc_keymod_flags mods; -} oc_keyboard_state; -``` - -**Fields** - -- keys -- mods - - ---- - -####
oc_mouse_state
- -``` -typedef struct oc_mouse_state -{ - u64 lastUpdate; - bool posValid; - oc_vec2 pos; - oc_vec2 delta; - oc_vec2 wheel; - union - { - oc_key_state buttons[5]; - struct - { - oc_key_state left; - oc_key_state right; - oc_key_state middle; - oc_key_state ext1; - oc_key_state ext2; - }; - }; -} oc_mouse_state; -``` - -**Fields** - -- lastUpdate -- posValid -- pos -- delta -- wheel -- Anonymous union - - buttons - - Anonymous struct - - left - - right - - middle - - ext1 - - ext2 - - - - ---- - -#### Anonymous enum - -``` -typedef enum -{ - OC_INPUT_TEXT_BACKING_SIZE = 64 -}; -``` - -**Enum Constants** - -- OC_INPUT_TEXT_BACKING_SIZE - - ---- - -####
oc_text_state
- -``` -typedef struct oc_text_state -{ - u64 lastUpdate; - oc_utf32 backing[64]; - oc_str32 codePoints; -} oc_text_state; -``` - -**Fields** - -- lastUpdate -- backing -- codePoints - - ---- - -####
oc_clipboard_state
- -``` -typedef struct oc_clipboard_state -{ - u64 lastUpdate; - oc_str8 pastedText; -} oc_clipboard_state; -``` - -**Fields** - -- lastUpdate -- pastedText - - ---- - -####
oc_input_state
- -``` -typedef struct oc_input_state -{ - u64 frameCounter; - oc_keyboard_state keyboard; - oc_mouse_state mouse; - oc_text_state text; - oc_clipboard_state clipboard; -} oc_input_state; -``` - -**Fields** - -- frameCounter -- keyboard -- mouse -- text -- clipboard - - ---- - -####
oc_ui_key
- -``` -typedef struct oc_ui_key -{ - u64 hash; -} oc_ui_key; -``` - -**Fields** - -- hash - - ---- - -####
oc_ui_axis
- -``` -typedef enum oc_ui_axis -{ - OC_UI_AXIS_X = 0, - OC_UI_AXIS_Y = 1, - OC_UI_AXIS_COUNT = 2 -} oc_ui_axis; -``` - -**Enum Constants** - -- OC_UI_AXIS_X -- OC_UI_AXIS_Y -- OC_UI_AXIS_COUNT - - ---- - -####
oc_ui_align
- -``` -typedef enum oc_ui_align -{ - OC_UI_ALIGN_START = 0, - OC_UI_ALIGN_END = 1, - OC_UI_ALIGN_CENTER = 2 -} oc_ui_align; -``` - -**Enum Constants** - -- OC_UI_ALIGN_START -- OC_UI_ALIGN_END -- OC_UI_ALIGN_CENTER - - ---- - -####
oc_ui_layout_align
- -``` -typedef union oc_ui_layout_align -{ - struct - { - oc_ui_align x; - oc_ui_align y; - }; - oc_ui_align c[2]; -} oc_ui_layout_align; -``` - -**Fields** - -- Anonymous struct - - x - - y - -- c - - ---- - -####
oc_ui_layout
- -``` -typedef struct oc_ui_layout -{ - oc_ui_axis axis; - f32 spacing; - union - { - struct - { - f32 x; - f32 y; - }; - f32 c[2]; - }; - union - { - struct - { - f32 x; - f32 y; - }; - f32 c[2]; - } margin; - oc_ui_layout_align align; -} oc_ui_layout; -``` - -**Fields** - -- axis -- spacing -- Anonymous union - - Anonymous struct - - x - - y - - - c - -- margin - - Anonymous struct - - x - - y - - - c - -- align - - ---- - -####
oc_ui_size_kind
- -``` -typedef enum oc_ui_size_kind -{ - OC_UI_SIZE_TEXT = 0, - OC_UI_SIZE_PIXELS = 1, - OC_UI_SIZE_CHILDREN = 2, - OC_UI_SIZE_PARENT = 3, - OC_UI_SIZE_PARENT_MINUS_PIXELS = 4 -} oc_ui_size_kind; -``` - -**Enum Constants** - -- OC_UI_SIZE_TEXT -- OC_UI_SIZE_PIXELS -- OC_UI_SIZE_CHILDREN -- OC_UI_SIZE_PARENT -- OC_UI_SIZE_PARENT_MINUS_PIXELS - - ---- - -####
oc_ui_size
- -``` -typedef struct oc_ui_size -{ - oc_ui_size_kind kind; - f32 value; - f32 relax; - f32 minSize; -} oc_ui_size; -``` - -**Fields** - -- kind -- value -- relax -- minSize - - ---- - -####
oc_ui_box_size
- -``` -typedef union oc_ui_box_size -{ - struct - { - oc_ui_size width; - oc_ui_size height; - }; - oc_ui_size c[2]; -} oc_ui_box_size; -``` - -**Fields** - -- Anonymous struct - - width - - height - -- c - - ---- - -####
oc_ui_box_floating
- -``` -typedef union oc_ui_box_floating -{ - struct - { - bool x; - bool y; - }; - bool c[2]; -} oc_ui_box_floating; -``` - -**Fields** - -- Anonymous struct - - x - - y - -- c - - ---- - -####
oc_ui_style_mask
- -``` -typedef u64 oc_ui_style_mask; -``` - - ---- - -#### Anonymous enum - -``` -typedef enum -{ - OC_UI_STYLE_NONE = 0, - OC_UI_STYLE_SIZE_WIDTH = 2, - OC_UI_STYLE_SIZE_HEIGHT = 4, - OC_UI_STYLE_LAYOUT_AXIS = 8, - OC_UI_STYLE_LAYOUT_ALIGN_X = 16, - OC_UI_STYLE_LAYOUT_ALIGN_Y = 32, - OC_UI_STYLE_LAYOUT_SPACING = 64, - OC_UI_STYLE_LAYOUT_MARGIN_X = 128, - OC_UI_STYLE_LAYOUT_MARGIN_Y = 256, - OC_UI_STYLE_FLOAT_X = 512, - OC_UI_STYLE_FLOAT_Y = 1024, - OC_UI_STYLE_COLOR = 2048, - OC_UI_STYLE_BG_COLOR = 4096, - OC_UI_STYLE_BORDER_COLOR = 8192, - OC_UI_STYLE_BORDER_SIZE = 16384, - OC_UI_STYLE_ROUNDNESS = 32768, - OC_UI_STYLE_FONT = 65536, - OC_UI_STYLE_FONT_SIZE = 131072, - OC_UI_STYLE_ANIMATION_TIME = 262144, - OC_UI_STYLE_ANIMATION_MASK = 524288, - OC_UI_STYLE_SIZE = 6, - OC_UI_STYLE_LAYOUT_MARGINS = 384, - OC_UI_STYLE_LAYOUT = 504, - OC_UI_STYLE_FLOAT = 1536, - OC_UI_STYLE_MASK_INHERITED = 985088 -}; -``` - -**Enum Constants** - -- OC_UI_STYLE_NONE -- OC_UI_STYLE_SIZE_WIDTH -- OC_UI_STYLE_SIZE_HEIGHT -- OC_UI_STYLE_LAYOUT_AXIS -- OC_UI_STYLE_LAYOUT_ALIGN_X -- OC_UI_STYLE_LAYOUT_ALIGN_Y -- OC_UI_STYLE_LAYOUT_SPACING -- OC_UI_STYLE_LAYOUT_MARGIN_X -- OC_UI_STYLE_LAYOUT_MARGIN_Y -- OC_UI_STYLE_FLOAT_X -- OC_UI_STYLE_FLOAT_Y -- OC_UI_STYLE_COLOR -- OC_UI_STYLE_BG_COLOR -- OC_UI_STYLE_BORDER_COLOR -- OC_UI_STYLE_BORDER_SIZE -- OC_UI_STYLE_ROUNDNESS -- OC_UI_STYLE_FONT -- OC_UI_STYLE_FONT_SIZE -- OC_UI_STYLE_ANIMATION_TIME -- OC_UI_STYLE_ANIMATION_MASK -- OC_UI_STYLE_SIZE -- OC_UI_STYLE_LAYOUT_MARGINS -- OC_UI_STYLE_LAYOUT -- OC_UI_STYLE_FLOAT -- OC_UI_STYLE_MASK_INHERITED - - ---- - -####
oc_ui_style
- -``` -typedef struct oc_ui_style -{ - oc_ui_box_size size; - oc_ui_layout layout; - oc_ui_box_floating floating; - oc_vec2 floatTarget; - oc_color color; - oc_color bgColor; - oc_color borderColor; - oc_font font; - f32 fontSize; - f32 borderSize; - f32 roundness; - f32 animationTime; - oc_ui_style_mask animationMask; -} oc_ui_style; -``` - -**Fields** - -- size -- layout -- floating -- floatTarget -- color -- bgColor -- borderColor -- font -- fontSize -- borderSize -- roundness -- animationTime -- animationMask - - ---- - -####
oc_ui_palette
- -``` -typedef struct oc_ui_palette -{ - oc_color red0; - oc_color red1; - oc_color red2; - oc_color red3; - oc_color red4; - oc_color red5; - oc_color red6; - oc_color red7; - oc_color red8; - oc_color red9; - oc_color orange0; - oc_color orange1; - oc_color orange2; - oc_color orange3; - oc_color orange4; - oc_color orange5; - oc_color orange6; - oc_color orange7; - oc_color orange8; - oc_color orange9; - oc_color amber0; - oc_color amber1; - oc_color amber2; - oc_color amber3; - oc_color amber4; - oc_color amber5; - oc_color amber6; - oc_color amber7; - oc_color amber8; - oc_color amber9; - oc_color yellow0; - oc_color yellow1; - oc_color yellow2; - oc_color yellow3; - oc_color yellow4; - oc_color yellow5; - oc_color yellow6; - oc_color yellow7; - oc_color yellow8; - oc_color yellow9; - oc_color lime0; - oc_color lime1; - oc_color lime2; - oc_color lime3; - oc_color lime4; - oc_color lime5; - oc_color lime6; - oc_color lime7; - oc_color lime8; - oc_color lime9; - oc_color lightGreen0; - oc_color lightGreen1; - oc_color lightGreen2; - oc_color lightGreen3; - oc_color lightGreen4; - oc_color lightGreen5; - oc_color lightGreen6; - oc_color lightGreen7; - oc_color lightGreen8; - oc_color lightGreen9; - oc_color green0; - oc_color green1; - oc_color green2; - oc_color green3; - oc_color green4; - oc_color green5; - oc_color green6; - oc_color green7; - oc_color green8; - oc_color green9; - oc_color teal0; - oc_color teal1; - oc_color teal2; - oc_color teal3; - oc_color teal4; - oc_color teal5; - oc_color teal6; - oc_color teal7; - oc_color teal8; - oc_color teal9; - oc_color cyan0; - oc_color cyan1; - oc_color cyan2; - oc_color cyan3; - oc_color cyan4; - oc_color cyan5; - oc_color cyan6; - oc_color cyan7; - oc_color cyan8; - oc_color cyan9; - oc_color lightBlue0; - oc_color lightBlue1; - oc_color lightBlue2; - oc_color lightBlue3; - oc_color lightBlue4; - oc_color lightBlue5; - oc_color lightBlue6; - oc_color lightBlue7; - oc_color lightBlue8; - oc_color lightBlue9; - oc_color blue0; - oc_color blue1; - oc_color blue2; - oc_color blue3; - oc_color blue4; - oc_color blue5; - oc_color blue6; - oc_color blue7; - oc_color blue8; - oc_color blue9; - oc_color indigo0; - oc_color indigo1; - oc_color indigo2; - oc_color indigo3; - oc_color indigo4; - oc_color indigo5; - oc_color indigo6; - oc_color indigo7; - oc_color indigo8; - oc_color indigo9; - oc_color violet0; - oc_color violet1; - oc_color violet2; - oc_color violet3; - oc_color violet4; - oc_color violet5; - oc_color violet6; - oc_color violet7; - oc_color violet8; - oc_color violet9; - oc_color purple0; - oc_color purple1; - oc_color purple2; - oc_color purple3; - oc_color purple4; - oc_color purple5; - oc_color purple6; - oc_color purple7; - oc_color purple8; - oc_color purple9; - oc_color pink0; - oc_color pink1; - oc_color pink2; - oc_color pink3; - oc_color pink4; - oc_color pink5; - oc_color pink6; - oc_color pink7; - oc_color pink8; - oc_color pink9; - oc_color grey0; - oc_color grey1; - oc_color grey2; - oc_color grey3; - oc_color grey4; - oc_color grey5; - oc_color grey6; - oc_color grey7; - oc_color grey8; - oc_color grey9; - oc_color black; - oc_color white; -} oc_ui_palette; -``` - -**Fields** - -- red0 -- red1 -- red2 -- red3 -- red4 -- red5 -- red6 -- red7 -- red8 -- red9 -- orange0 -- orange1 -- orange2 -- orange3 -- orange4 -- orange5 -- orange6 -- orange7 -- orange8 -- orange9 -- amber0 -- amber1 -- amber2 -- amber3 -- amber4 -- amber5 -- amber6 -- amber7 -- amber8 -- amber9 -- yellow0 -- yellow1 -- yellow2 -- yellow3 -- yellow4 -- yellow5 -- yellow6 -- yellow7 -- yellow8 -- yellow9 -- lime0 -- lime1 -- lime2 -- lime3 -- lime4 -- lime5 -- lime6 -- lime7 -- lime8 -- lime9 -- lightGreen0 -- lightGreen1 -- lightGreen2 -- lightGreen3 -- lightGreen4 -- lightGreen5 -- lightGreen6 -- lightGreen7 -- lightGreen8 -- lightGreen9 -- green0 -- green1 -- green2 -- green3 -- green4 -- green5 -- green6 -- green7 -- green8 -- green9 -- teal0 -- teal1 -- teal2 -- teal3 -- teal4 -- teal5 -- teal6 -- teal7 -- teal8 -- teal9 -- cyan0 -- cyan1 -- cyan2 -- cyan3 -- cyan4 -- cyan5 -- cyan6 -- cyan7 -- cyan8 -- cyan9 -- lightBlue0 -- lightBlue1 -- lightBlue2 -- lightBlue3 -- lightBlue4 -- lightBlue5 -- lightBlue6 -- lightBlue7 -- lightBlue8 -- lightBlue9 -- blue0 -- blue1 -- blue2 -- blue3 -- blue4 -- blue5 -- blue6 -- blue7 -- blue8 -- blue9 -- indigo0 -- indigo1 -- indigo2 -- indigo3 -- indigo4 -- indigo5 -- indigo6 -- indigo7 -- indigo8 -- indigo9 -- violet0 -- violet1 -- violet2 -- violet3 -- violet4 -- violet5 -- violet6 -- violet7 -- violet8 -- violet9 -- purple0 -- purple1 -- purple2 -- purple3 -- purple4 -- purple5 -- purple6 -- purple7 -- purple8 -- purple9 -- pink0 -- pink1 -- pink2 -- pink3 -- pink4 -- pink5 -- pink6 -- pink7 -- pink8 -- pink9 -- grey0 -- grey1 -- grey2 -- grey3 -- grey4 -- grey5 -- grey6 -- grey7 -- grey8 -- grey9 -- black -- white - - ---- - -####
oc_ui_theme
- -``` -typedef struct oc_ui_theme -{ - oc_color white; - oc_color primary; - oc_color primaryHover; - oc_color primaryActive; - oc_color border; - oc_color fill0; - oc_color fill1; - oc_color fill2; - oc_color bg0; - oc_color bg1; - oc_color bg2; - oc_color bg3; - oc_color bg4; - oc_color text0; - oc_color text1; - oc_color text2; - oc_color text3; - oc_color sliderThumbBorder; - oc_color elevatedBorder; - f32 roundnessSmall; - f32 roundnessMedium; - f32 roundnessLarge; - oc_ui_palette* palette; -} oc_ui_theme; -``` - -**Fields** - -- white -- primary -- primaryHover -- primaryActive -- border -- fill0 -- fill1 -- fill2 -- bg0 -- bg1 -- bg2 -- bg3 -- bg4 -- text0 -- text1 -- text2 -- text3 -- sliderThumbBorder -- elevatedBorder -- roundnessSmall -- roundnessMedium -- roundnessLarge -- palette - - ---- - -####
oc_ui_tag
- -``` -typedef struct oc_ui_tag -{ - u64 hash; -} oc_ui_tag; -``` - -**Fields** - -- hash - - ---- - -####
oc_ui_selector_kind
- -``` -typedef enum oc_ui_selector_kind -{ - OC_UI_SEL_ANY = 0, - OC_UI_SEL_OWNER = 1, - OC_UI_SEL_TEXT = 2, - OC_UI_SEL_TAG = 3, - OC_UI_SEL_STATUS = 4, - OC_UI_SEL_KEY = 5 -} oc_ui_selector_kind; -``` - -**Enum Constants** - -- OC_UI_SEL_ANY -- OC_UI_SEL_OWNER -- OC_UI_SEL_TEXT -- OC_UI_SEL_TAG -- OC_UI_SEL_STATUS -- OC_UI_SEL_KEY - - ---- - -####
oc_ui_status
- -``` -typedef u8 oc_ui_status; -``` - - ---- - -####
oc_ui_status_enum
- -``` -typedef enum oc_ui_status_enum -{ - OC_UI_NONE = 0, - OC_UI_HOVER = 2, - OC_UI_HOT = 4, - OC_UI_ACTIVE = 8, - OC_UI_DRAGGING = 16 -} oc_ui_status_enum; -``` - -**Enum Constants** - -- OC_UI_NONE -- OC_UI_HOVER -- OC_UI_HOT -- OC_UI_ACTIVE -- OC_UI_DRAGGING - - ---- - -####
oc_ui_selector_op
- -``` -typedef enum oc_ui_selector_op -{ - OC_UI_SEL_DESCENDANT = 0, - OC_UI_SEL_AND = 1 -} oc_ui_selector_op; -``` - -**Enum Constants** - -- OC_UI_SEL_DESCENDANT -- OC_UI_SEL_AND - - ---- - -####
oc_ui_selector
- -``` -typedef struct oc_ui_selector -{ - oc_list_elt listElt; - oc_ui_selector_kind kind; - oc_ui_selector_op op; - union - { - oc_str8 text; - oc_ui_key key; - oc_ui_tag tag; - oc_ui_status status; - }; -} oc_ui_selector; -``` - -**Fields** - -- listElt -- kind -- op -- Anonymous union - - text - - key - - tag - - status - - - ---- - -####
oc_ui_pattern
- -``` -typedef struct oc_ui_pattern -{ - oc_list l; -} oc_ui_pattern; -``` - -**Fields** - -- l - - ---- - -####
oc_ui_box
- -``` -typedef struct oc_ui_box -{ - oc_list_elt listElt; - oc_list children; - oc_ui_box* parent; - oc_list_elt overlayElt; - oc_list_elt bucketElt; - oc_ui_key key; - u64 frameCounter; - oc_ui_flags flags; - oc_str8 string; - oc_list tags; - oc_ui_box_draw_proc drawProc; - void* drawData; - oc_list beforeRules; - oc_list afterRules; - oc_ui_style* targetStyle; - oc_ui_style style; - u32 z; - oc_vec2 floatPos; - f32 childrenSum[2]; - f32 spacing[2]; - f32 minSize[2]; - oc_rect rect; - oc_ui_sig* sig; - bool fresh; - bool closed; - bool parentClosed; - bool dragging; - bool hot; - bool active; - oc_vec2 scroll; - oc_vec2 pressedMouse; - f32 hotTransition; - f32 activeTransition; -} oc_ui_box; -``` - -**Fields** - -- listElt -- children -- parent -- overlayElt -- bucketElt -- key -- frameCounter -- flags -- string -- tags -- drawProc -- drawData -- beforeRules -- afterRules -- targetStyle -- style -- z -- floatPos -- childrenSum -- spacing -- minSize -- rect -- sig -- fresh -- closed -- parentClosed -- dragging -- hot -- active -- scroll -- pressedMouse -- hotTransition -- activeTransition - - ---- - -####
oc_ui_style_rule
- -``` -typedef struct oc_ui_style_rule -{ - oc_list_elt boxElt; - oc_list_elt buildElt; - oc_list_elt tmpElt; - oc_ui_box* owner; - oc_ui_pattern pattern; - oc_ui_style_mask mask; - oc_ui_style* style; -} oc_ui_style_rule; -``` - -**Fields** - -- boxElt -- buildElt -- tmpElt -- owner -- pattern -- mask -- style - - ---- - -####
oc_ui_sig
- -``` -typedef struct oc_ui_sig -{ - oc_ui_box* box; - oc_vec2 mouse; - oc_vec2 delta; - oc_vec2 wheel; - bool pressed; - bool released; - bool clicked; - bool doubleClicked; - bool tripleClicked; - bool rightPressed; - bool dragging; - bool hovering; - bool pasted; -} oc_ui_sig; -``` - -**Fields** - -- box -- mouse -- delta -- wheel -- pressed -- released -- clicked -- doubleClicked -- tripleClicked -- rightPressed -- dragging -- hovering -- pasted - - ---- - -####
oc_ui_box_draw_proc
- -``` -typedef void (*oc_ui_box_draw_proc)((oc_ui_box* arg0, void* arg1)); -``` - - ---- - -####
oc_ui_flags
- -``` -typedef enum oc_ui_flags -{ - OC_UI_FLAG_NONE = 0, - OC_UI_FLAG_CLICKABLE = 1, - OC_UI_FLAG_SCROLL_WHEEL_X = 2, - OC_UI_FLAG_SCROLL_WHEEL_Y = 4, - OC_UI_FLAG_BLOCK_MOUSE = 8, - OC_UI_FLAG_HOT_ANIMATION = 16, - OC_UI_FLAG_ACTIVE_ANIMATION = 32, - OC_UI_FLAG_OVERFLOW_ALLOW_X = 64, - OC_UI_FLAG_OVERFLOW_ALLOW_Y = 128, - OC_UI_FLAG_CLIP = 256, - OC_UI_FLAG_DRAW_BACKGROUND = 512, - OC_UI_FLAG_DRAW_FOREGROUND = 1024, - OC_UI_FLAG_DRAW_BORDER = 2048, - OC_UI_FLAG_DRAW_TEXT = 4096, - OC_UI_FLAG_DRAW_PROC = 8192, - OC_UI_FLAG_OVERLAY = 65536 -} oc_ui_flags; -``` - -**Enum Constants** - -- OC_UI_FLAG_NONE -- OC_UI_FLAG_CLICKABLE -- OC_UI_FLAG_SCROLL_WHEEL_X -- OC_UI_FLAG_SCROLL_WHEEL_Y -- OC_UI_FLAG_BLOCK_MOUSE -- OC_UI_FLAG_HOT_ANIMATION -- OC_UI_FLAG_ACTIVE_ANIMATION -- OC_UI_FLAG_OVERFLOW_ALLOW_X -- OC_UI_FLAG_OVERFLOW_ALLOW_Y -- OC_UI_FLAG_CLIP -- OC_UI_FLAG_DRAW_BACKGROUND -- OC_UI_FLAG_DRAW_FOREGROUND -- OC_UI_FLAG_DRAW_BORDER -- OC_UI_FLAG_DRAW_TEXT -- OC_UI_FLAG_DRAW_PROC -- OC_UI_FLAG_OVERLAY - - ---- - -#### Anonymous enum - -``` -typedef enum -{ - OC_UI_MAX_INPUT_CHAR_PER_FRAME = 64 -}; -``` - -**Enum Constants** - -- OC_UI_MAX_INPUT_CHAR_PER_FRAME - - ---- - -####
oc_ui_input_text
- -``` -typedef struct oc_ui_input_text -{ - u8 count; - oc_utf32 codePoints[64]; -} oc_ui_input_text; -``` - -**Fields** - -- count -- codePoints - - ---- - -####
oc_ui_stack_elt
- -``` -typedef struct oc_ui_stack_elt -{ - oc_ui_stack_elt* parent; - union - { - oc_ui_box* box; - oc_ui_size size; - oc_rect clip; - }; -} oc_ui_stack_elt; -``` - -**Fields** - -- parent -- Anonymous union - - box - - size - - clip - - - ---- - -####
oc_ui_tag_elt
- -``` -typedef struct oc_ui_tag_elt -{ - oc_list_elt listElt; - oc_ui_tag tag; -} oc_ui_tag_elt; -``` - -**Fields** - -- listElt -- tag - - ---- - -#### Anonymous enum - -``` -typedef enum -{ - OC_UI_BOX_MAP_BUCKET_COUNT = 1024 -}; -``` - -**Enum Constants** - -- OC_UI_BOX_MAP_BUCKET_COUNT - - ---- - -####
oc_ui_edit_move
- -``` -typedef enum oc_ui_edit_move -{ - OC_UI_EDIT_MOVE_NONE = 0, - OC_UI_EDIT_MOVE_CHAR = 1, - OC_UI_EDIT_MOVE_WORD = 2, - OC_UI_EDIT_MOVE_LINE = 3 -} oc_ui_edit_move; -``` - -**Enum Constants** - -- OC_UI_EDIT_MOVE_NONE -- OC_UI_EDIT_MOVE_CHAR -- OC_UI_EDIT_MOVE_WORD -- OC_UI_EDIT_MOVE_LINE - - ---- - -####
oc_ui_context
- -``` -typedef struct oc_ui_context -{ - bool init; - oc_input_state input; - u64 frameCounter; - f64 frameTime; - f64 lastFrameDuration; - oc_arena frameArena; - oc_pool boxPool; - oc_list boxMap[1024]; - oc_ui_box* root; - oc_ui_box* overlay; - oc_list overlayList; - oc_ui_stack_elt* boxStack; - oc_ui_stack_elt* clipStack; - oc_list nextBoxBeforeRules; - oc_list nextBoxAfterRules; - oc_list nextBoxTags; - u32 z; - oc_ui_box* hovered; - oc_ui_box* focus; - i32 editCursor; - i32 editMark; - i32 editFirstDisplayedChar; - f64 editCursorBlinkStart; - oc_ui_edit_move editSelectionMode; - i32 editWordSelectionInitialCursor; - i32 editWordSelectionInitialMark; - oc_ui_theme* theme; -} oc_ui_context; -``` - -**Fields** - -- init -- input -- frameCounter -- frameTime -- lastFrameDuration -- frameArena -- boxPool -- boxMap -- root -- overlay -- overlayList -- boxStack -- clipStack -- nextBoxBeforeRules -- nextBoxAfterRules -- nextBoxTags -- z -- hovered -- focus -- editCursor -- editMark -- editFirstDisplayedChar -- editCursorBlinkStart -- editSelectionMode -- editWordSelectionInitialCursor -- editWordSelectionInitialMark -- theme - - ---- - -####
oc_ui_text_box_result
- -``` -typedef struct oc_ui_text_box_result -{ - bool changed; - bool accepted; - oc_str8 text; -} oc_ui_text_box_result; -``` - -**Fields** - -- changed -- accepted -- text - - ---- - -####
oc_ui_select_popup_info
- -``` -typedef struct oc_ui_select_popup_info -{ - bool changed; - i32 selectedIndex; - i32 optionCount; - oc_str8* options; - oc_str8 placeholder; -} oc_ui_select_popup_info; -``` - -**Fields** - -- changed -- selectedIndex -- optionCount -- options -- placeholder - - ---- - -####
oc_ui_radio_group_info
- -``` -typedef struct oc_ui_radio_group_info -{ - bool changed; - i32 selectedIndex; - i32 optionCount; - oc_str8* options; -} oc_ui_radio_group_info; -``` - -**Fields** - -- changed -- selectedIndex -- optionCount -- options - - ---- - -## Functions - -####
oc_input_process_event
- -``` -void oc_input_process_event(oc_arena* arena, oc_input_state* state, oc_event* event); -``` - -**Parameters** - -- arena -- state -- event - ---- - -####
oc_input_next_frame
- -``` -void oc_input_next_frame(oc_input_state* state); -``` - -**Parameters** - -- state - ---- - -####
oc_key_down
- -``` -bool oc_key_down(oc_input_state* state, oc_key_code key); -``` - -**Parameters** - -- state -- key - ---- - -####
oc_key_press_count
- -``` -u8 oc_key_press_count(oc_input_state* state, oc_key_code key); -``` - -**Parameters** - -- state -- key - ---- - -####
oc_key_release_count
- -``` -u8 oc_key_release_count(oc_input_state* state, oc_key_code key); -``` - -**Parameters** - -- state -- key - ---- - -####
oc_key_repeat_count
- -``` -u8 oc_key_repeat_count(oc_input_state* state, oc_key_code key); -``` - -**Parameters** - -- state -- key - ---- - -####
oc_key_down_scancode
- -``` -bool oc_key_down_scancode(oc_input_state* state, oc_scan_code key); -``` - -**Parameters** - -- state -- key - ---- - -####
oc_key_press_count_scancode
- -``` -u8 oc_key_press_count_scancode(oc_input_state* state, oc_scan_code key); -``` - -**Parameters** - -- state -- key - ---- - -####
oc_key_release_count_scancode
- -``` -u8 oc_key_release_count_scancode(oc_input_state* state, oc_scan_code key); -``` - -**Parameters** - -- state -- key - ---- - -####
oc_key_repeat_count_scancode
- -``` -u8 oc_key_repeat_count_scancode(oc_input_state* state, oc_scan_code key); -``` - -**Parameters** - -- state -- key - ---- - -####
oc_mouse_down
- -``` -bool oc_mouse_down(oc_input_state* state, oc_mouse_button button); -``` - -**Parameters** - -- state -- button - ---- - -####
oc_mouse_pressed
- -``` -u8 oc_mouse_pressed(oc_input_state* state, oc_mouse_button button); -``` - -**Parameters** - -- state -- button - ---- - -####
oc_mouse_released
- -``` -u8 oc_mouse_released(oc_input_state* state, oc_mouse_button button); -``` - -**Parameters** - -- state -- button - ---- - -####
oc_mouse_clicked
- -``` -bool oc_mouse_clicked(oc_input_state* state, oc_mouse_button button); -``` - -**Parameters** - -- state -- button - ---- - -####
oc_mouse_double_clicked
- -``` -bool oc_mouse_double_clicked(oc_input_state* state, oc_mouse_button button); -``` - -**Parameters** - -- state -- button - ---- - -####
oc_mouse_position
- -``` -oc_vec2 oc_mouse_position(oc_input_state* state); -``` - -**Parameters** - -- state - ---- - -####
oc_mouse_delta
- -``` -oc_vec2 oc_mouse_delta(oc_input_state* state); -``` - -**Parameters** - -- state - ---- - -####
oc_mouse_wheel
- -``` -oc_vec2 oc_mouse_wheel(oc_input_state* state); -``` - -**Parameters** - -- state - ---- - -####
oc_input_text_utf32
- -``` -oc_str32 oc_input_text_utf32(oc_arena* arena, oc_input_state* state); -``` - -**Parameters** - -- arena -- state - ---- - -####
oc_input_text_utf8
- -``` -oc_str8 oc_input_text_utf8(oc_arena* arena, oc_input_state* state); -``` - -**Parameters** - -- arena -- state - ---- - -####
oc_clipboard_pasted
- -``` -bool oc_clipboard_pasted(oc_input_state* state); -``` - -**Parameters** - -- state - ---- - -####
oc_clipboard_pasted_text
- -``` -oc_str8 oc_clipboard_pasted_text(oc_input_state* state); -``` - -**Parameters** - -- state - ---- - -####
oc_key_mods
- -``` -oc_keymod_flags oc_key_mods(oc_input_state* state); -``` - -**Parameters** - -- state - ---- - -####
oc_ui_init
- -``` -void oc_ui_init(oc_ui_context* context); -``` - -**Parameters** - -- context - ---- - -####
oc_ui_get_context
- -``` -oc_ui_context* oc_ui_get_context(); -``` - - ---- - -####
oc_ui_set_context
- -``` -void oc_ui_set_context(oc_ui_context* context); -``` - -**Parameters** - -- context - ---- - -####
oc_ui_process_event
- -``` -void oc_ui_process_event(oc_event* event); -``` - -**Parameters** - -- event - ---- - -####
oc_ui_begin_frame
- -``` -void oc_ui_begin_frame(oc_vec2 size, oc_ui_style* defaultStyle, oc_ui_style_mask mask); -``` - -**Parameters** - -- size -- defaultStyle -- mask - ---- - -####
oc_ui_end_frame
- -``` -void oc_ui_end_frame(); -``` - - ---- - -####
oc_ui_draw
- -``` -void oc_ui_draw(); -``` - - ---- - -####
oc_ui_set_theme
- -``` -void oc_ui_set_theme(oc_ui_theme* theme); -``` - -**Parameters** - -- theme - ---- - -####
oc_ui_key_make_str8
- -``` -oc_ui_key oc_ui_key_make_str8(oc_str8 string); -``` - -**Parameters** - -- string - ---- - -####
oc_ui_key_make_path
- -``` -oc_ui_key oc_ui_key_make_path(oc_str8_list path); -``` - -**Parameters** - -- path - ---- - -####
oc_ui_box_make_str8
- -``` -oc_ui_box* oc_ui_box_make_str8(oc_str8 string, oc_ui_flags flags); -``` - -**Parameters** - -- string -- flags - ---- - -####
oc_ui_box_begin_str8
- -``` -oc_ui_box* oc_ui_box_begin_str8(oc_str8 string, oc_ui_flags flags); -``` - -**Parameters** - -- string -- flags - ---- - -####
oc_ui_box_end
- -``` -oc_ui_box* oc_ui_box_end(); -``` - - ---- - -####
oc_ui_box_push
- -``` -void oc_ui_box_push(oc_ui_box* box); -``` - -**Parameters** - -- box - ---- - -####
oc_ui_box_pop
- -``` -void oc_ui_box_pop(); -``` - - ---- - -####
oc_ui_box_top
- -``` -oc_ui_box* oc_ui_box_top(); -``` - - ---- - -####
oc_ui_box_lookup_key
- -``` -oc_ui_box* oc_ui_box_lookup_key(oc_ui_key key); -``` - -**Parameters** - -- key - ---- - -####
oc_ui_box_lookup_str8
- -``` -oc_ui_box* oc_ui_box_lookup_str8(oc_str8 string); -``` - -**Parameters** - -- string - ---- - -####
oc_ui_box_set_draw_proc
- -``` -void oc_ui_box_set_draw_proc(oc_ui_box* box, oc_ui_box_draw_proc proc, void* data); -``` - -**Parameters** - -- box -- proc -- data - ---- - -####
oc_ui_box_closed
- -``` -bool oc_ui_box_closed(oc_ui_box* box); -``` - -**Parameters** - -- box - ---- - -####
oc_ui_box_set_closed
- -``` -void oc_ui_box_set_closed(oc_ui_box* box, bool closed); -``` - -**Parameters** - -- box -- closed - ---- - -####
oc_ui_box_active
- -``` -bool oc_ui_box_active(oc_ui_box* box); -``` - -**Parameters** - -- box - ---- - -####
oc_ui_box_activate
- -``` -void oc_ui_box_activate(oc_ui_box* box); -``` - -**Parameters** - -- box - ---- - -####
oc_ui_box_deactivate
- -``` -void oc_ui_box_deactivate(oc_ui_box* box); -``` - -**Parameters** - -- box - ---- - -####
oc_ui_box_hot
- -``` -bool oc_ui_box_hot(oc_ui_box* box); -``` - -**Parameters** - -- box - ---- - -####
oc_ui_box_set_hot
- -``` -void oc_ui_box_set_hot(oc_ui_box* box, bool hot); -``` - -**Parameters** - -- box -- hot - ---- - -####
oc_ui_box_sig
- -``` -oc_ui_sig oc_ui_box_sig(oc_ui_box* box); -``` - -**Parameters** - -- box - ---- - -####
oc_ui_tag_make_str8
- -``` -oc_ui_tag oc_ui_tag_make_str8(oc_str8 string); -``` - -**Parameters** - -- string - ---- - -####
oc_ui_tag_box_str8
- -``` -void oc_ui_tag_box_str8(oc_ui_box* box, oc_str8 string); -``` - -**Parameters** - -- box -- string - ---- - -####
oc_ui_tag_next_str8
- -``` -void oc_ui_tag_next_str8(oc_str8 string); -``` - -**Parameters** - -- string - ---- - -####
oc_ui_apply_style_with_mask
- -``` -void oc_ui_apply_style_with_mask(oc_ui_style* dst, oc_ui_style* src, oc_ui_style_mask mask); -``` - -**Parameters** - -- dst -- src -- mask - ---- - -####
oc_ui_pattern_push
- -``` -void oc_ui_pattern_push(oc_arena* arena, oc_ui_pattern* pattern, oc_ui_selector selector); -``` - -**Parameters** - -- arena -- pattern -- selector - ---- - -####
oc_ui_pattern_all
- -``` -oc_ui_pattern oc_ui_pattern_all(); -``` - - ---- - -####
oc_ui_pattern_owner
- -``` -oc_ui_pattern oc_ui_pattern_owner(); -``` - - ---- - -####
oc_ui_style_next
- -``` -void oc_ui_style_next(oc_ui_style* style, oc_ui_style_mask mask); -``` - -**Parameters** - -- style -- mask - ---- - -####
oc_ui_style_match_before
- -``` -void oc_ui_style_match_before(oc_ui_pattern pattern, oc_ui_style* style, oc_ui_style_mask mask); -``` - -**Parameters** - -- pattern -- style -- mask - ---- - -####
oc_ui_style_match_after
- -``` -void oc_ui_style_match_after(oc_ui_pattern pattern, oc_ui_style* style, oc_ui_style_mask mask); -``` - -**Parameters** - -- pattern -- style -- mask - ---- - -####
oc_ui_label
- -``` -oc_ui_sig oc_ui_label(char* label); -``` - -**Parameters** - -- label - ---- - -####
oc_ui_label_str8
- -``` -oc_ui_sig oc_ui_label_str8(oc_str8 label); -``` - -**Parameters** - -- label - ---- - -####
oc_ui_button
- -``` -oc_ui_sig oc_ui_button(char* label); -``` - -**Parameters** - -- label - ---- - -####
oc_ui_checkbox
- -``` -oc_ui_sig oc_ui_checkbox(char* name, bool* checked); -``` - -**Parameters** - -- name -- checked - ---- - -####
oc_ui_slider
- -``` -oc_ui_box* oc_ui_slider(char* name, f32* value); -``` - -**Parameters** - -- name -- value - ---- - -####
oc_ui_scrollbar
- -``` -oc_ui_box* oc_ui_scrollbar(char* name, f32 thumbRatio, f32* scrollValue); -``` - -**Parameters** - -- name -- thumbRatio -- scrollValue - ---- - -####
oc_ui_tooltip
- -``` -void oc_ui_tooltip(char* label); -``` - -**Parameters** - -- label - ---- - -####
oc_ui_panel_begin
- -``` -void oc_ui_panel_begin(char* name, oc_ui_flags flags); -``` - -**Parameters** - -- name -- flags - ---- - -####
oc_ui_panel_end
- -``` -void oc_ui_panel_end(); -``` - - ---- - -####
oc_ui_menu_bar_begin
- -``` -void oc_ui_menu_bar_begin(char* name); -``` - -**Parameters** - -- name - ---- - -####
oc_ui_menu_bar_end
- -``` -void oc_ui_menu_bar_end(); -``` - - ---- - -####
oc_ui_menu_begin
- -``` -void oc_ui_menu_begin(char* label); -``` - -**Parameters** - -- label - ---- - -####
oc_ui_menu_end
- -``` -void oc_ui_menu_end(); -``` - - ---- - -####
oc_ui_menu_button
- -``` -oc_ui_sig oc_ui_menu_button(char* label); -``` - -**Parameters** - -- label - ---- - -####
oc_ui_text_box
- -``` -oc_ui_text_box_result oc_ui_text_box(char* name, oc_arena* arena, oc_str8 text); -``` - -**Parameters** - -- name -- arena -- text - ---- - -####
oc_ui_select_popup
- -``` -oc_ui_select_popup_info oc_ui_select_popup(char* name, oc_ui_select_popup_info* info); -``` - -**Parameters** - -- name -- info - ---- - -####
oc_ui_radio_group
- -``` -oc_ui_radio_group_info oc_ui_radio_group(char* name, oc_ui_radio_group_info* info); -``` - -**Parameters** - -- name -- info - ---- - diff --git a/doc/mkdocs/docs/api/Utility.md b/doc/mkdocs/docs/api/Utility.md deleted file mode 100644 index 822de9b3..00000000 --- a/doc/mkdocs/docs/api/Utility.md +++ /dev/null @@ -1,15 +0,0 @@ -# Utility - -Utility data structures and helpers used throughout the Orca API. - -## Modules - -- [Algebra](Utility/Algebra.md) Types and helpers for vectors and matrices. -- [Debug](Utility/Debug.md) Helpers for logging, asserting and aborting. -- [Lists](Utility/Lists.md) Types and helpers for doubly-linked lists. -- [Memory](Utility/Memory.md) Base allocator and memory arenas. -- [Strings](Utility/Strings.md) String slices and string lists. -- [UTF8](Utility/UTF8.md) UTF8 encoding/decoding. - ---- - diff --git a/doc/mkdocs/docs/api/Utility/Algebra.md b/doc/mkdocs/docs/api/Utility/Algebra.md deleted file mode 100644 index 5f461114..00000000 --- a/doc/mkdocs/docs/api/Utility/Algebra.md +++ /dev/null @@ -1,330 +0,0 @@ -# Algebra - -Types and helpers for vectors and matrices. - -## Types - -####
oc_vec2
- -``` -typedef union oc_vec2 -{ - struct - { - f32 x; - f32 y; - }; - f32 c[2]; -} oc_vec2; -``` - -A 2D vector type. - -**Fields** - -- Anonymous struct - - x First component of the vector. - - y Second component of the vector. - -- c The vector components as an array. - - ---- - -####
oc_vec3
- -``` -typedef union oc_vec3 -{ - struct - { - f32 x; - f32 y; - f32 z; - }; - f32 c[3]; -} oc_vec3; -``` - -A 3D vector type. - -**Fields** - -- Anonymous struct - - x First component of the vector. - - y Second component of the vector. - - z Third component of the vector. - -- c The vector components as an array. - - ---- - -####
oc_vec2i
- -``` -typedef union oc_vec2i -{ - struct - { - i32 x; - i32 y; - }; - i32 c[2]; -} oc_vec2i; -``` - -A 2D integer vector type. - -**Fields** - -- Anonymous struct - - x First component of the vector. - - y Second component of the vector. - -- c The vector components as an array. - - ---- - -####
oc_vec4
- -``` -typedef union oc_vec4 -{ - struct - { - f32 x; - f32 y; - f32 z; - f32 w; - }; - f32 c[4]; -} oc_vec4; -``` - -A 4D vector type. - -**Fields** - -- Anonymous struct - - x First component of the vector. - - y Second component of the vector. - - z Third component of the vector. - - w Fourth component of the vector. - -- c The vector components as an array. - - ---- - -####
oc_mat2x3
- -``` -typedef struct oc_mat2x3 -{ - f32 m[6]; -} oc_mat2x3; -``` - -A 2-by-3 matrix. - -**Fields** - -- m The elements of the matrix, stored in row-major order. - - ---- - -####
oc_rect
- -``` -typedef union oc_rect -{ - struct - { - f32 x; - f32 y; - f32 w; - f32 h; - }; - struct - { - oc_vec2 xy; - oc_vec2 wh; - }; - f32 c[4]; -} oc_rect; -``` - -An axis-aligned rectangle. - -**Fields** - -- Anonymous struct - - x The x-coordinate of the top-left corner. - - y The y-coordinate of the top-left corner. - - w The width of the rectangle. - - h The height of the rectangle. - -- Anonymous struct - - xy The top-left corner of the rectangle. - - wh The size of the rectangle. - -- c The rectangle components as an array. - - ---- - -## Functions - -####
oc_vec2_equal
- -``` -bool oc_vec2_equal(oc_vec2 v0, oc_vec2 v1); -``` - -Check if two 2D vectors are equal. - -**Parameters** - -- v0 The first vector -- v1 The second vector - -**Return** - -`true` if `v0` and `v1` are equal, `false` otherwise. - ---- - -####
oc_vec2_mul
- -``` -oc_vec2 oc_vec2_mul(f32 f, oc_vec2 v); -``` - -Multiply a 2D vector by a scalar. - -**Parameters** - -- f The value by which to scale the vector. -- v The vector to scale. - -**Return** - -The result of the multiplication. - ---- - -####
oc_vec2_add
- -``` -oc_vec2 oc_vec2_add(oc_vec2 v0, oc_vec2 v1); -``` - -Add two 2D vectors - -**Parameters** - -- v0 The first vector. -- v1 The second vector. - -**Return** - -The result vector. - ---- - -####
oc_mat2x3_mul
- -``` -oc_vec2 oc_mat2x3_mul(oc_mat2x3 m, oc_vec2 p); -``` - -Transforms a vector by an affine transformation represented as a 2x3 matrix. - -**Parameters** - -- m The input matrix. `m` holds an affine transformation. It is treated as a 3x3 matrix with an implicit `(0, 0, 1)` bottom row. -- p The input vector. It is treated as a 3D homogeneous coordinate vector with an implicit z-coordinate equal to 1. - -**Return** - -The result vector. - ---- - -####
oc_mat2x3_mul_m
- -``` -oc_mat2x3 oc_mat2x3_mul_m(oc_mat2x3 lhs, oc_mat2x3 rhs); -``` - -Multiply two affine transformations represented as 2x3 matrices. Both matrices are treated as 3x3 matrices with an implicit `(0, 0, 1)` bottom row - -**Parameters** - -- lhs The left-hand side matrix -- rhs The right-hand side matrix - -**Return** - -The result matrix. - ---- - -####
oc_mat2x3_inv
- -``` -oc_mat2x3 oc_mat2x3_inv(oc_mat2x3 x); -``` - -Invert an affine transform represented as a 2x3 matrix. - -**Parameters** - -- x The input matrix. It is treated as a 3x3 matrix with an implicit `(0, 0, 1)` bottom row. - -**Return** - -The result matrix - ---- - -####
oc_mat2x3_rotate
- -``` -oc_mat2x3 oc_mat2x3_rotate(f32 radians); -``` - -Return a 2x3 matrix representing a rotation. - -**Parameters** - -- radians The rotation angle, in radians. - -**Return** - -The resulting rotation. - ---- - -####
oc_mat2x3_translate
- -``` -oc_mat2x3 oc_mat2x3_translate(f32 x, f32 y); -``` - -Return a 2x3 matrix representing a translation. - -**Parameters** - -- x The first component of the translation. -- y The second component of the translation. - -**Return** - -The resulting translation. - ---- - diff --git a/doc/mkdocs/docs/api/Utility/Debug.md b/doc/mkdocs/docs/api/Utility/Debug.md deleted file mode 100644 index 0729cd8f..00000000 --- a/doc/mkdocs/docs/api/Utility/Debug.md +++ /dev/null @@ -1,210 +0,0 @@ -# Debug - -Helpers for logging, asserting and aborting. - -## Types - -####
oc_log_level
- -``` -typedef enum oc_log_level -{ - OC_LOG_LEVEL_ERROR = 0, - OC_LOG_LEVEL_WARNING = 1, - OC_LOG_LEVEL_INFO = 2, - OC_LOG_LEVEL_COUNT = 3 -} oc_log_level; -``` - -Constants allowing to specify the level of logging verbosity. - -**Enum Constants** - -- OC_LOG_LEVEL_ERROR Only errors are logged. -- OC_LOG_LEVEL_WARNING Only warnings and errors are logged. -- OC_LOG_LEVEL_INFO All messages are logged. -- OC_LOG_LEVEL_COUNT - - ---- - -## Macros - -####
oc_log_error
- -``` -#define oc_log_error(msg, ...) -``` - -Log an error to the console. - -**Parameters** - -- msg The format string of the message, similar to `printf()`. -- ... Additional arguments of the message. - ---- - -####
oc_log_warning
- -``` -#define oc_log_warning(msg, ...) -``` - -Log a warning to the console. - -**Parameters** - -- msg The format string of the message, similar to `printf()`. -- ... Additional arguments of the message. - ---- - -####
oc_log_info
- -``` -#define oc_log_info(msg, ...) -``` - -Log a informative message to the console. - -**Parameters** - -- msg The format string of the message, similar to `printf()`. -- ... Additional arguments of the message. - ---- - -####
OC_ABORT
- -``` -#define OC_ABORT(...) -``` - -Abort the application with an optional error message. - -**Parameters** - -- ... An optional format string for the error message, followed by additional message arguments, similar to `printf()`. - ---- - -####
OC_ASSERT
- -``` -#define OC_ASSERT(test, ...) -``` - -Test a given condition, and abort the application if it is false. - -**Parameters** - -- test The condition expression to test. -- ... An optional format string for the error message, followed by additional message arguments, similar to `printf()`. - ---- - -####
OC_DEBUG_ASSERT
- -``` -#define OC_DEBUG_ASSERT(test, ...) -``` - -Similar to `OC_ASSERT`, but only run in Debug mode. - -**Parameters** - -- test The condition expression to test. -- ... An optional format string for the error message, followed by additional message arguments, similar to `printf()`. - ---- - -## Functions - -####
oc_abort_ext
- -``` -void oc_abort_ext(char* file, char* function, i32 line, char* fmt, ...); -``` - -Abort the application, showing an error message. - -This function should not be called directly by user code, which should use the `OC_ABORT` macro instead, as the macro takes care of filling in the source location parameters of the function. - - -**Parameters** - -- file The name of the source file the abort originates from. -- function The name of the function the abort originates from. -- line The source line the abort originates from. -- fmt The format string of the abort message similar to `printf()`. -- ... Additional arguments for the abort message. - -**Note** - -This function does not return. - ---- - -####
oc_assert_fail
- -``` -void oc_assert_fail(char* file, char* function, i32 line, char* src, char* fmt, ...); -``` - -Tigger a failed assertion. This aborts the application, showing the failed assertion and an error message. - -This function should not be called directly by user code, which should use the `OC_ASSERT` macro instead. The macro checks the assert condition and calls the function if it is false. It also takes care of filling in the source location parameters of the function. - - -**Parameters** - -- file The name of the source file the failed assertion originates from. -- function The name of the function the failed assertion originates from. -- line The source line the failed assertion originates from. -- src The source code of the failed assert condition. -- fmt The format string of the error message, similar to `printf()`. -- ... Additional arguments for the error message. - -**Note** - -This function does not return. - ---- - -####
oc_log_set_level
- -``` -void oc_log_set_level(oc_log_level level); -``` - -Set the logging verbosity. - -**Parameters** - -- level The desired logging level. Messages whose level is below this threshold will not be logged. - ---- - -####
oc_log_ext
- -``` -void oc_log_ext(oc_log_level level, char* function, char* file, i32 line, char* fmt, ...); -``` - -Log a message to the console. - -This function should not be called directly by user code, which should use the `oc_log_XXX` family of macros instead. The macros take care of filling in the message level and source location parameters of the function. - - -**Parameters** - -- level The logging level of the message. -- function The name of the function the message originated from -- file The name of the source file the message originated from -- line The source line the message originated from -- fmt The format string of the message, similar to `printf()`. -- ... Additional arguments of the message - ---- - diff --git a/doc/mkdocs/docs/api/Utility/Lists.md b/doc/mkdocs/docs/api/Utility/Lists.md deleted file mode 100644 index df149260..00000000 --- a/doc/mkdocs/docs/api/Utility/Lists.md +++ /dev/null @@ -1,493 +0,0 @@ -# Lists - -Types and helpers for doubly-linked lists. - -## Types - -####
oc_list_elt
- -``` -typedef struct oc_list_elt -{ - oc_list_elt* prev; - oc_list_elt* next; -} oc_list_elt; -``` - -An element of an intrusive doubly-linked list. - -**Fields** - -- prev Points to the previous element in the list. -- next Points to the next element in the list. - - ---- - -####
oc_list
- -``` -typedef struct oc_list -{ - oc_list_elt* first; - oc_list_elt* last; -} oc_list; -``` - -A doubly-linked list. - -**Fields** - -- first Points to the first element in the list. -- last Points to the last element in the list. - - ---- - -## Macros - -####
oc_list_begin
- -``` -#define oc_list_begin(l) -``` - -Get the first element of a list. - -**Parameters** - -- l An `oc_list` list. - -**Return** - -A pointer to the first `oc_list_elt` of the list. - ---- - -####
oc_list_last
- -``` -#define oc_list_last(l) -``` - -Returns the last element of a list. - -**Parameters** - -- l An `oc_list` list. - -**Return** - -A pointer to the last `oc_list_elt` of the list. - ---- - -####
oc_list_next
- -``` -#define oc_list_next(elt) -``` - -Get the next element in a list. - -**Parameters** - -- elt A pointer to an `oc_list_elt` element in a list. - -**Return** - -A pointer to the next element in the list. - ---- - -####
oc_list_prev
- -``` -#define oc_list_prev(elt) -``` - -Get the previous element in a list. - -**Parameters** - -- elt A pointer to an `oc_list_elt` element in a list. - -**Return** - -A pointer to the previous element in the list. - ---- - -####
oc_list_entry
- -``` -#define oc_list_entry(elt, type, member) -``` - -Get the entry for a given list element. - -**Parameters** - -- elt A pointer to an `oc_list_elt` element. -- type The type of the entry to retrieve. -- member The name of the `oc_list_elt` field in `type` by which the entry is linked into the list. - -**Return** - -A pointer to the entry of type `type` which is linked into the list by element `elt`. - ---- - -####
oc_list_next_entry
- -``` -#define oc_list_next_entry(list, elt, type, member) -``` - -Get the next entry in a list. - -**Parameters** - -- list An `oc_list` object. -- elt A pointer to an `oc_list_elt` element in that list. -- type The type of the entry to retrieve. -- member The name of the `oc_list_elt` field in `type` by which the entry is linked into the list. - -**Return** - -A pointer to the entry of type `type` which is linked into the list after element `elt`. - ---- - -####
oc_list_prev_entry
- -``` -#define oc_list_prev_entry(list, elt, type, member) -``` - -Get the previous entry in a list. - -**Parameters** - -- list An `oc_list` object. -- elt A pointer to an `oc_list_elt` element in that list. -- type The type of the entry to retrieve. -- member The name of the `oc_list_elt` field in `type` by which the entry is linked into the list. - -**Return** - -A pointer to the entry of type `type` which is linked into the list before element `elt`. - ---- - -####
oc_list_checked_entry
- -``` -#define oc_list_checked_entry(elt, type, member) -``` - -Same as `oc_list_entry`, but `elt` might be null. - -**Parameters** - -- elt A pointer to an `oc_list_elt` element. -- type The type of the entry to retrieve. -- member The name of the `oc_list_elt` field in `type` by which the entry is linked into the list. - -**Return** - -If `elt` is null, the macro returns a null pointer. Otherwise it returns a pointer to the entry of type `type` which is linked into the list by element `elt`. - ---- - -####
oc_list_first_entry
- -``` -#define oc_list_first_entry(list, type, member) -``` - -Get the first entry of a list. - -**Parameters** - -- list An `oc_list` object. -- type The type of the entry to retrieve. -- member The name of the `oc_list_elt` field in `type` by which the entry is linked into the list. - -**Return** - -A pointer to the entry of type `type` which is the first entry in the list. - ---- - -####
oc_list_last_entry
- -``` -#define oc_list_last_entry(list, type, member) -``` - -Get the last entry of a list. - -**Parameters** - -- list An `oc_list` object. -- type The type of the entry to retrieve. -- member The name of the `oc_list_elt` field in `type` by which the entry is linked into the list. - -**Return** - -A pointer to the entry of type `type` which is the last entry in the list. - ---- - -####
oc_list_for
- -``` -#define oc_list_for(list, elt, type, member) -``` - -Loop through a linked list. - -This macro creates a loop with an iterator named after the `elt` macro parameter. The iterator is of the type specified by the `type` macro parameter, which must be the type of the entries linked in the list. - -You should follow this macro with the loop body, where you can use the iterator. - - -**Parameters** - -- list An `oc_list` object. -- elt The name of the loop iterator. -- type The type of the loop iterator. This must be the type of the entries linked in `list`. -- member The name of the field of type `oc_list_elt` in `type` by which the list entries are linked. - -**Note** - -You should not add or remove elements from the list inside the loop body. If you need to do so, use `oc_list_for_safe` instead. - ---- - -####
oc_list_for_reverse
- -``` -#define oc_list_for_reverse(list, elt, type, member) -``` - -Loop through a linked list from last to first. See `oc_list_for` for details. - -**Parameters** - -- list An `oc_list` object. -- elt The name of the loop iterator. -- type The type of the loop iterator. This must be the type of the entries linked in `list`. -- member The name of the field of type `oc_list_elt` in `type` by which the list entries are linked. - ---- - -####
oc_list_for_safe
- -``` -#define oc_list_for_safe(list, elt, type, member) -``` - -Loop through a linked list in a way that allows adding or removing elements from it in the loop body. See `oc_list_for` for more details. - -**Parameters** - -- list An `oc_list` object. -- elt The name of the loop iterator. -- type The type of the loop iterator. This must be the type of the entries linked in `list`. -- member The name of the field of type `oc_list_elt` in `type` by which the list entries are linked. - ---- - -####
oc_list_pop_front_entry
- -``` -#define oc_list_pop_front_entry(list, type, member) -``` - -Remove the first entry from a list and return it. - -**Parameters** - -- list An `oc_list` object. -- type The type of the entry to retrieve. -- member The name of the field of type `oc_list_elt` in `type` by which the list entries are linked. - -**Return** - -A pointer of type `type` to the entry that was removed from the list. - ---- - -####
oc_list_pop_back_entry
- -``` -#define oc_list_pop_back_entry(list, type, member) -``` - -Remove the last entry from a list and return it. - -**Parameters** - -- list An `oc_list` object. -- type The type of the entry to retrieve. -- member The name of the field of type `oc_list_elt` in `type` by which the list entries are linked. - -**Return** - -A pointer of type `type` to the entry that was removed from the list. - ---- - -## Functions - -####
oc_list_empty
- -``` -bool oc_list_empty(oc_list list); -``` - -Check if a list is empty. - -**Parameters** - -- list A linked list. - -**Return** - -`true` if the list is empty, `false` otherwise. - ---- - -####
oc_list_init
- -``` -void oc_list_init(oc_list* list); -``` - -Zero-initializes a linked list. - -**Parameters** - -- list A pointer to the list to initialize. - -**Note** - -In C the same result can be achieved with `*list = (oc_list){0}`. - ---- - -####
oc_list_insert
- -``` -void oc_list_insert(oc_list* list, oc_list_elt* afterElt, oc_list_elt* elt); -``` - -Insert an element in a list after a given element. - -**Parameters** - -- list -- afterElt -- elt The element to insert in the list. - ---- - -####
oc_list_insert_before
- -``` -void oc_list_insert_before(oc_list* list, oc_list_elt* beforeElt, oc_list_elt* elt); -``` - -Insert an element in a list before a given element. - -**Parameters** - -- list The list to insert in. -- beforeElt The element before which to insert. -- elt The element to insert in the list. - ---- - -####
oc_list_remove
- -``` -void oc_list_remove(oc_list* list, oc_list_elt* elt); -``` - -Remove an element from a list. - -**Parameters** - -- list The list to remove from. -- elt The element to remove from the list. - ---- - -####
oc_list_push_back
- -``` -void oc_list_push_back(oc_list* list, oc_list_elt* elt); -``` - -Add an element at the end of a list. - -**Parameters** - -- list The list to add an element to. -- elt The element to add to the list. - ---- - -####
oc_list_pop_back
- -``` -oc_list_elt* oc_list_pop_back(oc_list* list); -``` - -Remove the last element from a list. - -**Parameters** - -- list The list to remove an element from. - -**Return** - -The element that was removed, or a null pointer if the list was empty. - ---- - -####
oc_list_push_front
- -``` -void oc_list_push_front(oc_list* list, oc_list_elt* elt); -``` - -Add an element at the beginning of a list. - -**Parameters** - -- list The list to add an element to. -- elt The element to add to the list. - ---- - -####
oc_list_pop_front
- -``` -oc_list_elt* oc_list_pop_front(oc_list* list); -``` - -Remove the first element from a list. - -**Parameters** - -- list The list to remove an element from. - -**Return** - -The element that was removed, or a null pointer if the list was empty. - ---- - diff --git a/doc/mkdocs/docs/api/Utility/Memory.md b/doc/mkdocs/docs/api/Utility/Memory.md deleted file mode 100644 index 844b6072..00000000 --- a/doc/mkdocs/docs/api/Utility/Memory.md +++ /dev/null @@ -1,366 +0,0 @@ -# Memory - -Base allocator and memory arenas. - -## Types - -####
oc_mem_reserve_proc
- -``` -typedef void* (*oc_mem_reserve_proc)((oc_base_allocator* context, u64 size)); -``` - -The prototype of a procedure to reserve memory from the system. - - ---- - -####
oc_mem_modify_proc
- -``` -typedef void (*oc_mem_modify_proc)((oc_base_allocator* context, void* ptr, u64 size)); -``` - -The prototype of a procedure to modify a memory reservation. - - ---- - -####
oc_base_allocator
- -``` -typedef struct oc_base_allocator -{ - oc_mem_reserve_proc reserve; - oc_mem_modify_proc commit; - oc_mem_modify_proc decommit; - oc_mem_modify_proc release; -} oc_base_allocator; -``` - -A structure that defines how to allocate memory from the system. - -**Fields** - -- reserve A procedure to reserve memory from the system. -- commit A procedure to commit memory from the system. -- decommit A procedure to decommit memory from the system. -- release A procedure to release memory previously reserved from the system. - - ---- - -####
oc_arena_chunk
- -``` -typedef struct oc_arena_chunk -{ - oc_list_elt listElt; - char* ptr; - u64 offset; - u64 committed; - u64 cap; -} oc_arena_chunk; -``` - -A contiguous chunk of memory managed by a memory arena. - -**Fields** - -- listElt -- ptr -- offset -- committed -- cap - - ---- - -####
oc_arena
- -``` -typedef struct oc_arena -{ - oc_base_allocator* base; - oc_list chunks; - oc_arena_chunk* currentChunk; -} oc_arena; -``` - -A memory arena, allowing to allocate memory in a linear or stack-like fashion. - -**Fields** - -- base An allocator providing memory pages from the system -- chunks A list of `oc_arena_chunk` chunks. -- currentChunk The chunk new memory allocations are pulled from. - - ---- - -####
oc_arena_scope
- -``` -typedef struct oc_arena_scope -{ - oc_arena* arena; - oc_arena_chunk* chunk; - u64 offset; -} oc_arena_scope; -``` - -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 - -**Fields** - -- arena The arena which offset is stored. -- chunk The arena chunk to which the offset belongs. -- offset The offset to rewind the arena to. - - ---- - -####
oc_arena_options
- -``` -typedef struct oc_arena_options -{ - oc_base_allocator* base; - u64 reserve; -} oc_arena_options; -``` - -Options for arena creation. - -**Fields** - -- base The base allocator to use with this arena -- reserve The amount of memory to reserve up-front when creating the arena. - - ---- - -## Macros - -####
oc_arena_push_type
- -``` -#define oc_arena_push_type(arena, type) -``` - -Allocate a type from an arena. This macro takes care of the memory alignment and type cast. - -**Parameters** - -- arena The arena to allocate from. -- type The type of the object to allocate. - -**Return** - -A pointer to the allocated object. - ---- - -####
oc_arena_push_array
- -``` -#define oc_arena_push_array(arena, type, count) -``` - -Allocate an array from an arena. This macro takes care of the size calculation, memory alignment and type cast. - -**Parameters** - -- arena The arena to allocate from. -- type The type of the array's elements. -- count The number of element in the array. - -**Return** - -A pointer to the allocated array. - ---- - -####
oc_scratch_end
- -``` -#define oc_scratch_end(scope) -``` - -End a scratch scope. - -**Parameters** - -- scope A scope object created by a call to `oc_scratch_begin()` or similar functions. - ---- - -## Functions - -####
oc_arena_init
- -``` -void oc_arena_init(oc_arena* arena); -``` - -Initialize a memory arena. - -**Parameters** - -- arena The arena to initialize. - ---- - -####
oc_arena_init_with_options
- -``` -void oc_arena_init_with_options(oc_arena* arena, oc_arena_options* options); -``` - -Initialize a memory arena with additional options. - -**Parameters** - -- arena The arena to initialize. -- options The options to use to initialize the arena. - ---- - -####
oc_arena_cleanup
- -``` -void oc_arena_cleanup(oc_arena* arena); -``` - -Release all resources allocated to a memory arena. - -**Parameters** - -- arena The arena to cleanup. - ---- - -####
oc_arena_push
- -``` -void* oc_arena_push(oc_arena* arena, u64 size); -``` - -Allocate a block of memory from an arena. - -**Parameters** - -- arena An arena to allocate memory from. -- size The size of the memory to allocate, in bytes. - -**Return** - -A pointer to the allocated memory. - ---- - -####
oc_arena_push_aligned
- -``` -void* oc_arena_push_aligned(oc_arena* arena, u64 size, u32 alignment); -``` - -Allocate an aligned block of memory from an arena. - -**Parameters** - -- arena An arena to allocate memory from. -- size The size of the memory to allocate, in bytes. -- alignment The desired alignment of the memory block, in bytes - -**Return** - -A pointer to the allocated memory - ---- - -####
oc_arena_clear
- -``` -void oc_arena_clear(oc_arena* arena); -``` - -Reset an arena. All memory that was previously allocated from this arena is released to the arena, and can be reallocated by later calls to `oc_arena_push` and similar functions. No memory is actually released _to the system_. - -**Parameters** - -- arena The arena to clear. - ---- - -####
oc_arena_scope_begin
- -``` -oc_arena_scope oc_arena_scope_begin(oc_arena* arena); -``` - -Begin a memory scope. This creates an `oc_arena_scope` object that stores the current offset of the arena. The arena can later be reset to that offset by calling `oc_arena_scope_end`, releasing all memory that was allocated within the scope to the arena. - -**Parameters** - -- arena The arena for which the scope is created. - -**Return** - -A `oc_arena_scope` object storing the current offset of the arena. - ---- - -####
oc_arena_scope_end
- -``` -void oc_arena_scope_end(oc_arena_scope scope); -``` - -End a memory scope. This resets an arena to the offset it had when the scope was created. All memory allocated within the scope is released back to the arena. - -**Parameters** - -- scope An `oc_arena_scope` object that was created by a call to `oc_arena_scope_begin()`. - ---- - -####
oc_scratch_begin
- -``` -oc_arena_scope oc_scratch_begin(); -``` - -Begin a scratch scope. This creates a memory scope on a per-thread, global "scratch" arena. This allows easily creating temporary memory for scratch computations or intermediate results, in a stack-like fashion. - -If you must return results in an arena passed by the caller, and you also use a scratch arena to do intermediate computations, beware that the results arena could itself be a scatch arena. In this case, you have to be careful not to intermingle your scratch computations with the final result, or clear your result entirely. You can either: - -- Allocate memory for the result upfront and call `oc_scratch_begin` afterwards, if possible. -- Use `oc_scratch_begin_next()` and pass it the result arena, to get a scratch arena that does not conflict with it. - - - -**Return** - -A memory scope object. You can use the `arena` field of this object to allocate memory from the scratch scope. When you're done, pass the scope oject to `oc_scratch_end()`. - ---- - -####
oc_scratch_begin_next
- -``` -oc_arena_scope oc_scratch_begin_next(oc_arena* used); -``` - -Begin a scratch scope that does not conflict with a given arena. See `oc_scratch_begin()` for more details about when to use this function. - -**Parameters** - -- used A pointer to a memory arena that the scratch scope shouldn't interfere with. - -**Return** - -A memory scope object. You can use the `arena` field of this object to allocate memory from the scratch scope. When you're done, pass the scope oject to `oc_scratch_end()`. - ---- - diff --git a/doc/mkdocs/docs/api/Utility/Strings.md b/doc/mkdocs/docs/api/Utility/Strings.md deleted file mode 100644 index 35e1fc64..00000000 --- a/doc/mkdocs/docs/api/Utility/Strings.md +++ /dev/null @@ -1,777 +0,0 @@ -# Strings - -String slices and string lists. - -## Types - -####
oc_str8
- -``` -typedef struct oc_str8 -{ - char* ptr; - size_t len; -} oc_str8; -``` - -**Fields** - -- ptr -- len - - ---- - -####
oc_str8_elt
- -``` -typedef struct oc_str8_elt -{ - oc_list_elt listElt; - oc_str8 string; -} oc_str8_elt; -``` - -**Fields** - -- listElt -- string - - ---- - -####
oc_str8_list
- -``` -typedef struct oc_str8_list -{ - oc_list list; - u64 eltCount; - u64 len; -} oc_str8_list; -``` - -**Fields** - -- list -- eltCount -- len - - ---- - -####
oc_str16
- -``` -typedef struct oc_str16 -{ - u16* ptr; - size_t len; -} oc_str16; -``` - -**Fields** - -- ptr -- len - - ---- - -####
oc_str16_elt
- -``` -typedef struct oc_str16_elt -{ - oc_list_elt listElt; - oc_str16 string; -} oc_str16_elt; -``` - -**Fields** - -- listElt -- string - - ---- - -####
oc_str16_list
- -``` -typedef struct oc_str16_list -{ - oc_list list; - u64 eltCount; - u64 len; -} oc_str16_list; -``` - -**Fields** - -- list -- eltCount -- len - - ---- - -####
oc_str32
- -``` -typedef struct oc_str32 -{ - u32* ptr; - size_t len; -} oc_str32; -``` - -**Fields** - -- ptr -- len - - ---- - -####
oc_str32_elt
- -``` -typedef struct oc_str32_elt -{ - oc_list_elt listElt; - oc_str32 string; -} oc_str32_elt; -``` - -**Fields** - -- listElt -- string - - ---- - -####
oc_str32_list
- -``` -typedef struct oc_str32_list -{ - oc_list list; - u64 eltCount; - u64 len; -} oc_str32_list; -``` - -**Fields** - -- list -- eltCount -- len - - ---- - -## Macros - -####
OC_STR8
- -``` -#define OC_STR8(s) -``` - -**Parameters** - -- s - ---- - -####
OC_STR8_LIT
- -``` -#define OC_STR8_LIT(s) -``` - -**Parameters** - -- s - ---- - -####
oc_str8_lp
- -``` -#define oc_str8_lp(s) -``` - -**Parameters** - -- s - ---- - -####
oc_str8_ip
- -``` -#define oc_str8_ip(s) -``` - -**Parameters** - -- s - ---- - -####
oc_str8_list_first
- -``` -#define oc_str8_list_first(sl) -``` - -**Parameters** - -- sl - ---- - -####
oc_str8_list_last
- -``` -#define oc_str8_list_last(sl) -``` - -**Parameters** - -- sl - ---- - -####
oc_str8_list_for
- -``` -#define oc_str8_list_for(sl, elt) -``` - -**Parameters** - -- sl -- elt - ---- - -####
oc_str8_list_empty
- -``` -#define oc_str8_list_empty(sl) -``` - -**Parameters** - -- sl - ---- - -####
oc_str16_list_first
- -``` -#define oc_str16_list_first(sl) -``` - -**Parameters** - -- sl - ---- - -####
oc_str16_list_last
- -``` -#define oc_str16_list_last(sl) -``` - -**Parameters** - -- sl - ---- - -####
oc_str16_list_for
- -``` -#define oc_str16_list_for(sl, elt) -``` - -**Parameters** - -- sl -- elt - ---- - -####
oc_str32_list_first
- -``` -#define oc_str32_list_first(sl) -``` - -**Parameters** - -- sl - ---- - -####
oc_str32_list_last
- -``` -#define oc_str32_list_last(sl) -``` - -**Parameters** - -- sl - ---- - -####
oc_str32_list_for
- -``` -#define oc_str32_list_for(sl, elt) -``` - -**Parameters** - -- sl -- elt - ---- - -## Functions - -####
oc_str8_from_buffer
- -``` -oc_str8 oc_str8_from_buffer(u64 len, char* buffer); -``` - -**Parameters** - -- len -- buffer - ---- - -####
oc_str8_slice
- -``` -oc_str8 oc_str8_slice(oc_str8 s, u64 start, u64 end); -``` - -**Parameters** - -- s -- start -- end - ---- - -####
oc_str8_push_buffer
- -``` -oc_str8 oc_str8_push_buffer(oc_arena* arena, u64 len, char* buffer); -``` - -**Parameters** - -- arena -- len -- buffer - ---- - -####
oc_str8_push_cstring
- -``` -oc_str8 oc_str8_push_cstring(oc_arena* arena, const char* str); -``` - -**Parameters** - -- arena -- str - ---- - -####
oc_str8_push_copy
- -``` -oc_str8 oc_str8_push_copy(oc_arena* arena, oc_str8 s); -``` - -**Parameters** - -- arena -- s - ---- - -####
oc_str8_push_slice
- -``` -oc_str8 oc_str8_push_slice(oc_arena* arena, oc_str8 s, u64 start, u64 end); -``` - -**Parameters** - -- arena -- s -- start -- end - ---- - -####
oc_str8_pushfv
- -``` -oc_str8 oc_str8_pushfv(oc_arena* arena, const char* format, va_list args); -``` - -**Parameters** - -- arena -- format -- args - ---- - -####
oc_str8_pushf
- -``` -oc_str8 oc_str8_pushf(oc_arena* arena, const char* format, ...); -``` - -**Parameters** - -- arena -- format -- ... - ---- - -####
oc_str8_cmp
- -``` -i32 oc_str8_cmp(oc_str8 s1, oc_str8 s2); -``` - -**Parameters** - -- s1 -- s2 - ---- - -####
oc_str8_to_cstring
- -``` -char* oc_str8_to_cstring(oc_arena* arena, oc_str8 string); -``` - -**Parameters** - -- arena -- string - ---- - -####
oc_str8_list_push
- -``` -void oc_str8_list_push(oc_arena* arena, oc_str8_list* list, oc_str8 str); -``` - -**Parameters** - -- arena -- list -- str - ---- - -####
oc_str8_list_pushf
- -``` -void oc_str8_list_pushf(oc_arena* arena, oc_str8_list* list, const char* format, ...); -``` - -**Parameters** - -- arena -- list -- format -- ... - ---- - -####
oc_str8_list_collate
- -``` -oc_str8 oc_str8_list_collate(oc_arena* arena, oc_str8_list list, oc_str8 prefix, oc_str8 separator, oc_str8 postfix); -``` - -**Parameters** - -- arena -- list -- prefix -- separator -- postfix - ---- - -####
oc_str8_list_join
- -``` -oc_str8 oc_str8_list_join(oc_arena* arena, oc_str8_list list); -``` - -**Parameters** - -- arena -- list - ---- - -####
oc_str8_split
- -``` -oc_str8_list oc_str8_split(oc_arena* arena, oc_str8 str, oc_str8_list separators); -``` - -**Parameters** - -- arena -- str -- separators - ---- - -####
oc_str16_from_buffer
- -``` -oc_str16 oc_str16_from_buffer(u64 len, u16* buffer); -``` - -**Parameters** - -- len -- buffer - ---- - -####
oc_str16_slice
- -``` -oc_str16 oc_str16_slice(oc_str16 s, u64 start, u64 end); -``` - -**Parameters** - -- s -- start -- end - ---- - -####
oc_str16_push_buffer
- -``` -oc_str16 oc_str16_push_buffer(oc_arena* arena, u64 len, u16* buffer); -``` - -**Parameters** - -- arena -- len -- buffer - ---- - -####
oc_str16_push_copy
- -``` -oc_str16 oc_str16_push_copy(oc_arena* arena, oc_str16 s); -``` - -**Parameters** - -- arena -- s - ---- - -####
oc_str16_push_slice
- -``` -oc_str16 oc_str16_push_slice(oc_arena* arena, oc_str16 s, u64 start, u64 end); -``` - -**Parameters** - -- arena -- s -- start -- end - ---- - -####
oc_str16_list_push
- -``` -void oc_str16_list_push(oc_arena* arena, oc_str16_list* list, oc_str16 str); -``` - -**Parameters** - -- arena -- list -- str - ---- - -####
oc_str16_list_join
- -``` -oc_str16 oc_str16_list_join(oc_arena* arena, oc_str16_list list); -``` - -**Parameters** - -- arena -- list - ---- - -####
oc_str16_split
- -``` -oc_str16_list oc_str16_split(oc_arena* arena, oc_str16 str, oc_str16_list separators); -``` - -**Parameters** - -- arena -- str -- separators - ---- - -####
oc_str32_from_buffer
- -``` -oc_str32 oc_str32_from_buffer(u64 len, u32* buffer); -``` - -**Parameters** - -- len -- buffer - ---- - -####
oc_str32_slice
- -``` -oc_str32 oc_str32_slice(oc_str32 s, u64 start, u64 end); -``` - -**Parameters** - -- s -- start -- end - ---- - -####
oc_str32_push_buffer
- -``` -oc_str32 oc_str32_push_buffer(oc_arena* arena, u64 len, u32* buffer); -``` - -**Parameters** - -- arena -- len -- buffer - ---- - -####
oc_str32_push_copy
- -``` -oc_str32 oc_str32_push_copy(oc_arena* arena, oc_str32 s); -``` - -**Parameters** - -- arena -- s - ---- - -####
oc_str32_push_slice
- -``` -oc_str32 oc_str32_push_slice(oc_arena* arena, oc_str32 s, u64 start, u64 end); -``` - -**Parameters** - -- arena -- s -- start -- end - ---- - -####
oc_str32_list_push
- -``` -void oc_str32_list_push(oc_arena* arena, oc_str32_list* list, oc_str32 str); -``` - -**Parameters** - -- arena -- list -- str - ---- - -####
oc_str32_list_join
- -``` -oc_str32 oc_str32_list_join(oc_arena* arena, oc_str32_list list); -``` - -**Parameters** - -- arena -- list - ---- - -####
oc_str32_split
- -``` -oc_str32_list oc_str32_split(oc_arena* arena, oc_str32 str, oc_str32_list separators); -``` - -**Parameters** - -- arena -- str -- separators - ---- - diff --git a/doc/mkdocs/docs/api/Utility/UTF8.md b/doc/mkdocs/docs/api/Utility/UTF8.md deleted file mode 100644 index ca31aaa3..00000000 --- a/doc/mkdocs/docs/api/Utility/UTF8.md +++ /dev/null @@ -1,219 +0,0 @@ -# UTF8 - -UTF8 encoding/decoding. - -## Types - -####
oc_utf32
- -``` -typedef u32 oc_utf32; -``` - - ---- - -####
oc_utf8_dec
- -``` -typedef struct oc_utf8_dec -{ - oc_utf32 codepoint; - u32 size; -} oc_utf8_dec; -``` - -**Fields** - -- codepoint -- size - - ---- - -####
oc_unicode_range
- -``` -typedef struct oc_unicode_range -{ - oc_utf32 firstCodePoint; - u32 count; -} oc_unicode_range; -``` - -**Fields** - -- firstCodePoint -- count - - ---- - -## Functions - -####
oc_utf8_size_from_leading_char
- -``` -u32 oc_utf8_size_from_leading_char(char leadingChar); -``` - -**Parameters** - -- leadingChar - ---- - -####
oc_utf8_codepoint_size
- -``` -u32 oc_utf8_codepoint_size(oc_utf32 codePoint); -``` - -**Parameters** - -- codePoint - ---- - -####
oc_utf8_codepoint_count_for_string
- -``` -u64 oc_utf8_codepoint_count_for_string(oc_str8 string); -``` - -**Parameters** - -- string - ---- - -####
oc_utf8_byte_count_for_codepoints
- -``` -u64 oc_utf8_byte_count_for_codepoints(oc_str32 codePoints); -``` - -**Parameters** - -- codePoints - ---- - -####
oc_utf8_next_offset
- -``` -u64 oc_utf8_next_offset(oc_str8 string, u64 byteOffset); -``` - -**Parameters** - -- string -- byteOffset - ---- - -####
oc_utf8_prev_offset
- -``` -u64 oc_utf8_prev_offset(oc_str8 string, u64 byteOffset); -``` - -**Parameters** - -- string -- byteOffset - ---- - -####
oc_utf8_decode
- -``` -oc_utf8_dec oc_utf8_decode(oc_str8 string); -``` - -**Parameters** - -- string - ---- - -####
oc_utf8_decode_at
- -``` -oc_utf8_dec oc_utf8_decode_at(oc_str8 string, u64 offset); -``` - -**Parameters** - -- string -- offset - ---- - -####
oc_utf8_encode
- -``` -oc_str8 oc_utf8_encode(char* dst, oc_utf32 codePoint); -``` - -**Parameters** - -- dst -- codePoint - ---- - -####
oc_utf8_to_codepoints
- -``` -oc_str32 oc_utf8_to_codepoints(u64 maxCount, oc_utf32* backing, oc_str8 string); -``` - -**Parameters** - -- maxCount -- backing -- string - ---- - -####
oc_utf8_from_codepoints
- -``` -oc_str8 oc_utf8_from_codepoints(u64 maxBytes, char* backing, oc_str32 codePoints); -``` - -**Parameters** - -- maxBytes -- backing -- codePoints - ---- - -####
oc_utf8_push_to_codepoints
- -``` -oc_str32 oc_utf8_push_to_codepoints(oc_arena* arena, oc_str8 string); -``` - -**Parameters** - -- arena -- string - ---- - -####
oc_utf8_push_from_codepoints
- -``` -oc_str8 oc_utf8_push_from_codepoints(oc_arena* arena, oc_str32 codePoints); -``` - -**Parameters** - -- arena -- codePoints - ---- - diff --git a/doc/mkdocs/docs/api/api_reference.md b/doc/mkdocs/docs/api/api_reference.md deleted file mode 100644 index 23faf728..00000000 --- a/doc/mkdocs/docs/api/api_reference.md +++ /dev/null @@ -1,17 +0,0 @@ -# API reference - -### Modules - -- [Utility](Utility.md) -Utility data structures and helpers used throughout the Orca API. -- [Application](Application.md) -Input, windowing, dialogs. -- [I/O](I/O.md) -File input/output. -- [Graphics](Graphics.md) -2D/3D rendering APIs. -- [UI](UI.md) -Graphical User Interface API. - ---- -