Module ui

ui
Dependencies from vmod:
0
Imports:
17
Imported by:
6
Repository:
OS-specific
Show selected OS-specific symbols.
Backend-specific
Show selected Backend-specific symbols.

Dependencies defined in v.mod

This section is empty.

Aliases

#type Actions

type Actions = map[string]Action

#type KeyShortcuts

type KeyShortcuts = map[int]Shortcut

#type CharShortcuts

type CharShortcuts = map[string]Shortcut

Constants

#constant stretch

stretch        = -10000.0

#constant compact

compact        = 0.0 // from parent

#constant fit

fit            = 0.0

#constant z_index_hidden

z_index_hidden = -10000

#constant z_index_focus

z_index_focus  = 10

#constant top_left

top_left      = [0.0, 0.0]

#constant top_center

top_center    = [0.5, 0.0]

#constant top_right

top_right     = [1.0, 0.0]

#constant center_left

center_left   = [0.0, 0.5]

#constant center

center        = [0.5, 0.5]

#constant center_center

center_center = [0.5, 0.5]

#constant center_right

center_right  = [1.0, 0.5]

#constant bottom_left

bottom_left   = [0.0, 1.0]

#constant bottom_center

bottom_center = [0.5, 1.0]

#constant bottom_right

bottom_right  = [1.0, 1.0]

#constant scrollbar_size

scrollbar_size                 = 10

#constant scroolbar_thumb_color

scroolbar_thumb_color          = gx.rgb(87, 153, 245)

#constant scrollbar_background_color

scrollbar_background_color     = gx.rgb(219, 219, 219)

#constant scrollbar_button_color

scrollbar_button_color         = gx.rgb(150, 150, 150)

#constant scrollbar_focused_button_color

scrollbar_focused_button_color = gx.rgb(100, 100, 100)

#constant scrollview_delta_key

scrollview_delta_key           = 5

#constant null_scrollview

null_scrollview                = &ScrollView(unsafe { nil })

#constant empty_stack

empty_stack           = stack(id: '_empty_stack_')

#constant scrollview_empty_rect

scrollview_empty_rect = Rect{}

#constant no_style

no_style    = '_no_style_'

#constant no_color

no_color    = gx.Color{0, 0, 0, 0}

#constant transparent

transparent = gx.Color{0, 0, 0, 1}

#constant sw_decoration

sw_decoration    = 20

#constant sw_resize_border

sw_resize_border = 4

#constant sw_z_index

sw_z_index       = 10000

#constant sw_z_index_top

sw_z_index_top   = 1000

#constant sw_z_index_child

sw_z_index_child = 100

#constant color_solaris

color_solaris             = gx.hex(0xfcf4e4ff)

#constant color_solaris_transparent

color_solaris_transparent = gx.hex(0xfcf4e4f0)

#constant events

pub const events = EventNames{}

#constant mouse_system

mouse_system = '_system_'

#constant mouse_hidden

mouse_hidden = '_hidden_mouse_'

Sum types

#type Size

pub type Size = []f64 | f64

#fn (Size) as_f32_array

fn (size Size) as_f32_array(len int) []f32

Functions

#fn alpha_colored

fn alpha_colored(c gx.Color, a u8) gx.Color

#fn alt_key

fn alt_key(mods KeyMod) bool

#fn android_config

Android
fn android_config(mode AndroidConfig) u32

#fn at

fn at(x int, y int, w Widget) Widget

allow to specify widgets with absolute coordinates (CanvasLayout and Window)

#fn blue_style

fn blue_style() Style

#fn box_layout

fn box_layout(c BoxLayoutParams) &BoxLayout

TODO: documentation

#fn bundle_path

fn bundle_path() string

#fn button

fn button(c ButtonParams) &Button

#fn button_style

#fn canvas

fn canvas(c CanvasParams) &Canvas

#fn canvas_layer

fn canvas_layer(c CanvasLayoutParams) &CanvasLayout

Used to absolute coordinates on top (of everything)

#fn canvas_layout

fn canvas_layout(c CanvasLayoutParams) &CanvasLayout

TODO: documentation

#fn canvas_plus

fn canvas_plus(c CanvasLayoutParams) &CanvasLayout

canvas_plus returns a canvas_layout but without layout it can be viewed as a extended canvas

#fn canvaslayout_style

#fn char_shortcut

fn char_shortcut(e KeyEvent, shortcuts Shortcuts, context voidptr)

TODO: documentation

#fn checkbox

fn checkbox(c CheckBoxParams) &CheckBox

#fn checkbox_style

#fn color_scheme_from_accent_color

fn color_scheme_from_accent_color(accent_color []int) []gx.Color

#fn column

fn column(c ColumnParams) &Stack

#fn component_connect

fn component_connect(comp voidptr, children []ComponentChild)

TODO: documentation

#fn component_id

fn component_id(id string, parts []string) string

to ensure homogeneity for name related to component

#fn component_id_from

fn component_id_from(from_id string, id string) string

TODO: documentation

#fn component_id_from_by

fn component_id_from_by(from_id string, level int, id string) string

TODO: documentation

#fn component_parent_id

fn component_parent_id(part_id string) string

TODO: documentation

#fn component_parent_id_by

fn component_parent_id_by(part_id string, level int) string

TODO: documentation

#fn confirm

fn confirm(s string) bool

#fn create_blue_style_file

fn create_blue_style_file()

#fn create_default_style_file

fn create_default_style_file()

#fn create_dynamic_texture

fn create_dynamic_texture(w int, h int) C.sg_image

Dynamic texture

#fn create_red_style_file

fn create_red_style_file()

#fn create_texture

fn create_texture(w int, h int, buf &u8) C.sg_image

TODO: documentation

#fn ctl_alt_key

fn ctl_alt_key(mods KeyMod) bool

#fn ctl_shift_key

fn ctl_shift_key(mods KeyMod) bool

#fn ctrl_key

fn ctrl_key(mods KeyMod) bool

#fn default_style

fn default_style() Style

#fn destroy_texture

fn destroy_texture(sg_img C.sg_image)

TODO: documentation

#fn draw_device_bitmap

fn draw_device_bitmap(p DrawDeviceBitmapParams) &DrawDeviceBitmap

TODO: documentation

#fn draw_device_print

fn draw_device_print(p DrawDevicePrintParams) &DrawDevicePrint

TODO: documentation

#fn draw_device_svg

fn draw_device_svg(p DrawDeviceSVGParams) &DrawDeviceSVG

TODO: documentation

#fn draw_text_lines

fn draw_text_lines(w DrawText, x int, y int, lines []string)

TODO: documentation

#fn easing

fn easing(easingtype EasingType) fn (f64) f64

#fn env

fn env(var string) string

TODO: documentation

#fn font_default

fn font_default() string

#fn font_path_list

fn font_path_list() []string

#fn get_align_offset_from_parent

fn get_align_offset_from_parent(mut w &Widget, aw f64, ah f64) (int, int)

#fn get_align_offset_from_size

fn get_align_offset_from_size(width int, height int, pwidth int, pheight int, aw f64, ah f64) (int, int)

#fn get_dropped_file_path

fn get_dropped_file_path(i int) string

TODO: documentation

#fn get_num_dropped_files

fn get_num_dropped_files() int

TODO: documentation

#fn get_scrollview

fn get_scrollview(sw ScrollableWidget) (bool, &ScrollView)

TODO: documentation

#fn grid

fn grid(c GridParams) &Grid

#fn group

fn group(c GroupParams) &Group

#fn has_key_mods

fn has_key_mods(mods KeyMod, opts KeyMod) bool

#fn has_scrollview

fn has_scrollview(w ScrollableWidget) bool

TODO: documentation

#fn has_scrollview_or_parent_scrollview

fn has_scrollview_or_parent_scrollview(w ScrollableWidget) bool

TODO: documentation

#fn hex_color

fn hex_color(c gx.Color) string

#fn hex_rgba

fn hex_rgba(r u8, g u8, b u8, a u8) string

#fn hsl_to_rgb

fn hsl_to_rgb(h f64, s f64, l f64) gx.Color

h, s, l in [0,1]

#fn hsv_to_rgb

fn hsv_to_rgb(h f64, s f64, v f64) gx.Color

h, s, l in [0,1]

#fn id

fn id(id string, ids []string) string

#fn id_hovered

fn id_hovered(x f64, y f64, mut m &Menu) int

#fn inside_rect

fn inside_rect(r gg.Rect, c gg.Rect) bool

#fn intersection_rect

fn intersection_rect(r1 gg.Rect, r2 gg.Rect) gg.Rect

#fn is_children_have_widget

fn is_children_have_widget(children []Widget) bool

children contains pure widgets (no stack or group), canvas_layout considered here as a widget (as it is the case ver often for component)

#fn is_empty_intersection

fn is_empty_intersection(r1 gg.Rect, r2 gg.Rect) bool

#fn is_rgb_valid

fn is_rgb_valid(c int) bool

#fn key_shortcut

fn key_shortcut(e KeyEvent, shortcuts Shortcuts, context voidptr)

TODO: documentation

#fn label

fn label(c LabelParams) &Label

#fn listbox

fn listbox(c ListBoxParams) &ListBox

Keys of the items map are IDs of the elements, values are text

#fn listbox_style

#fn listitem

fn listitem(p ListItemParams) &ListItem

#fn load_settings

fn load_settings()

#fn lock_scrollview_key

fn lock_scrollview_key(w ScrollableWidget)

TODO: documentation

#fn message_box

Windows
fn message_box(s string)

#fn message_box

fn message_box(s string)

message_box shows a simple message box, containing a single text message, and an OK button

#fn message_box

fn message_box(s string)

fn C.darwin_draw_string(s string)

#fn message_box

Android
fn message_box(s string)

#fn mini_calc

fn mini_calc() MiniCalc

#fn notify

fn notify(title string, msg string)

#fn on_top_at

fn on_top_at(x int, y int, w Widget) Widget

on top_layer

#fn open_url

fn open_url(url string)

#fn parse_char_key

fn parse_char_key(key_str string) int

#fn parse_key

fn parse_key(key_str string) int

parse ley

#fn parse_shortcut

fn parse_shortcut(s string) (KeyMod, int, string)

#fn parse_style_toml_file

fn parse_style_toml_file(path string) Style

#fn picture

fn picture(c PictureParams) &Picture

#fn progressbar

fn progressbar(c ProgressBarParams) &ProgressBar

#fn progressbar_style

#fn radio

fn radio(c RadioParams) &Radio

#fn radio_style

#fn rectangle

fn rectangle(c RectangleParams) &Rectangle

#fn rectangle_style

#fn red_style

fn red_style() Style

#fn relative_size_from_parent

fn relative_size_from_parent(size int, parent_free_size int) int

if size is negative, it is relative in percentage of the parent

#fn rgb_to_hsl

fn rgb_to_hsl(col gx.Color) (f64, f64, f64)

TODO: documentation

#fn rgb_to_hsv

fn rgb_to_hsv(col gx.Color) (f64, f64, f64)

TODO: documentation

#fn row

fn row(c RowParams) &Stack

#fn run

fn run(window &Window)

#fn scrollview_add[T]

fn scrollview_add[T](mut w &T)

TODO: documentation

#fn scrollview_delegate_parent_scrollview[T]

fn scrollview_delegate_parent_scrollview[T](mut w &T)

TODO: documentation

#fn scrollview_draw_begin[T]

fn scrollview_draw_begin[T](mut w &T, d DrawDevice)

TODO: documentation

#fn scrollview_draw_end[T]

fn scrollview_draw_end[T](w &T, d DrawDevice)

TODO: documentation

#fn scrollview_is_active

fn scrollview_is_active(w ScrollableWidget) bool

TODO: documentation

#fn scrollview_need_update

fn scrollview_need_update(mut w &ScrollableWidget)

TODO: documentation

#fn scrollview_reset[T]

fn scrollview_reset[T](mut w &T)

TODO: documentation

#fn scrollview_restore_offset[T]

fn scrollview_restore_offset[T](w &T, orig bool)

TODO: documentation

#fn scrollview_save_offset[T]

fn scrollview_save_offset[T](w &T)

TODO: documentation

#fn scrollview_set_children_orig_xy

fn scrollview_set_children_orig_xy(w Widget, reset_offset bool)

TODO: documentation

#fn scrollview_set_orig_xy[T]

fn scrollview_set_orig_xy[T](w &T, reset_offset bool)

TODO: documentation

#fn scrollview_update[T]

fn scrollview_update[T](w &T)

TODO: documentation

#fn scrollview_update_active[T]

fn scrollview_update_active[T](w &T)

TODO: documentation

#fn scrollview_widget_restore_offset

fn scrollview_widget_restore_offset(w Widget, orig bool)

TODO: documentation

#fn scrollview_widget_save_offset

fn scrollview_widget_save_offset(w Widget)

TODO: documentation

#fn scrollview_widget_set_orig_xy

fn scrollview_widget_set_orig_xy(w Widget, reset_offset bool)

TODO: documentation

#fn scrollview_widget_update

fn scrollview_widget_update(w Widget)

TODO: documentation

#fn scrollview_widget_update_active

fn scrollview_widget_update_active(w Widget)

TODO: documentation

#fn set_offset

fn set_offset(mut w &Widget, ox int, oy int)

set offset_x and offset_y for Widget

#fn shift_key

fn shift_key(mods KeyMod) bool

#fn show_mouse

fn show_mouse(state bool)

#fn slider

fn slider(c SliderParams) &Slider

#fn slider_style

#fn spacing

fn spacing(c RectangleParams) &Rectangle

Workaround to have a spacing notably

#fn stack_style

#fn style_toml_file

fn style_toml_file(style_id string) string

#fn subwindow

fn subwindow(c SubWindowParams) &SubWindow

#fn super_alt_key

fn super_alt_key(mods KeyMod) bool

#fn super_key

fn super_key(mods KeyMod) bool

#fn switcher

fn switcher(c SwitchParams) &Switch

#fn text_size_as_int

fn text_size_as_int(size f64, win_height int) int

text_size: f64 0 (default) => system 16 (or 16.0) => fixed font size .5 (in ]0,1]) => proprtion of height window

#fn textbox

fn textbox(c TextBoxParams) &TextBox

#fn textbox_style

#fn transition

fn transition(c TransitionParams) &Transition

#fn union_rect

fn union_rect(r1 gg.Rect, r2 gg.Rect) gg.Rect

#fn unlock_scrollview_key

fn unlock_scrollview_key(w ScrollableWidget)

TODO: documentation

#fn update_text_texture

fn update_text_texture(sg_img C.sg_image, w int, h int, buf &u8)

Use only if usage: .dynamic is enabled

#fn wait_events

fn wait_events()

#fn window

fn window(cfg WindowParams) &Window

Structs

