package vendor:microui

Index

Procedures (84)
Procedure Groups (2)

Types

Clip ¶

Clip :: enum u32 {
	NONE, 
	PART, 
	ALL, 
}

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, 
}

Color ¶

Color :: struct {
	r,
	g,
	b,
	a: u8,
}

Command_Clip ¶

Command_Clip :: struct {
	command: Command,
	rect:    Rect,
}

Command_Icon ¶

Command_Icon :: struct {
	command: Command,
	rect:    Rect,
	id:      Icon,
	color:   Color,
}

Command_Jump ¶

Command_Jump :: struct {
	command: Command,
	dst:     rawptr,
}

Command_Rect ¶

Command_Rect :: struct {
	command: Command,
	rect:    Rect,
	color:   Color,
}

Command_Text ¶

Command_Text :: struct {
	command: Command,
	font:    Font,
	pos:     Vec2,
	color:   Color,
	str:     string,
}

Command ¶

Command :: struct {
	variant: Command_Variant,
	size:    i32,
}

Container ¶

Container :: struct {
	head,
	tail:         ^Command,
	rect,
	body:         Rect,
	content_size: Vec2,
	scroll:       Vec2,
	zindex:       i32,
	open:         b32,
}

Context ¶

Context :: struct {
	// callbacks 
	text_width:          proc "odin" (font: Font, text: string) -> (width: 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,
}

Font ¶

Font :: distinct rawptr

Frame_Index ¶

Frame_Index :: distinct i32

Icon ¶

Icon :: enum u32 {
	NONE, 
	CLOSE, 
	CHECK, 
	COLLAPSED, 
	EXPANDED, 
	RESIZE, 
}

Id ¶

Id :: distinct u32

Key_Set ¶

Key_Set :: distinct bit_set[Key; u32]

Key ¶

Key :: enum u32 {
	SHIFT, 
	CTRL, 
	ALT, 
	BACKSPACE, 
	RETURN, 
}

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]

Mouse ¶

Mouse :: enum u32 {
	LEFT, 
	RIGHT, 
	MIDDLE, 
}

Options ¶

Options :: distinct bit_set[Opt; 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,
}

Real ¶

Real :: f32

Rect ¶

Rect :: struct {
	x,
	y,
	w,
	h: i32,
}

Result ¶

Result :: enum u32 {
	ACTIVE, 
	SUBMIT, 
	CHANGE, 
}

Result_Set ¶

Result_Set :: bit_set[Result; u32]

Stack ¶

Stack :: struct {}

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,
}

Vec2 ¶

Vec2 :: distinct [2]i32

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_FMT ¶

MAX_FMT :: #config(MICROUI_MAX_FMT, 127)

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_alpha ¶

default_atlas_alpha: [16384]u8 = …

default_atlas ¶

default_atlas: [136]Rect = …

default_style ¶

default_style: Style = …

unclipped_rect ¶

unclipped_rect: Rect = …

Procedures

begin ¶

begin :: proc "odin" (ctx: ^Context) {…}

begin_panel ¶

begin_panel :: proc "odin" (ctx: ^Context, name: string, opt: Options = Options{}) {…}

begin_popup ¶

begin_popup :: proc "odin" (ctx: ^Context, name: string) -> bool {…}

begin_treenode ¶

begin_treenode :: proc "odin" (ctx: ^Context, label: string, opt: Options = Options{}) -> bit_set[Result; u32] {…}

begin_window ¶

begin_window :: proc "odin" (ctx: ^Context, title: string, rect: Rect, opt: Options = Options{}) -> bool {…}

bring_to_front ¶

bring_to_front :: proc "odin" (ctx: ^Context, cnt: ^Container) {…}

button ¶

button :: proc "odin" (ctx: ^Context, label: string, icon: Icon = .NONE, opt: Options = {.ALIGN_CENTER}) -> (res: bit_set[Result; u32]) {…}

check_clip ¶

