1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29 #import "../ui/toolbar.h"
30 #import "toolkit.h"
31 #import <stdarg.h>
32
33
34 @protocol UiToolItem
35 - (NSToolbarItem *) createItem:(NSToolbar*)toolbar
36 identifier:(NSString*)identifier
37 object:(UiObject*)obj;
38
39 - (
void) addGroup:(
int)group;
40
41 - (UcxList*) groups;
42
43 @end
44
45
46
47
48
49
50
51 @interface UiToolbarStockItem : NSObject <UiToolItem> {
52 char *name;
53 char *stockid;
54 ui_callback callback;
55 void *userdata;
56 UcxList *groups;
57 BOOL isToggleButton;
58 }
59
60 - (UiToolbarStockItem*) initWithIdentifier:(
char*)identifier
61 stockID:(
char*)sid
62 callback:(ui_callback)f
63 userdata:(
void*)data;
64
65 - (
void) setIsToggleButton:(
BOOL)t;
66
67
68 @end
69
70
71
72
73
74
75 @interface UiToolbarItem : NSObject <UiToolItem> {
76 char *name;
77 char *label;
78
79 ui_callback callback;
80 void *userdata;
81 UcxList *groups;
82 BOOL isToggleButton;
83 }
84
85 - (UiToolbarItem*) initWithIdentifier:(
char*)identifier
86 label:(
char*)lbl
87 callback:(ui_callback)f
88 userdata:(
void*)data;
89
90 - (
void) setIsToggleButton:(
BOOL)t;
91
92
93 @end
94
95
96
97
98
99
100 @interface UiToolbarDelegate : NSObject <NSToolbarDelegate> {
101 NSMutableArray *allowedItems;
102 NSMutableArray *defaultItems;
103 NSMutableDictionary *items;
104 }
105
106 - (UiToolbarDelegate*) init;
107
108 - (
void) addDefault:(NSString*)identifier;
109
110 - (
void) addItem: (NSString*) identifier
111 item: (NSObject<UiToolItem>*) item;
112
113 @end
114
115
116
117
118
119 @interface UiToolbar : NSToolbar {
120 UiObject *obj;
121 }
122
123 - (UiToolbar*) initWithObject:(UiObject*)object;
124
125 - (UiObject*) object;
126
127 @end
128
129 void ui_toolbar_init();
130 void ui_toolbar_stock_button(
char *name,
char *stockid,
BOOL toggle, ui_callback f,
void *udata, va_list ap);
131 NSToolbar* ui_create_toolbar(UiObject *obj);
132