#struct Button

heap
pub struct Button {
	// init size read-only
	width_  int
	height_ int
pub mut:
	id          string
	state       ButtonState = .normal
	height      int
	width       int
	z_index     int
	x           int
	y           int
	offset_x    int
	offset_y    int
	text_width  int
	text_height int
	parent      Layout = empty_stack
	is_focused  bool
	ui          &UI = unsafe { nil }
	on_click    ButtonFn
	// TODO: same convention for all callback
	on_key_down    ButtonU32Fn
	on_mouse_down  ButtonMouseFn
	on_mouse_up    ButtonMouseFn
	on_mouse_move  ButtonMouseMoveFn
	on_mouse_enter ButtonMouseMoveFn
	on_mouse_leave ButtonMouseMoveFn
	text           string
	icon_path      string
	image          gg.Image
	use_icon       bool
	alpha_mode     bool
	padding        f32
	hidden         bool
	disabled       bool
	movable        bool // drag, transition or anything allowing offset yo be updated
	just_dragged   bool
	drag_type      string = 'btn'
	hoverable      bool
	tooltip        TooltipMessage
	// style
	// radius   f32
	bg_color &gx.Color = unsafe { nil }
	// Style
	theme_style  string
	style        ButtonShapeStyle
	style_params ButtonStyleParams
	// text styles
	text_styles TextStyles
	// text_size   f64
	// // theme
	// theme_cfg ColorThemeCfg
	// theme     map[int]gx.Color = map[int]gx.Color{}
	// component state for composable widget
	component voidptr
}

#fn (&Button) init

fn (mut b &Button) init(parent Layout)

#fn (&Button) cleanup

manualfree
fn (mut b &Button) cleanup()

#fn (&Button) free

unsafe
fn (b &Button) free()

#fn (&Button) mouse_enter

fn (mut b &Button) mouse_enter(e &MouseMoveEvent)

#fn (&Button) mouse_leave

fn (mut b &Button) mouse_leave(e &MouseMoveEvent)

#fn (&Button) set_pos

fn (mut b &Button) set_pos(x int, y int)

#fn (&Button) size

fn (b &Button) size() (int, int)

#fn (&Button) propose_size

fn (mut b &Button) propose_size(w int, h int) (int, int)

#fn (&Button) draw

fn (mut b &Button) draw()

#fn (&Button) draw_device

fn (mut b &Button) draw_device(mut d &DrawDevice)

#fn (&Button) set_text

fn (mut b &Button) set_text(text string)

#fn (&Button) set_text_size

fn (mut b &Button) set_text_size()

#fn (&Button) point_inside

fn (b &Button) point_inside(x f64, y f64) bool

#fn (&Button) set_visible

fn (mut b &Button) set_visible(state bool)

#fn (&Button) focus

fn (mut b &Button) focus()

#fn (&Button) unfocus

fn (mut b &Button) unfocus()

#fn (&Button) get_window

fn (b &Button) get_window() &Window

method implemented in Draggable

#fn (&Button) drag_type

fn (b &Button) drag_type() string

#fn (&Button) drag_bounds

fn (b &Button) drag_bounds() gg.Rect

#fn (&Button) load_style

fn (mut b &Button) load_style()

#fn (&Button) update_theme_style

fn (mut b &Button) update_theme_style(theme string)

#fn (&Button) update_style

fn (mut b &Button) update_style(p ButtonStyleParams)

#fn (&Button) update_shape_theme_style

fn (mut b &Button) update_shape_theme_style(bs ButtonStyle)

#fn (&Button) update_shape_style

fn (mut b &Button) update_shape_style(p ButtonStyleParams)

#fn (&Button) update_style_params

fn (mut b &Button) update_style_params(p ButtonStyleParams)

update style_params

#struct ButtonParams

params
pub struct ButtonParams {
	ButtonStyleParams
	id             string
	text           string
	icon_path      string
	on_click       ButtonFn
	on_key_down    ButtonU32Fn
	on_mouse_down  ButtonMouseFn
	on_mouse_up    ButtonMouseFn
	on_mouse_move  ButtonMouseMoveFn
	on_mouse_enter ButtonMouseMoveFn
	on_mouse_leave ButtonMouseMoveFn
	height         int
	width          int
	z_index        int
	movable        bool
	hoverable      bool
	tooltip        string
	tooltip_side   Side = .top
	padding        f64
	// text_size    f64
	theme string = no_style
}

#struct ButtonShapeStyle

pub struct ButtonShapeStyle {
pub mut:
	radius           f32
	border_color     gx.Color
	bg_color         gx.Color
	bg_color_pressed gx.Color
	bg_color_hover   gx.Color
}

#struct ButtonStyle

pub struct ButtonStyle {
	ButtonShapeStyle
pub mut:
	text_font_name      string = 'system'
	text_color          gx.Color
	text_size           int = 16
	text_align          TextHorizontalAlign = .center
	text_vertical_align TextVerticalAlign   = .middle
}

#fn (ButtonStyle) to_toml

fn (bs ButtonStyle) to_toml() string

#fn (&ButtonStyle) from_toml

fn (mut bs &ButtonStyle) from_toml(a toml.Any)

#struct ButtonStyleParams

params
pub struct ButtonStyleParams {
	WidgetTextStyleParams
pub mut:
	style            string   = no_style
	radius           f32      = -1
	border_color     gx.Color = no_color
	bg_color         gx.Color = no_color
	bg_color_pressed gx.Color = no_color
	bg_color_hover   gx.Color = no_color
}

#struct Canvas

heap
pub struct Canvas {
pub mut:
	id       string
	width    int
	height   int
	x        int
	y        int
	offset_x int
	offset_y int
	z_index  int
	ui       &UI = unsafe { nil }
	hidden   bool
	clipping bool
	// component state for composable widget
	component voidptr
mut:
	parent  Layout = empty_stack
	draw_fn DrawFn = unsafe { nil }
}

#fn (&Canvas) init

fn (mut c &Canvas) init(parent Layout)

#fn (&Canvas) cleanup

manualfree
fn (mut c &Canvas) cleanup()

#fn (&Canvas) free

unsafe
fn (c &Canvas) free()

#fn (&Canvas) set_pos

fn (mut c &Canvas) set_pos(x int, y int)

#fn (&Canvas) size

fn (mut c &Canvas) size() (int, int)

#fn (&Canvas) propose_size

fn (mut c &Canvas) propose_size(w int, h int) (int, int)

#fn (&Canvas) draw

fn (mut c &Canvas) draw()

#fn (&Canvas) draw_device

fn (mut c &Canvas) draw_device(mut d &DrawDevice)

#fn (&Canvas) set_visible

fn (mut c &Canvas) set_visible(state bool)

#fn (&Canvas) point_inside

fn (c &Canvas) point_inside(x f64, y f64) bool

#struct CanvasParams

params
pub struct CanvasParams {
	id       string
	width    int
	height   int
	z_index  int
	text     string
	draw_fn  DrawFn = unsafe { nil }
	clipping bool
}

#struct DrawDeviceBitmapParams

params
pub struct DrawDeviceBitmapParams {
	id string = 'dd_bitmap'
}

#struct DrawDeviceContext

pub struct DrawDeviceContext {
	gg.Context
mut:
	clip_rect Rect
}

#fn (&DrawDeviceContext) reset_clipping

fn (mut d &DrawDeviceContext) reset_clipping()

TODO: documentation

#fn (&DrawDeviceContext) set_clipping

fn (mut d &DrawDeviceContext) set_clipping(rect Rect)

TODO: documentation

#fn (DrawDeviceContext) get_clipping

fn (d DrawDeviceContext) get_clipping() Rect

TODO: documentation

#fn (DrawDeviceContext) text_width_additive

fn (d DrawDeviceContext) text_width_additive(text string) f64

TODO: documentation

#fn (&DrawDeviceContext) scissor_rect

deprecated:use `widget.clipping` flag instead
fn (d &DrawDeviceContext) scissor_rect(x int, y int, w int, h int)

#struct DrawDevicePrintParams

params
pub struct DrawDevicePrintParams {
	id       string = 'dd_print'
	filename string
}

#fn (&Dropdown) init

fn (mut dd &Dropdown) init(parent Layout)

#fn (&Dropdown) cleanup

manualfree
fn (mut dd &Dropdown) cleanup()

#fn (&Dropdown) free

unsafe
fn (dd &Dropdown) free()

#fn (&Dropdown) set_pos

fn (mut dd &Dropdown) set_pos(x int, y int)

#fn (&Dropdown) size

fn (mut dd &Dropdown) size() (int, int)

#fn (&Dropdown) propose_size

fn (mut dd &Dropdown) propose_size(w int, h int) (int, int)

#fn (&Dropdown) draw

fn (mut dd &Dropdown) draw()

#fn (&Dropdown) draw_device

fn (mut dd &Dropdown) draw_device(mut d &DrawDevice)

#fn (&Dropdown) draw_device_open

fn (dd &Dropdown) draw_device_open(d DrawDevice)

#fn (&Dropdown) add_item

fn (mut dd &Dropdown) add_item(text string)

#fn (&Dropdown) open_drawer

fn (mut dd &Dropdown) open_drawer()

#fn (&Dropdown) set_visible

fn (mut dd &Dropdown) set_visible(state bool)

#fn (&Dropdown) focus

fn (mut dd &Dropdown) focus()

#fn (&Dropdown) unfocus

fn (mut dd &Dropdown) unfocus()

#fn (&Dropdown) point_inside

fn (dd &Dropdown) point_inside(x f64, y f64) bool

#fn (&Dropdown) selected

fn (dd &Dropdown) selected() DropdownItem

Returns the currently selected DropdownItem

#fn (&Dropdown) load_style

fn (mut dd &Dropdown) load_style()

#fn (&Dropdown) update_theme_style

fn (mut dd &Dropdown) update_theme_style(theme string)

#fn (&Dropdown) update_style

fn (mut dd &Dropdown) update_style(p DropdownStyleParams)

#fn (&Dropdown) update_shape_theme_style

fn (mut dd &Dropdown) update_shape_theme_style(dds DropdownStyle)

#fn (&Dropdown) update_shape_style

fn (mut dd &Dropdown) update_shape_style(p DropdownStyleParams)

#fn (&Dropdown) update_style_params

fn (mut dd &Dropdown) update_style_params(p DropdownStyleParams)

#struct Margins

pub struct Margins {
pub mut:
	top    f32
	right  f32
	bottom f32
	left   f32
}

for Stacks

#struct Margin

pub struct Margin {
	top    f64
	right  f64
	bottom f64
	left   f64
}

for Config

#struct Grid

heap
pub struct Grid {
pub mut:
	id          string
	header      []string
	body        [][]string
	x           int
	y           int
	offset_x    int
	offset_y    int
	height      int
	width       int
	z_index     int
	cell_height f32
	cell_width  f32    = 40
	parent      Layout = empty_stack
	ui          &UI    = unsafe { nil }
	hidden      bool
}

#fn (&Grid) init

fn (mut gv &Grid) init(parent Layout)

#fn (&Grid) cleanup

manualfree
fn (mut g &Grid) cleanup()

#fn (&Grid) free

unsafe
fn (g &Grid) free()

#fn (&Grid) draw

fn (mut gv &Grid) draw()

#fn (&Grid) draw_device

fn (mut gv &Grid) draw_device(mut d &DrawDevice)

#fn (&Grid) set_visible

fn (mut gv &Grid) set_visible(state bool)

#fn (&Grid) set_pos

fn (mut gv &Grid) set_pos(x int, y int)

#fn (&Grid) size

fn (mut gv &Grid) size() (int, int)

#fn (&Grid) propose_size

fn (mut gv &Grid) propose_size(w int, h int) (int, int)

#fn (&Grid) point_inside

fn (gv &Grid) point_inside(x f64, y f64) bool

#struct GridParams

params
pub struct GridParams {
	header      []string
	body        [][]string
	height      int = 200
	width       int = 400
	z_index     int
	cell_height f32 = 25
}

#struct Action

pub struct Action {
pub mut:
	action_fn ActionFn
	context   voidptr
}

#struct WindowCallbackParams

params
pub struct WindowCallbackParams {
	on_click        WindowMouseFn
	on_mouse_down   WindowMouseFn
	on_mouse_up     WindowMouseFn
	on_files_droped WindowMouseFn
	on_swipe        WindowMouseFn
	on_mouse_move   WindowMouseMoveFn
	on_key_down     WindowKeyFn
	on_char         WindowKeyFn
	on_scroll       WindowScrollFn
	on_resize       WindowResizeFn
	on_iconify      WindowFn
	on_restore      WindowFn
	on_quit_request WindowFn
	on_suspend      WindowFn
	on_resume       WindowFn
	on_focus        WindowFn
	on_unfocus      WindowFn
}

#struct ScrollView

heap
pub struct ScrollView {
pub mut:
	widget &Widget = unsafe { nil }
	// color
	btn_color_x gx.Color = scrollbar_button_color
	btn_color_y gx.Color = scrollbar_button_color
	// horizontal scrollbar
	sb_w  int
	btn_x int
	btn_w int
	// vertical scrollbar
	sb_h  int
	btn_y int
	btn_h int
	// offset
	offset_x int
	offset_y int
	// active scrollbar
	active_x bool
	active_y bool
	// dragging
	dragging    int // 0=invalid, 1=x, 2=y
	drag_offset int
	orig_offset int
	// to update children pos
	children_to_update bool
	// focus
	is_focused bool
	key_locked bool
	// sizes of widget
	orig_x     int
	orig_y     int
	width      int
	height     int
	adj_width  int
	adj_height int
	// win_width  int
	// win_height int
	ui     &UI = unsafe { nil }
	parent Layout
	// delta mouse
	delta_mouse int = 50
	// saved scrollview
	prev_offset_x int
	prev_offset_y int
}

#fn (&ScrollView) init

fn (mut sv &ScrollView) init(parent Layout)

#fn (&ScrollView) cleanup

manualfree
fn (mut sv &ScrollView) cleanup()

TODO: documentation

#fn (&ScrollView) free

unsafe
fn (sv &ScrollView) free()

TODO: documentation

#fn (&ScrollView) parent_offset

fn (sv &ScrollView) parent_offset() (int, int)

#fn (&ScrollView) orig_xy

fn (sv &ScrollView) orig_xy() (int, int)

From a ScrollableWidget's ScrollView, fetch the "original" (x,y) co-ordinates for the widget, prior to them being adjusted due to scrolling. (Note:

although they're called "original" co-ordinates, they will also reflect any scrolling offsets that have occurred in parent ScrollViews -- which is usually what you want -- and so should technically be thought of as the (x,y) co-ordinates of this widget where no scrolling has occurred in this widget.)

#fn (&ScrollView) update_active

fn (mut sv &ScrollView) update_active()

