1 | /* GTK - The GIMP Toolkit |
---|
2 | * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald |
---|
3 | * |
---|
4 | * This library is free software; you can redistribute it and/or |
---|
5 | * modify it under the terms of the GNU Library General Public |
---|
6 | * License as published by the Free Software Foundation; either |
---|
7 | * version 2 of the License, or (at your option) any later version. |
---|
8 | * |
---|
9 | * This library is distributed in the hope that it will be useful, |
---|
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
---|
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
---|
12 | * Library General Public License for more details. |
---|
13 | * |
---|
14 | * You should have received a copy of the GNU Library General Public |
---|
15 | * License along with this library; if not, write to the |
---|
16 | * Free Software Foundation, Inc., 59 Temple Place - Suite 330, |
---|
17 | * Boston, MA 02111-1307, USA. |
---|
18 | */ |
---|
19 | |
---|
20 | /* |
---|
21 | * Modified by the GTK+ Team and others 1997-1999. See the AUTHORS |
---|
22 | * file for a list of people on the GTK+ Team. See the ChangeLog |
---|
23 | * files for a list of changes. These files are distributed with |
---|
24 | * GTK+ at ftp://ftp.gtk.org/pub/gtk/. |
---|
25 | */ |
---|
26 | |
---|
27 | #ifndef __GTK_WIDGET_H__ |
---|
28 | #define __GTK_WIDGET_H__ |
---|
29 | |
---|
30 | #include <gdk/gdk.h> |
---|
31 | #include <gtk/gtkaccelgroup.h> |
---|
32 | #include <gtk/gtkobject.h> |
---|
33 | #include <gtk/gtkadjustment.h> |
---|
34 | #include <gtk/gtkstyle.h> |
---|
35 | |
---|
36 | |
---|
37 | #ifdef __cplusplus |
---|
38 | extern "C" { |
---|
39 | #endif /* __cplusplus */ |
---|
40 | |
---|
41 | |
---|
42 | /* The flags that are used by GtkWidget on top of the |
---|
43 | * flags field of GtkObject. |
---|
44 | */ |
---|
45 | typedef enum |
---|
46 | { |
---|
47 | GTK_TOPLEVEL = 1 << 4, |
---|
48 | GTK_NO_WINDOW = 1 << 5, |
---|
49 | GTK_REALIZED = 1 << 6, |
---|
50 | GTK_MAPPED = 1 << 7, |
---|
51 | GTK_VISIBLE = 1 << 8, |
---|
52 | GTK_SENSITIVE = 1 << 9, |
---|
53 | GTK_PARENT_SENSITIVE = 1 << 10, |
---|
54 | GTK_CAN_FOCUS = 1 << 11, |
---|
55 | GTK_HAS_FOCUS = 1 << 12, |
---|
56 | GTK_CAN_DEFAULT = 1 << 13, |
---|
57 | GTK_HAS_DEFAULT = 1 << 14, |
---|
58 | GTK_HAS_GRAB = 1 << 15, |
---|
59 | GTK_RC_STYLE = 1 << 16, |
---|
60 | GTK_COMPOSITE_CHILD = 1 << 17, |
---|
61 | GTK_NO_REPARENT = 1 << 18, |
---|
62 | GTK_APP_PAINTABLE = 1 << 19, |
---|
63 | GTK_RECEIVES_DEFAULT = 1 << 20 |
---|
64 | } GtkWidgetFlags; |
---|
65 | |
---|
66 | /* Macro for casting a pointer to a GtkWidget or GtkWidgetClass pointer. |
---|
67 | * Macros for testing whether `widget' or `klass' are of type GTK_TYPE_WIDGET. |
---|
68 | */ |
---|
69 | #define GTK_TYPE_WIDGET (gtk_widget_get_type ()) |
---|
70 | #define GTK_WIDGET(widget) (GTK_CHECK_CAST ((widget), GTK_TYPE_WIDGET, GtkWidget)) |
---|
71 | #define GTK_WIDGET_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), GTK_TYPE_WIDGET, GtkWidgetClass)) |
---|
72 | #define GTK_IS_WIDGET(widget) (GTK_CHECK_TYPE ((widget), GTK_TYPE_WIDGET)) |
---|
73 | #define GTK_IS_WIDGET_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((klass), GTK_TYPE_WIDGET)) |
---|
74 | |
---|
75 | /* Macros for extracting various fields from GtkWidget and GtkWidgetClass. |
---|
76 | */ |
---|
77 | #define GTK_WIDGET_TYPE(wid) (GTK_OBJECT_TYPE (wid)) |
---|
78 | #define GTK_WIDGET_STATE(wid) (GTK_WIDGET (wid)->state) |
---|
79 | #define GTK_WIDGET_SAVED_STATE(wid) (GTK_WIDGET (wid)->saved_state) |
---|
80 | |
---|
81 | /* Macros for extracting the widget flags from GtkWidget. |
---|
82 | */ |
---|
83 | #define GTK_WIDGET_FLAGS(wid) (GTK_OBJECT_FLAGS (wid)) |
---|
84 | #define GTK_WIDGET_TOPLEVEL(wid) ((GTK_WIDGET_FLAGS (wid) & GTK_TOPLEVEL) != 0) |
---|
85 | #define GTK_WIDGET_NO_WINDOW(wid) ((GTK_WIDGET_FLAGS (wid) & GTK_NO_WINDOW) != 0) |
---|
86 | #define GTK_WIDGET_REALIZED(wid) ((GTK_WIDGET_FLAGS (wid) & GTK_REALIZED) != 0) |
---|
87 | #define GTK_WIDGET_MAPPED(wid) ((GTK_WIDGET_FLAGS (wid) & GTK_MAPPED) != 0) |
---|
88 | #define GTK_WIDGET_VISIBLE(wid) ((GTK_WIDGET_FLAGS (wid) & GTK_VISIBLE) != 0) |
---|
89 | #define GTK_WIDGET_DRAWABLE(wid) (GTK_WIDGET_VISIBLE (wid) && GTK_WIDGET_MAPPED (wid)) |
---|
90 | #define GTK_WIDGET_SENSITIVE(wid) ((GTK_WIDGET_FLAGS (wid) & GTK_SENSITIVE) != 0) |
---|
91 | #define GTK_WIDGET_PARENT_SENSITIVE(wid) ((GTK_WIDGET_FLAGS (wid) & GTK_PARENT_SENSITIVE) != 0) |
---|
92 | #define GTK_WIDGET_IS_SENSITIVE(wid) (GTK_WIDGET_SENSITIVE (wid) && \ |
---|
93 | GTK_WIDGET_PARENT_SENSITIVE (wid)) |
---|
94 | #define GTK_WIDGET_CAN_FOCUS(wid) ((GTK_WIDGET_FLAGS (wid) & GTK_CAN_FOCUS) != 0) |
---|
95 | #define GTK_WIDGET_HAS_FOCUS(wid) ((GTK_WIDGET_FLAGS (wid) & GTK_HAS_FOCUS) != 0) |
---|
96 | #define GTK_WIDGET_CAN_DEFAULT(wid) ((GTK_WIDGET_FLAGS (wid) & GTK_CAN_DEFAULT) != 0) |
---|
97 | #define GTK_WIDGET_HAS_DEFAULT(wid) ((GTK_WIDGET_FLAGS (wid) & GTK_HAS_DEFAULT) != 0) |
---|
98 | #define GTK_WIDGET_HAS_GRAB(wid) ((GTK_WIDGET_FLAGS (wid) & GTK_HAS_GRAB) != 0) |
---|
99 | #define GTK_WIDGET_RC_STYLE(wid) ((GTK_WIDGET_FLAGS (wid) & GTK_RC_STYLE) != 0) |
---|
100 | #define GTK_WIDGET_COMPOSITE_CHILD(wid) ((GTK_WIDGET_FLAGS (wid) & GTK_COMPOSITE_CHILD) != 0) |
---|
101 | #define GTK_WIDGET_APP_PAINTABLE(wid) ((GTK_WIDGET_FLAGS (wid) & GTK_APP_PAINTABLE) != 0) |
---|
102 | #define GTK_WIDGET_RECEIVES_DEFAULT(wid) ((GTK_WIDGET_FLAGS (wid) & GTK_RECEIVES_DEFAULT) != 0) |
---|
103 | |
---|
104 | /* Macros for setting and clearing widget flags. |
---|
105 | */ |
---|
106 | #define GTK_WIDGET_SET_FLAGS(wid,flag) G_STMT_START{ (GTK_WIDGET_FLAGS (wid) |= (flag)); }G_STMT_END |
---|
107 | #define GTK_WIDGET_UNSET_FLAGS(wid,flag) G_STMT_START{ (GTK_WIDGET_FLAGS (wid) &= ~(flag)); }G_STMT_END |
---|
108 | |
---|
109 | |
---|
110 | |
---|
111 | typedef struct _GtkRequisition GtkRequisition; |
---|
112 | typedef struct _GtkAllocation GtkAllocation; |
---|
113 | typedef struct _GtkSelectionData GtkSelectionData; |
---|
114 | typedef struct _GtkWidgetClass GtkWidgetClass; |
---|
115 | typedef struct _GtkWidgetAuxInfo GtkWidgetAuxInfo; |
---|
116 | typedef struct _GtkWidgetShapeInfo GtkWidgetShapeInfo; |
---|
117 | |
---|
118 | typedef void (*GtkCallback) (GtkWidget *widget, |
---|
119 | gpointer data); |
---|
120 | |
---|
121 | /* A requisition is a desired amount of space which a |
---|
122 | * widget may request. |
---|
123 | */ |
---|
124 | struct _GtkRequisition |
---|
125 | { |
---|
126 | gint16 width; |
---|
127 | gint16 height; |
---|
128 | }; |
---|
129 | |
---|
130 | /* An allocation is a size and position. Where a widget |
---|
131 | * can ask for a desired size, it is actually given |
---|
132 | * this amount of space at the specified position. |
---|
133 | */ |
---|
134 | struct _GtkAllocation |
---|
135 | { |
---|
136 | gint16 x; |
---|
137 | gint16 y; |
---|
138 | guint16 width; |
---|
139 | guint16 height; |
---|
140 | }; |
---|
141 | |
---|
142 | /* The contents of a selection are returned in a GtkSelectionData |
---|
143 | structure. selection/target identify the request. |
---|
144 | type specifies the type of the return; if length < 0, and |
---|
145 | the data should be ignored. This structure has object semantics - |
---|
146 | no fields should be modified directly, they should not be created |
---|
147 | directly, and pointers to them should not be stored beyond the duration of |
---|
148 | a callback. (If the last is changed, we'll need to add reference |
---|
149 | counting.) The time field gives the timestamp at which the data was sent. */ |
---|
150 | |
---|
151 | struct _GtkSelectionData |
---|
152 | { |
---|
153 | GdkAtom selection; |
---|
154 | GdkAtom target; |
---|
155 | GdkAtom type; |
---|
156 | gint format; |
---|
157 | guchar *data; |
---|
158 | gint length; |
---|
159 | }; |
---|
160 | |
---|
161 | /* The widget is the base of the tree for displayable objects. |
---|
162 | * (A displayable object is one which takes up some amount |
---|
163 | * of screen real estate). It provides a common base and interface |
---|
164 | * which actual widgets must adhere to. |
---|
165 | */ |
---|
166 | struct _GtkWidget |
---|
167 | { |
---|
168 | /* The object structure needs to be the first |
---|
169 | * element in the widget structure in order for |
---|
170 | * the object mechanism to work correctly. This |
---|
171 | * allows a GtkWidget pointer to be cast to a |
---|
172 | * GtkObject pointer. |
---|
173 | */ |
---|
174 | GtkObject object; |
---|
175 | |
---|
176 | /* 16 bits of internally used private flags. |
---|
177 | * this will be packed into the same 4 byte alignment frame that |
---|
178 | * state and saved_state go. we therefore don't waste any new |
---|
179 | * space on this. |
---|
180 | */ |
---|
181 | guint16 private_flags; |
---|
182 | |
---|
183 | /* The state of the widget. There are actually only |
---|
184 | * 5 widget states (defined in "gtkenums.h"). |
---|
185 | */ |
---|
186 | guint8 state; |
---|
187 | |
---|
188 | /* The saved state of the widget. When a widgets state |
---|
189 | * is changed to GTK_STATE_INSENSITIVE via |
---|
190 | * "gtk_widget_set_state" or "gtk_widget_set_sensitive" |
---|
191 | * the old state is kept around in this field. The state |
---|
192 | * will be restored once the widget gets sensitive again. |
---|
193 | */ |
---|
194 | guint8 saved_state; |
---|
195 | |
---|
196 | /* The widgets name. If the widget does not have a name |
---|
197 | * (the name is NULL), then its name (as returned by |
---|
198 | * "gtk_widget_get_name") is its classes name. |
---|
199 | * Among other things, the widget name is used to determine |
---|
200 | * the style to use for a widget. |
---|
201 | */ |
---|
202 | gchar *name; |
---|
203 | |
---|
204 | /* The style for the widget. The style contains the |
---|
205 | * colors the widget should be drawn in for each state |
---|
206 | * along with graphics contexts used to draw with and |
---|
207 | * the font to use for text. |
---|
208 | */ |
---|
209 | GtkStyle *style; |
---|
210 | |
---|
211 | /* The widgets desired size. |
---|
212 | */ |
---|
213 | GtkRequisition requisition; |
---|
214 | |
---|
215 | /* The widgets allocated size. |
---|
216 | */ |
---|
217 | GtkAllocation allocation; |
---|
218 | |
---|
219 | /* The widgets window or its parent window if it does |
---|
220 | * not have a window. (Which will be indicated by the |
---|
221 | * GTK_NO_WINDOW flag being set). |
---|
222 | */ |
---|
223 | GdkWindow *window; |
---|
224 | |
---|
225 | /* The widgets parent. |
---|
226 | */ |
---|
227 | GtkWidget *parent; |
---|
228 | }; |
---|
229 | |
---|
230 | struct _GtkWidgetClass |
---|
231 | { |
---|
232 | /* The object class structure needs to be the first |
---|
233 | * element in the widget class structure in order for |
---|
234 | * the class mechanism to work correctly. This allows a |
---|
235 | * GtkWidgetClass pointer to be cast to a GtkObjectClass |
---|
236 | * pointer. |
---|
237 | */ |
---|
238 | GtkObjectClass parent_class; |
---|
239 | |
---|
240 | /* The signal to emit when a widget of this class is activated, |
---|
241 | * gtk_widget_activate() handles the emission. |
---|
242 | * Implementation of this signal is optional. |
---|
243 | */ |
---|
244 | guint activate_signal; |
---|
245 | |
---|
246 | /* This signal is emitted when a widget of this class is added |
---|
247 | * to a scrolling aware parent, gtk_widget_set_scroll_adjustments() |
---|
248 | * handles the emission. |
---|
249 | * Implementation of this signal is optional. |
---|
250 | */ |
---|
251 | guint set_scroll_adjustments_signal; |
---|
252 | |
---|
253 | /* basics */ |
---|
254 | void (* show) (GtkWidget *widget); |
---|
255 | void (* show_all) (GtkWidget *widget); |
---|
256 | void (* hide) (GtkWidget *widget); |
---|
257 | void (* hide_all) (GtkWidget *widget); |
---|
258 | void (* map) (GtkWidget *widget); |
---|
259 | void (* unmap) (GtkWidget *widget); |
---|
260 | void (* realize) (GtkWidget *widget); |
---|
261 | void (* unrealize) (GtkWidget *widget); |
---|
262 | void (* draw) (GtkWidget *widget, |
---|
263 | GdkRectangle *area); |
---|
264 | void (* draw_focus) (GtkWidget *widget); |
---|
265 | void (* draw_default) (GtkWidget *widget); |
---|
266 | void (* size_request) (GtkWidget *widget, |
---|
267 | GtkRequisition *requisition); |
---|
268 | void (* size_allocate) (GtkWidget *widget, |
---|
269 | GtkAllocation *allocation); |
---|
270 | void (* state_changed) (GtkWidget *widget, |
---|
271 | GtkStateType previous_state); |
---|
272 | void (* parent_set) (GtkWidget *widget, |
---|
273 | GtkWidget *previous_parent); |
---|
274 | void (* style_set) (GtkWidget *widget, |
---|
275 | GtkStyle *previous_style); |
---|
276 | |
---|
277 | /* accelerators */ |
---|
278 | gint (* add_accelerator) (GtkWidget *widget, |
---|
279 | guint accel_signal_id, |
---|
280 | GtkAccelGroup *accel_group, |
---|
281 | guint accel_key, |
---|
282 | GdkModifierType accel_mods, |
---|
283 | GtkAccelFlags accel_flags); |
---|
284 | void (* remove_accelerator) (GtkWidget *widget, |
---|
285 | GtkAccelGroup *accel_group, |
---|
286 | guint accel_key, |
---|
287 | GdkModifierType accel_mods); |
---|
288 | |
---|
289 | /* explicit focus */ |
---|
290 | void (* grab_focus) (GtkWidget *widget); |
---|
291 | |
---|
292 | /* events */ |
---|
293 | gint (* event) (GtkWidget *widget, |
---|
294 | GdkEvent *event); |
---|
295 | gint (* button_press_event) (GtkWidget *widget, |
---|
296 | GdkEventButton *event); |
---|
297 | gint (* button_release_event) (GtkWidget *widget, |
---|
298 | GdkEventButton *event); |
---|
299 | gint (* motion_notify_event) (GtkWidget *widget, |
---|
300 | GdkEventMotion *event); |
---|
301 | gint (* delete_event) (GtkWidget *widget, |
---|
302 | GdkEventAny *event); |
---|
303 | gint (* destroy_event) (GtkWidget *widget, |
---|
304 | GdkEventAny *event); |
---|
305 | gint (* expose_event) (GtkWidget *widget, |
---|
306 | GdkEventExpose *event); |
---|
307 | gint (* key_press_event) (GtkWidget *widget, |
---|
308 | GdkEventKey *event); |
---|
309 | gint (* key_release_event) (GtkWidget *widget, |
---|
310 | GdkEventKey *event); |
---|
311 | gint (* enter_notify_event) (GtkWidget *widget, |
---|
312 | GdkEventCrossing *event); |
---|
313 | gint (* leave_notify_event) (GtkWidget *widget, |
---|
314 | GdkEventCrossing *event); |
---|
315 | gint (* configure_event) (GtkWidget *widget, |
---|
316 | GdkEventConfigure *event); |
---|
317 | gint (* focus_in_event) (GtkWidget *widget, |
---|
318 | GdkEventFocus *event); |
---|
319 | gint (* focus_out_event) (GtkWidget *widget, |
---|
320 | GdkEventFocus *event); |
---|
321 | gint (* map_event) (GtkWidget *widget, |
---|
322 | GdkEventAny *event); |
---|
323 | gint (* unmap_event) (GtkWidget *widget, |
---|
324 | GdkEventAny *event); |
---|
325 | gint (* property_notify_event) (GtkWidget *widget, |
---|
326 | GdkEventProperty *event); |
---|
327 | gint (* selection_clear_event) (GtkWidget *widget, |
---|
328 | GdkEventSelection *event); |
---|
329 | gint (* selection_request_event) (GtkWidget *widget, |
---|
330 | GdkEventSelection *event); |
---|
331 | gint (* selection_notify_event) (GtkWidget *widget, |
---|
332 | GdkEventSelection *event); |
---|
333 | gint (* proximity_in_event) (GtkWidget *widget, |
---|
334 | GdkEventProximity *event); |
---|
335 | gint (* proximity_out_event) (GtkWidget *widget, |
---|
336 | GdkEventProximity *event); |
---|
337 | gint (* visibility_notify_event) (GtkWidget *widget, |
---|
338 | GdkEventVisibility *event); |
---|
339 | gint (* client_event) (GtkWidget *widget, |
---|
340 | GdkEventClient *event); |
---|
341 | gint (* no_expose_event) (GtkWidget *widget, |
---|
342 | GdkEventAny *event); |
---|
343 | |
---|
344 | /* selection */ |
---|
345 | void (* selection_get) (GtkWidget *widget, |
---|
346 | GtkSelectionData *selection_data, |
---|
347 | guint info, |
---|
348 | guint time); |
---|
349 | void (* selection_received) (GtkWidget *widget, |
---|
350 | GtkSelectionData *selection_data, |
---|
351 | guint time); |
---|
352 | |
---|
353 | /* Source side drag signals */ |
---|
354 | void (* drag_begin) (GtkWidget *widget, |
---|
355 | GdkDragContext *context); |
---|
356 | void (* drag_end) (GtkWidget *widget, |
---|
357 | GdkDragContext *context); |
---|
358 | void (* drag_data_get) (GtkWidget *widget, |
---|
359 | GdkDragContext *context, |
---|
360 | GtkSelectionData *selection_data, |
---|
361 | guint info, |
---|
362 | guint time); |
---|
363 | void (* drag_data_delete) (GtkWidget *widget, |
---|
364 | GdkDragContext *context); |
---|
365 | |
---|
366 | /* Target side drag signals */ |
---|
367 | void (* drag_leave) (GtkWidget *widget, |
---|
368 | GdkDragContext *context, |
---|
369 | guint time); |
---|
370 | gboolean (* drag_motion) (GtkWidget *widget, |
---|
371 | GdkDragContext *context, |
---|
372 | gint x, |
---|
373 | gint y, |
---|
374 | guint time); |
---|
375 | gboolean (* drag_drop) (GtkWidget *widget, |
---|
376 | GdkDragContext *context, |
---|
377 | gint x, |
---|
378 | gint y, |
---|
379 | guint time); |
---|
380 | void (* drag_data_received) (GtkWidget *widget, |
---|
381 | GdkDragContext *context, |
---|
382 | gint x, |
---|
383 | gint y, |
---|
384 | GtkSelectionData *selection_data, |
---|
385 | guint info, |
---|
386 | guint time); |
---|
387 | |
---|
388 | /* action signals */ |
---|
389 | void (* debug_msg) (GtkWidget *widget, |
---|
390 | const gchar *string); |
---|
391 | |
---|
392 | /* Padding for future expandsion */ |
---|
393 | GtkFunction pad1; |
---|
394 | GtkFunction pad2; |
---|
395 | GtkFunction pad3; |
---|
396 | GtkFunction pad4; |
---|
397 | }; |
---|
398 | |
---|
399 | struct _GtkWidgetAuxInfo |
---|
400 | { |
---|
401 | gint16 x; |
---|
402 | gint16 y; |
---|
403 | gint16 width; |
---|
404 | gint16 height; |
---|
405 | }; |
---|
406 | |
---|
407 | struct _GtkWidgetShapeInfo |
---|
408 | { |
---|
409 | gint16 offset_x; |
---|
410 | gint16 offset_y; |
---|
411 | GdkBitmap *shape_mask; |
---|
412 | }; |
---|
413 | |
---|
414 | |
---|
415 | GtkType gtk_widget_get_type (void); |
---|
416 | GtkWidget* gtk_widget_new (GtkType type, |
---|
417 | const gchar *first_arg_name, |
---|
418 | ...); |
---|
419 | GtkWidget* gtk_widget_newv (GtkType type, |
---|
420 | guint nargs, |
---|
421 | GtkArg *args); |
---|
422 | void gtk_widget_ref (GtkWidget *widget); |
---|
423 | void gtk_widget_unref (GtkWidget *widget); |
---|
424 | void gtk_widget_destroy (GtkWidget *widget); |
---|
425 | void gtk_widget_destroyed (GtkWidget *widget, |
---|
426 | GtkWidget **widget_pointer); |
---|
427 | void gtk_widget_get (GtkWidget *widget, |
---|
428 | GtkArg *arg); |
---|
429 | void gtk_widget_getv (GtkWidget *widget, |
---|
430 | guint nargs, |
---|
431 | GtkArg *args); |
---|
432 | void gtk_widget_set (GtkWidget *widget, |
---|
433 | const gchar *first_arg_name, |
---|
434 | ...); |
---|
435 | void gtk_widget_setv (GtkWidget *widget, |
---|
436 | guint nargs, |
---|
437 | GtkArg *args); |
---|
438 | void gtk_widget_unparent (GtkWidget *widget); |
---|
439 | void gtk_widget_show (GtkWidget *widget); |
---|
440 | void gtk_widget_show_now (GtkWidget *widget); |
---|
441 | void gtk_widget_hide (GtkWidget *widget); |
---|
442 | void gtk_widget_show_all (GtkWidget *widget); |
---|
443 | void gtk_widget_hide_all (GtkWidget *widget); |
---|
444 | void gtk_widget_map (GtkWidget *widget); |
---|
445 | void gtk_widget_unmap (GtkWidget *widget); |
---|
446 | void gtk_widget_realize (GtkWidget *widget); |
---|
447 | void gtk_widget_unrealize (GtkWidget *widget); |
---|
448 | |
---|
449 | /* Queuing draws */ |
---|
450 | void gtk_widget_queue_draw (GtkWidget *widget); |
---|
451 | void gtk_widget_queue_draw_area (GtkWidget *widget, |
---|
452 | gint x, |
---|
453 | gint y, |
---|
454 | gint width, |
---|
455 | gint height); |
---|
456 | void gtk_widget_queue_clear (GtkWidget *widget); |
---|
457 | void gtk_widget_queue_clear_area (GtkWidget *widget, |
---|
458 | gint x, |
---|
459 | gint y, |
---|
460 | gint width, |
---|
461 | gint height); |
---|
462 | |
---|
463 | |
---|
464 | void gtk_widget_queue_resize (GtkWidget *widget); |
---|
465 | void gtk_widget_draw (GtkWidget *widget, |
---|
466 | GdkRectangle *area); |
---|
467 | void gtk_widget_draw_focus (GtkWidget *widget); |
---|
468 | void gtk_widget_draw_default (GtkWidget *widget); |
---|
469 | void gtk_widget_size_request (GtkWidget *widget, |
---|
470 | GtkRequisition *requisition); |
---|
471 | void gtk_widget_size_allocate (GtkWidget *widget, |
---|
472 | GtkAllocation *allocation); |
---|
473 | void gtk_widget_get_child_requisition (GtkWidget *widget, |
---|
474 | GtkRequisition *requisition); |
---|
475 | void gtk_widget_add_accelerator (GtkWidget *widget, |
---|
476 | const gchar *accel_signal, |
---|
477 | GtkAccelGroup *accel_group, |
---|
478 | guint accel_key, |
---|
479 | guint accel_mods, |
---|
480 | GtkAccelFlags accel_flags); |
---|
481 | void gtk_widget_remove_accelerator (GtkWidget *widget, |
---|
482 | GtkAccelGroup *accel_group, |
---|
483 | guint accel_key, |
---|
484 | guint accel_mods); |
---|
485 | void gtk_widget_remove_accelerators (GtkWidget *widget, |
---|
486 | const gchar *accel_signal, |
---|
487 | gboolean visible_only); |
---|
488 | guint gtk_widget_accelerator_signal (GtkWidget *widget, |
---|
489 | GtkAccelGroup *accel_group, |
---|
490 | guint accel_key, |
---|
491 | guint accel_mods); |
---|
492 | void gtk_widget_lock_accelerators (GtkWidget *widget); |
---|
493 | void gtk_widget_unlock_accelerators (GtkWidget *widget); |
---|
494 | gboolean gtk_widget_accelerators_locked (GtkWidget *widget); |
---|
495 | gint gtk_widget_event (GtkWidget *widget, |
---|
496 | GdkEvent *event); |
---|
497 | |
---|
498 | gboolean gtk_widget_activate (GtkWidget *widget); |
---|
499 | gboolean gtk_widget_set_scroll_adjustments (GtkWidget *widget, |
---|
500 | GtkAdjustment *hadjustment, |
---|
501 | GtkAdjustment *vadjustment); |
---|
502 | |
---|
503 | void gtk_widget_reparent (GtkWidget *widget, |
---|
504 | GtkWidget *new_parent); |
---|
505 | void gtk_widget_popup (GtkWidget *widget, |
---|
506 | gint x, |
---|
507 | gint y); |
---|
508 | gint gtk_widget_intersect (GtkWidget *widget, |
---|
509 | GdkRectangle *area, |
---|
510 | GdkRectangle *intersection); |
---|
511 | |
---|
512 | void gtk_widget_grab_focus (GtkWidget *widget); |
---|
513 | void gtk_widget_grab_default (GtkWidget *widget); |
---|
514 | |
---|
515 | void gtk_widget_set_name (GtkWidget *widget, |
---|
516 | const gchar *name); |
---|
517 | gchar* gtk_widget_get_name (GtkWidget *widget); |
---|
518 | void gtk_widget_set_state (GtkWidget *widget, |
---|
519 | GtkStateType state); |
---|
520 | void gtk_widget_set_sensitive (GtkWidget *widget, |
---|
521 | gboolean sensitive); |
---|
522 | void gtk_widget_set_app_paintable (GtkWidget *widget, |
---|
523 | gboolean app_paintable); |
---|
524 | void gtk_widget_set_parent (GtkWidget *widget, |
---|
525 | GtkWidget *parent); |
---|
526 | void gtk_widget_set_parent_window (GtkWidget *widget, |
---|
527 | GdkWindow *parent_window); |
---|
528 | GdkWindow *gtk_widget_get_parent_window (GtkWidget *widget); |
---|
529 | void gtk_widget_set_uposition (GtkWidget *widget, |
---|
530 | gint x, |
---|
531 | gint y); |
---|
532 | void gtk_widget_set_usize (GtkWidget *widget, |
---|
533 | gint width, |
---|
534 | gint height); |
---|
535 | void gtk_widget_set_events (GtkWidget *widget, |
---|
536 | gint events); |
---|
537 | void gtk_widget_add_events (GtkWidget *widget, |
---|
538 | gint events); |
---|
539 | void gtk_widget_set_extension_events (GtkWidget *widget, |
---|
540 | GdkExtensionMode mode); |
---|
541 | |
---|
542 | GdkExtensionMode gtk_widget_get_extension_events (GtkWidget *widget); |
---|
543 | GtkWidget* gtk_widget_get_toplevel (GtkWidget *widget); |
---|
544 | GtkWidget* gtk_widget_get_ancestor (GtkWidget *widget, |
---|
545 | GtkType widget_type); |
---|
546 | GdkColormap* gtk_widget_get_colormap (GtkWidget *widget); |
---|
547 | GdkVisual* gtk_widget_get_visual (GtkWidget *widget); |
---|
548 | |
---|
549 | /* The following functions must not be called on an already |
---|
550 | * realized widget. Because it is possible that somebody |
---|
551 | * can call get_colormap() or get_visual() and save the |
---|
552 | * result, these functions are probably only safe to |
---|
553 | * call in a widget's init() function. |
---|
554 | */ |
---|
555 | void gtk_widget_set_colormap (GtkWidget *widget, |
---|
556 | GdkColormap *colormap); |
---|
557 | void gtk_widget_set_visual (GtkWidget *widget, |
---|
558 | GdkVisual *visual); |
---|
559 | |
---|
560 | |
---|
561 | gint gtk_widget_get_events (GtkWidget *widget); |
---|
562 | void gtk_widget_get_pointer (GtkWidget *widget, |
---|
563 | gint *x, |
---|
564 | gint *y); |
---|
565 | |
---|
566 | gint gtk_widget_is_ancestor (GtkWidget *widget, |
---|
567 | GtkWidget *ancestor); |
---|
568 | |
---|
569 | /* Hide widget and return TRUE. |
---|
570 | */ |
---|
571 | gint gtk_widget_hide_on_delete (GtkWidget *widget); |
---|
572 | |
---|
573 | /* Widget styles. |
---|
574 | */ |
---|
575 | void gtk_widget_set_style (GtkWidget *widget, |
---|
576 | GtkStyle *style); |
---|
577 | void gtk_widget_set_rc_style (GtkWidget *widget); |
---|
578 | void gtk_widget_ensure_style (GtkWidget *widget); |
---|
579 | GtkStyle* gtk_widget_get_style (GtkWidget *widget); |
---|
580 | void gtk_widget_restore_default_style (GtkWidget *widget); |
---|
581 | |
---|
582 | void gtk_widget_modify_style (GtkWidget *widget, |
---|
583 | GtkRcStyle *style); |
---|
584 | |
---|
585 | /* handle composite names for GTK_COMPOSITE_CHILD widgets, |
---|
586 | * the returned name is newly allocated. |
---|
587 | */ |
---|
588 | void gtk_widget_set_composite_name (GtkWidget *widget, |
---|
589 | const gchar *name); |
---|
590 | gchar* gtk_widget_get_composite_name (GtkWidget *widget); |
---|
591 | |
---|
592 | /* Descend recursively and set rc-style on all widgets without user styles */ |
---|
593 | void gtk_widget_reset_rc_styles (GtkWidget *widget); |
---|
594 | |
---|
595 | /* Push/pop pairs, to change default values upon a widget's creation. |
---|
596 | * This will override the values that got set by the |
---|
597 | * gtk_widget_set_default_* () functions. |
---|
598 | */ |
---|
599 | void gtk_widget_push_style (GtkStyle *style); |
---|
600 | void gtk_widget_push_colormap (GdkColormap *cmap); |
---|
601 | void gtk_widget_push_visual (GdkVisual *visual); |
---|
602 | void gtk_widget_push_composite_child (void); |
---|
603 | void gtk_widget_pop_composite_child (void); |
---|
604 | void gtk_widget_pop_style (void); |
---|
605 | void gtk_widget_pop_colormap (void); |
---|
606 | void gtk_widget_pop_visual (void); |
---|
607 | |
---|
608 | /* Set certain default values to be used at widget creation time. |
---|
609 | */ |
---|
610 | void gtk_widget_set_default_style (GtkStyle *style); |
---|
611 | void gtk_widget_set_default_colormap (GdkColormap *colormap); |
---|
612 | void gtk_widget_set_default_visual (GdkVisual *visual); |
---|
613 | GtkStyle* gtk_widget_get_default_style (void); |
---|
614 | GdkColormap* gtk_widget_get_default_colormap (void); |
---|
615 | GdkVisual* gtk_widget_get_default_visual (void); |
---|
616 | |
---|
617 | /* Counterpart to gdk_window_shape_combine_mask. |
---|
618 | */ |
---|
619 | void gtk_widget_shape_combine_mask (GtkWidget *widget, |
---|
620 | GdkBitmap *shape_mask, |
---|
621 | gint offset_x, |
---|
622 | gint offset_y); |
---|
623 | |
---|
624 | /* internal function */ |
---|
625 | void gtk_widget_reset_shapes (GtkWidget *widget); |
---|
626 | |
---|
627 | /* Compute a widget's path in the form "GtkWindow.MyLabel", and |
---|
628 | * return newly alocated strings. |
---|
629 | */ |
---|
630 | void gtk_widget_path (GtkWidget *widget, |
---|
631 | guint *path_length, |
---|
632 | gchar **path, |
---|
633 | gchar **path_reversed); |
---|
634 | void gtk_widget_class_path (GtkWidget *widget, |
---|
635 | guint *path_length, |
---|
636 | gchar **path, |
---|
637 | gchar **path_reversed); |
---|
638 | |
---|
639 | #if defined (GTK_TRACE_OBJECTS) && defined (__GNUC__) |
---|
640 | # define gtk_widget_ref gtk_object_ref |
---|
641 | # define gtk_widget_unref gtk_object_unref |
---|
642 | #endif /* GTK_TRACE_OBJECTS && __GNUC__ */ |
---|
643 | |
---|
644 | |
---|
645 | |
---|
646 | #ifdef __cplusplus |
---|
647 | } |
---|
648 | #endif /* __cplusplus */ |
---|
649 | |
---|
650 | |
---|
651 | #endif /* __GTK_WIDGET_H__ */ |
---|