Macro in ldk_ui.h

LDK_UI_INPUT_CODEPOINTS_CAPACITY

#define LDK_UI_INPUT_CODEPOINTS_CAPACITY 16
Macro in ldk_ui.h

LDK_UI_DEFAULT_CONTROL_HEIGHT

#define LDK_UI_DEFAULT_CONTROL_HEIGHT 22.0f
Macro in ldk_ui.h

LDK_UI_DEFAULT_CONTROL_WIDTH

#define LDK_UI_DEFAULT_CONTROL_WIDTH 16.0f
Macro in ldk_ui.h

LDK_UI_LAYOUT_STACK_CAPACITY

#define LDK_UI_LAYOUT_STACK_CAPACITY 64
Macro in ldk_ui.h

LDK_UI_LAYOUT_ITEM_CAPACITY

#define LDK_UI_LAYOUT_ITEM_CAPACITY 512
Macro in ldk_ui.h

LDK_UI_LAYOUT_ITEM_CACHE_CAPACITY

#define LDK_UI_LAYOUT_ITEM_CACHE_CAPACITY 64
Macro in ldk_ui.h

LDK_UI_MEASURE_ENTRY_CAPACITY

#define LDK_UI_MEASURE_ENTRY_CAPACITY 64
Macro in ldk_ui.h

LDK_UI_WINDOW_CAPACITY

#define LDK_UI_WINDOW_CAPACITY 16
Macro in ldk_ui.h

LDK_UI_WINDOW_STACK_CAPACITY

#define LDK_UI_WINDOW_STACK_CAPACITY 16
Macro in ldk_ui.h

LDK_UI_SCROLLVIEW_STACK_CAPACITY

#define LDK_UI_SCROLLVIEW_STACK_CAPACITY 16
Macro in ldk_ui.h

LDK_UI_SCROLLVIEW_CACHE_CAPACITY

#define LDK_UI_SCROLLVIEW_CACHE_CAPACITY 16
Macro in ldk_ui.h

LDK_UI_SCROLLBAR_SIZE

#define LDK_UI_SCROLLBAR_SIZE 12.0f
Macro in ldk_ui.h

LDK_UI_AREA_STACK_CAPACITY

#define LDK_UI_AREA_STACK_CAPACITY 64
Macro in ldk_ui.h

LDK_UI_POPUP_STACK_CAPACITY

#define LDK_UI_POPUP_STACK_CAPACITY 16
Macro in ldk_ui.h

LDK_UI_MIN_WINDOW_WIDTH

#define LDK_UI_MIN_WINDOW_WIDTH 64.0f
Macro in ldk_ui.h

LDK_UI_MIN_WINDOW_HEIGHT

#define LDK_UI_MIN_WINDOW_HEIGHT 1
Macro in ldk_ui.h

LDK_UI_TITLE_BAR_HEIGHT

#define LDK_UI_TITLE_BAR_HEIGHT 24.0f
Macro in ldk_ui.h

LDK_UI_DEFAULT_SPACING

#define LDK_UI_DEFAULT_SPACING 4.0f
Macro in ldk_ui.h

LDK_UI_DEFAULT_PADDING

#define LDK_UI_DEFAULT_PADDING 4.0f
Macro in ldk_ui.h

LDK_UI_TREE_NODE_INDENT_WIDTH

#define LDK_UI_TREE_NODE_INDENT_WIDTH 8.0f
Macro in ldk_ui.h

LDK_UI_TREE_NODE_CHEVRON_WIDTH

#define LDK_UI_TREE_NODE_CHEVRON_WIDTH 10.0f
Macro in ldk_ui.h

LDK_UI_TAB_BAR_TAB_HEIGHT

#define LDK_UI_TAB_BAR_TAB_HEIGHT 34.0f
Macro in ldk_ui.h

LDK_UI_TAB_BAR_HEIGHT

#define LDK_UI_TAB_BAR_HEIGHT 34.0f
Macro in ldk_ui.h

LDK_UI_TAB_BAR_TAB_PADDING

#define LDK_UI_TAB_BAR_TAB_PADDING 14.0f
Macro in ldk_ui.h

LDK_UI_AREA_HEADER_HEIGHT

#define LDK_UI_AREA_HEADER_HEIGHT 34.0f
Macro in ldk_ui.h

LDK_UI_AREA_PADDING

#define LDK_UI_AREA_PADDING 8.0f
Macro in ldk_ui.h

LDK_UI_TAB_BAR_MENU_BUTTON_WIDTH

#define LDK_UI_TAB_BAR_MENU_BUTTON_WIDTH 24.0f
Macro in ldk_ui.h

LDK_UI_TAB_BAR_SPACING

#define LDK_UI_TAB_BAR_SPACING 2.0f
Macro in ldk_ui.h

LDK_UI_TAB_BAR_LINE_THICKNESS

#define LDK_UI_TAB_BAR_LINE_THICKNESS 1.2f
Typedef in ldk_ui.h

LDKUIId

typedef uint32_t LDKUIId;
Typedef in ldk_ui.h

LDKUITextureHandle

typedef uintptr_t LDKUITextureHandle;
Typedef in ldk_ui.h

LDKUIGetFontPageTextureFn

Callback resolving the texture for a font atlas page.

typedef LDKUITextureHandle(*LDKUIGetFontPageTextureFn)(void *user, LDKFontInstance *font, u32 page_index);

Parameters

user
Opaque caller-supplied data passed to the callback.
font
Font or font instance used by the operation.
page_index
Index of the requested font or asset page.

Returns

Handle to the requested object or resource.

Typedef in ldk_ui.h

LDKUIColor

typedef u32 LDKUIColor;
Struct in ldk_ui.h

LDKUILayout

typedef struct LDKUILayout LDKUILayout;
Struct in ldk_ui.h

LDKUIWindow

typedef struct LDKUIWindow LDKUIWindow;
Struct in ldk_ui.h

LDKUIWindowStackEntry

typedef struct LDKUIWindowStackEntry LDKUIWindowStackEntry;
Struct in ldk_ui.h

LDKUIScrollViewCache

typedef struct LDKUIScrollViewCache LDKUIScrollViewCache;
Struct in ldk_ui.h

LDKUIScrollViewStackEntry

typedef struct LDKUIScrollViewStackEntry LDKUIScrollViewStackEntry;
Struct in ldk_ui.h

LDKUIAreaStackEntry

typedef struct LDKUIAreaStackEntry LDKUIAreaStackEntry;
Struct in ldk_ui.h

LDKUIPopupStackEntry

typedef struct LDKUIPopupStackEntry LDKUIPopupStackEntry;
Struct in ldk_ui.h

LDKUIPopupFrameEntry

typedef struct LDKUIPopupFrameEntry LDKUIPopupFrameEntry;
Struct in ldk_ui.h

LDKUIPopupCache

typedef struct LDKUIPopupCache LDKUIPopupCache;
Struct in ldk_ui.h

LDKUIHitCandidate

typedef struct LDKUIHitCandidate LDKUIHitCandidate;
Struct in ldk_ui.h

LDKUIContext

typedef struct LDKUIContext LDKUIContext;
Enum in ldk_ui.h

