--- a/ui/gtk/container.h Tue Feb 25 21:11:00 2025 +0100 +++ b/ui/gtk/container.h Sat Apr 05 16:46:11 2025 +0200 @@ -36,11 +36,13 @@ #include <cx/allocator.h> #include <cx/hash_map.h> +#include <cx/list.h> +#include <cx/array_list.h> #ifdef __cplusplus extern "C" { #endif - + #define ui_reset_layout(layout) memset(&(layout), 0, sizeof(UiLayout)) #define ui_lb2bool(b) ((b) == UI_LAYOUT_TRUE ? TRUE : FALSE) #define ui_bool2lb(b) ((b) ? UI_LAYOUT_TRUE : UI_LAYOUT_FALSE) @@ -49,15 +51,14 @@ typedef struct UiDocumentView UiDocumentView; -typedef struct UiLayout UiLayout; -typedef enum UiLayoutBool UiLayoutBool; -enum UiLayoutBool { +typedef enum UiLayoutBool { UI_LAYOUT_UNDEFINED = 0, UI_LAYOUT_TRUE, UI_LAYOUT_FALSE, -}; +} UiLayoutBool; +typedef struct UiLayout UiLayout; struct UiLayout { UiLayoutBool fill; UiBool newline; @@ -127,10 +128,12 @@ typedef struct UiSplitPaneContainer { UiContainer container; GtkWidget *current_pane; + CxList *children; UiOrientation orientation; int pos; int max; int nchildren; + int initial_position; } UiSplitPaneContainer; typedef struct UiHeaderbarContainer { @@ -197,7 +200,7 @@ UiContainer* ui_tabview_container(UiObject *obj, GtkWidget *tabview); void ui_tabview_container_add(UiContainer *ct, GtkWidget *widget, UiBool fill); -UiContainer* ui_splitpane_container(UiObject *obj, GtkWidget *pane, UiOrientation orientation, int max); +UiContainer* ui_splitpane_container(UiObject *obj, GtkWidget *pane, UiOrientation orientation, int max, int init); void ui_splitpane_container_add(UiContainer *ct, GtkWidget *widget, UiBool fill);