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