LDKUIColorSlot

typedef enum LDKUIColorSlot{
  LDK_UI_COLOR_TEXT,
  LDK_UI_COLOR_TEXT_DISABLED,
  LDK_UI_COLOR_WINDOW_BG,
  LDK_UI_COLOR_PANEL_BG,
  LDK_UI_COLOR_CONTROL_BG,
  LDK_UI_COLOR_CONTROL_BG_HOVERED,
  LDK_UI_COLOR_CONTROL_BG_ACTIVE,
  LDK_UI_COLOR_CONTROL_BG_ACTIVE_HOVERED,
  LDK_UI_COLOR_CONTROL_TEXT,
  LDK_UI_COLOR_CONTROL_TEXT_HOVERED,
  LDK_UI_COLOR_CONTROL_TEXT_ACTIVE,
  LDK_UI_COLOR_CONTROL_TEXT_ACTIVE_HOVERED,
  LDK_UI_COLOR_CONTROL_TEXT_DISABLED,
  LDK_UI_COLOR_CONTROL_BORDER,
  LDK_UI_COLOR_CONTROL_BORDER_HOVERED,
  LDK_UI_COLOR_CONTROL_BORDER_ACTIVE,
  LDK_UI_COLOR_CONTROL_BORDER_ACTIVE_HOVERED,
  LDK_UI_COLOR_CONTROL_BORDER_DISABLED,
  LDK_UI_COLOR_BORDER,
  LDK_UI_COLOR_FOCUS,
  LDK_UI_COLOR_SLIDER_TRACK,
  LDK_UI_COLOR_SLIDER_TRACK_HOVERED,
  LDK_UI_COLOR_SLIDER_TRACK_ACTIVE,
  LDK_UI_COLOR_SLIDER_FILL,
  LDK_UI_COLOR_SLIDER_THUMB,
  LDK_UI_COLOR_SLIDER_THUMB_HOVERED,
  LDK_UI_COLOR_SLIDER_THUMB_ACTIVE,
  LDK_UI_COLOR_TITLE,
  LDK_UI_COLOR_TITLE_BAR,
  LDK_UI_COLOR_TITLE_BAR_FOCUSED,
  LDK_UI_COLOR_SCROLLBAR_TRACK,
  LDK_UI_COLOR_SCROLLBAR_THUMB,
  LDK_UI_COLOR_SCROLLBAR_THUMB_HOVERED,
  LDK_UI_COLOR_SCROLLBAR_THUMB_ACTIVE,
  LDK_UI_COLOR_TAB_BAR_BG,
  LDK_UI_COLOR_TAB_BAR_SEPARATOR,
  LDK_UI_COLOR_TAB_BG,
  LDK_UI_COLOR_TAB_BG_HOVERED,
  LDK_UI_COLOR_TAB_TEXT,
  LDK_UI_COLOR_TAB_TEXT_HOVERED,
  LDK_UI_COLOR_TAB_BORDER,
  LDK_UI_COLOR_TAB_BORDER_HOVERED,
  LDK_UI_COLOR_TAB_ACTIVE_BG,
  LDK_UI_COLOR_TAB_ACTIVE_TEXT,
  LDK_UI_COLOR_TAB_ACTIVE_BORDER,
  LDK_UI_COLOR_SEPARATOR,
  LDK_UI_COLOR_INPUT_BORDER,
  LDK_UI_COLOR_INPUT_BG,
  LDK_UI_COLOR_INPUT_BG_HOVERED,
  LDK_UI_COLOR_INPUT_BG_ACTIVE,
  LDK_UI_COLOR_INPUT_BG_ACTIVE_HOVERED,
  LDK_UI_COLOR_COUNT,
}LDKUIColorSlot;
Enum in ldk_ui.h

LDKUIThemeIconSlot

typedef enum LDKUIThemeIconSlot{
  LDK_UI_THEME_ICON_TREE_NODE_COLLAPSED,
  LDK_UI_THEME_ICON_TREE_NODE_EXPANDED,
  LDK_UI_THEME_ICON_TOGGLE_UNCHECKED,
  LDK_UI_THEME_ICON_TOGGLE_CHECKED,
  LDK_UI_THEME_ICON_MORE_HORIZ,
  LDK_UI_THEME_ICON_MORE_VERT,
  LDK_UI_THEME_ICON_EJECT,
  LDK_UI_THEME_ICON_COUNT,
}LDKUIThemeIconSlot;
Struct in ldk_ui.h

LDKUITheme

Uniform content inset for windows and panels, in pixels.

typedef struct LDKUITheme{
  rgba32 colors[LDK_UI_COLOR_COUNT];
  LDKUIIcon icons[LDK_UI_THEME_ICON_COUNT];
  float control_border_size;
  float input_border_size;
  float window_border_size;
  float window_interaction_border_size;
  float slider_track_height;
  float slider_thumb_width;
  bool text_cursor_blink;
  float text_cursor_blink_interval;
  float text_cursor_width;
  float text_cursor_padding_y;
  /** Uniform content inset for windows and panels, in pixels. */float panel_padding;
}LDKUITheme;
Struct in ldk_ui.h

LDKUIVertex

typedef struct LDKUIVertex{
  float x;
  float y;
  float u;
  float v;
  rgba32 color;
}LDKUIVertex;
Function in ldk_ui.h

X_ARRAY_TYPE_NAMED

 X_ARRAY_TYPE_NAMED(
 LDKUIId,
 ldk_ui_id
);
Enum in ldk_ui.h

LDKUIThemeType

typedef enum LDKUIThemeType{
  LDK_UI_THEME_CUSTOM=0,
  LDK_UI_THEME_DEFAULT_LIGHT=1,
  LDK_UI_THEME_DEFAULT_DARK=2,
}LDKUIThemeType;
Struct in ldk_ui.h

LDKUIRenderData

Logical viewport used to generate the vertices and clip rectangles.

typedef struct LDKUIRenderData{
  LDKUIVertex const *vertices;
  u32 vertex_count;
  u32 const *indices;
  u32 index_count;
  LDKUIDrawCmd const *commands;
  uint32_t command_count;
  /** Logical viewport used to generate the vertices and clip rectangles. */LDKUISize viewport_size;
}LDKUIRenderData;
Enum in ldk_ui.h

LDKUILayoutDirection

typedef enum LDKUILayoutDirection{
  LDK_UI_LAYOUT_VERTICAL=0,
  LDK_UI_LAYOUT_HORIZONTAL=1,
}LDKUILayoutDirection;
Enum in ldk_ui.h

LDKUIItemType

