package vendor:microui
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_Type ¶
Color_Type :: enum u32 { TEXT, BORDER, WINDOW_BG, TITLE_BG, TITLE_TEXT, PANEL_BG, BUTTON, BUTTON_HOVER = 7, BUTTON_FOCUS = 8, BASE, BASE_HOVER = 10, BASE_FOCUS = 11, SCROLL_BASE, SCROLL_THUMB, }
Command ¶
Command :: struct { variant: Command_Variant, size: i32, }
Command_Jump ¶
Command_Jump :: struct { command: Command, dst: rawptr, }
Command_Variant ¶
Command_Variant :: union { ^Command_Jump, ^Command_Clip, ^Command_Rect, ^Command_Text, ^Command_Icon, }
Context ¶
Context :: struct { // callbacks text_width: proc "odin" (font: Font, str: string) -> i32, text_height: proc "odin" (font: Font) -> i32, draw_frame: proc "odin" (ctx: ^Context, rect: Rect, colorid: Color_Type), // core state _style: Style, style: ^Style, hover_id, focus_id, last_id: Id, last_rect: Rect, last_zindex: i32, updated_focus: b32, frame: Frame_Index, hover_root, next_hover_root: ^Container, scroll_target: ^Container, number_edit_buf: [127]u8, number_edit_len: int, number_edit_id: Id, // stacks command_list: Stack(u8, COMMAND_LIST_SIZE), root_list: Stack(^Container, ROOT_LIST_SIZE), container_stack: Stack(^Container, ROOT_LIST_SIZE), clip_stack: Stack(Rect, CLIP_STACK_SIZE), id_stack: Stack(Id, ID_STACK_SIZE), layout_stack: Stack(Layout, LAYOUT_STACK_SIZE), // retained state pools container_pool: [48]Pool_Item, containers: [48]Container, treenode_pool: [48]Pool_Item, // input state mouse_pos, last_mouse_pos: Vec2, mouse_delta, scroll_delta: Vec2, mouse_down_bits: Mouse_Set, mouse_pressed_bits: Mouse_Set, mouse_released_bits: Mouse_Set, key_down_bits, key_pressed_bits: Key_Set, _text_store: [1024]u8, text_input: strings.Builder, }
Frame_Index ¶
Frame_Index :: distinct i32
Layout ¶
Layout :: struct { body, next: Rect, position, size, max: Vec2, widths: [16]i32, items, item_index, next_row: i32, next_type: Layout_Type, indent: i32, }
Layout_Type ¶
Layout_Type :: enum int { NONE = 0, RELATIVE = 1, ABSOLUTE = 2, }
Mouse_Set ¶
Mouse_Set :: distinct bit_set[Mouse; u32]
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, }
Pool_Item ¶
Pool_Item :: struct { id: Id, last_update: Frame_Index, }
Result_Set ¶
Result_Set :: bit_set[Result; u32]
Stack ¶
Stack :: struct($Key: typeid, $Value: typeid) where intrinsics.type_is_valid_map_key(Key) {}
Style ¶
Style :: struct { font: Font, size: Vec2, padding: i32, spacing: i32, indent: i32, title_height: i32, footer_height: i32, scrollbar_size: i32, thumb_size: i32, colors: [Color_Type]Color, }
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
begin_popup ¶
begin_popup :: proc "odin" (ctx: ^Context, name: string) -> bool {…}
default_atlas_text_height ¶
default_atlas_text_height :: proc "odin" (font: Font) -> i32 {…}
default_atlas_text_width ¶
default_atlas_text_width :: proc "odin" (font: Font, text: string) -> (width: i32) {…}
draw_control_frame ¶
draw_control_frame :: proc "odin" (ctx: ^Context, id: Id, rect: Rect, colorid: Color_Type, opt: Options = Options{}) {…}
draw_control_text ¶
draw_control_text :: proc "odin" (ctx: ^Context, str: string, rect: Rect, colorid: Color_Type, opt: Options = Options{}) {…}
end_panel ¶
end_panel :: proc "odin" (ctx: ^Context) {…}
end_popup ¶
end_popup :: proc "odin" (ctx: ^Context) {…}
end_treenode ¶
end_treenode :: proc "odin" (ctx: ^Context) {…}
end_window ¶
end_window :: proc "odin" (ctx: ^Context) {…}
input_mouse_move ¶
input_mouse_move :: proc "odin" (ctx: ^Context, x, y: i32) {…}
input_scroll ¶
input_scroll :: proc "odin" (ctx: ^Context, x, y: i32) {…}
input_text ¶
input_text :: proc "odin" (ctx: ^Context, text: string) {…}
layout_begin_column ¶
layout_begin_column :: proc "odin" (ctx: ^Context) {…}
layout_column ¶
layout_column :: proc "odin" (ctx: ^Context) -> bool {…}
layout_end_column ¶
layout_end_column :: proc "odin" (ctx: ^Context) {…}
layout_height ¶
layout_height :: proc "odin" (ctx: ^Context, height: i32) {…}
layout_row ¶
layout_row :: proc "odin" (ctx: ^Context, widths: []i32, height: i32 = 0) {…}
layout_row_items ¶
layout_row_items :: proc "odin" (ctx: ^Context, items: i32, height: i32 = 0) {…}
layout_width ¶
layout_width :: proc "odin" (ctx: ^Context, width: i32) {…}
next_command_iterator ¶
next_command_iterator :: proc "odin" (ctx: ^Context, pcm: ^^Command) -> (Command_Variant, bool) {…}
open_popup ¶
open_popup :: proc "odin" (ctx: ^Context, name: string) {…}
pop_clip_rect ¶
pop_clip_rect :: proc "odin" (ctx: ^Context) {…}
push_command ¶
push_command :: proc "odin" (ctx: ^Context, $Type: typeid, extra_size: int = 0) -> ^typeid {…}
push_id_bytes ¶
push_id_bytes :: proc "odin" (ctx: ^Context, bytes: []u8) {…}
push_id_rawptr ¶
push_id_rawptr :: proc "odin" (ctx: ^Context, data: rawptr, size: int) {…}
push_id_string ¶
push_id_string :: proc "odin" (ctx: ^Context, str: string) {…}
push_id_uintptr ¶
push_id_uintptr :: proc "odin" (ctx: ^Context, ptr: uintptr) {…}
scoped_end_popup ¶
scoped_end_popup :: proc "odin" (ctx: ^Context, _: string, ok: bool) {…}
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-2023-03 (vendor "odin") Windows_amd64 @ 2023-03-29 21:09:05.639740600 +0000 UTC