1 | /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ |
---|
2 | /** |
---|
3 | * bonobo-ui-component.h: Client UI signal multiplexer and verb repository. |
---|
4 | * |
---|
5 | * Author: |
---|
6 | * Michael Meeks (michael@helixcode.com) |
---|
7 | * |
---|
8 | * Copyright 1999, 2000 Helix Code, Inc. |
---|
9 | */ |
---|
10 | #ifndef _BONOBO_UI_COMPONENT_H_ |
---|
11 | #define _BONOBO_UI_COMPONENT_H_ |
---|
12 | |
---|
13 | #include <bonobo/bonobo-xobject.h> |
---|
14 | #include <bonobo/bonobo-ui-node.h> |
---|
15 | |
---|
16 | BEGIN_GNOME_DECLS |
---|
17 | |
---|
18 | #define BONOBO_UI_COMPONENT_TYPE (bonobo_ui_component_get_type ()) |
---|
19 | #define BONOBO_UI_COMPONENT(o) (GTK_CHECK_CAST ((o), BONOBO_UI_COMPONENT_TYPE, BonoboUIComponent)) |
---|
20 | #define BONOBO_UI_COMPONENT_CLASS(k) (GTK_CHECK_CLASS_CAST((k), BONOBO_UI_COMPONENT_TYPE, BonoboUIComponentClass)) |
---|
21 | #define BONOBO_IS_UI_COMPONENT(o) (GTK_CHECK_TYPE ((o), BONOBO_UI_COMPONENT_TYPE)) |
---|
22 | #define BONOBO_IS_UI_COMPONENT_CLASS(k) (GTK_CHECK_CLASS_TYPE ((k), BONOBO_UI_COMPONENT_TYPE)) |
---|
23 | |
---|
24 | typedef struct _BonoboUIComponent BonoboUIComponent; |
---|
25 | typedef struct _BonoboUIComponentPrivate BonoboUIComponentPrivate; |
---|
26 | |
---|
27 | typedef void (*BonoboUIListenerFn) (BonoboUIComponent *component, |
---|
28 | const char *path, |
---|
29 | Bonobo_UIComponent_EventType type, |
---|
30 | const char *state, |
---|
31 | gpointer user_data); |
---|
32 | |
---|
33 | typedef void (*BonoboUIVerbFn) (BonoboUIComponent *component, |
---|
34 | gpointer user_data, |
---|
35 | const char *cname); |
---|
36 | |
---|
37 | struct _BonoboUIComponent { |
---|
38 | BonoboXObject object; |
---|
39 | BonoboUIComponentPrivate *priv; |
---|
40 | }; |
---|
41 | |
---|
42 | typedef struct { |
---|
43 | BonoboXObjectClass parent_class; |
---|
44 | |
---|
45 | POA_Bonobo_UIComponent__epv epv; |
---|
46 | |
---|
47 | /* Signals */ |
---|
48 | void (*exec_verb) (BonoboUIComponent *comp, |
---|
49 | const char *cname); |
---|
50 | |
---|
51 | void (*ui_event) (BonoboUIComponent *comp, |
---|
52 | const char *path, |
---|
53 | Bonobo_UIComponent_EventType type, |
---|
54 | const char *state); |
---|
55 | /* Virtual XML Methods */ |
---|
56 | void (*freeze) (BonoboUIComponent *component, |
---|
57 | CORBA_Environment *opt_ev); |
---|
58 | |
---|
59 | void (*thaw) (BonoboUIComponent *component, |
---|
60 | CORBA_Environment *opt_ev); |
---|
61 | |
---|
62 | void (*xml_set) (BonoboUIComponent *component, |
---|
63 | const char *path, |
---|
64 | const char *xml, |
---|
65 | CORBA_Environment *ev); |
---|
66 | |
---|
67 | CORBA_char *(*xml_get) (BonoboUIComponent *component, |
---|
68 | const char *path, |
---|
69 | gboolean recurse, |
---|
70 | CORBA_Environment *ev); |
---|
71 | |
---|
72 | void (*xml_rm) (BonoboUIComponent *component, |
---|
73 | const char *path, |
---|
74 | CORBA_Environment *ev); |
---|
75 | |
---|
76 | void (*set_prop) (BonoboUIComponent *component, |
---|
77 | const char *path, |
---|
78 | const char *prop, |
---|
79 | const char *value, |
---|
80 | CORBA_Environment *opt_ev); |
---|
81 | |
---|
82 | gchar *(*get_prop) (BonoboUIComponent *component, |
---|
83 | const char *path, |
---|
84 | const char *prop, |
---|
85 | CORBA_Environment *opt_ev); |
---|
86 | |
---|
87 | gboolean (*exists) (BonoboUIComponent *component, |
---|
88 | const char *path, |
---|
89 | CORBA_Environment *ev); |
---|
90 | |
---|
91 | |
---|
92 | gpointer dummy; |
---|
93 | } BonoboUIComponentClass; |
---|
94 | |
---|
95 | GtkType bonobo_ui_component_get_type (void); |
---|
96 | |
---|
97 | BonoboUIComponent *bonobo_ui_component_construct (BonoboUIComponent *component, |
---|
98 | const char *name); |
---|
99 | |
---|
100 | BonoboUIComponent *bonobo_ui_component_new (const char *name); |
---|
101 | BonoboUIComponent *bonobo_ui_component_new_default (void); |
---|
102 | |
---|
103 | void bonobo_ui_component_set_name (BonoboUIComponent *component, |
---|
104 | const char *name); |
---|
105 | const char *bonobo_ui_component_get_name (BonoboUIComponent *component); |
---|
106 | |
---|
107 | void bonobo_ui_component_set_container (BonoboUIComponent *component, |
---|
108 | Bonobo_UIContainer container); |
---|
109 | void bonobo_ui_component_unset_container (BonoboUIComponent *component); |
---|
110 | Bonobo_UIContainer bonobo_ui_component_get_container (BonoboUIComponent *component); |
---|
111 | |
---|
112 | void bonobo_ui_component_add_verb (BonoboUIComponent *component, |
---|
113 | const char *cname, |
---|
114 | BonoboUIVerbFn fn, |
---|
115 | gpointer user_data); |
---|
116 | |
---|
117 | void bonobo_ui_component_add_verb_full(BonoboUIComponent *component, |
---|
118 | const char *cname, |
---|
119 | BonoboUIVerbFn fn, |
---|
120 | gpointer user_data, |
---|
121 | GDestroyNotify destroy_fn); |
---|
122 | |
---|
123 | void bonobo_ui_component_remove_verb (BonoboUIComponent *component, |
---|
124 | const char *cname); |
---|
125 | |
---|
126 | void bonobo_ui_component_remove_verb_by_func (BonoboUIComponent *component, |
---|
127 | BonoboUIVerbFn fn); |
---|
128 | |
---|
129 | void bonobo_ui_component_remove_verb_by_data (BonoboUIComponent *component, |
---|
130 | gpointer user_data); |
---|
131 | |
---|
132 | void bonobo_ui_component_add_listener (BonoboUIComponent *component, |
---|
133 | const char *id, |
---|
134 | BonoboUIListenerFn fn, |
---|
135 | gpointer user_data); |
---|
136 | |
---|
137 | void bonobo_ui_component_add_listener_full (BonoboUIComponent *component, |
---|
138 | const char *id, |
---|
139 | BonoboUIListenerFn fn, |
---|
140 | gpointer user_data, |
---|
141 | GDestroyNotify destroy_fn); |
---|
142 | |
---|
143 | void bonobo_ui_component_remove_listener (BonoboUIComponent *component, |
---|
144 | const char *cname); |
---|
145 | |
---|
146 | void bonobo_ui_component_remove_listener_by_func (BonoboUIComponent *component, |
---|
147 | BonoboUIListenerFn fn); |
---|
148 | |
---|
149 | void bonobo_ui_component_remove_listener_by_data (BonoboUIComponent *component, |
---|
150 | gpointer user_data); |
---|
151 | |
---|
152 | void bonobo_ui_component_set (BonoboUIComponent *component, |
---|
153 | const char *path, |
---|
154 | const char *xml, |
---|
155 | CORBA_Environment *ev); |
---|
156 | |
---|
157 | void bonobo_ui_component_set_translate(BonoboUIComponent *component, |
---|
158 | const char *path, |
---|
159 | const char *xml, |
---|
160 | CORBA_Environment *ev); |
---|
161 | |
---|
162 | void bonobo_ui_component_set_tree (BonoboUIComponent *component, |
---|
163 | const char *path, |
---|
164 | BonoboUINode *node, |
---|
165 | CORBA_Environment *ev); |
---|
166 | |
---|
167 | void bonobo_ui_component_rm (BonoboUIComponent *component, |
---|
168 | const char *path, |
---|
169 | CORBA_Environment *ev); |
---|
170 | |
---|
171 | gboolean bonobo_ui_component_path_exists (BonoboUIComponent *component, |
---|
172 | const char *path, |
---|
173 | CORBA_Environment *ev); |
---|
174 | |
---|
175 | CORBA_char *bonobo_ui_component_get (BonoboUIComponent *component, |
---|
176 | const char *path, |
---|
177 | gboolean recurse, |
---|
178 | CORBA_Environment *ev); |
---|
179 | |
---|
180 | BonoboUINode *bonobo_ui_component_get_tree (BonoboUIComponent *component, |
---|
181 | const char *path, |
---|
182 | gboolean recurse, |
---|
183 | CORBA_Environment *ev); |
---|
184 | |
---|
185 | void bonobo_ui_component_object_set (BonoboUIComponent *component, |
---|
186 | const char *path, |
---|
187 | Bonobo_Unknown control, |
---|
188 | CORBA_Environment *ev); |
---|
189 | |
---|
190 | Bonobo_Unknown bonobo_ui_component_object_get (BonoboUIComponent *component, |
---|
191 | const char *path, |
---|
192 | CORBA_Environment *opt_ev); |
---|
193 | |
---|
194 | void bonobo_ui_component_freeze (BonoboUIComponent *component, |
---|
195 | CORBA_Environment *opt_ev); |
---|
196 | |
---|
197 | void bonobo_ui_component_thaw (BonoboUIComponent *component, |
---|
198 | CORBA_Environment *opt_ev); |
---|
199 | |
---|
200 | void bonobo_ui_component_set_prop (BonoboUIComponent *component, |
---|
201 | const char *path, |
---|
202 | const char *prop, |
---|
203 | const char *value, |
---|
204 | CORBA_Environment *opt_ev); |
---|
205 | |
---|
206 | gchar *bonobo_ui_component_get_prop (BonoboUIComponent *component, |
---|
207 | const char *path, |
---|
208 | const char *prop, |
---|
209 | CORBA_Environment *opt_ev); |
---|
210 | |
---|
211 | void bonobo_ui_component_set_status (BonoboUIComponent *component, |
---|
212 | const char *text, |
---|
213 | CORBA_Environment *opt_ev); |
---|
214 | |
---|
215 | typedef struct { |
---|
216 | char *cname; |
---|
217 | BonoboUIVerbFn cb; |
---|
218 | gpointer user_data; |
---|
219 | gpointer dummy; |
---|
220 | } BonoboUIVerb; |
---|
221 | |
---|
222 | #define BONOBO_UI_VERB(name,cb) { (name), (cb), NULL } |
---|
223 | #define BONOBO_UI_VERB_DATA(name,cb,data) { (name), (cb), (data) } |
---|
224 | #define BONOBO_UI_UNSAFE_VERB(name,cb) { (name), ((BonoboUIVerbFn)(cb)), NULL } |
---|
225 | #define BONOBO_UI_UNSAFE_VERB_DATA(name,cb,data) { (name), ((BonoboUIVerbFn)(cb)), (data) } |
---|
226 | #define BONOBO_UI_VERB_END { NULL, NULL, NULL } |
---|
227 | |
---|
228 | void bonobo_ui_component_add_verb_list (BonoboUIComponent *component, |
---|
229 | BonoboUIVerb *list); |
---|
230 | void bonobo_ui_component_add_verb_list_with_data (BonoboUIComponent *component, |
---|
231 | BonoboUIVerb *list, |
---|
232 | gpointer user_data); |
---|
233 | |
---|
234 | END_GNOME_DECLS |
---|
235 | |
---|
236 | #endif /* _BONOBO_UI_COMPONENT_H_ */ |
---|