typedef enum LDKUIItemType{
  LDK_UI_ITEM_WINDOW=1,
  LDK_UI_ITEM_LABEL=2,
  LDK_UI_ITEM_BUTTON=3,
  LDK_UI_ITEM_SLIDER=4,
  LDK_UI_ITEM_SCROLLVIEW=5,
  LDK_UI_ITEM_LAYOUT_VERTICAL=6,
  LDK_UI_ITEM_LAYOUT_HORIZONTAL=7,
  LDK_UI_ITEM_INPUT_BOX=8,
  LDK_UI_ITEM_IMAGE=9,
  LDK_UI_ITEM_ICON_BUTTON=10,
  LDK_UI_ITEM_PANEL=11,
  LDK_UI_ITEM_SPACER=12,
  LDK_UI_ITEM_TOGGLE=13,
  LDK_UI_ITEM_SEPARATOR=14,
  LDK_UI_ITEM_ICON_LABEL=15,
  LDK_UI_ITEM_COMBO_BOX=16,
  LDK_UI_ITEM_TAB_BAR=17,
  LDK_UI_ITEM_RESIZE_HANDLE=18,
  LDK_UI_ITEM_SLIDER_INPUT=19,
}LDKUIItemType;
Enum in ldk_ui.h

LDKUISizeMode

typedef enum LDKUISizeMode{
  LDK_UI_SIZE_PIXELS=0,
  LDK_UI_SIZE_PERCENT=1,
  LDK_UI_SIZE_FILL=2,
  LDK_UI_SIZE_AUTO=3,
}LDKUISizeMode;
Struct in ldk_ui.h

LDKUILayoutSize

typedef struct LDKUILayoutSize{
  LDKUISizeMode mode;
  float value;
}LDKUILayoutSize;
Enum in ldk_ui.h

LDKUIWindowFlags

typedef enum LDKUIWindowFlags{
  LDK_UI_WINDOW_NONE=0,
  LDK_UI_WINDOW_TITLE_BAR=1<<0,
  LDK_UI_WINDOW_DRAGGABLE=1<<1,
  LDK_UI_WINDOW_RESIZABLE=1<<2,
  LDK_UI_WINDOW_BORDER=1<<3,
  LDK_UI_WINDOW_NO_BG=1<<4,
  LDK_UI_WINDOW_CLOSE_BUTTON=1<<5,
  LDK_UI_WINDOW_NO_PADDING=1<<6,
  LDK_UI_WINDOW_CACHEABLE=1<<7,
  LDK_UI_WINDOW_TOOL=LDK_UI_WINDOW_CLOSE_BUTTON|LDK_UI_WINDOW_TITLE_BAR|LDK_UI_WINDOW_DRAGGABLE|LDK_UI_WINDOW_RESIZABLE|LDK_UI_WINDOW_BORDER,
}LDKUIWindowFlags;
Enum in ldk_ui.h

LDKUIScrollViewFlags

typedef enum LDKUIScrollViewFlags{
  LDK_UI_SCROLL_NONE=0,
  LDK_UI_SCROLL_VERTICAL=1<<0,
  LDK_UI_SCROLL_HORIZONTAL=1<<1,
  LDK_UI_SCROLL_IF_NEEDED=1<<2,
}LDKUIScrollViewFlags;
Enum in ldk_ui.h

LDKTreeNodeFlags

typedef enum LDKTreeNodeFlags{
  LDK_UI_TREE_NODE_NONE=0,
  LDK_UI_TREE_NODE_LEAF=1<<0,
  LDK_UI_TREE_NODE_SELECTED=1<<1
}LDKTreeNodeFlags;
Enum in ldk_ui.h

LDKTreeNodeResult

typedef enum LDKTreeNodeResult{
  LDK_UI_TREE_NODE_RESULT_NONE=0,
  LDK_UI_TREE_NODE_RESULT_CLICKED=1<<0,
  LDK_UI_TREE_NODE_RESULT_TOGGLED=1<<1,
}LDKTreeNodeResult;
Struct in ldk_ui.h

LDKUIMark

typedef struct LDKUIMark{
  LDKUILayout *layout;
  u32 measure_index;
}LDKUIMark;
Struct in ldk_ui.h

LDKUILayoutItem

typedef struct LDKUILayoutItem{
  LDKUIId layout_id;
  u32 item_index;
  u32 next_layout_item_array_index;
  u32 cache_array_index;
  LDKUILayoutRequest request;
  LDKUIRect fallback_rect;
}LDKUILayoutItem;
Struct in ldk_ui.h

LDKUILayoutItemCache

typedef struct LDKUILayoutItemCache{
  LDKUIId layout_id;
  LDKUIId owner_window_id;
  u32 item_index;
  LDKUIRect rect;
  u32 last_frame_touched;
}LDKUILayoutItemCache;
Struct in ldk_ui.h

LDKUIConfig

typedef struct LDKUIConfig{
  u32 frame_arena_size;
  u32 initial_vertex_capacity;
  u32 initial_index_capacity;
  u32 initial_command_capacity;
  u32 initial_window_capacity;
  u32 initial_id_stack_capacity;
  LDKFontInstance *font;
  void *font_texture_user;
  LDKUIGetFontPageTextureFn get_font_page_texture;
  LDKUIThemeType theme;
  u32 font_size;
}LDKUIConfig;
Enum in ldk_ui.h

LDKUIControlVisualState

typedef enum LDKUIControlVisualState{
  LDK_UI_CONTROL_VISUAL_STATE_IDLE=0,
  LDK_UI_CONTROL_VISUAL_STATE_HOVERED=1,
  LDK_UI_CONTROL_VISUAL_STATE_ACTIVE=2,
  LDK_UI_CONTROL_VISUAL_STATE_ACTIVE_HOVERED=3,
  LDK_UI_CONTROL_VISUAL_STATE_DISABLED=4,
}LDKUIControlVisualState;
Enum in ldk_ui.h

LDKUIInputBoxResult

typedef enum LDKUIInputBoxResult{
  LDK_UI_INPUT_BOX_NONE=0,
  LDK_UI_INPUT_BOX_CHANGED=1<<0,
  LDK_UI_INPUT_BOX_COMMITTED=1<<1,
  LDK_UI_INPUT_BOX_CANCELED=1<<2,
}LDKUIInputBoxResult;
Struct in ldk_ui.h

LDKUISliderInputState

typedef struct LDKUISliderInputState{
  LDKUIId id;
  char buffer[64];
  float initial_value;
  float value;
}LDKUISliderInputState;
Enum in ldk_ui.h

LDKUIHitLayer

typedef enum LDKUIHitLayer{
  LDK_UI_HIT_LAYER_NORMAL=0,
  LDK_UI_HIT_LAYER_POPUP=1,
}LDKUIHitLayer;
Struct in ldk_ui.h

LDKUITabFocusEntry

typedef struct LDKUITabFocusEntry{
  LDKUIId window_id;
  LDKUIId item_id;
}LDKUITabFocusEntry;
Struct in ldk_ui.h

LDKUITabBarItem

typedef struct LDKUITabBarItem{
  LDKUIId id;
  LDKUIIcon icon;
  char const *label;
}LDKUITabBarItem;
Struct in ldk_ui.h

LDKUITabBarResult

typedef struct LDKUITabBarResult{
  u32 active_index;
  u32 pressed_index;
  bool changed;
}LDKUITabBarResult;
Function in ldk_ui.h

ldk_ui_initialize

Initialize the UI.

LDK_API bool ldk_ui_initialize(
 LDKUIContext *ctx,
 LDKUIConfig const *config
);

Parameters

LDKUIContext *ctx
UI context used by this operation.
LDKUIConfig const *config
Configuration for this operation.

