ui/gtk/container.h

changeset 103
6606616eca9f
parent 102
64ded9f6a6c6
child 108
77254bd6dccb
equal deleted inserted replaced
102:64ded9f6a6c6 103:6606616eca9f
34 #include "toolkit.h" 34 #include "toolkit.h"
35 #include <string.h> 35 #include <string.h>
36 36
37 #include <cx/allocator.h> 37 #include <cx/allocator.h>
38 #include <cx/hash_map.h> 38 #include <cx/hash_map.h>
39 #include <cx/list.h>
40 #include <cx/array_list.h>
39 41
40 #ifdef __cplusplus 42 #ifdef __cplusplus
41 extern "C" { 43 extern "C" {
42 #endif 44 #endif
43 45
44 #define ui_reset_layout(layout) memset(&(layout), 0, sizeof(UiLayout)) 46 #define ui_reset_layout(layout) memset(&(layout), 0, sizeof(UiLayout))
45 #define ui_lb2bool(b) ((b) == UI_LAYOUT_TRUE ? TRUE : FALSE) 47 #define ui_lb2bool(b) ((b) == UI_LAYOUT_TRUE ? TRUE : FALSE)
46 #define ui_bool2lb(b) ((b) ? UI_LAYOUT_TRUE : UI_LAYOUT_FALSE) 48 #define ui_bool2lb(b) ((b) ? UI_LAYOUT_TRUE : UI_LAYOUT_FALSE)
47 49
48 typedef void (*ui_container_add_f)(UiContainer*, GtkWidget*, UiBool); 50 typedef void (*ui_container_add_f)(UiContainer*, GtkWidget*, UiBool);
49 51
50 typedef struct UiDocumentView UiDocumentView; 52 typedef struct UiDocumentView UiDocumentView;
51 53
52 typedef struct UiLayout UiLayout; 54
53 typedef enum UiLayoutBool UiLayoutBool; 55 typedef enum UiLayoutBool {
54
55 enum UiLayoutBool {
56 UI_LAYOUT_UNDEFINED = 0, 56 UI_LAYOUT_UNDEFINED = 0,
57 UI_LAYOUT_TRUE, 57 UI_LAYOUT_TRUE,
58 UI_LAYOUT_FALSE, 58 UI_LAYOUT_FALSE,
59 }; 59 } UiLayoutBool;
60 60
61 typedef struct UiLayout UiLayout;
61 struct UiLayout { 62 struct UiLayout {
62 UiLayoutBool fill; 63 UiLayoutBool fill;
63 UiBool newline; 64 UiBool newline;
64 char *label; 65 char *label;
65 UiBool hexpand; 66 UiBool hexpand;
125 126
126 127
127 typedef struct UiSplitPaneContainer { 128 typedef struct UiSplitPaneContainer {
128 UiContainer container; 129 UiContainer container;
129 GtkWidget *current_pane; 130 GtkWidget *current_pane;
131 CxList *children;
130 UiOrientation orientation; 132 UiOrientation orientation;
131 int pos; 133 int pos;
132 int max; 134 int max;
133 int nchildren; 135 int nchildren;
136 int initial_position;
134 } UiSplitPaneContainer; 137 } UiSplitPaneContainer;
135 138
136 typedef struct UiHeaderbarContainer { 139 typedef struct UiHeaderbarContainer {
137 UiContainer container; 140 UiContainer container;
138 GtkWidget *centerbox; 141 GtkWidget *centerbox;
195 void ui_scrolledwindow_container_add(UiContainer *ct, GtkWidget *widget, UiBool fill); 198 void ui_scrolledwindow_container_add(UiContainer *ct, GtkWidget *widget, UiBool fill);
196 199
197 UiContainer* ui_tabview_container(UiObject *obj, GtkWidget *tabview); 200 UiContainer* ui_tabview_container(UiObject *obj, GtkWidget *tabview);
198 void ui_tabview_container_add(UiContainer *ct, GtkWidget *widget, UiBool fill); 201 void ui_tabview_container_add(UiContainer *ct, GtkWidget *widget, UiBool fill);
199 202
200 UiContainer* ui_splitpane_container(UiObject *obj, GtkWidget *pane, UiOrientation orientation, int max); 203 UiContainer* ui_splitpane_container(UiObject *obj, GtkWidget *pane, UiOrientation orientation, int max, int init);
201 void ui_splitpane_container_add(UiContainer *ct, GtkWidget *widget, UiBool fill); 204 void ui_splitpane_container_add(UiContainer *ct, GtkWidget *widget, UiBool fill);
202 205
203 206
204 UiGtkTabView* ui_widget_get_tabview_data(UIWIDGET tabview); 207 UiGtkTabView* ui_widget_get_tabview_data(UIWIDGET tabview);
205 208

mercurial