#fn (&ScrollView) update

fn (mut sv &ScrollView) update()

#fn (&ScrollView) is_active

fn (sv &ScrollView) is_active() bool

TODO: documentation

#fn (&ScrollView) point_inside

fn (sv &ScrollView) point_inside(x f64, y f64, mode ScrollViewPart) bool

#fn (&ScrollView) change_value

fn (mut sv &ScrollView) change_value(mode ScrollViewPart)

#fn (&ScrollView) draw_device

fn (sv &ScrollView) draw_device(d DrawDevice)

TODO: documentation

#fn (&ScrollView) set

fn (mut sv &ScrollView) set(val int, mode ScrollViewPart)

TODO: documentation

#fn (&ScrollView) scroll_to_end_y

fn (mut sv &ScrollView) scroll_to_end_y()

TODO: documentation

#fn (&ScrollView) inc

fn (mut sv &ScrollView) inc(delta int, mode ScrollViewPart)

TODO: documentation

#fn (&ScrollView) x_offset_max_and_coef

fn (sv &ScrollView) x_offset_max_and_coef() (int, f32)

returns max scroll offset (in scrollview pixels), and scrollview-to-scrollbar coefficient (i.e., multiplying a number of pixels in the view by this gives you the smaller, fractional number of pixels in the scrollbar which is the scrollbar button offset)

#fn (&ScrollView) y_offset_max_and_coef

fn (sv &ScrollView) y_offset_max_and_coef() (int, f32)

#struct Shortcuts

pub struct Shortcuts {
pub mut:
	keys  KeyShortcuts
	chars CharShortcuts
}

#struct Shortcut

pub struct Shortcut {
pub mut:
	mods    KeyMod
	key_fn  ShortcutFn
	context voidptr
}

#struct Label

heap
pub struct Label {
pub mut:
	id         string
	text       string
	parent     Layout = empty_stack
	x          int
	y          int
	offset_x   int
	offset_y   int
	width      int
	height     int
	z_index    int
	adj_width  int
	adj_height int
	// Adjustable
	justify []f64
	ax      int
	ay      int
	ui      &UI = unsafe { nil }
	// Style
	theme_style  string
	style        LabelStyle
	style_params LabelStyleParams
	// text styles
	text_styles TextStyles
	// text_size   f64
	hidden   bool
	clipping bool
	// component state for composable widget
	component voidptr
}

#fn (&Label) init

fn (mut l &Label) init(parent Layout)

#fn (&Label) cleanup

manualfree
fn (mut l &Label) cleanup()

#fn (&Label) free

unsafe
fn (l &Label) free()

#fn (&Label) set_pos

fn (mut l &Label) set_pos(x int, y int)

#fn (&Label) adj_size

fn (mut l &Label) adj_size() (int, int)

#fn (&Label) init_size

fn (mut l &Label) init_size()

#fn (&Label) size

fn (l &Label) size() (int, int)

#fn (&Label) propose_size

fn (mut l &Label) propose_size(w int, h int) (int, int)

#fn (&Label) draw

fn (mut l &Label) draw()

#fn (&Label) draw_device

fn (mut l &Label) draw_device(mut d &DrawDevice)

#fn (&Label) set_visible

fn (mut l &Label) set_visible(state bool)

#fn (&Label) point_inside

fn (l &Label) point_inside(x f64, y f64) bool

#fn (&Label) set_text

fn (mut l &Label) set_text(s string)

#fn (&Label) load_style

fn (mut l &Label) load_style()

#fn (&Label) update_theme_style

fn (mut l &Label) update_theme_style(theme string)

#fn (&Label) update_style

fn (mut l &Label) update_style(p LabelStyleParams)

#struct LabelParams

params
pub struct LabelParams {
	LabelStyleParams
	id       string
	width    int
	height   int
	z_index  int
	clipping bool
	justify  []f64 = [0.0, 0.0]
	text     string
	// text_size f64
	theme string = no_style
}

#struct BoxLayout

heap
pub struct BoxLayout {
pub mut:
	id          string
	height      int
	width       int
	adj_height  int
	adj_width   int
	x           int
	y           int
	offset_x    int
	offset_y    int
	z_index     int
	deactivated bool
	is_focused  bool
	parent      Layout = empty_stack
	ui          &UI    = unsafe { nil }
	// children
	child_box        []Box
	child_box_expr   map[string]string // for box_expression mode, i.e. specifically when some @id are used inside bounding expression
	child_id         []string // relative id
	cid              []string // real child id defined inside its own constructor
	child_mode       []BoxMode
	children         []Widget
	drawing_children []Widget
	hidden           bool
	clipping         bool
	is_root_layout   bool = true
	// scrollview
	has_scrollview   bool
	scrollview       &ScrollView = unsafe { nil }
	on_scroll_change ScrollViewChangedFn = ScrollViewChangedFn(0)
	// component state for composable widget
	component voidptr
	// debug stuff to be removed
	debug_ids []string
	mc        MiniCalc = mini_calc()
}

TODO: add bg_color

#fn (&BoxLayout) init

fn (mut b &BoxLayout) init(parent Layout)

TODO: documentation

#fn (&BoxLayout) set_root_layout

fn (mut b &BoxLayout) set_root_layout()

Determine wheither BoxLayout b is a root layout

#fn (&BoxLayout) cleanup

manualfree
fn (mut b &BoxLayout) cleanup()

TODO: documentation

#fn (&BoxLayout) free

unsafe
fn (b &BoxLayout) free()

TODO: documentation

#fn (&BoxLayout) set_child_bounding

fn (mut b &BoxLayout) set_child_bounding(key string, mut child &Widget)

#fn (&BoxLayout) add_child_lt2rb

fn (mut b &BoxLayout) add_child_lt2rb(id string, child Widget, vec4 []f32)

#fn (&BoxLayout) add_child_rect

fn (mut b &BoxLayout) add_child_rect(id string, child Widget, vec4 []f32)

#fn (&BoxLayout) add_child_box_expr

fn (mut b &BoxLayout) add_child_box_expr(id string, child Widget, box_expr string)

#fn (&BoxLayout) update_child_bounding

fn (mut b &BoxLayout) update_child_bounding(key string)

#fn (&BoxLayout) update_boundings

fn (mut b &BoxLayout) update_boundings(keys []string)

TODO: documentation

#fn (&BoxLayout) update_child_lt2rb

fn (mut b &BoxLayout) update_child_lt2rb(id string, vec4 []f32)

TODO: IMPORTANT check if it was before a box_expression to remove inside b.child_box_expr

#fn (&BoxLayout) update_child_rect

fn (mut b &BoxLayout) update_child_rect(id string, vec4 []f32)

TODO: IMPORTANT check if it was before a box_expression to remove inside b.child_box_expr

#fn (&BoxLayout) update_child_box_expr

fn (mut b &BoxLayout) update_child_box_expr(id string, box_expr string)

#fn (&BoxLayout) update_child_depth

fn (mut b &BoxLayout) update_child_depth(id string, z_index int)

#fn (&BoxLayout) update_child

fn (mut b &BoxLayout) update_child(id string, mut child &Widget)

TODO: documentation

#fn (&BoxLayout) update_visible_children

fn (mut b &BoxLayout) update_visible_children()

#fn (&BoxLayout) decode_size

fn (mut b &BoxLayout) decode_size()

#fn (&BoxLayout) set_pos

fn (mut b &BoxLayout) set_pos(x int, y int)

#fn (&BoxLayout) set_child_pos

fn (b &BoxLayout) set_child_pos(i int, mut child &Widget)

TODO: documentation

#fn (&BoxLayout) set_child_size

fn (b &BoxLayout) set_child_size(i int, mut child &Widget)

TODO: documentation

#fn (&BoxLayout) ids_repl

fn (b &BoxLayout) ids_repl(re regex.RE, in_txt string, start int, end int) string

#fn (&BoxLayout) preprocess_child_box_expression

fn (mut b &BoxLayout) preprocess_child_box_expression(i int, id string)

#fn (&BoxLayout) precompute_box_expression

fn (b &BoxLayout) precompute_box_expression(bounding string) string

#fn (&BoxLayout) calculate

fn (b &BoxLayout) calculate(formula string) f32

#fn (&BoxLayout) set_children_pos

fn (mut b &BoxLayout) set_children_pos()

TODO: documentation

#fn (&BoxLayout) set_children_pos_and_size

fn (mut b &BoxLayout) set_children_pos_and_size()

#fn (&BoxLayout) draw

fn (mut b &BoxLayout) draw()

#fn (&BoxLayout) draw_device

fn (mut b &BoxLayout) draw_device(mut d &DrawDevice)

#fn (&BoxLayout) point_inside

fn (b &BoxLayout) point_inside(x f64, y f64) bool

#fn (&BoxLayout) set_visible

fn (mut b &BoxLayout) set_visible(state bool)

#fn (&BoxLayout) get_ui

fn (b &BoxLayout) get_ui() &UI

#fn (&BoxLayout) resize

fn (mut b &BoxLayout) resize(width int, height int)

#fn (&BoxLayout) get_subscriber

fn (b &BoxLayout) get_subscriber() &eventbus.Subscriber

#fn (&BoxLayout) propose_size

fn (mut b &BoxLayout) propose_size(w int, h int) (int, int)

#fn (&BoxLayout) size

fn (b &BoxLayout) size() (int, int)

#fn (&BoxLayout) set_adjusted_size

fn (mut b &BoxLayout) set_adjusted_size(gui &UI)

TODO: documentation

#fn (&BoxLayout) adj_size

fn (b &BoxLayout) adj_size() (int, int)

#fn (&BoxLayout) get_children

fn (b &BoxLayout) get_children() []Widget

#fn (&BoxLayout) update_layout

fn (mut b &BoxLayout) update_layout()

TODO: documentation

#fn (&BoxLayout) set_drawing_children

fn (mut b &BoxLayout) set_drawing_children()

#fn (&BoxLayout) is_box_hidden

fn (b &BoxLayout) is_box_hidden(id string) bool

#fn (&BoxLayout) register_child

fn (mut b &BoxLayout) register_child(child Widget)

#fn (&BoxLayout) update_child_current_box_expression

fn (mut b &BoxLayout) update_child_current_box_expression(id string, bounding string) string

deal with underscore '_' syntax to update a box expression

#fn (&BoxLayout) parse_boxlayout_child_bounding

fn (b &BoxLayout) parse_boxlayout_child_bounding(bounding string) (string, []f32, bool, int, string)

parse child bounding and return

#fn (&BoxLayout) parse_bounding_with_possible_zindex

fn (b &BoxLayout) parse_bounding_with_possible_zindex(left string, right string) ([]f32, bool, int)

TODO: ?int does not work yet

#fn (&BoxLayout) sorted_drawing_children

fn (mut b &BoxLayout) sorted_drawing_children()

#struct BoxLayoutParams

params
pub struct BoxLayoutParams {
pub mut:
	id         string
	x          int
	y          int
	width      int
	height     int
	clipping   bool = true
	scrollview bool
	children   map[string]Widget
}

#struct CanvasLayout

heap
pub struct CanvasLayout {
pub mut:
	id               string
	children         []Widget
	drawing_children []Widget
	width            int
	height           int
	x                int
	y                int
	offset_x         int
	offset_y         int
	z_index          int
	deactivated      bool
	is_focused       bool
	ui               &UI = unsafe { nil }
	hidden           bool
	is_root_layout   bool = true
	clipping         bool
	adj_width        int
	adj_height       int
	full_width       int
	full_height      int
	// Adjustable
	justify         []f64
	ax              int
	ay              int
	is_canvas_layer bool
	// Style
	theme_style  string
	style        CanvasLayoutShapeStyle
	style_params CanvasLayoutStyleParams
	// text styles
	text_styles TextStyles
	// component state for composable widget
	component         voidptr
	active_evt_mngr   bool
	delegate_evt_mngr bool
	on_build          BuildFn
	on_init           InitFn
	// scrollview
	has_scrollview bool
	scrollview     &ScrollView = unsafe { nil }
	// callbacks
	draw_device_fn      CanvasLayoutDrawDeviceFn = CanvasLayoutDrawDeviceFn(0)
	post_draw_device_fn CanvasLayoutDrawDeviceFn = CanvasLayoutDrawDeviceFn(0)
	click_fn            CanvasLayoutMouseFn      = CanvasLayoutMouseFn(0)
	mouse_down_fn       CanvasLayoutMouseFn      = CanvasLayoutMouseFn(0)
	mouse_up_fn         CanvasLayoutMouseFn      = CanvasLayoutMouseFn(0)
	scroll_fn           CanvasLayoutScrollFn     = CanvasLayoutScrollFn(0)
	mouse_move_fn       CanvasLayoutMouseMoveFn  = CanvasLayoutMouseMoveFn(0)
	mouse_enter_fn      CanvasLayoutMouseMoveFn  = CanvasLayoutMouseMoveFn(0)
	mouse_leave_fn      CanvasLayoutMouseMoveFn  = CanvasLayoutMouseMoveFn(0)
	key_down_fn         CanvasLayoutKeyFn        = CanvasLayoutKeyFn(0)
	char_fn             CanvasLayoutKeyFn        = CanvasLayoutKeyFn(0)
	full_size_fn        CanvasLayoutSizeFn       = CanvasLayoutSizeFn(0)
	bounding_change_fn  CanvasLayoutBoundingFn   = CanvasLayoutBoundingFn(0)
	on_scroll_change    ScrollViewChangedFn      = ScrollViewChangedFn(0)
	on_delegate         CanvasLayoutDelegateFn
	parent              Layout = empty_stack
mut:
	// To keep track of original position
	pos_ map[int]XYPos
	// debug stuff to be removed
	debug_ids          []string
	debug_children_ids []string
}

#fn (&CanvasLayout) draw_texture

fn (c &CanvasLayout) draw_texture(simg C.sg_image)

REMOVED: this function uses internals of gg.Context which we probably do not want to reproduce in the DrawDevice interface

#fn (&CanvasLayout) build

fn (mut c &CanvasLayout) build(win &Window)

#fn (&CanvasLayout) init

fn (mut c &CanvasLayout) init(parent Layout)

#fn (&CanvasLayout) set_root_layout

fn (mut c &CanvasLayout) set_root_layout()

Determine wheither CanvasLayout b is a root layout

#fn (&CanvasLayout) cleanup

manualfree
fn (mut c &CanvasLayout) cleanup()

TODO: documentation

#fn (&CanvasLayout) free

unsafe
fn (c &CanvasLayout) free()

TODO: documentation

#fn (&CanvasLayout) init_size

fn (mut c &CanvasLayout) init_size()

#fn (&CanvasLayout) mouse_enter

fn (mut c &CanvasLayout) mouse_enter(e &MouseMoveEvent)