Returns

True if the operation succeeds; false otherwise.

Function in ldk_ui.h

ldk_ui_theme_set

Set the UI theme.

LDK_API bool ldk_ui_theme_set(
 LDKUIContext *ctx,
 LDKUITheme *theme
);

Parameters

LDKUIContext *ctx
UI context used by this operation.
LDKUITheme *theme
Theme used by this operation.

Returns

True if the operation succeeds; false otherwise.

Function in ldk_ui.h

ldk_ui_begin_frame

Start a UI frame with the current input snapshots and viewport.

LDK_API void ldk_ui_begin_frame(
 LDKUIContext *ctx,
 float delta,
 LDKMouseState const *mouse,
 LDKKeyboardState const *keyboard,
 LDKUITextInputState const *text_input,
 LDKUIRect viewport
);

Parameters

LDKUIContext *ctx
UI context used by this operation.
float delta
Elapsed time since the preceding frame, in seconds.
LDKMouseState const *mouse
Mouse used by this operation.
LDKKeyboardState const *keyboard
Keyboard used by this operation.
LDKUITextInputState const *text_input
Text input used by this operation.
LDKUIRect viewport
Viewport used by this operation.
Function in ldk_ui.h

ldk_ui_end_frame

Finish the current UI frame and prepare render data.

LDK_API void ldk_ui_end_frame(LDKUIContext *ctx);

Parameters

LDKUIContext *ctx
UI context used by this operation.
Function in ldk_ui.h

ldk_ui_get_render_data

Access draw data produced by the completed UI frame.

LDK_API LDKUIRenderData const * ldk_ui_get_render_data(LDKUIContext const *ctx);

Parameters

LDKUIContext const *ctx
UI context used by this operation.

Returns

Pointer to the requested object or data; NULL when unavailable.

Function in ldk_ui.h

ldk_ui_clipboard_window_set

Associate a native window with UI clipboard operations.

LDK_API void ldk_ui_clipboard_window_set(
 LDKUIContext *ctx,
 LDKWindow window
);

Parameters

LDKUIContext *ctx
UI context used by this operation.
LDKWindow window
Native window handle.
Function in ldk_ui.h

ldk_ui_push_id_u32

Push an integer onto the hierarchical UI ID stack.

LDK_API void ldk_ui_push_id_u32(
 LDKUIContext *ctx,
 uint32_t value
);

Parameters

LDKUIContext *ctx
UI context used by this operation.
uint32_t value
Input value or current widget value.
Function in ldk_ui.h

ldk_ui_push_id_ptr

Push a pointer identity onto the hierarchical UI ID stack.

LDK_API void ldk_ui_push_id_ptr(
 LDKUIContext *ctx,
 void const *value
);

Parameters

LDKUIContext *ctx
UI context used by this operation.
void const *value
Input value or current widget value.
Function in ldk_ui.h

ldk_ui_push_id_cstr

Push a string identity onto the hierarchical UI ID stack.

LDK_API void ldk_ui_push_id_cstr(
 LDKUIContext *ctx,
 char const *value
);

Parameters

LDKUIContext *ctx
UI context used by this operation.
char const *value
Input value or current widget value.
Function in ldk_ui.h

ldk_ui_set_next_disabled

Set disabled state for the next UI item.

LDK_API void ldk_ui_set_next_disabled(
 LDKUIContext *ctx,
 bool disabled
);

Parameters

LDKUIContext *ctx
UI context used by this operation.
bool disabled
Whether interaction is disabled.
Function in ldk_ui.h

ldk_ui_set_next_focus

Request keyboard focus for the next UI item.

LDK_API void ldk_ui_set_next_focus(LDKUIContext *ctx);

Parameters

LDKUIContext *ctx
UI context used by this operation.
Function in ldk_ui.h

ldk_ui_begin_disabled

Begin a nested disabled-state scope.

LDK_API void ldk_ui_begin_disabled(
 LDKUIContext *ctx,
 bool disabled
);

Parameters

LDKUIContext *ctx
UI context used by this operation.
bool disabled
Whether interaction is disabled.
Function in ldk_ui.h

ldk_ui_end_disabled

End the current disabled-state scope.

LDK_API void ldk_ui_end_disabled(LDKUIContext *ctx);

Parameters

LDKUIContext *ctx
UI context used by this operation.
Function in ldk_ui.h

ldk_ui_rect

Construct a UI rectangle from position and dimensions.

LDK_API LDKUIRect ldk_ui_rect(
 float x,
 float y,
 float w,
 float h
);

Parameters

float x
X coordinate or component.
float y
Y coordinate or component.
float w
W used by this operation.
float h
H used by this operation.

Returns

The resulting rectangle.

Function in ldk_ui.h

ldk_ui_format_float

Format a floating-point value for UI display.

LDK_API void ldk_ui_format_float(
 char *buffer,
 u32 buffer_size,
 float value
);

Parameters

char *buffer
Buffer containing the data or receiving formatted output.
u32 buffer_size
Capacity of the buffer in bytes.
float value
Input value or current widget value.
Function in ldk_ui.h

ldk_ui_begin_window_fixed

Begin a UI window with fixed placement.

LDK_API LDKUIRect ldk_ui_begin_window_fixed(
 LDKUIContext *ctx,
 char const *title,
 LDKUIRect rect,
 u32 flags
);

Parameters

LDKUIContext *ctx
UI context used by this operation.
char const *title
Title shown by the window or dialog.
LDKUIRect rect
UI or geometry rectangle.
u32 flags
Bitmask of options controlling this operation.

Returns

The resulting rectangle.

Function in ldk_ui.h

ldk_ui_begin_window

Begin a UI window.

LDK_API LDKUIRect ldk_ui_begin_window(
 LDKUIContext *ctx,
 char const *title,
 LDKUIRect rect,
 u32 flags
);

Parameters

LDKUIContext *ctx
UI context used by this operation.
char const *title
Title shown by the window or dialog.
LDKUIRect rect
UI or geometry rectangle.
u32 flags
Bitmask of options controlling this operation.

Returns

The resulting rectangle.

Function in ldk_ui.h

ldk_ui_begin_window_open

Begin an optionally closable window with editable geometry.

LDK_API bool ldk_ui_begin_window_open(
 LDKUIContext *ctx,
 char const *title,
 LDKUIRect *rect,
 bool *open,
 u32 flags
);

Parameters

LDKUIContext *ctx
UI context used by this operation.
char const *title
Title shown by the window or dialog.
LDKUIRect *rect
UI or geometry rectangle.
bool *open
In/out flag indicating whether the window remains open.
u32 flags
Bitmask of options controlling this operation.

Returns

True when the UI condition or interaction is active; false otherwise.

Function in ldk_ui.h

ldk_ui_window_close_requested

Report whether the current window has requested closure.

LDK_API bool ldk_ui_window_close_requested(LDKUIContext *ctx);

Parameters

LDKUIContext *ctx
UI context used by this operation.

Returns

True when the UI condition or interaction is active; false otherwise.

Function in ldk_ui.h

ldk_ui_window_content_should_build