check_clip :: proc "odin" (ctx: ^Context, r: Rect) -> Clip {…}

checkbox ¶

checkbox :: proc "odin" (ctx: ^Context, label: string, state: ^bool) -> (res: bit_set[Result; u32]) {…}

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_box ¶

draw_box :: proc "odin" (ctx: ^Context, rect: Rect, color: Color) {…}

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{}) {…}

draw_icon ¶

draw_icon :: proc "odin" (ctx: ^Context, id: Icon, rect: Rect, color: Color) {…}

draw_rect ¶

draw_rect :: proc "odin" (ctx: ^Context, rect: Rect, color: Color) {…}

draw_text ¶

draw_text :: proc "odin" (ctx: ^Context, font: Font, str: string, pos: Vec2, color: Color) {…}

end ¶

end :: proc "odin" (ctx: ^Context) {…}

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) {…}

expand_rect ¶

expand_rect :: proc "odin" (rect: Rect, n: i32) -> Rect {…}

get_clip_rect ¶

get_clip_rect :: proc "odin" (ctx: ^Context) -> Rect {…}

get_container ¶

get_container :: proc "odin" (ctx: ^Context, name: string, opt: Options = Options{}) -> ^Container {…}

get_current_container ¶

get_current_container :: proc "odin" (ctx: ^Context) -> ^Container {…}

get_id_bytes ¶

get_id_bytes :: proc "odin" (ctx: ^Context, bytes: []u8) -> Id {…}

get_id_rawptr ¶

get_id_rawptr :: proc "odin" (ctx: ^Context, data: rawptr, size: int) -> Id {…}

get_id_string ¶

get_id_string :: proc "odin" (ctx: ^Context, str: string) -> Id {…}

get_id_uintptr ¶

get_id_uintptr :: proc "odin" (ctx: ^Context, ptr: uintptr) -> Id {…}

get_layout ¶

get_layout :: proc "odin" (ctx: ^Context) -> ^Layout {…}
header :: proc "odin" (ctx: ^Context, label: string, opt: Options = Options{}) -> bit_set[Result; u32] {…}

init ¶

init :: proc "odin" (ctx: ^Context) {…}

input_key_down ¶

input_key_down :: proc "odin" (ctx: ^Context, key: Key) {…}

input_key_up ¶

input_key_up :: proc "odin" (ctx: ^Context, key: Key) {…}

input_mouse_down ¶

input_mouse_down :: proc "odin" (ctx: ^Context, x, y: i32, btn: Mouse) {…}

input_mouse_move ¶

input_mouse_move :: proc "odin" (ctx: ^Context, x, y: i32) {…}

input_mouse_up ¶

input_mouse_up :: proc "odin" (ctx: ^Context, x, y: i32, btn: Mouse) {…}

input_scroll ¶

input_scroll :: proc "odin" (ctx: ^Context, x, y: i32) {…}

input_text ¶

input_text :: proc "odin" (ctx: ^Context, str: string) {…}

intersect_rects ¶

intersect_rects :: proc "odin" (r1, r2: Rect) -> Rect {…}

label ¶

label :: proc "odin" (ctx: ^Context, str: 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, width: i32) {…}

layout_next ¶

layout_next :: proc "odin" (ctx: ^Context) -> Rect {…}

layout_row ¶

layout_row :: proc "odin" (ctx: ^Context, widths: []i32, height: i32 = 0) {…}

layout_row_items ¶

layout_row_items :: proc "odin" (ctx: ^Context, x, y: i32) {…}

layout_set_next ¶

layout_set_next :: proc "odin" (ctx: ^Context, r: Rect, relative: bool) {…}

layout_width ¶

layout_width :: proc "odin" (ctx: ^Context, width: i32) {…}

mouse_over ¶

mouse_over :: proc "odin" (ctx: ^Context, rect: Rect) -> bool {…}

next_command_iterator ¶