TODO: documentation

#fn (&CanvasLayout) mouse_leave

fn (mut c &CanvasLayout) mouse_leave(e &MouseMoveEvent)

TODO: documentation

#fn (&CanvasLayout) update_layout

fn (mut c &CanvasLayout) update_layout()

TODO: documentation

#fn (&CanvasLayout) set_adjusted_size

fn (mut c &CanvasLayout) set_adjusted_size(gui &UI)

TODO: documentation

#fn (&CanvasLayout) set_children_pos

fn (mut c &CanvasLayout) set_children_pos()

TODO: documentation

#fn (&CanvasLayout) set_child_relative_pos

fn (mut c &CanvasLayout) set_child_relative_pos(id string, x int, y int)

TODO: documentation

#fn (&CanvasLayout) set_pos

fn (mut c &CanvasLayout) set_pos(x int, y int)

TODO: documentation

#fn (&CanvasLayout) adj_size

fn (c &CanvasLayout) adj_size() (int, int)

TODO: documentation

#fn (&CanvasLayout) size

fn (c &CanvasLayout) size() (int, int)

TODO: documentation

#fn (&CanvasLayout) full_size

fn (c &CanvasLayout) full_size() (int, int)

possibly dynamic full size

#fn (&CanvasLayout) bounding_changed

fn (mut c &CanvasLayout) bounding_changed()

#fn (&CanvasLayout) propose_size

fn (mut c &CanvasLayout) propose_size(w int, h int) (int, int)

TODO: documentation

#fn (&CanvasLayout) set_drawing_children

fn (mut c &CanvasLayout) set_drawing_children()

#fn (&CanvasLayout) draw

fn (mut c &CanvasLayout) draw()

#fn (&CanvasLayout) draw_device

fn (mut c &CanvasLayout) draw_device(mut d &DrawDevice)

#fn (&CanvasLayout) set_visible

fn (mut c &CanvasLayout) set_visible(state bool)

TODO: documentation

#fn (&CanvasLayout) point_inside

fn (c &CanvasLayout) point_inside(x f64, y f64) bool

TODO: documentation

#fn (&CanvasLayout) get_ui

fn (c &CanvasLayout) get_ui() &UI

#fn (&CanvasLayout) resize

fn (mut c &CanvasLayout) resize(width int, height int)

#fn (&CanvasLayout) get_subscriber

fn (c &CanvasLayout) get_subscriber() &eventbus.Subscriber

#fn (&CanvasLayout) focus

fn (mut c &CanvasLayout) focus()

TODO: documentation

#fn (&CanvasLayout) unfocus

fn (mut c &CanvasLayout) unfocus()

TODO: documentation

#fn (&CanvasLayout) get_children

fn (c &CanvasLayout) get_children() []Widget

TODO: documentation

#fn (&CanvasLayout) child_index_by_id

fn (c &CanvasLayout) child_index_by_id(id string) int

TODO: documentation

#fn (&CanvasLayout) orig_pos

fn (c &CanvasLayout) orig_pos(x f64, y f64) (int, int)

TODO: documentation

#fn (&CanvasLayout) abs_pos

fn (c &CanvasLayout) abs_pos(x f64, y f64) (int, int)

TODO: documentation

#fn (&CanvasLayout) rel_pos

fn (c &CanvasLayout) rel_pos(x f64, y f64) (f32, f32)

TODO: documentation

#fn (&CanvasLayout) rel_pos_x

fn (c &CanvasLayout) rel_pos_x(x f64) f32

TODO: documentation

#fn (&CanvasLayout) rel_pos_y

fn (c &CanvasLayout) rel_pos_y(y f64) f32

TODO: documentation

#fn (&CanvasLayout) draw_text

fn (c &CanvasLayout) draw_text(x int, y int, text string)

TODO: documentation

#fn (&CanvasLayout) draw_device_text

fn (c &CanvasLayout) draw_device_text(d DrawDevice, x int, y int, text string)

TODO: documentation

#fn (&CanvasLayout) draw_styled_text

fn (c &CanvasLayout) draw_styled_text(x int, y int, text string, ts TextStyleParams)

TODO: documentation

#fn (&CanvasLayout) draw_device_styled_text

fn (c &CanvasLayout) draw_device_styled_text(d DrawDevice, x int, y int, text string, ts TextStyleParams)

TODO: documentation

#fn (&CanvasLayout) draw_device_triangle_empty

fn (c &CanvasLayout) draw_device_triangle_empty(d DrawDevice, x f64, y f64, x2 f64, y2 f64, x3 f64, y3 f64, color gx.Color)

TODO: documentation

#fn (&CanvasLayout) draw_device_triangle_filled

fn (c &CanvasLayout) draw_device_triangle_filled(d DrawDevice, x f64, y f64, x2 f64, y2 f64, x3 f64, y3 f64, color gx.Color)

TODO: documentation

#fn (&CanvasLayout) draw_device_square_empty

fn (c &CanvasLayout) draw_device_square_empty(d DrawDevice, x f64, y f64, s f32, color gx.Color)

TODO: documentation

#fn (&CanvasLayout) draw_device_square_filled

fn (c &CanvasLayout) draw_device_square_filled(d DrawDevice, x f64, y f64, s f32, color gx.Color)

TODO: documentation

#fn (&CanvasLayout) draw_device_rect_empty

fn (c &CanvasLayout) draw_device_rect_empty(d DrawDevice, x f64, y f64, w f32, h f32, color gx.Color)

TODO: documentation

#fn (&CanvasLayout) draw_device_rect_filled

fn (c &CanvasLayout) draw_device_rect_filled(d DrawDevice, x f64, y f64, w f32, h f32, color gx.Color)

TODO: documentation

#fn (&CanvasLayout) draw_device_rounded_rect_filled

fn (c &CanvasLayout) draw_device_rounded_rect_filled(d DrawDevice, x f64, y f64, w f32, h f32, radius f32, color gx.Color)

TODO: documentation

#fn (&CanvasLayout) draw_device_rounded_rect_empty

fn (c &CanvasLayout) draw_device_rounded_rect_empty(d DrawDevice, x f64, y f64, w f32, h f32, radius f32, border_color gx.Color)

TODO: documentation

#fn (&CanvasLayout) draw_device_circle_line

fn (c &CanvasLayout) draw_device_circle_line(d DrawDevice, x f64, y f64, r int, segments int, color gx.Color)

TODO: documentation

#fn (&CanvasLayout) draw_device_circle_empty

fn (c &CanvasLayout) draw_device_circle_empty(d DrawDevice, x f64, y f64, r f32, color gx.Color)

TODO: documentation

#fn (&CanvasLayout) draw_device_circle_filled

fn (c &CanvasLayout) draw_device_circle_filled(d DrawDevice, x f64, y f64, r f32, color gx.Color)

TODO: documentation

#fn (&CanvasLayout) draw_device_slice_empty

fn (c &CanvasLayout) draw_device_slice_empty(d DrawDevice, x f64, y f64, r f32, start_angle f32, end_angle f32, segments int, color gx.Color)

TODO: documentation

#fn (&CanvasLayout) draw_device_slice_filled

fn (c &CanvasLayout) draw_device_slice_filled(d DrawDevice, x f64, y f64, r f32, start_angle f32, end_angle f32, segments int, color gx.Color)

TODO: documentation

#fn (&CanvasLayout) draw_device_arc_empty

fn (c &CanvasLayout) draw_device_arc_empty(d DrawDevice, x f64, y f64, radius f32, thickness f32, start_angle f32, end_angle f32, segments int, color gx.Color)

TODO: documentation

#fn (&CanvasLayout) draw_device_arc_filled

fn (c &CanvasLayout) draw_device_arc_filled(d DrawDevice, x f64, y f64, radius f32, thickness f32, start_angle f32, end_angle f32, segments int, color gx.Color)

TODO: documentation

#fn (&CanvasLayout) draw_device_arc_line

fn (c &CanvasLayout) draw_device_arc_line(d DrawDevice, x f64, y f64, radius f32, start_angle f32, end_angle f32, segments int, color gx.Color)

TODO: documentation

#fn (&CanvasLayout) draw_device_line

fn (c &CanvasLayout) draw_device_line(d DrawDevice, x f64, y f64, x2 f64, y2 f64, color gx.Color)

TODO: documentation

#fn (&CanvasLayout) draw_device_convex_poly

fn (c &CanvasLayout) draw_device_convex_poly(d DrawDevice, points []f32, color gx.Color)

---- polygon

TODO: What to do about canvas offset?

TODO: documentation

#fn (&CanvasLayout) draw_device_empty_poly

fn (c &CanvasLayout) draw_device_empty_poly(d DrawDevice, points []f32, color gx.Color)

TODO: documentation

#fn (&CanvasLayout) draw_device_rect_surrounded

fn (c &CanvasLayout) draw_device_rect_surrounded(d DrawDevice, x f32, y f32, w f32, h f32, size int, color gx.Color)

#fn (&CanvasLayout) add_top_layer

fn (mut c &CanvasLayout) add_top_layer(w Widget)

#fn (&CanvasLayout) load_style

fn (mut l &CanvasLayout) load_style()

#fn (&CanvasLayout) update_theme_style

fn (mut l &CanvasLayout) update_theme_style(theme string)

#fn (&CanvasLayout) update_style

fn (mut l &CanvasLayout) update_style(p CanvasLayoutStyleParams)

#fn (&CanvasLayout) update_shape_theme_style

fn (mut l &CanvasLayout) update_shape_theme_style(ls CanvasLayoutStyle)

#fn (&CanvasLayout) update_shape_style

fn (mut l &CanvasLayout) update_shape_style(p CanvasLayoutStyleParams)

#fn (&CanvasLayout) update_style_params

fn (mut l &CanvasLayout) update_style_params(p CanvasLayoutStyleParams)

#fn (&CanvasLayout) sorted_drawing_children

fn (mut c &CanvasLayout) sorted_drawing_children()

#struct CanvasLayoutParams

params
pub struct CanvasLayoutParams {
	CanvasLayoutStyleParams
	id                string
	width             int
	height            int
	full_width        int = -1
	full_height       int = -1
	z_index           int
	clipping          bool
	text              string
	scrollview        bool
	is_focused        bool
	justify           []f64  = [0.0, 0.0]
	theme             string = no_style
	active_evt_mngr   bool   = true
	delegate_evt_mngr bool
	on_draw           CanvasLayoutDrawDeviceFn = unsafe { nil }
	on_post_draw      CanvasLayoutDrawDeviceFn = unsafe { nil }
	on_click          CanvasLayoutMouseFn      = unsafe { nil }
	on_mouse_down     CanvasLayoutMouseFn      = unsafe { nil }
	on_mouse_up       CanvasLayoutMouseFn      = unsafe { nil }
	on_scroll         CanvasLayoutScrollFn     = unsafe { nil }
	on_mouse_move     CanvasLayoutMouseMoveFn  = unsafe { nil }
	on_mouse_enter    CanvasLayoutMouseMoveFn  = unsafe { nil }
	on_mouse_leave    CanvasLayoutMouseMoveFn  = unsafe { nil }
	// resize_fn     ResizeFn
	on_key_down        CanvasLayoutKeyFn      = unsafe { nil }
	on_char            CanvasLayoutKeyFn      = unsafe { nil }
	full_size_fn       CanvasLayoutSizeFn     = unsafe { nil }
	on_bounding_change CanvasLayoutBoundingFn = unsafe { nil }
	on_scroll_change   ScrollViewChangedFn    = ScrollViewChangedFn(0)
	on_delegate        CanvasLayoutDelegateFn = unsafe { nil }
	children           []Widget
}

#struct ColumnParams

params
pub struct ColumnParams {
	id        string
	width     int // To remove soon
	height    int // To remove soon
	alignment HorizontalAlignment
	spacing   f64 // Size = Size(0.0) // Spacing = Spacing(0) // int
	spacings  []f64 = []f64{}
	stretch   bool // to remove ui.stretch doing the job from parent
	margin    Margin
	margin_   f64
	// children related
	widths     Size //[]f64 // children sizes
	heights    Size //[]f64
	alignments HorizontalAlignments
	align      Alignments
	bg_color   gx.Color = no_color
	bg_radius  f64
	title      string
	scrollview bool
	clipping   bool
	children   []Widget
}

#struct Group

heap
pub struct Group {
pub mut:
	id            string
	title         string
	height        int
	width         int
	x             int
	y             int
	offset_x      int
	offset_y      int
	z_index       int
	is_focused    bool
	parent        Layout = empty_stack
	ui            &UI    = unsafe { nil }
	children      []Widget
	margin_left   int = 5
	margin_top    int = 10
	margin_right  int = 5
	margin_bottom int = 5
	spacing       int = 5
	adj_height    int
	adj_width     int
	hidden        bool
	clipping      bool
	// component state for composable widget
	component voidptr
	// debug stuff to be removed
	debug_ids []string
}

#fn (&Group) init

fn (mut g &Group) init(parent Layout)

#fn (&Group) cleanup

manualfree
fn (mut g &Group) cleanup()

#fn (&Group) free

unsafe
fn (g &Group) free()

#fn (&Group) decode_size

fn (mut g &Group) decode_size()

#fn (&Group) set_pos

fn (mut g &Group) set_pos(x int, y int)

#fn (&Group) calculate_child_positions

fn (mut g &Group) calculate_child_positions()

#fn (&Group) draw

fn (mut g &Group) draw()

#fn (&Group) draw_device

fn (mut g &Group) draw_device(mut d &DrawDevice)

#fn (&Group) point_inside

fn (g &Group) point_inside(x f64, y f64) bool

#fn (&Group) set_visible

fn (mut g &Group) set_visible(state bool)

#fn (&Group) get_ui

fn (g &Group) get_ui() &UI

#fn (&Group) resize

fn (g &Group) resize(width int, height int)

#fn (&Group) get_subscriber

fn (g &Group) get_subscriber() &eventbus.Subscriber

#fn (&Group) set_adjusted_size

fn (mut g &Group) set_adjusted_size(i int, ui &UI)

#fn (&Group) adj_size

fn (g &Group) adj_size() (int, int)

#fn (&Group) propose_size

fn (mut g &Group) propose_size(w int, h int) (int, int)

#fn (&Group) size

fn (g &Group) size() (int, int)

#fn (&Group) get_children

fn (g &Group) get_children() []Widget

#fn (&Group) update_layout

fn (g &Group) update_layout()

#struct GroupParams

params
pub struct GroupParams {
pub mut:
	id       string
	title    string
	x        int
	y        int
	width    int
	height   int
	spacing  int = 5
	clipping bool
	children []Widget
}

#struct RowParams

