package vendor:microui
Overview
** Original work: Copyright (c) 2020 rxi ** Modified work: Copyright (c) 2020 oskarnp ** Modified work: Copyright (c) 2021 gingerBill ** ** Permission is hereby granted, free of charge, to any person obtaining a copy ** of this software and associated documentation files (the "Software"), to ** deal in the Software without restriction, including without limitation the ** rights to use, copy, modify, merge, publish, distribute, sublicense, and/or ** sell copies of the Software, and to permit persons to whom the Software is ** furnished to do so, subject to the following conditions: ** ** The above copyright notice and this permission notice shall be included in ** all copies or substantial portions of the Software. ** ** THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR ** IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, ** FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE ** AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER ** LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING ** FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS ** IN THE SOFTWARE.
Index
Constants (21)
- CLIP_STACK_SIZE
- COMMAND_LIST_SIZE
- CONTAINER_POOL_SIZE
- CONTAINER_STACK_SIZE
- DEFAULT_ATLAS_FONT
- DEFAULT_ATLAS_HEIGHT
- DEFAULT_ATLAS_ICON_CHECK
- DEFAULT_ATLAS_ICON_CLOSE
- DEFAULT_ATLAS_ICON_COLLAPSED
- DEFAULT_ATLAS_ICON_EXPANDED
- DEFAULT_ATLAS_ICON_RESIZE
- DEFAULT_ATLAS_WHITE
- DEFAULT_ATLAS_WIDTH
- ID_STACK_SIZE
- LAYOUT_STACK_SIZE
- MAX_FMT
- MAX_TEXT_STORE
- MAX_WIDTHS
- ROOT_LIST_SIZE
- SLIDER_FMT
- TREENODE_POOL_SIZE
Variables (4)
Procedures (84)
- begin
- begin_panel
- begin_popup
- begin_treenode
- begin_window
- bring_to_front
- button
- check_clip
- checkbox
- default_atlas_text_height
- default_atlas_text_width
- draw_box
- draw_control_frame
- draw_control_text
- draw_icon
- draw_rect
- draw_text
- end
- end_panel
- end_popup
- end_treenode
- end_window
- expand_rect
- get_clip_rect
- get_container
- get_current_container
- get_id_bytes
- get_id_rawptr
- get_id_string
- get_id_uintptr
- get_layout
- header
- init
- input_key_down
- input_key_up
- input_mouse_down
- input_mouse_move
- input_mouse_up
- input_scroll
- input_text
- intersect_rects
- label
- layout_begin_column
- layout_column
- layout_end_column
- layout_height
- layout_next
- layout_row
- layout_row_items
- layout_set_next
- layout_width
- mouse_over
- next_command
- next_command_iterator
- number
- number_textbox
- open_popup
- pool_get
- pool_init
- pool_update
- pop
- pop_clip_rect
- pop_id
- popup
- push
- push_clip_rect
- push_command
- push_id_bytes
- push_id_rawptr
- push_id_string
- push_id_uintptr
- rect_overlaps_vec2
- scoped_end_popup
- scoped_end_treenode
- scoped_end_window
- set_clip
- set_focus
- slider
- text
- textbox
- textbox_raw
- treenode
- update_control
- window
Types
Color ¶
Related Procedures With Parameters
Color_Type ¶
Color_Type :: enum u32 { TEXT, SELECTION_BG, BORDER, WINDOW_BG, TITLE_BG, TITLE_TEXT, PANEL_BG, BUTTON, BUTTON_HOVER = 8, BUTTON_FOCUS = 9, BASE, BASE_HOVER = 11, BASE_FOCUS = 12, SCROLL_BASE, SCROLL_THUMB, }
Related Procedures With Parameters
Command ¶
Command :: struct { variant: Command_Variant, size: i32, }
Command_Variant ¶
Command_Variant :: union { ^Command_Jump, ^Command_Clip, ^Command_Rect, ^Command_Text, ^Command_Icon, }
Related Procedures With Returns
Container ¶
Container :: struct { head: ^Command, tail: ^Command, rect: Rect, body: Rect, content_size: Vec2, scroll: Vec2, zindex: i32, open: b32, }
Related Procedures With Parameters
Related Procedures With Returns
Context ¶
Context :: struct { // callbacks text_width: proc(font: Font, str: string) -> i32, text_height: proc(font: Font) -> i32, draw_frame: proc(ctx: ^Context, rect: Rect, colorid: Color_Type), // core state _style: Style, style: ^Style, hover_id: Id, focus_id: Id, last_id: Id, last_rect: Rect, last_zindex: i32, updated_focus: b32, frame: Frame_Index, hover_root: ^Container, next_hover_root: ^Container, scroll_target: ^Container, number_edit_buf: [127]u8, number_edit_len: int, number_edit_id: Id, // stacks command_list: Stack($T=u8, $N=262144), root_list: Stack($T=^Container, $N=32), container_stack: Stack($T=^Container, $N=32), clip_stack: Stack($T=Rect, $N=32), id_stack: Stack($T=Id, $N=32), layout_stack: Stack($T=Layout, $N=16), // retained state pools container_pool: [48]Pool_Item, containers: [48]Container, treenode_pool: [48]Pool_Item, // input state mouse_pos: Vec2, last_mouse_pos: Vec2, mouse_delta: Vec2, scroll_delta: Vec2, mouse_down_bits: Mouse_Set, mouse_pressed_bits: Mouse_Set, mouse_released_bits: Mouse_Set, key_down_bits: Key_Set, key_pressed_bits: Key_Set, _text_store: [1024]u8, text_input: strings.Builder, // uses `_text_store` as backing store with nil_allocator. textbox_state: text_edit.State, textbox_offset: i32, }
Related Procedures With Parameters
- begin
- begin_panel
- begin_popup
- begin_treenode
- begin_window
- bring_to_front
- button
- check_clip
- checkbox
- draw_box
- draw_control_frame
- draw_control_text
- draw_icon
- draw_rect
- draw_text
- end
- end_panel
- end_popup
- end_treenode
- end_window
- get_clip_rect
- get_container
- get_current_container
- get_id_bytes
- get_id_rawptr
- get_id_string
- get_id_uintptr
- get_layout
- header
- init
- input_key_down
- input_key_up
- input_mouse_down
- input_mouse_move
- input_mouse_up
- input_scroll
- input_text
- label
- layout_begin_column
- layout_column
- layout_end_column
- layout_height
- layout_next
- layout_row
- layout_row_items
- layout_set_next
- layout_width
- mouse_over
- next_command
- next_command_iterator
- number
- number_textbox
- open_popup
- pool_get
- pool_init
- pool_update
- pop_clip_rect
- pop_id
- popup
- push_clip_rect
- push_command
- push_id_bytes
- push_id_rawptr
- push_id_string
- push_id_uintptr
- scoped_end_popup
- scoped_end_treenode
- scoped_end_window
- set_clip
- set_focus
- slider
- text
- textbox
- textbox_raw
- treenode
- update_control
- window
- get_id (procedure groups)
- push_id (procedure groups)
Frame_Index ¶
Frame_Index :: distinct i32
Icon ¶
Icon :: enum u32 { NONE, CLOSE, CHECK, COLLAPSED, EXPANDED, RESIZE, }
Related Procedures With Parameters
Id ¶
Id :: distinct u32
Related Procedures With Parameters
Related Procedures With Returns
- get_id_bytes
- get_id_rawptr
- get_id_string
- get_id_uintptr
- get_id (procedure groups)
Key ¶
Key :: enum u32 { SHIFT, CTRL, ALT, BACKSPACE, DELETE, RETURN, LEFT, RIGHT, HOME, END, A, X, C, V, }
Related Procedures With Parameters
Layout ¶
Layout :: struct { body: Rect, next: Rect, position: Vec2, size: Vec2, max: Vec2, widths: [16]i32, items: i32, item_index: i32, next_row: i32, next_type: Layout_Type, indent: i32, }
Related Procedures With Returns
Layout_Type ¶
Layout_Type :: enum int { NONE = 0, RELATIVE = 1, ABSOLUTE = 2, }
Opt ¶
Opt :: enum u32 { ALIGN_CENTER, ALIGN_RIGHT, NO_INTERACT, NO_FRAME, NO_RESIZE, NO_SCROLL, NO_CLOSE, NO_TITLE, HOLD_FOCUS, AUTO_SIZE, POPUP, CLOSED, EXPANDED, }
Options ¶
Related Procedures With Parameters
Pool_Item ¶
Pool_Item :: struct { id: Id, last_update: Frame_Index, }
Related Procedures With Parameters
Rect ¶
Related Procedures With Parameters
- begin_window
- check_clip
- draw_box
- draw_control_frame
- draw_control_text
- draw_icon
- draw_rect
- expand_rect
- intersect_rects
- layout_set_next
- mouse_over
- number_textbox
- push_clip_rect
- rect_overlaps_vec2
- scoped_end_window
- set_clip
- textbox_raw
- update_control
- window
Related Procedures With Returns
Constants
CLIP_STACK_SIZE ¶
CLIP_STACK_SIZE :: #config(MICROUI_CLIP_STACK_SIZE, 32)
COMMAND_LIST_SIZE ¶
COMMAND_LIST_SIZE :: #config(MICROUI_COMMAND_LIST_SIZE, 256 * 1024)
CONTAINER_POOL_SIZE ¶
CONTAINER_POOL_SIZE :: #config(MICROUI_CONTAINER_POOL_SIZE, 48)
CONTAINER_STACK_SIZE ¶
CONTAINER_STACK_SIZE :: #config(MICROUI_CONTAINER_STACK_SIZE, 32)
DEFAULT_ATLAS_FONT ¶
DEFAULT_ATLAS_FONT :: int(len(Icon) + 2)
DEFAULT_ATLAS_HEIGHT ¶
DEFAULT_ATLAS_HEIGHT :: 128
DEFAULT_ATLAS_ICON_CHECK ¶
DEFAULT_ATLAS_ICON_CHECK :: int(Icon.CHECK)
DEFAULT_ATLAS_ICON_CLOSE ¶
DEFAULT_ATLAS_ICON_CLOSE :: int(Icon.CLOSE)
DEFAULT_ATLAS_ICON_COLLAPSED ¶
DEFAULT_ATLAS_ICON_COLLAPSED :: int(Icon.COLLAPSED)
DEFAULT_ATLAS_ICON_EXPANDED ¶
DEFAULT_ATLAS_ICON_EXPANDED :: int(Icon.EXPANDED)
DEFAULT_ATLAS_ICON_RESIZE ¶
DEFAULT_ATLAS_ICON_RESIZE :: int(Icon.RESIZE)
DEFAULT_ATLAS_WHITE ¶
DEFAULT_ATLAS_WHITE :: int(len(Icon) + 1)
DEFAULT_ATLAS_WIDTH ¶
DEFAULT_ATLAS_WIDTH :: 128
ID_STACK_SIZE ¶
ID_STACK_SIZE :: #config(MICROUI_ID_STACK_SIZE, 32)
LAYOUT_STACK_SIZE ¶
LAYOUT_STACK_SIZE :: #config(MICROUI_LAYOUT_STACK_SIZE, 16)
MAX_TEXT_STORE ¶
MAX_TEXT_STORE :: #config(MICROUI_MAX_TEXT_STORE, 1024)
MAX_WIDTHS ¶
MAX_WIDTHS :: #config(MICROUI_MAX_WIDTHS, 16)
ROOT_LIST_SIZE ¶
ROOT_LIST_SIZE :: #config(MICROUI_ROOT_LIST_SIZE, 32)
SLIDER_FMT ¶
SLIDER_FMT :: #config(MICROUI_SLIDER_FMT, "%.2f")
TREENODE_POOL_SIZE ¶
TREENODE_POOL_SIZE :: #config(MICROUI_TREENODE_POOL_SIZE, 48)
Variables
default_atlas ¶
default_atlas: [136]Rect = …
default_atlas_alpha ¶
default_atlas_alpha: [16384]u8 = …
default_style ¶
default_style: Style = …
unclipped_rect ¶
unclipped_rect: Rect = …
Procedures
draw_control_frame ¶
draw_control_frame :: proc(ctx: ^Context, id: Id, rect: Rect, colorid: Color_Type, opt: Options = Options{}) {…}
draw_control_text ¶
draw_control_text :: proc(ctx: ^Context, str: string, rect: Rect, colorid: Color_Type, opt: Options = Options{}) {…}
end_panel ¶
end_panel :: proc(ctx: ^Context) {…}
end_popup ¶
end_popup :: proc(ctx: ^Context) {…}
end_treenode ¶
end_treenode :: proc(ctx: ^Context) {…}
end_window ¶
end_window :: proc(ctx: ^Context) {…}
layout_begin_column ¶
layout_begin_column :: proc(ctx: ^Context) {…}
layout_end_column ¶
layout_end_column :: proc(ctx: ^Context) {…}
next_command_iterator ¶
next_command_iterator :: proc "contextless" (ctx: ^Context, pcm: ^^Command) -> (Command_Variant, bool) {…}
pop_clip_rect ¶
pop_clip_rect :: proc(ctx: ^Context) {…}
popup ¶
This is scoped and is intended to be use in the condition of a if-statement
treenode ¶
treenode :: proc(ctx: ^Context, label: string, opt: Options = Options{}) -> bit_set[Result; u32] {…}
This is scoped and is intended to be use in the condition of a if-statement
window ¶
This is scoped and is intended to be use in the condition of a if-statement
Procedure Groups
get_id ¶
get_id :: proc{ get_id_string, get_id_bytes, get_id_rawptr, get_id_uintptr, }
push_id ¶
push_id :: proc{ push_id_string, push_id_bytes, push_id_rawptr, push_id_uintptr, }
Source Files
Generation Information
Generated with odin version dev-2024-12 (vendor "odin") Windows_amd64 @ 2024-12-20 21:10:47.489660400 +0000 UTC