LDKUIColor
typedef u32 LDKUIColor;
typedef u32 LDKUIColor;
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;
typedef struct LDKUIDrawCmd{
LDKUITextureHandle texture;
LDKUIRect clip_rect;
u32 index_offset;
u32 index_count;
}LDKUIDrawCmd;
Callback resolving the texture for a font atlas page.
typedef LDKUITextureHandle(*LDKUIGetFontPageTextureFn)(void *user, LDKFontInstance *font, u32 page_index);
userfontpage_indexHandle to the requested object or resource.
typedef struct LDKUIHitCandidate LDKUIHitCandidate;
typedef enum LDKUIHitLayer{
LDK_UI_HIT_LAYER_NORMAL=0,
LDK_UI_HIT_LAYER_POPUP=1,
}LDKUIHitLayer;
typedef uint32_t LDKUIId;
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;
typedef struct LDKUILayout LDKUILayout;
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;
typedef struct LDKUILayoutItemCache{
LDKUIId layout_id;
LDKUIId owner_window_id;
u32 item_index;
LDKUIRect rect;
u32 last_frame_touched;
}LDKUILayoutItemCache;
typedef struct LDKUILayoutRequest{
LDKUIItemType type;
LDKUISize min_size;
LDKUILayoutSize width;
LDKUILayoutSize height;
float weight;
bool has_height;
bool has_width;
bool hit_test;
}LDKUILayoutRequest;
typedef LDKPointf LDKUIPoint;
typedef uintptr_t LDKUITextureHandle;
typedef struct LDKUIVertex{
float x;
float y;
float u;
float v;
rgba32 color;
}LDKUIVertex;
#define LDK_UI_DEFAULT_SPACING 4.0f
#define LDK_UI_LAYOUT_ITEM_CACHE_CAPACITY 64
#define LDK_UI_LAYOUT_ITEM_CAPACITY 512
#define LDK_UI_LAYOUT_STACK_CAPACITY 64
Format a floating-point value for UI display.
LDK_API void ldk_ui_format_float(
char *buffer,
u32 buffer_size,
float value
);
char *bufferu32 buffer_sizefloat valueInitialize the UI.
LDK_API bool ldk_ui_initialize(
LDKUIContext *ctx,
LDKUIConfig const *config
);
LDKUIContext *ctxLDKUIConfig const *configTrue if the operation succeeds; false otherwise.
Shut down the UI.
LDK_API void ldk_ui_terminate(LDKUIContext *ctx);
LDKUIContext *ctx