params
pub struct RowParams {
pub:
	id        string
	width     int
	height    int
	alignment VerticalAlignment
	spacing   f64
	spacings  []f64 = []f64{} // Size = Size(0.0) // Spacing = Spacing(0) // int
	stretch   bool
	margin_   f64
	margin    Margin
	// children related
	widths     Size //[]f64 // children sizes
	heights    Size //[]f64
	align      Alignments
	alignments VerticalAlignments
	bg_color   gx.Color = no_color
	bg_radius  f64
	title      string
	scrollview bool
	clipping   bool
	children   []Widget
}

#struct ListBox

heap
pub struct ListBox {
pub mut:
	height        int
	width         int
	x             int
	y             int
	offset_x      int
	offset_y      int
	z_index       int
	parent        Layout      = empty_stack
	ui            &UI         = unsafe { nil }
	items         []&ListItem = []&ListItem{}
	selection     int = -1
	selectable    bool
	multi         bool
	hovering      int = -1
	draw_count    int
	on_change     ListBoxFn = ListBoxFn(0)
	is_focused    bool
	item_height   int = listbox_item_height
	text_offset_y int = listbox_text_offset_y
	id            string
	// TODO
	draw_lines     bool
	color_disabled gx.Color = listbox_color_disabled
	// Style
	theme_style  string
	style        ListBoxShapeStyle
	style_params ListBoxStyleParams
	// text styles
	text_styles TextStyles
	text_size   f64
	hidden      bool
	clipping    bool
	// files droped
	files_droped bool
	// ordered
	ordered      bool
	just_dragged bool
	// drag drop types for compatibility
	drag_type  string   = 'lb'
	drop_types []string = ['lb']
	// guess adjusted width
	adj_width  int
	adj_height int
	// component state for composable widget
	component voidptr
	// scrollview
	has_scrollview   bool
	scrollview       &ScrollView = unsafe { nil }
	on_scroll_change ScrollViewChangedFn = ScrollViewChangedFn(0)
}

#fn (&ListBox) init

fn (mut lb &ListBox) init(parent Layout)

#fn (&ListBox) cleanup

manualfree
fn (mut lb &ListBox) cleanup()

#fn (&ListBox) free

unsafe
fn (lb &ListBox) free()

#fn (&ListBox) init_style

fn (mut lb &ListBox) init_style()

#fn (&ListBox) init_items

fn (mut lb &ListBox) init_items()

#fn (&ListBox) reset

fn (mut lb &ListBox) reset()

#fn (&ListBox) update_items

fn (mut lb &ListBox) update_items(items []string)

#fn (&ListBox) add_item

fn (mut lb &ListBox) add_item(id string, text string)

#fn (&ListBox) append_item

fn (mut lb &ListBox) append_item(id string, text string, draw_to int)

#fn (&ListBox) delete_item

fn (mut lb &ListBox) delete_item(id string)

#fn (&ListBox) delete_at

fn (mut lb &ListBox) delete_at(i int)

#fn (&ListBox) insert_at

fn (mut lb &ListBox) insert_at(i int, item &ListItem)

#fn (&ListBox) move_by

fn (mut lb &ListBox) move_by(i int, delta int)

#fn (&ListBox) is_selected

fn (lb &ListBox) is_selected() bool

#fn (&ListBox) is_item_selected_at

fn (lb &ListBox) is_item_selected_at(inx int) bool

#fn (&ListBox) is_item_selected

fn (lb &ListBox) is_item_selected(li &ListItem) bool

#fn (&ListBox) set_item_selected

fn (mut lb &ListBox) set_item_selected(inx int, enable_mode bool) bool

#fn (&ListBox) is_item_enabled_at

fn (lb &ListBox) is_item_enabled_at(inx int) bool

#fn (&ListBox) ids

fn (lb &ListBox) ids() []string

#fn (&ListBox) values

fn (lb &ListBox) values() []string

#fn (&ListBox) indices

fn (lb &ListBox) indices() []int

#fn (&ListBox) selected

fn (lb &ListBox) selected() !(string, string)

Returns the id and the text of the selected item

#fn (&ListBox) selected_item

fn (lb &ListBox) selected_item() (string, string)

Returns id and text of the selected item. Empty id means that there is no selection.

#fn (&ListBox) items

fn (lb &ListBox) items() []&ListItem

#fn (&ListBox) selected_at

fn (lb &ListBox) selected_at() !int

Returns the index of the selected item

#fn (&ListBox) selected_item_at

fn (lb &ListBox) selected_item_at() int

Returns the index of the selected item and -1 if no selection.

#fn (&ListBox) set_text

fn (mut lb &ListBox) set_text(id string, text string)

#fn (&ListBox) clear

manualfree
fn (mut lb &ListBox) clear()

#fn (&ListBox) get_selected_item

fn (lb &ListBox) get_selected_item(y int) int

#fn (&ListBox) current_pos

fn (lb &ListBox) current_pos(y int) int

#fn (&ListBox) visible_items

fn (lb &ListBox) visible_items() (int, int)

#fn (&ListBox) draw

fn (mut lb &ListBox) draw()

#fn (&ListBox) draw_device

fn (mut lb &ListBox) draw_device(mut d &DrawDevice)

#fn (&ListBox) get_draw_to

fn (mut lb &ListBox) get_draw_to(text string) int

#fn (&ListBox) point_inside

fn (lb &ListBox) point_inside(x f64, y f64) bool

#fn (&ListBox) call_on_change

fn (lb &ListBox) call_on_change()

#fn (&ListBox) set_pos

fn (mut lb &ListBox) set_pos(x int, y int)

#fn (&ListBox) set_visible

fn (mut lb &ListBox) set_visible(state bool)

#fn (&ListBox) focus

fn (mut lb &ListBox) focus()

#fn (&ListBox) unfocus

fn (mut lb &ListBox) unfocus()

#fn (&ListBox) adj_size

fn (mut lb &ListBox) adj_size() (int, int)

Needed for ScrollableWidget

#fn (&ListBox) update_adj_size

fn (mut lb &ListBox) update_adj_size()

#fn (&ListBox) init_size

fn (mut lb &ListBox) init_size()

#fn (&ListBox) size

fn (lb &ListBox) size() (int, int)

#fn (&ListBox) propose_size

fn (mut lb &ListBox) propose_size(w int, h int) (int, int)

#fn (&ListBox) resize

fn (mut lb &ListBox) resize(width int, height int)

#fn (&ListBox) set_children_pos

fn (lb &ListBox) set_children_pos()

Normally useless but required for scrollview_draw_begin()

#fn (&ListBox) has_dragger_active_at

fn (lb &ListBox) has_dragger_active_at(inx int) bool

#fn (&ListBox) has_dragger_active

fn (lb &ListBox) has_dragger_active() bool

#fn (&ListBox) fit_at

fn (lb &ListBox) fit_at(at int) int

#fn (&ListBox) load_style

fn (mut lb &ListBox) load_style()

#fn (&ListBox) update_theme_style

fn (mut lb &ListBox) update_theme_style(theme string)

#fn (&ListBox) update_style

fn (mut lb &ListBox) update_style(p ListBoxStyleParams)

#fn (&ListBox) update_shape_theme_style

fn (mut lb &ListBox) update_shape_theme_style(lbs ListBoxStyle)

#fn (&ListBox) update_shape_style

fn (mut lb &ListBox) update_shape_style(p ListBoxStyleParams)

#fn (&ListBox) update_style_params

fn (mut lb &ListBox) update_style_params(p ListBoxStyleParams)

#struct ListBoxParams

params
pub struct ListBoxParams {
	ListBoxStyleParams
mut:
	x             int
	y             int
	width         int
	height        int
	z_index       int
	on_change     ListBoxFn = ListBoxFn(0)
	item_height   int       = listbox_item_height
	text_offset_y int       = listbox_text_offset_y
	id            string // To use one callback for multiple ListBoxes
	// TODO
	draw_lines bool // Draw a rectangle around every item?
	theme      string = no_style
	// related to text drawing
	text_size  f64
	selection  int  = -1
	selectable bool = true
	multi      bool
	scrollview bool = true
	items      map[string]string
	// files droped
	files_droped bool
	// ordered
	ordered bool
}

#fn (&Menu) build

fn (mut m &Menu) build(mut win &Window)

#fn (&Menu) init

fn (mut m &Menu) init(parent Layout)

#fn (&Menu) cleanup

manualfree
fn (mut m &Menu) cleanup()

#fn (&Menu) free

unsafe
fn (m &Menu) free()

#fn (&Menu) is_root_menu

fn (m &Menu) is_root_menu() bool

#fn (&Menu) is_top_layer_menu

fn (m &Menu) is_top_layer_menu() bool

#fn (&Menu) propagate_connection

fn (mut m &Menu) propagate_connection()

#fn (&Menu) set_pos

fn (mut m &Menu) set_pos(x int, y int)

#fn (&Menu) update_size

fn (mut m &Menu) update_size()

#fn (&Menu) size

fn (mut m &Menu) size() (int, int)

#fn (&Menu) propose_size

fn (mut m &Menu) propose_size(w int, h int) (int, int)

#fn (&Menu) draw

fn (mut m &Menu) draw()

#fn (&Menu) draw_device

fn (mut m &Menu) draw_device(mut d &DrawDevice)

#fn (&Menu) add_item

fn (mut m &Menu) add_item(p MenuItemParams)

#fn (&Menu) set_visible

fn (mut m &Menu) set_visible(state bool)

#fn (&Menu) set_children_visible

fn (mut m &Menu) set_children_visible(state bool)

#fn (&Menu) set_all_children_visible

fn (mut m &Menu) set_all_children_visible(state bool)

#fn (&Menu) close

fn (mut m &Menu) close()

#fn (&Menu) point_inside

fn (m &Menu) point_inside(x f64, y f64) bool

#fn (&Menu) set_text

fn (mut m &Menu) set_text(s string)

#fn (&Menu) show_all_states

fn (m &Menu) show_all_states()

#fn (&Menu) load_style

fn (mut m &Menu) load_style()

#fn (&Menu) update_theme_style

fn (mut m &Menu) update_theme_style(theme string)

#fn (&Menu) update_style

fn (mut m &Menu) update_style(p MenuStyleParams)

#fn (&Menu) update_shape_theme_style

fn (mut m &Menu) update_shape_theme_style(ms MenuStyle)

#fn (&Menu) update_shape_style

fn (mut m &Menu) update_shape_style(p MenuStyleParams)

#fn (&Menu) update_style_params

fn (mut m &Menu) update_style_params(p MenuStyleParams)

#fn (&MenuItem) build

fn (mut mi &MenuItem) build(mut win &Window)

#fn (&MenuItem) set_menu_root_menu

fn (mut mi &MenuItem) set_menu_root_menu()

#fn (&MenuItem) has_menu

fn (mi &MenuItem) has_menu() bool

#fn (&MenuItem) set_menu

fn (mut mi &MenuItem) set_menu(state bool)

#fn (&MenuItem) set_menu_visible

fn (mut mi &MenuItem) set_menu_visible(state bool)

#fn (&MenuItem) set_menu_pos

fn (mut mi &MenuItem) set_menu_pos()

#struct Picture

heap
pub struct Picture {
pub mut:
	id       string
	offset_x int
	offset_y int
	hidden   bool
	// component state for composable widget
	component voidptr
	width     int
	height    int
mut:
	text      string
	parent    Layout = empty_stack
	x         int
	y         int
	z_index   int
	movable   bool
	drag_type string = 'pic'
	path      string
	ui        &UI = unsafe { nil }
	image     gg.Image
	on_click  PictureFn
	use_cache bool
	tooltip   TooltipMessage
}

#fn (&Picture) init

fn (mut pic &Picture) init(parent Layout)

#fn (&Picture) cleanup

manualfree
fn (mut p &Picture) cleanup()

#fn (&Picture) free

unsafe
fn (p &Picture) free()

#fn (&Picture) set_pos

fn (mut pic &Picture) set_pos(x int, y int)

#fn (&Picture) size

fn (pic &Picture) size() (int, int)

#fn (&Picture) propose_size

fn (mut pic &Picture) propose_size(w int, h int) (int, int)

#fn (&Picture) draw

fn (mut pic &Picture) draw()

#fn (&Picture) draw_device

fn (mut pic &Picture) draw_device(mut d &DrawDevice)

#fn (&Picture) set_visible

fn (mut pic &Picture) set_visible(state bool)

#fn (&Picture) point_inside

fn (pic &Picture) point_inside(x f64, y f64) bool

#fn (&Picture) get_window

fn (pic &Picture) get_window() &Window

method implemented in Draggable

#fn (&Picture) drag_type

fn (pic &Picture) drag_type() string

#fn (&Picture) drag_bounds

fn (pic &Picture) drag_bounds() gg.Rect

#struct PictureParams

params
pub struct PictureParams {
	id           string
	path         string
	width        int
	height       int
	z_index      int
	movable      bool
	on_click     PictureFn
	use_cache    bool     = true
	ref          &Picture = unsafe { nil }
	image        gg.Image
	tooltip      string
	tooltip_side Side = .top
}

#struct ProgressBar

heap
pub struct ProgressBar {
pub mut:
	id       string
	height   int
	width    int
	x        int
	y        int
	offset_x int
	offset_y int
	z_index  int
	parent   Layout = empty_stack
	ui       &UI    = unsafe { nil }
	val      int
	min      int
	max      int
	hidden   bool
	// Style
	theme_style  string
	style        ProgressBarStyle
	style_params ProgressBarStyleParams
	// component state for composable widget
	component voidptr
}

#fn (&ProgressBar) init

fn (mut pb &ProgressBar) init(parent Layout)

#fn (&ProgressBar) cleanup

manualfree
fn (mut pb &ProgressBar) cleanup()

#fn (&ProgressBar) free

unsafe
fn (pb &ProgressBar) free()

#fn (&ProgressBar) set_pos

fn (mut pb &ProgressBar) set_pos(x int, y int)

#fn (&ProgressBar) size

fn (mut pb &ProgressBar) size() (int, int)

#fn (&ProgressBar) propose_size

fn (mut pb &ProgressBar) propose_size(w int, h int) (int, int)

#fn (&ProgressBar) draw

fn (mut pb &ProgressBar) draw()

#fn (&ProgressBar) draw_device

fn (mut pb &ProgressBar) draw_device(mut d &DrawDevice)

#fn (&ProgressBar) point_inside

fn (pb &ProgressBar) point_inside(x f64, y f64) bool

#fn (&ProgressBar) set_visible

fn (mut pb &ProgressBar) set_visible(state bool)

#fn (&ProgressBar) load_style

fn (mut pb &ProgressBar) load_style()

#fn (&ProgressBar) update_theme_style

fn (mut pb &ProgressBar) update_theme_style(theme string)

#fn (&ProgressBar) update_style

fn (mut pb &ProgressBar) update_style(p ProgressBarStyleParams)