Determine whether cached window content needs rebuilding.

LDK_API bool ldk_ui_window_content_should_build(LDKUIContext *ctx);

Parameters

LDKUIContext *ctx
UI context used by this operation.

Returns

True if the operation succeeds; false otherwise.

Function in ldk_ui.h

ldk_ui_window_focus

Request focus for the specified UI window.

LDK_API bool ldk_ui_window_focus(
 LDKUIContext *ctx,
 LDKUIId id
);

Parameters

LDKUIContext *ctx
UI context used by this operation.
LDKUIId id
Identifier of the target object.

Returns

True if the operation succeeds; false otherwise.

Function in ldk_ui.h

ldk_ui_window_invalidate

Invalidate cached contents of one UI window.

LDK_API void ldk_ui_window_invalidate(
 LDKUIContext *ctx,
 LDKUIId id
);

Parameters

LDKUIContext *ctx
UI context used by this operation.
LDKUIId id
Identifier of the target object.
Function in ldk_ui.h

ldk_ui_windows_invalidate

Invalidate cached contents of all UI windows.

LDK_API void ldk_ui_windows_invalidate(LDKUIContext *ctx);

Parameters

LDKUIContext *ctx
UI context used by this operation.
Function in ldk_ui.h

ldk_ui_px

Create a pixel-based UI layout size.

LDK_API LDKUILayoutSize ldk_ui_px(float value);

Parameters

float value
Input value or current widget value.

Returns

The resulting size.

Function in ldk_ui.h

ldk_ui_percent

Create a percentage-based UI layout size.

LDK_API LDKUILayoutSize ldk_ui_percent(float value);

Parameters

float value
Input value or current widget value.

Returns

The resulting size.

Function in ldk_ui.h

ldk_ui_fill

Create a UI layout size that fills available space.

LDK_API LDKUILayoutSize ldk_ui_fill(void);

Returns

The resulting size.

Function in ldk_ui.h

ldk_ui_set_next_min_size

Set the minimum size for the next UI item.

LDK_API void ldk_ui_set_next_min_size(
 LDKUIContext *ctx,
 float width,
 float height
);

Parameters

LDKUIContext *ctx
UI context used by this operation.
float width
Width in pixels or the units expected by the API.
float height
Height in pixels or the units expected by the API.
Function in ldk_ui.h

ldk_ui_set_next_weight

Set the layout weight of the next UI item.

LDK_API void ldk_ui_set_next_weight(
 LDKUIContext *ctx,
 float weight
);

Parameters

LDKUIContext *ctx
UI context used by this operation.
float weight
Weight used by this operation.
Function in ldk_ui.h

ldk_ui_last_rect

Get the rectangle of the most recently emitted UI item.

LDK_API LDKUIRect ldk_ui_last_rect(LDKUIContext *ctx);

Parameters

LDKUIContext *ctx
UI context used by this operation.

Returns

The resulting rectangle.

Function in ldk_ui.h

ldk_ui_last_bounding_rect

Get the outer bounding rectangle of the most recent UI item.

LDK_API LDKUIRect ldk_ui_last_bounding_rect(LDKUIContext *ctx);

Parameters

LDKUIContext *ctx
UI context used by this operation.

Returns

The resulting rectangle.

Function in ldk_ui.h

ldk_ui_begin_vertical

Begin a vertical auto-layout scope.

LDK_API void ldk_ui_begin_vertical(LDKUIContext *ctx);

Parameters

LDKUIContext *ctx
UI context used by this operation.
Function in ldk_ui.h

ldk_ui_begin_horizontal

Begin a horizontal auto-layout scope.

LDK_API void ldk_ui_begin_horizontal(LDKUIContext *ctx);

Parameters

LDKUIContext *ctx
UI context used by this operation.
Function in ldk_ui.h

ldk_ui_end_vertical

Close a vertical auto-layout scope.

LDK_API void ldk_ui_end_vertical(LDKUIContext *ctx);

Parameters

LDKUIContext *ctx
UI context used by this operation.
Function in ldk_ui.h

ldk_ui_end_horizontal

Close a horizontal auto-layout scope.

LDK_API void ldk_ui_end_horizontal(LDKUIContext *ctx);

Parameters

LDKUIContext *ctx
UI context used by this operation.
Function in ldk_ui.h

ldk_ui_set_padding

Set the current container's uniform content inset in pixels. Call after successfully opening a window, an expanded area, or a vertical/horizontal/scrollview layout, before adding children. Nested containers keep their own padding. Zero removes the inset; negative or nonfinite values are treated as zero.

LDK_API void ldk_ui_set_padding(
 LDKUIContext *ctx,
 float padding
);

Parameters

LDKUIContext *ctx
UI context used by this operation.
float padding
Padding used by this operation.
Function in ldk_ui.h

ldk_ui_begin_scrollview

Begin a scrollable region and restore its scroll position.

LDK_API LDKUIPoint ldk_ui_begin_scrollview(
 LDKUIContext *ctx,
 LDKUIPoint scroll,
 u32 flags
);

Parameters

LDKUIContext *ctx
UI context used by this operation.
LDKUIPoint scroll
Current scroll offset.
u32 flags
Bitmask of options controlling this operation.

Returns

The resulting point.

Function in ldk_ui.h

ldk_ui_end_scrollview

End the active scrollable region.

LDK_API void ldk_ui_end_scrollview(LDKUIContext *ctx);

Parameters

LDKUIContext *ctx
UI context used by this operation.
Function in ldk_ui.h

ldk_ui_begin_area_ex

Begin a collapsible UI area with an optional icon.

LDK_API bool ldk_ui_begin_area_ex(
 LDKUIContext *ctx,
 char const *title,
 LDKUIIcon icon,
 bool expanded
);

Parameters

LDKUIContext *ctx
UI context used by this operation.
char const *title
Title shown by the window or dialog.
LDKUIIcon icon
Icon shown by the widget.
bool expanded
Whether the collapsible item starts expanded.

Returns

True when the UI condition or interaction is active; false otherwise.

Function in ldk_ui.h

ldk_ui_begin_area

Begin a collapsible UI area.

LDK_API bool ldk_ui_begin_area(
 LDKUIContext *ctx,
 char const *title,
 bool expanded
);

Parameters

LDKUIContext *ctx
UI context used by this operation.
char const *title
Title shown by the window or dialog.
bool expanded
Whether the collapsible item starts expanded.

Returns

True when the UI condition or interaction is active; false otherwise.

Function in ldk_ui.h

ldk_ui_area_header_rect

Rectangle of the current area's header, for header action buttons.

LDK_API LDKUIRect ldk_ui_area_header_rect(LDKUIContext *ctx);

Parameters

LDKUIContext *ctx
UI context used by this operation.

Returns

The resulting rectangle.

Function in ldk_ui.h

ldk_ui_close_current_popup

Close the active popup.

LDK_API void ldk_ui_close_current_popup(LDKUIContext *ctx);

Parameters

LDKUIContext *ctx
UI context used by this operation.
Function in ldk_ui.h

ldk_ui_popup_is_open

Check whether a popup is currently open.

