--- a/ui/motif/menu.h Thu Dec 12 20:01:43 2024 +0100 +++ b/ui/motif/menu.h Mon Jan 06 22:22:55 2025 +0100 @@ -31,12 +31,40 @@ #include "../ui/menu.h" #include "../common/menu.h" +#include "../common/context.h" #ifdef __cplusplus extern "C" { #endif +typedef struct UiActiveMenuItemList UiActiveMenuItemList; +struct UiActiveMenuItemList { + UiObject *object; + Widget menu; + int index; + int oldcount; + UiVar *var; + ui_getvaluefunc getvalue; + ui_callback callback; + void *userdata; + bool addseparator; +}; + +typedef void(*ui_menu_add_f)(Widget, int, UiMenuItemI*, UiObject*); + +void ui_create_menubar(UiObject *obj, Widget window); +void ui_add_menu_widget(Widget parent, int i, UiMenuItemI *item, UiObject *obj); +void add_menu_widget(Widget parent, int i, UiMenuItemI *item, UiObject *obj); +void add_menuitem_widget(Widget parent, int i, UiMenuItemI *item, UiObject *obj); +void add_menuitem_st_widget(Widget p, int i, UiMenuItemI *item, UiObject *obj); +void add_menuseparator_widget(Widget p, int i, UiMenuItemI *item, UiObject *obj); +void add_checkitem_widget(Widget p, int i, UiMenuItemI *item, UiObject *obj); +void add_radioitem_widget(Widget p, int index, UiMenuItemI *item, UiObject *obj); +void add_checkitemnv_widget(Widget p, int i, UiMenuItemI *item, UiObject *obj); +void add_menuitem_list_widget(Widget p, int i, UiMenuItemI *item, UiObject *obj); + +void ui_update_menuitem_list(UiEvent *event, UiActiveMenuItemList *list); #ifdef __cplusplus }