#import "../ui/menu.h"
#import "toolkit.h"
#import <ucx/list.h>
typedef struct UiAbstractMenuItem {
int (*update)(id window, void *item);
void *item_data;
} UiAbstractMenuItem;
typedef struct UiMenuItem {
NSMenuItem *item;
int state;
} UiMenuItem;
typedef struct UiStateItem {
NSMenuItem *item;
char *var;
} UiStateItem;
typedef struct UiMenuItemList {
NSMenu *menu;
NSMenuItem *first;
UiList *list;
int index;
int oldcount;
ui_callback callback;
void *data;
} UiMenuItemList;
@interface UiMenuDelegate : NSObject <NSMenuDelegate> {
UcxList *items;
UcxList *itemlists;
}
- (void) menuNeedsUpdate:(NSMenu*) menu;
- (void) addItem:(NSMenuItem*) item var: (char*)name;
- (void) addList:(UiList*) list menu:(NSMenu*)menu index: (int)i callback: (ui_callback)f data:(void*) data;
- (UcxList*) items;
- (UcxList*) lists;
@end
@interface UiGroupMenuItem : NSMenuItem {
NSMutableArray *groups;
}
- (id)initWithTitle:(NSString*)title action:(SEL)action keyEquivalent:(NSString*)s;
- (void) addGroup:(int)group;
- (void) checkGroups:(int*)g count:(int)n;
@end
void ui_menu_init();
UiMenuDelegate* ui_menu_delegate();
int ui_menuitem_get(UiInteger *i);
void ui_menuitem_set(UiInteger *i, int value);
int ui_update_item(id window, void *data);
int ui_update_item_list(id window, void *data);