next_command_iterator :: proc "odin" (ctx: ^Context, pcm: ^^Command) -> (Command_Variant, bool) {…}

next_command ¶

next_command :: proc "odin" (ctx: ^Context, pcmd: ^^Command) -> bool {…}

number ¶

number :: proc "odin" (ctx: ^Context, value: ^f32, step: f32, fmt_string: string = SLIDER_FMT, opt: Options = {.ALIGN_CENTER}) -> (res: bit_set[Result; u32]) {…}

number_textbox ¶

number_textbox :: proc "odin" (ctx: ^Context, value: ^f32, r: Rect, id: Id, fmt_string: string) -> bool {…}

open_popup ¶

open_popup :: proc "odin" (ctx: ^Context, str: string) {…}

pool_get ¶

pool_get :: proc "odin" (ctx: ^Context, items: []Pool_Item, id: Id) -> (int, bool) {…}

pool_init ¶

pool_init :: proc "odin" (ctx: ^Context, items: []Pool_Item, id: Id) -> int {…}

pool_update ¶

pool_update :: proc "odin" (ctx: ^Context, item: ^Pool_Item) {…}

pop_clip_rect ¶

pop_clip_rect :: proc "odin" (ctx: ^Context) {…}

pop ¶

pop :: proc "odin" (stk: ^$T/Stack($V, $N)) {…}

pop_id ¶

pop_id :: proc "odin" (ctx: ^Context) {…}
popup :: proc "odin" (ctx: ^Context, name: string) -> bool {…}

push ¶

push :: proc "odin" (stk: ^$T/Stack($V, $N), val: $) {…}

push_clip_rect ¶

push_clip_rect :: proc "odin" (ctx: ^Context, rect: Rect) {…}

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) {…}

rect_overlaps_vec2 ¶

rect_overlaps_vec2 :: proc "odin" (r: Rect, p: Vec2) -> bool {…}

scoped_end_popup ¶

scoped_end_popup :: proc "odin" (ctx: ^Context, _: string, ok: bool) {…}

scoped_end_treenode ¶

scoped_end_treenode :: proc "odin" (ctx: ^Context, _: string, _: Options, result_set: bit_set[Result; u32]) {…}

scoped_end_window ¶

scoped_end_window :: proc "odin" (ctx: ^Context, _: string, _: Rect, _: Options, ok: bool) {…}

set_clip ¶

set_clip :: proc "odin" (ctx: ^Context, rect: Rect) {…}

set_focus ¶

set_focus :: proc "odin" (ctx: ^Context, id: Id) {…}

slider ¶

slider :: proc "odin" (
	ctx:        ^Context, 
	value:      ^f32, 
	low, high:  f32, 
	step:       f32 = 0.0, 
	fmt_string: string = SLIDER_FMT, 
) -> (res: bit_set[Result; u32]) {…}

textbox ¶

textbox :: proc "odin" (ctx: ^Context, buf: []u8, textlen: ^int, opt: Options = Options{}) -> bit_set[Result; u32] {…}

text ¶

text :: proc "odin" (ctx: ^Context, str: string) {…}

textbox_raw ¶

textbox_raw :: proc "odin" (
	ctx:     ^Context, 
	textbuf: []u8, 
	textlen: ^int, 
	id:      Id, 
	r:       Rect, 
) -> (res: bit_set[Result; u32]) {…}

treenode ¶

treenode :: proc "odin" (ctx: ^Context, label: string, opt: Options = Options{}) -> bit_set[Result; u32] {…}

update_control ¶

update_control :: proc "odin" (ctx: ^Context, id: Id, rect: Rect, opt: Options = Options{}) {…}

window ¶

window :: proc "odin" (ctx: ^Context, title: string, rect: Rect, opt: Options = Options{}) -> bool {…}

Procedure Groups

Source Files

Generation Information

Generated with odin version dev-2022-07 (vendor "odin") Windows_amd64 @ 2022-07-01 21:08:58.766208300 +0000 UTC