# HG changeset patch # User Olaf Wintermann # Date 1729452366 -7200 # Node ID c7427cadabd3a7c21604c8e6e68c00b0b8027877 # Parent 2dd42bd4fe5d0871da0153defbd8e9e3b8dce780 make ui_getappdir() and ui_configfile() public diff -r 2dd42bd4fe5d -r c7427cadabd3 ui/common/context.c --- a/ui/common/context.c Sun Oct 20 10:42:13 2024 +0200 +++ b/ui/common/context.c Sun Oct 20 21:26:06 2024 +0200 @@ -541,6 +541,10 @@ cxListAdd(ctx->group_widgets, &gw); } +UIEXPORT void *ui_ctx_allocator(UiContext *ctx) { + return (void*) ctx ? ctx->allocator : NULL; +} + void* ui_malloc(UiContext *ctx, size_t size) { return ctx ? cxMalloc(ctx->allocator, size) : NULL; } diff -r 2dd42bd4fe5d -r c7427cadabd3 ui/ui/properties.h --- a/ui/ui/properties.h Sun Oct 20 10:42:13 2024 +0200 +++ b/ui/ui/properties.h Sun Oct 20 21:26:06 2024 +0200 @@ -36,9 +36,6 @@ #endif typedef struct CxMap UiProperties; - -char* ui_getappdir(); -char* ui_configfile(char *name); char* ui_get_property(char *name); void ui_set_property(char *name, char *value); diff -r 2dd42bd4fe5d -r c7427cadabd3 ui/ui/toolkit.h --- a/ui/ui/toolkit.h Sun Oct 20 10:42:13 2024 +0200 +++ b/ui/ui/toolkit.h Sun Oct 20 21:26:06 2024 +0200 @@ -447,6 +447,7 @@ UIEXPORT void ui_unset_group(UiContext *ctx, int group); UIEXPORT int* ui_active_groups(UiContext *ctx, int *ngroups); +UIEXPORT void *ui_ctx_allocator(UiContext *ctx); UIEXPORT void* ui_malloc(UiContext *ctx, size_t size); UIEXPORT void* ui_calloc(UiContext *ctx, size_t nelem, size_t elsize); UIEXPORT void ui_free(UiContext *ctx, void *ptr); @@ -482,6 +483,12 @@ UIEXPORT void ui_text_set(UiText *s, const char* value); UIEXPORT char* ui_text_get(UiText *s); +UIEXPORT void ui_var_set_int(UiContext *ctx, const char *name, int64_t value); +UIEXPORT int64_t ui_var_get_int(UiContext *ctx, const char *name); +UIEXPORT void ui_var_set_double(UiContext *ctx, const char *name, double value); +UIEXPORT double ui_var_get_double(UiContext *ctx, const char *name); +UIEXPORT void ui_var_set_string(UiContext *ctx, const char *name, char *value); +UIEXPORT char* ui_var_get_string(UiContext *ctx, const char *name); UIEXPORT UiObserver* ui_observer_new(ui_callback f, void *data); UIEXPORT UiObserver* ui_obsvlist_add(UiObserver *list, UiObserver *observer); @@ -526,6 +533,10 @@ UIEXPORT UiStr ui_str(char *cstr); UIEXPORT UiStr ui_str_free(char *str, void (*free)(void *v)); + +UIEXPORT char* ui_getappdir(); +UIEXPORT char* ui_configfile(char *name); + #ifdef __cplusplus } #endif