Sun, 20 Oct 2024 21:26:06 +0200
make ui_getappdir() and ui_configfile() public
ui/common/context.c | file | annotate | diff | comparison | revisions | |
ui/ui/properties.h | file | annotate | diff | comparison | revisions | |
ui/ui/toolkit.h | file | annotate | diff | comparison | revisions |
--- 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; }
--- 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);
--- 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