ui/motif/container.h

changeset 61
7ee124a58fe3
parent 60
7cd1b8890302
child 62
70d2aee84432
equal deleted inserted replaced
60:7cd1b8890302 61:7ee124a58fe3
40 #define ui_reset_layout(layout) memset(&(layout), 0, sizeof(UiLayout)) 40 #define ui_reset_layout(layout) memset(&(layout), 0, sizeof(UiLayout))
41 41
42 typedef struct MotifTabbedPane MotifTabbedPane; 42 typedef struct MotifTabbedPane MotifTabbedPane;
43 typedef struct UiTab UiTab; 43 typedef struct UiTab UiTab;
44 typedef struct UiBoxContainer UiBoxContainer; 44 typedef struct UiBoxContainer UiBoxContainer;
45 typedef struct UiLayout UiLayout;
45 46
46 typedef Widget (*ui_container_add_f)(UiContainer*, Arg*, int*, UiBool); 47 typedef Widget (*ui_container_add_f)(UiContainer*, Arg*, int*, UiBool);
47 48
48 typedef struct UiLayout UiLayout; 49 typedef enum UiLayoutBool UiLayoutBool;
49 typedef enum UiLayoutBool UiLayoutBool; 50 typedef enum UiBoxOrientation UiBoxOrientation;
50 51
51 52
52 enum UiLayoutBool { 53 enum UiLayoutBool {
53 UI_LAYOUT_UNDEFINED = 0, 54 UI_LAYOUT_UNDEFINED = 0,
54 UI_LAYOUT_TRUE, 55 UI_LAYOUT_TRUE,
55 UI_LAYOUT_FALSE, 56 UI_LAYOUT_FALSE,
57 };
58
59 enum UiBoxOrientation {
60 UI_BOX_VERTICAL = 0,
61 UI_BOX_HORIZONTAL
56 }; 62 };
57 63
58 struct UiLayout { 64 struct UiLayout {
59 UiLayoutBool fill; 65 UiLayoutBool fill;
60 }; 66 };
67 }; 73 };
68 74
69 struct UiBoxContainer { 75 struct UiBoxContainer {
70 UiContainer container; 76 UiContainer container;
71 Widget prev_widget; 77 Widget prev_widget;
72 Widget filled_widget;
73 UiBool cur_fill;
74 UiBool has_fill; 78 UiBool has_fill;
79 UiBoxOrientation orientation;
75 }; 80 };
76 81
77 struct MotifTabbedPane { 82 struct MotifTabbedPane {
78 UiTabbedPane view; 83 UiTabbedPane view;
79 Widget tabbar; 84 Widget tabbar;
90 95
91 UiContainer* ui_frame_container(UiObject *obj, Widget frame); 96 UiContainer* ui_frame_container(UiObject *obj, Widget frame);
92 Widget ui_frame_container_prepare(UiContainer *ct, Arg *args, int *n, UiBool fill); 97 Widget ui_frame_container_prepare(UiContainer *ct, Arg *args, int *n, UiBool fill);
93 void ui_frame_container_add(UiContainer *ct, Widget widget); 98 void ui_frame_container_add(UiContainer *ct, Widget widget);
94 99
95 UiContainer* ui_vbox_container(UiObject *obj, Widget box); 100 UiContainer* ui_box_container(UiObject *obj, Widget box, UiBoxOrientation orientation);
96 Widget ui_vbox_container_prepare(UiContainer *ct, Arg *args, int *n, UiBool fill); 101 Widget ui_box_container_prepare(UiContainer *ct, Arg *args, int *n, UiBool fill);
97 void ui_vbox_container_add(UiContainer *ct, Widget widget); 102 void ui_box_container_add(UiContainer *ct, Widget widget);
98 103
99 void ui_tab_button_callback(Widget widget, UiTab *tab, XtPointer d); 104 void ui_tab_button_callback(Widget widget, UiTab *tab, XtPointer d);
100 void ui_change_tab(MotifTabbedPane *pane, UiTab *tab); 105 void ui_change_tab(MotifTabbedPane *pane, UiTab *tab);
101 106
102 void ui_tab_set_document(UiContext *ctx, void *document); 107 void ui_tab_set_document(UiContext *ctx, void *document);

mercurial