ui/gtk/toolbar.h

changeset 431
bb7da585debc
parent 321
8d63b7cd3d98
equal deleted inserted replaced
169:fe49cff3c571 431:bb7da585debc
28 28
29 #ifndef TOOLBAR_H 29 #ifndef TOOLBAR_H
30 #define TOOLBAR_H 30 #define TOOLBAR_H
31 31
32 #include "../ui/toolbar.h" 32 #include "../ui/toolbar.h"
33 #include <ucx/map.h> 33 #include "../common/toolbar.h"
34 #include <ucx/list.h> 34 #include <cx/map.h>
35 #include <cx/list.h>
35 36
36 #include "model.h" 37 #include "list.h"
37 #include "tree.h"
38 38
39 #ifdef __cplusplus 39 #ifdef __cplusplus
40 extern "C" { 40 extern "C" {
41 #endif 41 #endif
42 42
43 #if UI_GTK2 || UI_GTK3
44
43 typedef struct UiToolItemI UiToolItemI; 45 typedef struct UiToolItemI UiToolItemI;
44 typedef struct UiToolItem UiToolItem; 46 typedef struct UiToolItem UiToolItem;
45 typedef struct UiStToolItem UiStToolItem; 47 typedef struct UiStToolItem UiStToolItem;
46 typedef struct UiToggleToolItem UiToggleToolItem; 48 typedef struct UiToggleToolItem UiToggleToolItem;
47 49
59 const char *label; 61 const char *label;
60 const char *image; 62 const char *image;
61 ui_callback callback; 63 ui_callback callback;
62 void *userdata; 64 void *userdata;
63 const char *varname; 65 const char *varname;
64 UcxList *groups; 66 CxList *groups;
65 int isimportant; 67 int isimportant;
66 }; 68 };
67 69
68 struct UiStToolItem { 70 struct UiStToolItem {
69 UiToolItemI item; 71 UiToolItemI item;
70 const char *stockid; 72 const char *stockid;
71 ui_callback callback; 73 ui_callback callback;
72 void *userdata; 74 void *userdata;
73 const char *varname; 75 const char *varname;
74 UcxList *groups; 76 CxList *groups;
75 int isimportant; 77 int isimportant;
76 }; 78 };
77 79
78 struct UiToggleToolItem { 80 struct UiToggleToolItem {
79 UiToolItemI item; 81 UiToolItemI item;
80 const char *label; 82 const char *label;
81 const char *image; 83 const char *image;
82 const char *stockid; 84 const char *stockid;
83 UiInteger *value; 85 UiInteger *value;
84 const char *var; 86 const char *var;
85 UcxList *groups; 87 CxList *groups;
86 int isimportant; 88 int isimportant;
87 }; 89 };
88 90
89 struct UiToolbarComboBox { 91 struct UiToolbarComboBox {
90 UiToolItemI item; 92 UiToolItemI item;
95 }; 97 };
96 98
97 struct UiToolbarComboBoxNV { 99 struct UiToolbarComboBoxNV {
98 UiToolItemI item; 100 UiToolItemI item;
99 char *listname; 101 char *listname;
100 ui_getvaluefunc getvalue; 102 ui_getvaluefunc getvalue;
101 ui_callback callback; 103 ui_callback callback;
102 void *userdata; 104 void *userdata;
103 }; 105 };
104 106
105 void ui_toolbar_init();
106 107
107 void ui_toolitem_vstgr( 108 void ui_toolitem_vstgr(
108 char *name, 109 char *name,
109 char *stockid, 110 char *stockid,
110 int isimportant, 111 int isimportant,
112 void *userdata, 113 void *userdata,
113 va_list ap); 114 va_list ap);
114 115
115 GtkWidget* ui_create_toolbar(UiObject *obj); 116 GtkWidget* ui_create_toolbar(UiObject *obj);
116 117
117 void add_toolitem_widget(GtkToolbar *tb, UiToolItem *item, UiObject *obj); 118 void ui_toolbar_add_items(UiObject *obj, GtkWidget *toolbar, CxMap *items, CxList *defaults);
118 void add_toolitem_st_widget(GtkToolbar *tb, UiStToolItem *item, UiObject *obj);
119 void add_toolitem_toggle_widget(GtkToolbar *tb, UiToggleToolItem *item, UiObject *obj);
120 119
120 void add_toolitem_widget(GtkToolbar *tb, UiToolbarItem *item, UiObject *obj);
121 void add_toolitem_toggle_widget(GtkToolbar *tb, UiToolbarToggleItem *item, UiObject *obj);
122 void add_toolitem_menu_widget(GtkToolbar *tb, UiToolbarMenuItem *item, UiObject *obj);
123
124 void ui_tool_button_toggled(GtkToggleToolButton *widget, UiVarEventData *event);
125 int64_t ui_tool_toggle_button_get(UiInteger *integer);
126 void ui_tool_toggle_button_set(UiInteger *integer, int64_t value);
127
128 GtkWidget* ui_create_headerbar(UiObject *obj);
129
130 void ui_toolbar_headerbar_add_items(UiObject *obj, GtkWidget *headerbar, CxMap *items, CxList *defaults);
131
132 void add_headerbar_item_widget(GtkHeaderBar *hb, UiToolbarItem *item, UiObject *obj);
133 void add_headerbar_item_toggle_widget(GtkHeaderBar *hb, UiToolbarToggleItem *item, UiObject *obj);
134 void add_headerbar_item_menu_widget(GtkHeaderBar *hb, UiToolbarMenuItem *item, UiObject *obj);
135
136
137 /*
121 void add_toolbar_combobox(GtkToolbar *tb, UiToolbarComboBox *cb, UiObject *obj); 138 void add_toolbar_combobox(GtkToolbar *tb, UiToolbarComboBox *cb, UiObject *obj);
122 void add_toolbar_combobox_nv(GtkToolbar *tb, UiToolbarComboBoxNV *cb, UiObject *obj); 139 void add_toolbar_combobox_nv(GtkToolbar *tb, UiToolbarComboBoxNV *cb, UiObject *obj);
123 void ui_combobox_change_event(GtkComboBox *widget, UiEventData *e); 140 void ui_combobox_change_event(GtkComboBox *widget, UiEventData *e);
124 void ui_combobox_update(UiEvent *event, void *combobox); 141 void ui_combobox_update(UiEvent *event, void *combobox);
142 */
125 143
126 void ui_tool_button_toggled(GtkToggleToolButton *widget, UiEventData *event); 144 #endif
127 int64_t ui_tool_toggle_button_get(UiInteger *integer);
128 void ui_tool_toggle_button_set(UiInteger *integer, int64_t value);
129 145
130 #ifdef __cplusplus 146 #ifdef __cplusplus
131 } 147 }
132 #endif 148 #endif
133 149

mercurial