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;
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;
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;
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_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.

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.