LDK_API bool ldk_ui_popup_is_open(
 LDKUIContext *ctx,
 LDKUIId id
);

Parameters

LDKUIContext *ctx
UI context used by this operation.
LDKUIId id
Identifier of the target object.

Returns

True when the queried condition holds; false otherwise.

Function in ldk_ui.h

ldk_ui_begin_popup

Begin drawing the named popup when it is open.

LDK_API bool ldk_ui_begin_popup(
 LDKUIContext *ctx,
 LDKUIId id
);

Parameters

LDKUIContext *ctx
UI context used by this operation.
LDKUIId id
Identifier of the target object.

Returns

True when the UI condition or interaction is active; false otherwise.

Function in ldk_ui.h

ldk_ui_icon_button

Draw an icon button and report its interaction.

LDK_API bool ldk_ui_icon_button(
 LDKUIContext *ctx,
 LDKUIIcon icon,
 char const *text
);

Parameters

LDKUIContext *ctx
UI context used by this operation.
LDKUIIcon icon
Icon shown by the widget.
char const *text
Text used by this operation.

Returns

True when the UI condition or interaction is active; false otherwise.

Function in ldk_ui.h

ldk_ui_label

Draw a label UI element.

LDK_API void ldk_ui_label(
 LDKUIContext *ctx,
 char const *text
);

Parameters

LDKUIContext *ctx
UI context used by this operation.
char const *text
Text used by this operation.
Function in ldk_ui.h

ldk_ui_icon_label

Draw an icon alongside text.

LDK_API void ldk_ui_icon_label(
 LDKUIContext *ctx,
 LDKUIIcon icon,
 char const *text
);

Parameters

LDKUIContext *ctx
UI context used by this operation.
LDKUIIcon icon
Icon shown by the widget.
char const *text
Text used by this operation.
Function in ldk_ui.h

ldk_ui_selectable_text

Draw selectable UI text.

LDK_API void ldk_ui_selectable_text(
 LDKUIContext *ctx,
 char const *text
);

Parameters

LDKUIContext *ctx
UI context used by this operation.
char const *text
Text used by this operation.
Function in ldk_ui.h

ldk_ui_color_view

Draw and interact with a color view control.

LDK_API bool ldk_ui_color_view(
 LDKUIContext *ctx,
 rgba32 color
);

Parameters

LDKUIContext *ctx
UI context used by this operation.
rgba32 color
Color value used by the operation.

Returns

True when the UI condition or interaction is active; false otherwise.

Function in ldk_ui.h

ldk_ui_button

Draw and interact with a button control.

LDK_API bool ldk_ui_button(
 LDKUIContext *ctx,
 char const *text
);

Parameters

LDKUIContext *ctx
UI context used by this operation.
char const *text
Text used by this operation.

Returns

True when the UI condition or interaction is active; false otherwise.

Function in ldk_ui.h

ldk_ui_toggle

Draw and interact with a toggle control.

LDK_API bool ldk_ui_toggle(
 LDKUIContext *ctx,
 bool value
);

Parameters

LDKUIContext *ctx
UI context used by this operation.
bool value
Input value or current widget value.

Returns

True when the UI condition or interaction is active; false otherwise.

Function in ldk_ui.h

ldk_ui_button_flat

Draw and interact with a button flat control.

LDK_API bool ldk_ui_button_flat(
 LDKUIContext *ctx,
 char const *text
);

Parameters

LDKUIContext *ctx
UI context used by this operation.
char const *text
Text used by this operation.

Returns

True when the UI condition or interaction is active; false otherwise.

Function in ldk_ui.h

ldk_ui_combo_box

Draw and interact with a combo box control.

LDK_API u32 ldk_ui_combo_box(
 LDKUIContext *ctx,
 const char *const *items,
 u32 item_count,
 u32 selected_index
);

Parameters

LDKUIContext *ctx
UI context used by this operation.
const char *const *items
Array of items presented by the widget.
u32 item_count
Number of items in the array.
u32 selected_index
Currently selected item index.

Returns

The resulting numeric value.

Function in ldk_ui.h

ldk_ui_slider

Draw and interact with a slider control.

LDK_API float ldk_ui_slider(
 LDKUIContext *ctx,
 float value,
 float min_value,
 float max_value
);

Parameters

LDKUIContext *ctx
UI context used by this operation.
float value
Input value or current widget value.
float min_value
Minimum permitted value.
float max_value
Maximum permitted value.

Returns

The resulting value.

Function in ldk_ui.h

ldk_ui_slider_input

Draw and interact with a slider input control.

LDK_API float ldk_ui_slider_input(
 LDKUIContext *ctx,
 float value,
 float min_value,
 float max_value
);

Parameters

LDKUIContext *ctx
UI context used by this operation.
float value
Input value or current widget value.
float min_value
Minimum permitted value.
float max_value
Maximum permitted value.

Returns

The resulting value.

Function in ldk_ui.h

ldk_ui_tree_node_ex

Draw a hierarchical tree item with icon and additional options.

LDK_API u32 ldk_ui_tree_node_ex(
 LDKUIContext *ctx,
 char const *title,
 LDKUIIcon icon,
 bool expanded,
 u32 depth,
 u32 flags
);

Parameters

LDKUIContext *ctx
UI context used by this operation.
char const *title
Title shown by the window or dialog.
LDKUIIcon icon
Icon shown by the widget.
bool expanded
Whether the collapsible item starts expanded.
u32 depth
Hierarchy depth or depth setting.
u32 flags
Bitmask of options controlling this operation.

Returns

The resulting numeric value.

Function in ldk_ui.h

ldk_ui_tree_node

Draw a hierarchical tree item with expand/collapse state.

LDK_API bool ldk_ui_tree_node(
 LDKUIContext *ctx,
 char const *title,
 bool expanded,
 u32 depth,
 u32 flags
);

Parameters

LDKUIContext *ctx
UI context used by this operation.
char const *title
Title shown by the window or dialog.
bool expanded
Whether the collapsible item starts expanded.
u32 depth
Hierarchy depth or depth setting.
u32 flags
Bitmask of options controlling this operation.

Returns

True when the UI condition or interaction is active; false otherwise.

Function in ldk_ui.h

ldk_ui_input_box

Draw an editable text box and update its buffer.

LDK_API u32 ldk_ui_input_box(
 LDKUIContext *ctx,
 char *buffer,
 u32 buffer_size
);

Parameters

LDKUIContext *ctx
UI context used by this operation.
char *buffer
Buffer containing the data or receiving formatted output.
u32 buffer_size
Capacity of the buffer in bytes.

Returns

The resulting numeric value.

Function in ldk_ui.h

ldk_ui_input_label

Draw an editable text label and update its buffer.

LDK_API u32 ldk_ui_input_label(
 LDKUIContext *ctx,
 char *buffer,
 u32 buffer_size
);

Parameters

LDKUIContext *ctx
UI context used by this operation.
char *buffer
Buffer containing the data or receiving formatted output.
u32 buffer_size
Capacity of the buffer in bytes.

Returns

The resulting numeric value.

Function in ldk_ui.h

ldk_ui_horizontal_line

Draw a horizontal line UI element.

