--- a/ui/gtk/toolbar.h Sun May 23 09:44:43 2021 +0200 +++ b/ui/gtk/toolbar.h Sat Jan 04 16:38:48 2025 +0100 @@ -30,16 +30,18 @@ #define TOOLBAR_H #include "../ui/toolbar.h" -#include <ucx/map.h> -#include <ucx/list.h> +#include "../common/toolbar.h" +#include <cx/map.h> +#include <cx/list.h> -#include "model.h" -#include "tree.h" +#include "list.h" #ifdef __cplusplus extern "C" { #endif +#if UI_GTK2 || UI_GTK3 + typedef struct UiToolItemI UiToolItemI; typedef struct UiToolItem UiToolItem; typedef struct UiStToolItem UiStToolItem; @@ -61,7 +63,7 @@ ui_callback callback; void *userdata; const char *varname; - UcxList *groups; + CxList *groups; int isimportant; }; @@ -71,7 +73,7 @@ ui_callback callback; void *userdata; const char *varname; - UcxList *groups; + CxList *groups; int isimportant; }; @@ -82,7 +84,7 @@ const char *stockid; UiInteger *value; const char *var; - UcxList *groups; + CxList *groups; int isimportant; }; @@ -97,12 +99,11 @@ struct UiToolbarComboBoxNV { UiToolItemI item; char *listname; - ui_getvaluefunc getvalue; + ui_getvaluefunc getvalue; ui_callback callback; void *userdata; }; -void ui_toolbar_init(); void ui_toolitem_vstgr( char *name, @@ -114,18 +115,33 @@ GtkWidget* ui_create_toolbar(UiObject *obj); -void add_toolitem_widget(GtkToolbar *tb, UiToolItem *item, UiObject *obj); -void add_toolitem_st_widget(GtkToolbar *tb, UiStToolItem *item, UiObject *obj); -void add_toolitem_toggle_widget(GtkToolbar *tb, UiToggleToolItem *item, UiObject *obj); +void ui_toolbar_add_items(UiObject *obj, GtkWidget *toolbar, CxMap *items, CxList *defaults); + +void add_toolitem_widget(GtkToolbar *tb, UiToolbarItem *item, UiObject *obj); +void add_toolitem_toggle_widget(GtkToolbar *tb, UiToolbarToggleItem *item, UiObject *obj); +void add_toolitem_menu_widget(GtkToolbar *tb, UiToolbarMenuItem *item, UiObject *obj); + +void ui_tool_button_toggled(GtkToggleToolButton *widget, UiVarEventData *event); +int64_t ui_tool_toggle_button_get(UiInteger *integer); +void ui_tool_toggle_button_set(UiInteger *integer, int64_t value); +GtkWidget* ui_create_headerbar(UiObject *obj); + +void ui_toolbar_headerbar_add_items(UiObject *obj, GtkWidget *headerbar, CxMap *items, CxList *defaults); + +void add_headerbar_item_widget(GtkHeaderBar *hb, UiToolbarItem *item, UiObject *obj); +void add_headerbar_item_toggle_widget(GtkHeaderBar *hb, UiToolbarToggleItem *item, UiObject *obj); +void add_headerbar_item_menu_widget(GtkHeaderBar *hb, UiToolbarMenuItem *item, UiObject *obj); + + +/* void add_toolbar_combobox(GtkToolbar *tb, UiToolbarComboBox *cb, UiObject *obj); void add_toolbar_combobox_nv(GtkToolbar *tb, UiToolbarComboBoxNV *cb, UiObject *obj); void ui_combobox_change_event(GtkComboBox *widget, UiEventData *e); void ui_combobox_update(UiEvent *event, void *combobox); +*/ -void ui_tool_button_toggled(GtkToggleToolButton *widget, UiEventData *event); -int64_t ui_tool_toggle_button_get(UiInteger *integer); -void ui_tool_toggle_button_set(UiInteger *integer, int64_t value); +#endif #ifdef __cplusplus }