#struct ProgressBarParams

params
pub struct ProgressBarParams {
	ProgressBarStyleParams
	id      string
	width   int
	height  int = 16
	z_index int
	min     int
	max     int
	val     int
	theme   string = no_style
}

#struct Radio

heap
pub struct Radio {
pub mut:
	id             string
	selected_index int
	values         []string
	// state      RadioState
	title string
	// items sizes except for compact mode where width is the full size
	height int
	width  int
	// real sizes (returned by size()) which is a sort of cached sizes to avoid recomputation
	real_height int = 20
	real_width  int
	// items widths for compact mode
	widths []int
	// adjusted sizes that fit the items contents
	adj_height int
	adj_width  int
	x          int
	y          int
	offset_x   int
	offset_y   int
	z_index    int
	parent     Layout = empty_stack
	is_focused bool
	is_checked bool
	ui         &UI = unsafe { nil }
	// Style
	theme_style  string
	style        RadioShapeStyle
	style_params RadioStyleParams
	// text styles
	text_styles TextStyles
	// text_size   f64
	hidden     bool
	horizontal bool
	compact    bool
	// component state for composable widget
	component voidptr
	// selected_value string
	on_click RadioFn
}

#fn (&Radio) init

fn (mut r &Radio) init(parent Layout)

#fn (&Radio) cleanup

manualfree
fn (mut r &Radio) cleanup()

#fn (&Radio) free

unsafe
fn (r &Radio) free()

#fn (&Radio) set_pos

fn (mut r &Radio) set_pos(x int, y int)

#fn (&Radio) size

fn (r &Radio) size() (int, int)

#fn (&Radio) propose_size

fn (mut r &Radio) propose_size(w int, h int) (int, int)

#fn (&Radio) set_size_from_values

fn (mut r &Radio) set_size_from_values()

#fn (&Radio) update_size

fn (mut r &Radio) update_size()

#fn (&Radio) draw

fn (mut r &Radio) draw()

#fn (&Radio) draw_device

fn (mut r &Radio) draw_device(mut d &DrawDevice)

#fn (&Radio) point_inside

fn (r &Radio) point_inside(x f64, y f64) bool

#fn (&Radio) set_visible

fn (mut r &Radio) set_visible(state bool)

#fn (&Radio) focus

fn (mut r &Radio) focus()

#fn (&Radio) unfocus

fn (mut r &Radio) unfocus()

#fn (&Radio) selected_value

fn (r &Radio) selected_value() string

#fn (&Radio) select_next_value

fn (mut r &Radio) select_next_value()

#fn (&Radio) select_prev_value

fn (mut r &Radio) select_prev_value()

#fn (&Radio) load_style

fn (mut r &Radio) load_style()

#fn (&Radio) update_theme_style

fn (mut r &Radio) update_theme_style(theme string)

#fn (&Radio) update_style

fn (mut r &Radio) update_style(p RadioStyleParams)

#fn (&Radio) update_shape_theme_style

fn (mut r &Radio) update_shape_theme_style(rs RadioStyle)

#fn (&Radio) update_shape_style

fn (mut r &Radio) update_shape_style(p RadioStyleParams)

#fn (&Radio) update_style_params

fn (mut r &Radio) update_style_params(p RadioStyleParams)

#struct RadioParams

params
pub struct RadioParams {
	RadioStyleParams
	id       string
	on_click RadioFn
	values   []string
	title    string
	width    int
	z_index  int
	// ref       &Radio = voidptr(0)
	horizontal bool
	compact    bool
	theme      string = no_style
}

#struct Rectangle

heap
pub struct Rectangle {
pub mut:
	id string
	// color    gx.Color
	text     string
	offset_x int
	offset_y int
	height   int
	width    int
	ui       &UI    = unsafe { nil }
	parent   Layout = empty_stack
	// Style
	theme_style  string
	style        RectangleShapeStyle
	style_params RectangleStyleParams
	// text styles
	text_styles TextStyles
	// text_size   f64
	// component state for composable widget
	component voidptr
mut:
	x       int
	y       int
	z_index int
	radius  int
	border  bool
	// border_color gx.Color
	hidden bool
}

#fn (&Rectangle) init

fn (mut r &Rectangle) init(parent Layout)

#fn (&Rectangle) cleanup

manualfree
fn (mut r &Rectangle) cleanup()

#fn (&Rectangle) free

unsafe
fn (r &Rectangle) free()

#fn (&Rectangle) set_pos

fn (mut r &Rectangle) set_pos(x int, y int)

#fn (&Rectangle) size

fn (mut r &Rectangle) size() (int, int)

#fn (&Rectangle) propose_size

fn (mut r &Rectangle) propose_size(w int, h int) (int, int)

#fn (&Rectangle) draw

fn (mut r &Rectangle) draw()

#fn (&Rectangle) draw_device

fn (mut r &Rectangle) draw_device(mut d &DrawDevice)

#fn (&Rectangle) set_visible

fn (mut r &Rectangle) set_visible(state bool)

#fn (&Rectangle) point_inside

fn (r &Rectangle) point_inside(x f64, y f64) bool

#fn (&Rectangle) load_style

fn (mut rect &Rectangle) load_style()

#fn (&Rectangle) update_theme_style

fn (mut rect &Rectangle) update_theme_style(theme string)

#fn (&Rectangle) update_style

fn (mut rect &Rectangle) update_style(p RectangleStyleParams)

#fn (&Rectangle) update_shape_theme_style

fn (mut rect &Rectangle) update_shape_theme_style(rects RectangleStyle)

#fn (&Rectangle) update_shape_style

fn (mut rect &Rectangle) update_shape_style(p RectangleStyleParams)

#fn (&Rectangle) update_style_params

fn (mut rect &Rectangle) update_style_params(p RectangleStyleParams)

#struct RectangleParams

params
pub struct RectangleParams {
	RectangleStyleParams
	id      string
	text    string
	height  int
	width   int
	z_index int
	// color        gx.Color = gx.Color{0, 0, 0, 0}
	radius int
	border bool
	// border_color gx.Color = gx.Color{
	// 	r: 180
	// 	g: 180
	// 	b: 190
	// }
	x int
	y int
	// text_size f64
	theme string = no_style
}

#struct Slider

heap
pub struct Slider {
pub mut:
	id                   string
	height               int // track width
	width                int // track height
	thumb_width          int
	thumb_height         int
	slider_size          int // fixed size (width) of the slider
	orientation          Orientation
	x                    int
	y                    int
	offset_x             int
	offset_y             int
	z_index              int
	parent               Layout = empty_stack
	ui                   &UI    = unsafe { nil }
	val                  f32
	min                  int
	max                  int = 100
	is_focused           bool
	dragging             bool
	on_value_changed     SliderFn
	focus_on_thumb_only  bool
	rev_min_max_pos      bool
	thumb_in_track       bool
	track_line_displayed bool
	entering             bool
	hidden               bool
	radius               int
	// Style
	theme_style  string
	style        SliderStyle
	style_params SliderStyleParams
	// component state for composable widget
	component voidptr
}

#fn (&Slider) init

fn (mut s &Slider) init(parent Layout)

#fn (&Slider) cleanup

manualfree
fn (mut s &Slider) cleanup()

#fn (&Slider) free

unsafe
fn (s &Slider) free()

#fn (&Slider) set_pos

fn (mut s &Slider) set_pos(x int, y int)

#fn (&Slider) set_thumb_size

fn (mut s &Slider) set_thumb_size()

#fn (&Slider) size

fn (mut s &Slider) size() (int, int)

#fn (&Slider) propose_size

fn (mut s &Slider) propose_size(w int, h int) (int, int)

#fn (&Slider) draw

fn (mut s &Slider) draw()

#fn (&Slider) draw_device

fn (mut s &Slider) draw_device(mut d &DrawDevice)

#fn (&Slider) draw_device_thumb

fn (s &Slider) draw_device_thumb(d DrawDevice)

TODO to simplify (seems a bit too complex)

#fn (&Slider) point_inside

fn (s &Slider) point_inside(x f64, y f64) bool

#fn (&Slider) point_inside_thumb

fn (s &Slider) point_inside_thumb(x f64, y f64) bool

#fn (&Slider) change_value

fn (mut s &Slider) change_value(x int, y int)

#fn (&Slider) set_visible

fn (mut s &Slider) set_visible(state bool)

#fn (&Slider) focus

fn (mut s &Slider) focus()

#fn (&Slider) unfocus

fn (mut s &Slider) unfocus()

#fn (&Slider) load_style

fn (mut s &Slider) load_style()

#fn (&Slider) update_theme_style

fn (mut s &Slider) update_theme_style(theme string)

#fn (&Slider) update_style

fn (mut s &Slider) update_style(p SliderStyleParams)

#struct SliderParams

params
pub struct SliderParams {
	SliderStyleParams
	id                   string
	width                int
	height               int
	slider_size          int = 10
	z_index              int
	min                  int
	max                  int
	val                  f32
	orientation          Orientation
	theme                string = no_style
	radius               int    = 5
	on_value_changed     SliderFn
	focus_on_thumb_only  bool = true
	rev_min_max_pos      bool
	thumb_in_track       bool
	track_line_displayed bool = true
	entering             bool
}

#struct Stack

heap
pub struct Stack {
	cache CachedSizes
pub mut:
	id                   string
	offset_x             int
	offset_y             int
	x                    int
	y                    int
	width                int
	height               int
	z_index              int
	deactivated          bool
	parent               Layout = empty_stack
	ui                   &UI    = unsafe { nil }
	vertical_alignment   VerticalAlignment
	horizontal_alignment HorizontalAlignment
	spacings             []f32 // []int // int
	stretch              bool
	direction            Direction
	margins              Margins
	real_x               int = -1
	real_y               int = -1
	real_width           int
	real_height          int
	adj_width            int
	adj_height           int
	fixed_width          int
	fixed_height         int
	title                string
	// children related
	children              []Widget
	drawing_children      []Widget
	widths                []f32 // children sizes
	heights               []f32
	vertical_alignments   VerticalAlignments // Flexible alignments by index overriding alignment.
	horizontal_alignments HorizontalAlignments
	alignments            Alignments
	hidden                bool
	clipping              bool
	is_root_layout        bool = true
	// Style
	theme_style  string
	style        StackShapeStyle
	style_params StackStyleParams
	// text styles
	text_styles TextStyles
	// component state for composable widget
	component voidptr
	on_build  BuildFn
	on_init   InitFn
	// scrollview
	has_scrollview   bool
	scrollview       &ScrollView = unsafe { nil }
	on_scroll_change ScrollViewChangedFn = ScrollViewChangedFn(0)
	// debug stuff to be removed
	debug_ids          []string
	debug_children_ids []string
}

#fn (&Stack) build

fn (mut s &Stack) build(win &Window)

#fn (&Stack) init

fn (mut s &Stack) init(parent Layout)

#fn (&Stack) set_root_layout

fn (mut s &Stack) set_root_layout()

Determine wheither Stack s is a root layout

#fn (&Stack) cleanup

manualfree
fn (mut s &Stack) cleanup()

#fn (&Stack) free

unsafe
fn (s &Stack) free()

#fn (&Stack) update_layout

fn (mut s &Stack) update_layout()

used inside window.update_layout()

#fn (&Stack) update_layout_without_pos

fn (mut s &Stack) update_layout_without_pos()

#fn (&Stack) init_size

fn (mut s &Stack) init_size()

#fn (&Stack) set_children_sizes

fn (mut s &Stack) set_children_sizes()

#fn (&Stack) children_sizes

fn (mut s &Stack) children_sizes() ([]int, []int)

#fn (&Stack) set_cache_sizes

fn (mut s &Stack) set_cache_sizes()

#fn (&Stack) default_sizes

fn (mut s &Stack) default_sizes()

default values for s.widths and s.heights

#fn (&Stack) adj_size

fn (s &Stack) adj_size() (int, int)

#fn (&Stack) propose_size

fn (mut s &Stack) propose_size(w int, h int) (int, int)

#fn (&Stack) size

fn (s &Stack) size() (int, int)

#fn (&Stack) free_size

fn (s &Stack) free_size() (int, int)

#fn (&Stack) set_adjusted_size

fn (mut s &Stack) set_adjusted_size(i int, force bool, gui &UI)

#fn (&Stack) update_pos

fn (mut s &Stack) update_pos()

#fn (&Stack) set_pos

fn (mut s &Stack) set_pos(x int, y int)

#fn (&Stack) set_children_pos

fn (mut s &Stack) set_children_pos()

#fn (&Stack) set_child_pos

fn (s &Stack) set_child_pos(mut child &Widget, i int, x int, y int)

#fn (&Stack) get_subscriber

fn (s &Stack) get_subscriber() &eventbus.Subscriber

#fn (&Stack) set_children_visible

fn (mut s &Stack) set_children_visible(state bool, children []int)

#fn (&Stack) set_children_depth

fn (mut s &Stack) set_children_depth(z_index int, children []int)

#fn (&Stack) set_drawing_children

fn (mut s &Stack) set_drawing_children()

#fn (&Stack) draw

fn (mut s &Stack) draw()

#fn (&Stack) draw_device

fn (mut s &Stack) draw_device(mut d &DrawDevice)

#fn (&Stack) margin

fn (s &Stack) margin(side Side) int

#fn (&Stack) spacing

fn (s &Stack) spacing(i int) int

#fn (&Stack) total_spacing

fn (s &Stack) total_spacing() int

#fn (&Stack) get_ui

fn (s &Stack) get_ui() &UI

#fn (&Stack) point_inside

fn (s &Stack) point_inside(x f64, y f64) bool

#fn (&Stack) set_visible

fn (mut s &Stack) set_visible(state bool)

#fn (&Stack) resize

fn (mut s &Stack) resize(width int, height int)

#fn (&Stack) get_children

fn (s &Stack) get_children() []Widget

#fn (&Stack) set_children

fn (mut s &Stack) set_children(c []Widget)

#fn (&Stack) get_vertical_alignment

fn (s &Stack) get_vertical_alignment(i int) VerticalAlignment

#fn (&Stack) get_horizontal_alignment

fn (s &Stack) get_horizontal_alignment(i int) HorizontalAlignment

#fn (&Stack) add

fn (mut s &Stack) add(cfg_ ChildrenParams)

#fn (&Stack) remove

fn (mut s &Stack) remove(cfg ChildrenParams)

#fn (&Stack) move

fn (mut s &Stack) move(cfg ChildrenParams)

#fn (&Stack) update_widths

fn (mut s &Stack) update_widths(cfg ChildrenParams, mode ChildUpdateType)

#fn (&Stack) update_heights

fn (mut s &Stack) update_heights(cfg ChildrenParams, mode ChildUpdateType)