LDK_API void ldk_ui_horizontal_line(LDKUIContext *ctx);

Parameters

LDKUIContext *ctx
UI context used by this operation.
Function in ldk_ui.h

ldk_ui_resize_handle_horizontal

Draw and interact with a resize handle horizontal control.

LDK_API float ldk_ui_resize_handle_horizontal(
 LDKUIContext *ctx,
 float value,
 float min_value,
 float max_value
);

Parameters

LDKUIContext *ctx
UI context used by this operation.
float value
Input value or current widget value.
float min_value
Minimum permitted value.
float max_value
Maximum permitted value.

Returns

The resulting value.

Function in ldk_ui.h

ldk_ui_resize_handle_vertical

Draw and interact with a resize handle vertical control.

LDK_API float ldk_ui_resize_handle_vertical(
 LDKUIContext *ctx,
 float value,
 float min_value,
 float max_value
);

Parameters

LDKUIContext *ctx
UI context used by this operation.
float value
Input value or current widget value.
float min_value
Minimum permitted value.
float max_value
Maximum permitted value.

Returns

The resulting value.

Function in ldk_ui.h

ldk_ui_tab_bar

Draw and interact with a tab bar control.

LDK_API LDKUITabBarResult ldk_ui_tab_bar(
 LDKUIContext *ctx,
 LDKUITabBarItem const *items,
 u32 item_count,
 u32 active_index
);

Parameters

LDKUIContext *ctx
UI context used by this operation.
LDKUITabBarItem const *items
Array of items presented by the widget.
u32 item_count
Number of items in the array.
u32 active_index
Currently active item index.

Returns

Result of the operation.

Function in ldk_ui.h

ldk_ui_widget_label

Draw UI text at an explicit rectangle.

LDK_API void ldk_ui_widget_label(
 LDKUIContext *ctx,
 LDKUIId id,
 char const *text,
 LDKUIRect rect
);

Parameters

LDKUIContext *ctx
UI context used by this operation.
LDKUIId id
Identifier of the target object.
char const *text
Text used by this operation.
LDKUIRect rect
UI or geometry rectangle.
Function in ldk_ui.h

ldk_ui_widget_gradient

Draw a four-corner UI color gradient.

LDK_API void ldk_ui_widget_gradient(
 LDKUIContext *ctx,
 LDKUIId id,
 rgba32 top_left,
 rgba32 top_right,
 rgba32 bottom_right,
 rgba32 bottom_left,
 LDKUIRect rect
);

Parameters

LDKUIContext *ctx
UI context used by this operation.
LDKUIId id
Identifier of the target object.
rgba32 top_left
Top left used by this operation.
rgba32 top_right
Top right used by this operation.
rgba32 bottom_right
Bottom right used by this operation.
rgba32 bottom_left
Bottom left used by this operation.
LDKUIRect rect
UI or geometry rectangle.
Function in ldk_ui.h

ldk_ui_widget_color_view

Draw and interact with a color view control.

LDK_API bool ldk_ui_widget_color_view(
 LDKUIContext *ctx,
 LDKUIId id,
 rgba32 color,
 LDKUIRect rect
);

Parameters

LDKUIContext *ctx
UI context used by this operation.
LDKUIId id
Identifier of the target object.
rgba32 color
Color value used by the operation.
LDKUIRect rect
UI or geometry rectangle.

Returns

True when the UI condition or interaction is active; false otherwise.

Function in ldk_ui.h

ldk_ui_widget_button

Draw and interact with a button control.

LDK_API bool ldk_ui_widget_button(
 LDKUIContext *ctx,
 LDKUIId id,
 char const *text,
 LDKUIRect rect
);

Parameters

LDKUIContext *ctx
UI context used by this operation.
LDKUIId id
Identifier of the target object.
char const *text
Text used by this operation.
LDKUIRect rect
UI or geometry rectangle.

Returns

True when the UI condition or interaction is active; false otherwise.

Function in ldk_ui.h

ldk_ui_widget_icon_button

Draw and interact with an icon button control.

LDK_API bool ldk_ui_widget_icon_button(
 LDKUIContext *ctx,
 LDKUIId id,
 LDKUIIcon icon,
 char const *text,
 LDKUIRect rect
);

Parameters

LDKUIContext *ctx
UI context used by this operation.
LDKUIId id
Identifier of the target object.
LDKUIIcon icon
Icon shown by the widget.
char const *text
Text used by this operation.
LDKUIRect rect
UI or geometry rectangle.

Returns

True when the UI condition or interaction is active; false otherwise.

Function in ldk_ui.h

ldk_ui_widget_icon_button_flat

Draw and interact with an icon button flat control.

LDK_API bool ldk_ui_widget_icon_button_flat(
 LDKUIContext *ctx,
 LDKUIId id,
 LDKUIIcon icon,
 char const *text,
 LDKUIRect rect
);

Parameters

LDKUIContext *ctx
UI context used by this operation.
LDKUIId id
Identifier of the target object.
LDKUIIcon icon
Icon shown by the widget.
char const *text
Text used by this operation.
LDKUIRect rect
UI or geometry rectangle.

Returns

True when the UI condition or interaction is active; false otherwise.

Function in ldk_ui.h

ldk_ui_widget_button_flat

Draw and interact with a button flat control.

LDK_API bool ldk_ui_widget_button_flat(
 LDKUIContext *ctx,
 LDKUIId id,
 char const *text,
 LDKUIRect rect
);

Parameters

LDKUIContext *ctx
UI context used by this operation.
LDKUIId id
Identifier of the target object.
char const *text
Text used by this operation.
LDKUIRect rect
UI or geometry rectangle.

Returns

True when the UI condition or interaction is active; false otherwise.

Function in ldk_ui.h

ldk_ui_widget_toggle

Draw a boolean toggle at an explicit rectangle.

LDK_API bool ldk_ui_widget_toggle(
 LDKUIContext *ctx,
 LDKUIId id,
 bool value,
 LDKUIRect rect
);

Parameters

LDKUIContext *ctx
UI context used by this operation.
LDKUIId id
Identifier of the target object.
bool value
Input value or current widget value.
LDKUIRect rect
UI or geometry rectangle.

Returns

True when the UI condition or interaction is active; false otherwise.

Function in ldk_ui.h

ldk_ui_widget_combo_box

Draw and interact with a combo box control.

LDK_API u32 ldk_ui_widget_combo_box(
 LDKUIContext *ctx,
 LDKUIId id,
 const char *const *items,
 u32 item_count,
 u32 selected_index,
 LDKUIRect rect
);

Parameters

LDKUIContext *ctx
UI context used by this operation.
LDKUIId id
Identifier of the target object.
const char *const *items
Array of items presented by the widget.
u32 item_count
Number of items in the array.
u32 selected_index
Currently selected item index.
LDKUIRect rect
UI or geometry rectangle.

Returns

The resulting numeric value.

Function in ldk_ui.h

ldk_ui_widget_slider

Draw a numeric slider at an explicit rectangle.

LDK_API float ldk_ui_widget_slider(
 LDKUIContext *ctx,
 LDKUIId id,
 float value,
 float min_value,
 float max_value,
 LDKUIRect rect
);