#fn (&Stack) update_spacings

fn (mut s &Stack) update_spacings(cfg ChildrenParams, mode ChildUpdateType)

#fn (&Stack) child

fn (s &Stack) child(from []int) Widget

#fn (&Stack) transpose

fn (mut s &Stack) transpose(size bool)

#fn (&Stack) register_child

fn (mut s &Stack) register_child(child Widget)

#fn (&Stack) child_index_by_id

fn (s &Stack) child_index_by_id(id string) int

#fn (&Stack) get_window

fn (s &Stack) get_window() &Window

method implemented in Draggable

#fn (&Stack) load_style

fn (mut l &Stack) load_style()

#fn (&Stack) update_theme_style

fn (mut l &Stack) update_theme_style(theme string)

#fn (&Stack) update_style

fn (mut l &Stack) update_style(p StackStyleParams)

#fn (&Stack) update_shape_theme_style

fn (mut l &Stack) update_shape_theme_style(ls StackStyle)

#fn (&Stack) update_shape_style

fn (mut l &Stack) update_shape_style(p StackStyleParams)

#fn (&Stack) update_style_params

fn (mut l &Stack) update_style_params(p StackStyleParams)

#fn (&Stack) sorted_drawing_children

fn (mut s &Stack) sorted_drawing_children()

#struct ChildrenParams

params
pub struct ChildrenParams {
mut:
	// add or remove or migrate
	at      int  = -1
	widths  Size = Size(-1.0)
	heights Size = Size(-1.0)
	// add or move or migrate
	spacing  f64    = -1.0
	spacings []f64  = []f64{}
	child    Widget = empty_stack
	children []Widget
	// move or migrate
	from int = -1
	to   int = -1
	// migrate
	target          &Stack = unsafe { nil }
	target_widths   Size   = Size(-1.0)
	target_heights  Size   = Size(-1.0)
	target_spacing  f64    = -1.0
	target_spacings []f64  = []f64{}
}

**** ChildrenParams *****

#struct CheckBoxShapeStyle

pub struct CheckBoxShapeStyle {
pub mut:
	check_mode   string   = 'check' // or "check_white" and maybe one day "square" and "square_white"
	border_color gx.Color = cb_border_color
	bg_color     gx.Color = gx.white
}

#struct CheckBoxStyle

pub struct CheckBoxStyle {
	CheckBoxShapeStyle // text_style TextStyle
pub mut:
	text_font_name      string = 'system'
	text_color          gx.Color
	text_size           int = 16
	text_align          TextHorizontalAlign = .left
	text_vertical_align TextVerticalAlign   = .top
}

#fn (CheckBoxStyle) to_toml

fn (cbs CheckBoxStyle) to_toml() string

#fn (&CheckBoxStyle) from_toml

fn (mut cbs &CheckBoxStyle) from_toml(a toml.Any)

#struct CheckBoxStyleParams

params
pub struct CheckBoxStyleParams {
	WidgetTextStyleParams
mut:
	style        string   = no_style
	border_color gx.Color = no_color
	bg_color     gx.Color = no_color
	check_mode   string
}

#struct WidgetTextStyle

pub struct WidgetTextStyle {
pub mut:
	text_font_name      string = 'system'
	text_color          gx.Color
	text_size           int = 16
	text_align          TextHorizontalAlign = .center
	text_vertical_align TextVerticalAlign   = .middle
}

#struct WidgetTextStyleParams

params
pub struct WidgetTextStyleParams {
pub mut:
	// text_style TextStyle
	text_font_name      string
	text_color          gx.Color = no_color
	text_size           f64
	text_align          TextHorizontalAlign = .@none
	text_vertical_align TextVerticalAlign   = .@none
}

#struct LabelStyle

pub struct LabelStyle {
pub mut:
	text_font_name      string = 'system'
	text_color          gx.Color
	text_size           int = 16
	text_align          TextHorizontalAlign = .left
	text_vertical_align TextVerticalAlign   = .top
}

#fn (LabelStyle) to_toml

fn (ls LabelStyle) to_toml() string

#fn (&LabelStyle) from_toml

fn (mut ls &LabelStyle) from_toml(a toml.Any)

#struct LabelStyleParams

pub struct LabelStyleParams {
	WidgetTextStyleParams
pub mut:
	style string = no_style
}

#struct CanvasLayoutShapeStyle

pub struct CanvasLayoutShapeStyle {
pub mut:
	bg_radius f32
	bg_color  gx.Color = no_color
}

#struct CanvasLayoutStyle

pub struct CanvasLayoutStyle {
	CanvasLayoutShapeStyle // text_style TextStyle
pub mut:
	text_font_name      string = 'system'
	text_color          gx.Color
	text_size           int = 16
	text_align          TextHorizontalAlign = .left
	text_vertical_align TextVerticalAlign   = .top
}

#fn (CanvasLayoutStyle) to_toml

fn (ls CanvasLayoutStyle) to_toml() string

#fn (&CanvasLayoutStyle) from_toml

fn (mut ls &CanvasLayoutStyle) from_toml(a toml.Any)

#struct CanvasLayoutStyleParams

params
pub struct CanvasLayoutStyleParams {
	WidgetTextStyleParams
pub mut:
	style     string = no_style
	bg_radius f32
	bg_color  gx.Color = no_color
}

#struct StackShapeStyle

pub struct StackShapeStyle {
pub mut:
	bg_radius f32
	bg_color  gx.Color = no_color
}

#struct StackStyle

pub struct StackStyle {
	StackShapeStyle // text_style TextStyle
pub mut:
	text_font_name      string = 'system'
	text_color          gx.Color
	text_size           int = 16
	text_align          TextHorizontalAlign = .left
	text_vertical_align TextVerticalAlign   = .top
}

#fn (StackStyle) to_toml

fn (ls StackStyle) to_toml() string

#fn (&StackStyle) from_toml

fn (mut ls &StackStyle) from_toml(a toml.Any)

#struct StackStyleParams

params
pub struct StackStyleParams {
pub mut:
	style     string = no_style
	bg_radius f32
	bg_color  gx.Color = no_color
	// text_style TextStyle
	text_font_name      string
	text_color          gx.Color = no_color
	text_size           f64
	text_align          TextHorizontalAlign = .@none
	text_vertical_align TextVerticalAlign   = .@none
}

#struct ListBoxShapeStyle

pub struct ListBoxShapeStyle {
pub mut:
	radius           f32
	border_color     gx.Color = gx.gray
	bg_color         gx.Color = gx.white
	bg_color_pressed gx.Color = gx.light_blue
	bg_color_hover   gx.Color = gx.light_gray
}

#struct ListBoxStyle

pub struct ListBoxStyle {
	ListBoxShapeStyle // text_style TextStyle
pub mut:
	text_font_name      string = 'system'
	text_color          gx.Color
	text_size           int = 16
	text_align          TextHorizontalAlign = .left
	text_vertical_align TextVerticalAlign   = .top
}

#fn (ListBoxStyle) to_toml

fn (lbs ListBoxStyle) to_toml() string

#fn (&ListBoxStyle) from_toml

fn (mut lbs &ListBoxStyle) from_toml(a toml.Any)

#struct ListBoxStyleParams

params
pub struct ListBoxStyleParams {
	WidgetTextStyleParams
mut:
	style            string = no_style
	radius           f32
	border_color     gx.Color = no_color
	bg_color         gx.Color = no_color
	bg_color_pressed gx.Color = no_color
	bg_color_hover   gx.Color = no_color
}

#fn (MenuStyle) to_toml

fn (ms MenuStyle) to_toml() string

#fn (&MenuStyle) from_toml

fn (mut ms &MenuStyle) from_toml(a toml.Any)

#struct ProgressBarStyle

pub struct ProgressBarStyle {
pub mut:
	color           gx.Color
	border_color    gx.Color
	bg_color        gx.Color
	bg_border_color gx.Color
}

#fn (ProgressBarStyle) to_toml

fn (pbs ProgressBarStyle) to_toml() string

#fn (&ProgressBarStyle) from_toml

fn (mut pbs &ProgressBarStyle) from_toml(a toml.Any)

#struct ProgressBarStyleParams

params
pub struct ProgressBarStyleParams {
pub mut:
	style           string   = no_style
	color           gx.Color = no_color
	border_color    gx.Color = no_color
	bg_color        gx.Color = no_color
	bg_border_color gx.Color = no_color
}

#struct RadioShapeStyle

pub struct RadioShapeStyle {
pub mut:
	radio_mode   string = 'radio' // or "radio_white" and maybe one day "square" and "square_white"
	border_color gx.Color
	bg_color     gx.Color = gx.white
}

#struct RadioStyle

pub struct RadioStyle {
	RadioShapeStyle // text_style TextStyle
pub mut:
	text_font_name      string = 'system'
	text_color          gx.Color
	text_size           int = 16
	text_align          TextHorizontalAlign = .left
	text_vertical_align TextVerticalAlign   = .top
}

#fn (RadioStyle) to_toml

fn (rs RadioStyle) to_toml() string

#fn (&RadioStyle) from_toml

fn (mut rs &RadioStyle) from_toml(a toml.Any)

#struct RadioStyleParams

params
pub struct RadioStyleParams {
	WidgetTextStyleParams
mut:
	style        string   = no_style
	border_color gx.Color = no_color
	bg_color     gx.Color = no_color
	radio_mode   string
}

#struct RectangleShapeStyle

pub struct RectangleShapeStyle {
pub mut:
	border_color gx.Color // = rect_border_color
	color        gx.Color = transparent
}

#struct RectangleStyle

pub struct RectangleStyle {
	RectangleShapeStyle // text_style TextStyle
pub mut:
	text_font_name      string = 'system'
	text_color          gx.Color
	text_size           int = 16
	text_align          TextHorizontalAlign = .left
	text_vertical_align TextVerticalAlign   = .top
}

#fn (RectangleStyle) to_toml

fn (rects RectangleStyle) to_toml() string

#fn (&RectangleStyle) from_toml

fn (mut rects &RectangleStyle) from_toml(a toml.Any)

#struct RectangleStyleParams

params
pub struct RectangleStyleParams {
	WidgetTextStyleParams
mut:
	style        string   = no_style
	border_color gx.Color = no_color
	color        gx.Color = no_color
}

#struct SliderStyle

pub struct SliderStyle {
pub mut:
	thumb_color             gx.Color = gx.rgb(87, 153, 245)
	bg_color                gx.Color = gx.rgb(219, 219, 219)
	bg_border_color         gx.Color = gx.rgb(191, 191, 191)
	focused_bg_border_color gx.Color = gx.rgb(255, 0, 0)
}

#fn (SliderStyle) to_toml

fn (ss SliderStyle) to_toml() string

#fn (&SliderStyle) from_toml

fn (mut ss &SliderStyle) from_toml(a toml.Any)

#struct SliderStyleParams

params
pub struct SliderStyleParams {
pub mut:
	style                   string   = no_style
	thumb_color             gx.Color = no_color
	bg_color                gx.Color = no_color
	bg_border_color         gx.Color = no_color
	focused_bg_border_color gx.Color = no_color
}

#struct TextBoxShapeStyle

pub struct TextBoxShapeStyle {
pub mut:
	bg_radius f32
	bg_color  gx.Color = gx.white
}

#struct TextBoxStyle

pub struct TextBoxStyle {
	TextBoxShapeStyle // text_style TextStyle
pub mut:
	text_font_name      string = 'system'
	text_color          gx.Color
	text_size           int = 16
	text_align          TextHorizontalAlign = .left
	text_vertical_align TextVerticalAlign   = .top
}

#fn (TextBoxStyle) to_toml

fn (ts TextBoxStyle) to_toml() string

#fn (&TextBoxStyle) from_toml

fn (mut ts &TextBoxStyle) from_toml(a toml.Any)

#struct TextBoxStyleParams

params
pub struct TextBoxStyleParams {
	WidgetTextStyleParams
pub mut:
	style     string = no_style
	bg_radius f32
	bg_color  gx.Color = no_color
}

#fn (&Style) to_toml

fn (s &Style) to_toml() string

#fn (&Style) as_toml_file

fn (s &Style) as_toml_file(path string)

#struct SubWindow

heap
pub struct SubWindow {
pub mut:
	id                    string
	x                     int
	y                     int
	z_index               int = sw_z_index
	z_index_children_orig []int
	offset_x              int
	offset_y              int
	hidden                bool
	ui                    &UI = unsafe { nil }
	// dragging
	drag         bool
	dragging     bool
	drag_mode    int // 0 = pos, 1 = size
	drag_xy_down [2]int
	drag_ltrb    [4]int
	// decoration
	decoration      bool
	border_dir      [2]int // direction border in x (possible values: -1, 0, 1, 10)
	prev_border_dir [2]int = [10, 10]!
	// main unique layout attached to the subwindow
	layout     Layout = empty_stack
	is_focused bool
	// related to wm
	is_top_wm bool
	parent    Layout = empty_stack
	// component state for composable widget
	component voidptr
}

#fn (&SubWindow) init

fn (mut s &SubWindow) init(parent Layout)

#fn (&SubWindow) cleanup

manualfree
fn (mut s &SubWindow) cleanup()

#fn (&SubWindow) draw

fn (mut s &SubWindow) draw()

#fn (&SubWindow) draw_device

fn (mut s &SubWindow) draw_device(mut d &DrawDevice)

#fn (&SubWindow) free

unsafe
fn (s &SubWindow) free()

#fn (&SubWindow) update_layout

fn (mut s &SubWindow) update_layout()

#fn (&SubWindow) set_adjusted_size

fn (mut s &SubWindow) set_adjusted_size(ui &UI)

#fn (&SubWindow) point_inside_bar

fn (mut s &SubWindow) point_inside_bar(x f64, y f64) bool

#fn (&SubWindow) point_inside_border

fn (mut s &SubWindow) point_inside_border(x f64, y f64) bool

#fn (&SubWindow) point_inside

fn (mut s &SubWindow) point_inside(x f64, y f64) bool

#fn (&SubWindow) set_pos

fn (mut s &SubWindow) set_pos(x int, y int)

#fn (&SubWindow) delegate_pos

fn (mut s &SubWindow) delegate_pos()

#fn (&SubWindow) delegate_size

fn (mut s &SubWindow) delegate_size()

#fn (&SubWindow) propose_size

fn (mut s &SubWindow) propose_size(width int, height int) (int, int)

#fn (&SubWindow) size

fn (s &SubWindow) size() (int, int)

#fn (&SubWindow) set_visible

fn (mut s &SubWindow) set_visible(state bool)

#fn (&SubWindow) is_visible

fn (s &SubWindow) is_visible() bool

#fn (&SubWindow) get_ui

fn (s &SubWindow) get_ui() &UI

#fn (&SubWindow) get_subscriber

fn (s &SubWindow) get_subscriber() &eventbus.Subscriber

#fn (&SubWindow) resize

fn (mut s &SubWindow) resize(w int, h int)

#fn (&SubWindow) get_children

fn (s &SubWindow) get_children() []Widget

#fn (&SubWindow) set_children_depth

fn (mut s &SubWindow) set_children_depth(z_inc int)

#fn (&SubWindow) is_top_subwindow

fn (mut s &SubWindow) is_top_subwindow() bool

#fn (&SubWindow) as_top_subwindow

fn (mut s &SubWindow) as_top_subwindow()

#fn (&SubWindow) update_depth

fn (mut s &SubWindow) update_depth(top bool)

#struct SubWindowParams

params
pub struct SubWindowParams {
	id         string
	x          int
	y          int
	hidden     bool   = true
	layout     Layout = empty_stack
	drag       bool   = true
	decoration bool   = true
}

#struct Switch

heap
pub struct Switch {
pub mut:
	id          string
	idx         int
	height      int
	width       int
	x           int
	y           int
	offset_x    int
	offset_y    int
	z_index     int
	parent      Layout = empty_stack
	is_focused  bool
	open        bool
	ui          &UI = unsafe { nil }
	on_click    SwitchFn
	on_key_down SwitchU32Fn
	hidden      bool
	// component state for composable widget
	component voidptr
}

#fn (&Switch) init

fn (mut s &Switch) init(parent Layout)

#fn (&Switch) cleanup

manualfree
fn (mut s &Switch) cleanup()

#fn (&Switch) free

unsafe
fn (s &Switch) free()

#fn (&Switch) set_pos

fn (mut s &Switch) set_pos(x int, y int)

#fn (&Switch) size

fn (mut s &Switch) size() (int, int)

#fn (&Switch) propose_size

fn (mut s &Switch) propose_size(w int, h int) (int, int)

#fn (&Switch) draw

fn (mut s &Switch) draw()

#fn (&Switch) draw_device

fn (mut s &Switch) draw_device(mut d &DrawDevice)

#fn (&Switch) point_inside

fn (s &Switch) point_inside(x f64, y f64) bool

#fn (&Switch) set_visible

fn (mut s &Switch) set_visible(state bool)

#fn (&Switch) focus

fn (mut s &Switch) focus()

#fn (&Switch) unfocus

fn (mut s &Switch) unfocus()

#struct SwitchParams

params
pub struct SwitchParams {
	id          string
	z_index     int
	on_click    SwitchFn
	on_key_down SwitchU32Fn
	open        bool
}

#struct TextBox

heap
pub struct TextBox {
pub mut:
	id       string
	height   int
	width    int
	x        int
	y        int
	offset_x int
	offset_y int
	z_index  int
	// Adjustable
	justify    []f64
	ax         int
	ay         int
	parent     Layout = empty_stack
	is_focused bool
	is_typing  bool
	// gg &gg.GG
	ui &UI = unsafe { nil }
	// text               string
	text               &string = unsafe { nil }
	text_value         string // This is the internal string content when not provided by the user
	max_len            int
	line_height        int
	line_height_factor f64
	cursor_pos         int
	large_text         bool
	draw_start         int
	draw_end           int
	sel_start          int
	sel_end            int
	// placeholder
	placeholder      string
	placeholder_bind &string = unsafe { nil }
	// multiline mode
	is_multiline   bool
	tv             TextView
	is_wordwrap    bool
	is_line_number bool
	is_sync        bool // if true lines are computed from text when drawing
	twosided_sel   bool // if true extension selection is made from both sides
	// others
	is_numeric    bool
	is_password   bool
	read_only     bool
	fitted_height bool // if true fit height in propose_size
	on_key_down   TextBoxU32Fn = TextBoxU32Fn(0)
	on_char       TextBoxU32Fn = TextBoxU32Fn(0)
	// on_key_up          KeyUpFn   = KeyUpFn(0)
	is_selectable bool // for read_only textbox
	sel_active    bool // to deal with show cursor when selection active
	dragging      bool
	sel_direction SelectionDirection
	is_error      &bool     = unsafe { nil }
	on_enter      TextBoxFn = TextBoxFn(0)
	on_change     TextBoxFn = TextBoxFn(0)
	// text styles
	text_styles TextStyles
	// text_size   f64
	// Style
	theme_style  string
	style        TextBoxShapeStyle
	style_params TextBoxStyleParams
	// TODO: put in style
	borderless bool
	// bg_color           gx.Color
	border_accentuated bool
	// related to widget drawing
	hidden   bool
	clipping bool
	// component state for composable widget
	component voidptr
	// scrollview
	has_scrollview   bool
	scrollview       &ScrollView = unsafe { nil }
	on_scroll_change ScrollViewChangedFn = ScrollViewChangedFn(0)
}

#fn (&TextBox) load_style

fn (mut t &TextBox) load_style()

#fn (&TextBox) update_theme_style

fn (mut t &TextBox) update_theme_style(theme string)

#fn (&TextBox) update_style

fn (mut t &TextBox) update_style(p TextBoxStyleParams)

#fn (&TextBox) update_shape_theme_style

fn (mut t &TextBox) update_shape_theme_style(ts TextBoxStyle)

#fn (&TextBox) update_shape_style

fn (mut t &TextBox) update_shape_style(p TextBoxStyleParams)

#fn (&TextBox) update_style_params

fn (mut t &TextBox) update_style_params(p TextBoxStyleParams)

#fn (&TextBox) init

fn (mut tb &TextBox) init(parent Layout)

#fn (&TextBox) cleanup

manualfree
fn (mut tb &TextBox) cleanup()

#fn (&TextBox) free

unsafe
fn (tb &TextBox) free()

#fn (&TextBox) set_pos

fn (mut tb &TextBox) set_pos(x int, y int)

#fn (&TextBox) adj_size

fn (tb &TextBox) adj_size() (int, int)

Needed for ScrollableWidget

#fn (&TextBox) size

fn (tb &TextBox) size() (int, int)

#fn (&TextBox) propose_size

fn (mut tb &TextBox) propose_size(w int, h int) (int, int)

#fn (&TextBox) update_line_height

fn (mut tb &TextBox) update_line_height()

#fn (&TextBox) draw

fn (mut tb &TextBox) draw()

#fn (&TextBox) draw_device

fn (mut tb &TextBox) draw_device(mut d &DrawDevice)

#fn (&TextBox) is_sel_active

fn (tb &TextBox) is_sel_active() bool

#fn (&TextBox) draw_selection

fn (mut tb &TextBox) draw_selection()

#fn (&TextBox) cancel_selection

fn (mut tb &TextBox) cancel_selection()

#fn (&TextBox) delete_selection

fn (mut tb &TextBox) delete_selection()

#fn (&TextBox) set_sel

fn (mut tb &TextBox) set_sel(sel_start_i int, sel_end_i int, key Key)

#fn (&TextBox) point_inside

fn (tb &TextBox) point_inside(x f64, y f64) bool

#fn (&TextBox) mouse_enter

fn (mut tb &TextBox) mouse_enter(e &MouseMoveEvent)

#fn (&TextBox) mouse_leave

fn (mut tb &TextBox) mouse_leave(e &MouseMoveEvent)

#fn (&TextBox) set_visible

fn (mut tb &TextBox) set_visible(state bool)

#fn (&TextBox) focus

fn (mut tb &TextBox) focus()

#fn (&TextBox) unfocus

fn (mut tb &TextBox) unfocus()

#fn (&TextBox) hide

fn (mut tb &TextBox) hide()

#fn (&TextBox) get_text

fn (mut tb &TextBox) get_text() string

#fn (&TextBox) set_text

fn (mut tb &TextBox) set_text(s string)

#fn (&TextBox) insert

fn (mut tb &TextBox) insert(s string)

#fn (&TextBox) set_children_pos

fn (tb &TextBox) set_children_pos()

Normally useless but required for scrollview_draw_begin()

#fn (&TextBox) text_xminmax_from_pos

fn (tb &TextBox) text_xminmax_from_pos(text string, x1 int, x2 int) (int, int)

#fn (&TextBox) text_pos_from_x

fn (tb &TextBox) text_pos_from_x(text string, x int) int

#fn (&TextBox) skip_index_from_end

fn (tb &TextBox) skip_index_from_end(ustr []rune, dtw DrawTextWidget) int

#fn (&TextBox) skip_index_from_start

fn (tb &TextBox) skip_index_from_start(ustr []rune, dtw DrawTextWidget) int

#fn (&TextBox) skip_index_from_cursor

fn (mut tb &TextBox) skip_index_from_cursor(ustr []rune, dtw DrawTextWidget)

#fn (&TextBox) check_cursor_pos

fn (mut tb &TextBox) check_cursor_pos()

#fn (&TextBox) set_cursor_pos

fn (mut tb &TextBox) set_cursor_pos(pos int)

#struct TextBoxParams

params
pub struct TextBoxParams {
	TextBoxStyleParams
	id                 string
	width              int
	height             int = 22
	line_height_factor f64 = textbox_line_height_factor
	read_only          bool
	is_multiline       bool
	is_wordwrap        bool
	is_line_number     bool
	mode               TextBoxMode // to summarize the three previous logical
	is_sync            bool = true
	twosided_sel       bool
	z_index            int
	justify            []f64 = top_left
	min                int
	max                int
	val                int
	placeholder        string
	placeholder_bind   &string = unsafe { nil }
	max_len            int
	is_numeric         bool
	is_password        bool
	text               &string = unsafe { nil }
	text_value         string
	is_error           &bool = unsafe { nil }
	is_focused         bool
	// is_error bool
	// bg_color           gx.Color = gx.white
	borderless         bool
	border_accentuated bool
	// text_size          f64
	theme         string = no_style
	fitted_height bool
	on_key_down   TextBoxU32Fn
	on_char       TextBoxU32Fn
	// on_key_up          KeyUpFn
	on_enter         TextBoxFn = TextBoxFn(0)
	on_change        TextBoxFn = TextBoxFn(0)
	scrollview       bool      = true
	on_scroll_change ScrollViewChangedFn = ScrollViewChangedFn(0)
}

#struct TextView

pub struct TextView {
pub mut:
	text       &string = unsafe { nil }
	cursor_pos int
	sel_start  int
	sel_end    int
	// text style
	line_height int
	// synchronised lines for the text (or maybe a part)
	tlv TextLinesView
	// textbox
	tb &TextBox = unsafe { nil } // needed for textwidth and for is_wordwrap
	// line_number
	left_margin int
	// Syntax Highlighter
	sh &SyntaxHighLighter = unsafe { nil }
}

position (cursor_pos, sel_start, sel_end) set in the runes world

#fn (&TextView) init

fn (mut tv &TextView) init(tb &TextBox)

#fn (&TextView) size

fn (tv &TextView) size() (int, int)

#fn (&TextView) info

fn (tv &TextView) info()

#fn (&TextView) is_wordwrap

fn (mut tv &TextView) is_wordwrap() bool

#fn (&TextView) set_wordwrap

fn (mut tv &TextView) set_wordwrap(state bool)

#fn (&TextView) switch_wordwrap

fn (mut tv &TextView) switch_wordwrap()

#fn (&TextView) line

fn (tv &TextView) line(j int) string

#fn (&TextView) current_line

fn (tv &TextView) current_line() string

#fn (&TextView) sel_start_line

fn (tv &TextView) sel_start_line() string

#fn (&TextView) sel_end_line

fn (tv &TextView) sel_end_line() string

#fn (&TextView) is_sel_active

fn (tv &TextView) is_sel_active() bool

#fn (&TextView) sync_text_pos

fn (mut tv &TextView) sync_text_pos()

#fn (&TextView) sync_text_lines

fn (mut tv &TextView) sync_text_lines()

#fn (&TextView) visible_lines

fn (mut tv &TextView) visible_lines()

#fn (&TextView) refresh_visible_lines

fn (mut tv &TextView) refresh_visible_lines()

#fn (&TextView) update_all_visible_lines

fn (mut tv &TextView) update_all_visible_lines()

#fn (&TextView) update_lines

fn (mut tv &TextView) update_lines()

#fn (&TextView) update_left_margin

fn (mut tv &TextView) update_left_margin()

#fn (&TextView) scroll_changed

fn (mut tv &TextView) scroll_changed()

#fn (&TextView) draw_device_textlines

fn (mut tv &TextView) draw_device_textlines(d DrawDevice)

#fn (&TextView) draw_device_visible_line

fn (mut tv &TextView) draw_device_visible_line(d DrawDevice, j int, y int, text string)

#fn (&TextView) draw_device_selection

fn (mut tv &TextView) draw_device_selection(d DrawDevice)

#fn (&TextView) draw_device_line_number

fn (tv &TextView) draw_device_line_number(d DrawDevice, i int, y int)

#fn (&TextView) insert

fn (mut tv &TextView) insert(s string)

#fn (&TextView) delete_cur_char

fn (mut tv &TextView) delete_cur_char()

#fn (&TextView) delete_prev_char

fn (mut tv &TextView) delete_prev_char()

#fn (&TextView) delete_prev_word

fn (mut tv &TextView) delete_prev_word()

#fn (&TextView) delete_selection

fn (mut tv &TextView) delete_selection()

#fn (&TextView) start_selection

fn (mut tv &TextView) start_selection(x int, y int)

#fn (&TextView) end_selection

fn (mut tv &TextView) end_selection(x int, y int)

#fn (&TextView) extend_selection

fn (mut tv &TextView) extend_selection(x int, y int)

#fn (&TextView) cancel_selection

fn (mut tv &TextView) cancel_selection()

#fn (&TextView) move_cursor

fn (mut tv &TextView) move_cursor(side Side)

#fn (&TextView) cursor_allways_visible

fn (mut tv &TextView) cursor_allways_visible()

#fn (&TextView) key_char

fn (mut tv &TextView) key_char(e &KeyEvent)

#fn (&TextView) key_down

fn (mut tv &TextView) key_down(e &KeyEvent)

#fn (&TextView) do_indent

fn (mut tv &TextView) do_indent(shift bool)

#fn (&TextView) do_select_all

fn (mut tv &TextView) do_select_all()

#fn (&TextView) do_copy

fn (mut tv &TextView) do_copy()

#fn (&TextView) do_paste

fn (mut tv &TextView) do_paste()

#fn (&TextView) do_cut

fn (mut tv &TextView) do_cut()

#fn (&TextView) do_zoom_down

fn (mut tv &TextView) do_zoom_down()

#fn (&TextView) do_zoom_up

fn (mut tv &TextView) do_zoom_up()

#fn (&TextView) do_logview

fn (mut tv &TextView) do_logview(cfg LogViewParams)

#fn (&TextView) cursor_y

fn (tv &TextView) cursor_y() int