Parameters

LDKUIContext *ctx
UI context used by this operation.
LDKUIId id
Identifier of the target object.
float value
Input value or current widget value.
float min_value
Minimum permitted value.
float max_value
Maximum permitted value.
LDKUIRect rect
UI or geometry rectangle.

Returns

The resulting value.

Function in ldk_ui.h

ldk_ui_widget_slider_input

Draw an editable numeric slider at an explicit rectangle.

LDK_API float ldk_ui_widget_slider_input(
 LDKUIContext *ctx,
 LDKUIId id,
 float value,
 float min_value,
 float max_value,
 LDKUIRect rect
);

Parameters

LDKUIContext *ctx
UI context used by this operation.
LDKUIId id
Identifier of the target object.
float value
Input value or current widget value.
float min_value
Minimum permitted value.
float max_value
Maximum permitted value.
LDKUIRect rect
UI or geometry rectangle.

Returns

The resulting value.

Function in ldk_ui.h

ldk_ui_widget_scrollbar_vertical

Draw a vertical scrollbar at an explicit rectangle.

LDK_API float ldk_ui_widget_scrollbar_vertical(
 LDKUIContext *ctx,
 LDKUIId id,
 float scroll,
 float visible_size,
 float content_size,
 LDKUIRect rect
);

Parameters

LDKUIContext *ctx
UI context used by this operation.
LDKUIId id
Identifier of the target object.
float scroll
Current scroll offset.
float visible_size
Length of the visible region.
float content_size
Length of the scrollable content.
LDKUIRect rect
UI or geometry rectangle.

Returns

The resulting value.

Function in ldk_ui.h

ldk_ui_widget_scrollbar_horizontal

Draw a horizontal scrollbar at an explicit rectangle.

LDK_API float ldk_ui_widget_scrollbar_horizontal(
 LDKUIContext *ctx,
 LDKUIId id,
 float scroll,
 float visible_size,
 float content_size,
 LDKUIRect rect
);

Parameters

LDKUIContext *ctx
UI context used by this operation.
LDKUIId id
Identifier of the target object.
float scroll
Current scroll offset.
float visible_size
Length of the visible region.
float content_size
Length of the scrollable content.
LDKUIRect rect
UI or geometry rectangle.

Returns

The resulting value.

Function in ldk_ui.h

ldk_ui_widget_input_box

Draw an editable text box at an explicit rectangle.

LDK_API u32 ldk_ui_widget_input_box(
 LDKUIContext *ctx,
 LDKUIId id,
 char *buffer,
 u32 buffer_size,
 LDKUIRect rect
);

Parameters

LDKUIContext *ctx
UI context used by this operation.
LDKUIId id
Identifier of the target object.
char *buffer
Buffer containing the data or receiving formatted output.
u32 buffer_size
Capacity of the buffer in bytes.
LDKUIRect rect
UI or geometry rectangle.

Returns

The resulting numeric value.

Function in ldk_ui.h

ldk_ui_widget_input_label

Draw an editable text label at an explicit rectangle.

LDK_API u32 ldk_ui_widget_input_label(
 LDKUIContext *ctx,
 LDKUIId id,
 char *buffer,
 u32 buffer_size,
 LDKUIRect rect
);

Parameters

LDKUIContext *ctx
UI context used by this operation.
LDKUIId id
Identifier of the target object.
char *buffer
Buffer containing the data or receiving formatted output.
u32 buffer_size
Capacity of the buffer in bytes.
LDKUIRect rect
UI or geometry rectangle.

Returns

The resulting numeric value.

Function in ldk_ui.h

ldk_ui_widget_tab

Draw a tab UI item at an explicit rectangle.

LDK_API bool ldk_ui_widget_tab(
 LDKUIContext *ctx,
 LDKUIId id,
 LDKUIIcon icon,
 char const *text,
 LDKUIRect rect,
 bool active
);

Parameters

LDKUIContext *ctx
UI context used by this operation.
LDKUIId id
Identifier of the target object.
LDKUIIcon icon
Icon shown by the widget.
char const *text
Text used by this operation.
LDKUIRect rect
UI or geometry rectangle.
bool active
Active used by this operation.

Returns

True when the UI condition or interaction is active; false otherwise.

Function in ldk_ui.h

ldk_ui_widget_resize_handle_horizontal

Draw a horizontal resize handle at an explicit rectangle.

LDK_API float ldk_ui_widget_resize_handle_horizontal(
 LDKUIContext *ctx,
 LDKUIId id,
 float value,
 float min_value,
 float max_value,
 LDKUIRect rect
);

Parameters

LDKUIContext *ctx
UI context used by this operation.
LDKUIId id
Identifier of the target object.
float value
Input value or current widget value.
float min_value
Minimum permitted value.
float max_value
Maximum permitted value.
LDKUIRect rect
UI or geometry rectangle.

Returns

The resulting value.

Function in ldk_ui.h

ldk_ui_widget_resize_handle_vertical

Draw a vertical resize handle at an explicit rectangle.

LDK_API float ldk_ui_widget_resize_handle_vertical(
 LDKUIContext *ctx,
 LDKUIId id,
 float value,
 float min_value,
 float max_value,
 LDKUIRect rect
);

Parameters

LDKUIContext *ctx
UI context used by this operation.
LDKUIId id
Identifier of the target object.
float value
Input value or current widget value.
float min_value
Minimum permitted value.
float max_value
Maximum permitted value.
LDKUIRect rect
UI or geometry rectangle.

Returns

The resulting value.

Struct in ldk_ui.h

LDKUIThemeFile

A resolved UI theme and its display name. Contains no owned resources.

typedef struct LDKUIThemeFile{
  LDKUITheme theme;
  char name[128];
}LDKUIThemeFile;
Function in ldk_ui.h

ldk_ui_theme_tml_parse

Parse an LDK theme from a null-terminated TML string. The output is replaced only on success. The theme inherits the selected built-in palette, and its icon handles are not loaded from the document. On failure, error receives a diagnostic when a buffer is provided.

LDK_API bool ldk_ui_theme_tml_parse(
 char const *source,
 LDKUIThemeFile *out_theme,
 char *error,
 size_t error_size
);

Parameters

char const *source
Source object or source data for this operation.
LDKUIThemeFile *out_theme
Receives the parsed UI theme.
char *error
Receives an error description when parsing fails.
size_t error_size
Capacity of the error buffer, in bytes.

Returns

True if the operation succeeds; false otherwise.

Function in ldk_ui.h

ldk_ui_theme_tml_load

Read and parse a UTF-8 TML theme file. The path is an ordinary filesystem path; discovery and application of the theme are separate responsibilities. The output is unchanged on failure.

LDK_API bool ldk_ui_theme_tml_load(
 char const *path,
 LDKUIThemeFile *out_theme,
 char *error,
 size_t error_size
);

Parameters

char const *path
Path identifying the file or resource.
LDKUIThemeFile *out_theme
Receives the parsed UI theme.
char *error
Receives an error description when parsing fails.
size_t error_size
Capacity of the error buffer, in bytes.

Returns

True if the operation succeeds; false otherwise.