]> Pileus Git - ~andy/gtk/blob - gtk/gtkwidget.h
Deprecate flag macros for toplevel, state, no window and composite child
[~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 Lesser 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  * Lesser General Public License for more details.
13  *
14  * You should have received a copy of the GNU Lesser 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-2000.  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 #if defined(GTK_DISABLE_SINGLE_INCLUDES) && !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION)
28 #error "Only <gtk/gtk.h> can be included directly."
29 #endif
30
31 #ifndef __GTK_WIDGET_H__
32 #define __GTK_WIDGET_H__
33
34 #include <gdk/gdk.h>
35 #include <gtk/gtkaccelgroup.h>
36 #include <gtk/gtkobject.h>
37 #include <gtk/gtkadjustment.h>
38 #include <gtk/gtkstyle.h>
39 #include <gtk/gtksettings.h>
40 #include <atk/atk.h>
41
42 G_BEGIN_DECLS
43
44 /**
45  * GtkWidgetFlags:
46  * @GTK_TOPLEVEL: widgets without a real parent, as there are #GtkWindow<!-- -->s and
47  *  #GtkMenu<!-- -->s have this flag set throughout their lifetime.
48  *  Toplevel widgets always contain their own #GdkWindow.
49  * @GTK_NO_WINDOW: Indicative for a widget that does not provide its own #GdkWindow.
50  *  Visible action (e.g. drawing) is performed on the parent's #GdkWindow.
51  * @GTK_REALIZED: Set by gtk_widget_realize(), unset by gtk_widget_unrealize().
52  *  A realized widget has an associated #GdkWindow.
53  * @GTK_MAPPED: Set by gtk_widget_map(), unset by gtk_widget_unmap().
54  *  Only realized widgets can be mapped. It means that gdk_window_show()
55  *  has been called on the widgets window(s).
56  * @GTK_VISIBLE: Set by gtk_widget_show(), unset by gtk_widget_hide(). Implies that a
57  *  widget will be mapped as soon as its parent is mapped.
58  * @GTK_SENSITIVE: Set and unset by gtk_widget_set_sensitive().
59  *  The sensitivity of a widget determines whether it will receive
60  *  certain events (e.g. button or key presses). One premise for
61  *  the widget's sensitivity is to have this flag set.
62  * @GTK_PARENT_SENSITIVE: Set and unset by gtk_widget_set_sensitive() operations on the
63  *  parents of the widget.
64  *  This is the second premise for the widget's sensitivity. Once
65  *  it has %GTK_SENSITIVE and %GTK_PARENT_SENSITIVE set, its state is
66  *  effectively sensitive. This is expressed (and can be examined) by
67  *  the #GTK_WIDGET_IS_SENSITIVE macro.
68  * @GTK_CAN_FOCUS: Determines whether a widget is able to handle focus grabs.
69  * @GTK_HAS_FOCUS: Set by gtk_widget_grab_focus() for widgets that also
70  *  have %GTK_CAN_FOCUS set. The flag will be unset once another widget
71  *  grabs the focus.
72  * @GTK_CAN_DEFAULT: The widget is allowed to receive the default action via
73  *  gtk_widget_grab_default() and will reserve space to draw the default if possible
74  * @GTK_HAS_DEFAULT: The widget currently is receiving the default action and
75  *  should be drawn appropriately if possible
76  * @GTK_HAS_GRAB: Set by gtk_grab_add(), unset by gtk_grab_remove(). It means that the
77  *  widget is in the grab_widgets stack, and will be the preferred one for
78  *  receiving events other than ones of cosmetic value.
79  * @GTK_RC_STYLE: Indicates that the widget's style has been looked up through the rc
80  *  mechanism. It does not imply that the widget actually had a style
81  *  defined through the rc mechanism.
82  * @GTK_COMPOSITE_CHILD: Indicates that the widget is a composite child of its parent; see
83  *  gtk_widget_push_composite_child(), gtk_widget_pop_composite_child().
84  * @GTK_NO_REPARENT: Unused since before GTK+ 1.2, will be removed in a future version.
85  * @GTK_APP_PAINTABLE: Set and unset by gtk_widget_set_app_paintable().
86  *  Must be set on widgets whose window the application directly draws on,
87  *  in order to keep GTK+ from overwriting the drawn stuff.  See
88  *  <xref linkend="app-paintable-widgets"/> for a detailed
89  *  description of this flag.
90  * @GTK_RECEIVES_DEFAULT: The widget when focused will receive the default action and have
91  *  %GTK_HAS_DEFAULT set even if there is a different widget set as default.
92  * @GTK_DOUBLE_BUFFERED: Set and unset by gtk_widget_set_double_buffered().
93  *  Indicates that exposes done on the widget should be
94  *  double-buffered.  See <xref linkend="double-buffering"/> for a
95  *  detailed discussion of how double-buffering works in GTK+ and
96  *  why you may want to disable it for special cases.
97  * @GTK_NO_SHOW_ALL:
98  *
99  * Tells about certain properties of the widget.
100  */
101 typedef enum
102 {
103   GTK_TOPLEVEL         = 1 << 4,
104   GTK_NO_WINDOW        = 1 << 5,
105   GTK_REALIZED         = 1 << 6,
106   GTK_MAPPED           = 1 << 7,
107   GTK_VISIBLE          = 1 << 8,
108   GTK_SENSITIVE        = 1 << 9,
109   GTK_PARENT_SENSITIVE = 1 << 10,
110   GTK_CAN_FOCUS        = 1 << 11,
111   GTK_HAS_FOCUS        = 1 << 12,
112   GTK_CAN_DEFAULT      = 1 << 13,
113   GTK_HAS_DEFAULT      = 1 << 14,
114   GTK_HAS_GRAB         = 1 << 15,
115   GTK_RC_STYLE         = 1 << 16,
116   GTK_COMPOSITE_CHILD  = 1 << 17,
117   GTK_NO_REPARENT      = 1 << 18,
118   GTK_APP_PAINTABLE    = 1 << 19,
119   GTK_RECEIVES_DEFAULT = 1 << 20,
120   GTK_DOUBLE_BUFFERED  = 1 << 21,
121   GTK_NO_SHOW_ALL      = 1 << 22
122 } GtkWidgetFlags;
123
124 /* Kinds of widget-specific help */
125 typedef enum
126 {
127   GTK_WIDGET_HELP_TOOLTIP,
128   GTK_WIDGET_HELP_WHATS_THIS
129 } GtkWidgetHelpType;
130
131 /* Macro for casting a pointer to a GtkWidget or GtkWidgetClass pointer.
132  * Macros for testing whether `widget' or `klass' are of type GTK_TYPE_WIDGET.
133  */
134 #define GTK_TYPE_WIDGET                   (gtk_widget_get_type ())
135 #define GTK_WIDGET(widget)                (G_TYPE_CHECK_INSTANCE_CAST ((widget), GTK_TYPE_WIDGET, GtkWidget))
136 #define GTK_WIDGET_CLASS(klass)           (G_TYPE_CHECK_CLASS_CAST ((klass), GTK_TYPE_WIDGET, GtkWidgetClass))
137 #define GTK_IS_WIDGET(widget)             (G_TYPE_CHECK_INSTANCE_TYPE ((widget), GTK_TYPE_WIDGET))
138 #define GTK_IS_WIDGET_CLASS(klass)        (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_WIDGET))
139 #define GTK_WIDGET_GET_CLASS(obj)         (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_WIDGET, GtkWidgetClass))
140
141 /* Macros for extracting various fields from GtkWidget and GtkWidgetClass.
142  */
143 #ifndef GTK_DISABLE_DEPRECATED
144 /**
145  * GTK_WIDGET_TYPE:
146  * @wid: a #GtkWidget.
147  *
148  * Gets the type of a widget.
149  *
150  * Deprecated: 2.20: Use G_OBJECT_TYPE() instead.
151  */
152 #define GTK_WIDGET_TYPE(wid)              (GTK_OBJECT_TYPE (wid))
153 #endif
154
155 /**
156  * GTK_WIDGET_STATE:
157  * @wid: a #GtkWidget.
158  *
159  * Returns the current state of the widget, as a #GtkStateType.
160  *
161  * Deprecated: 2.20: Use gtk_widget_get_state() instead.
162  */
163 #define GTK_WIDGET_STATE(wid)             (GTK_WIDGET (wid)->state)
164 /* FIXME: Deprecating GTK_WIDGET_STATE requires fixing GTK internals. */
165
166 #ifndef GTK_DISABLE_DEPRECATED
167 /**
168  * GTK_WIDGET_SAVED_STATE:
169  * @wid: a #GtkWidget.
170  *
171  * Returns the saved state of the widget, as a #GtkStateType.
172  *
173  * The saved state will be restored when a widget gets sensitive
174  * again, after it has been made insensitive with gtk_widget_set_state()
175  * or gtk_widget_set_sensitive().
176  *
177  * Deprecated: 2.20: Do not used it.
178  */
179 #define GTK_WIDGET_SAVED_STATE(wid)       (GTK_WIDGET (wid)->saved_state)
180 #endif
181
182
183 /* Macros for extracting the widget flags from GtkWidget.
184  */
185 /**
186  * GTK_WIDGET_FLAGS:
187  * @wid: a #GtkWidget.
188  *
189  * Returns the widget flags from @wid.
190  *
191  * Deprecated: 2.20: Do not use it.
192  */
193 #define GTK_WIDGET_FLAGS(wid)             (GTK_OBJECT_FLAGS (wid))
194 /* FIXME: Deprecating GTK_WIDGET_FLAGS requires fixing GTK internals. */
195
196 #ifndef GTK_DISABLE_DEPRECATED
197 /**
198  * GTK_WIDGET_TOPLEVEL:
199  * @wid: a #GtkWidget.
200  *
201  * Evaluates to %TRUE if the widget is a toplevel widget.
202  *
203  * Deprecated: 2.20: Use gtk_widget_is_toplevel() instead.
204  */
205 #define GTK_WIDGET_TOPLEVEL(wid)          ((GTK_WIDGET_FLAGS (wid) & GTK_TOPLEVEL) != 0)
206 #endif
207
208 /**
209  * GTK_WIDGET_NO_WINDOW:
210  * @wid: a #GtkWidget.
211  *
212  * Evaluates to %TRUE if the widget doesn't have an own #GdkWindow.
213  *
214  * Deprecated: 2.20: Use gtk_widget_get_has_window() instead.
215  */
216 #define GTK_WIDGET_NO_WINDOW(wid)         ((GTK_WIDGET_FLAGS (wid) & GTK_NO_WINDOW) != 0)
217 /* FIXME: Deprecating GTK_WIDGET_NO_WINDOW requires fixing GTK internals. */
218
219 /**
220  * GTK_WIDGET_REALIZED:
221  * @wid: a #GtkWidget.
222  *
223  * Evaluates to %TRUE if the widget is realized.
224  */
225 #define GTK_WIDGET_REALIZED(wid)          ((GTK_WIDGET_FLAGS (wid) & GTK_REALIZED) != 0)
226
227 /**
228  * GTK_WIDGET_MAPPED:
229  * @wid: a #GtkWidget.
230  *
231  * Evaluates to %TRUE if the widget is mapped.
232  */
233 #define GTK_WIDGET_MAPPED(wid)            ((GTK_WIDGET_FLAGS (wid) & GTK_MAPPED) != 0)
234
235 /**
236  * GTK_WIDGET_VISIBLE:
237  * @wid: a #GtkWidget.
238  *
239  * Evaluates to %TRUE if the widget is visible.
240  */
241 #define GTK_WIDGET_VISIBLE(wid)           ((GTK_WIDGET_FLAGS (wid) & GTK_VISIBLE) != 0)
242
243 /**
244  * GTK_WIDGET_DRAWABLE:
245  * @wid: a #GtkWidget.
246  *
247  * Evaluates to %TRUE if the widget is mapped and visible.
248  */
249 #define GTK_WIDGET_DRAWABLE(wid)          (GTK_WIDGET_VISIBLE (wid) && GTK_WIDGET_MAPPED (wid))
250
251 /**
252  * GTK_WIDGET_SENSITIVE:
253  * @wid: a #GtkWidget.
254  *
255  * Evaluates to %TRUE if the #GTK_SENSITIVE flag has be set on the widget.
256  */
257 #define GTK_WIDGET_SENSITIVE(wid)         ((GTK_WIDGET_FLAGS (wid) & GTK_SENSITIVE) != 0)
258
259 /**
260  * GTK_WIDGET_PARENT_SENSITIVE:
261  * @wid: a #GtkWidget.
262  *
263  * Evaluates to %TRUE if the #GTK_PARENT_SENSITIVE flag has be set on the widget.
264  */
265 #define GTK_WIDGET_PARENT_SENSITIVE(wid)  ((GTK_WIDGET_FLAGS (wid) & GTK_PARENT_SENSITIVE) != 0)
266
267 /**
268  * GTK_WIDGET_IS_SENSITIVE:
269  * @wid: a #GtkWidget.
270  *
271  * Evaluates to %TRUE if the widget is effectively sensitive.
272  */
273 #define GTK_WIDGET_IS_SENSITIVE(wid)      (GTK_WIDGET_SENSITIVE (wid) && \
274                                            GTK_WIDGET_PARENT_SENSITIVE (wid))
275 /**
276  * GTK_WIDGET_CAN_FOCUS:
277  * @wid: a #GtkWidget.
278  *
279  * Evaluates to %TRUE if the widget is able to handle focus grabs.
280  */
281 #define GTK_WIDGET_CAN_FOCUS(wid)         ((GTK_WIDGET_FLAGS (wid) & GTK_CAN_FOCUS) != 0)
282
283 /**
284  * GTK_WIDGET_HAS_FOCUS:
285  * @wid: a #GtkWidget.
286  *
287  * Evaluates to %TRUE if the widget has grabbed the focus and no other
288  * widget has done so more recently.
289  */
290 #define GTK_WIDGET_HAS_FOCUS(wid)         ((GTK_WIDGET_FLAGS (wid) & GTK_HAS_FOCUS) != 0)
291
292 /**
293  * GTK_WIDGET_CAN_DEFAULT:
294  * @wid: a #GtkWidget.
295  *
296  * Evaluates to %TRUE if the widget is allowed to receive the default action
297  * via gtk_widget_grab_default().
298  */
299 #define GTK_WIDGET_CAN_DEFAULT(wid)       ((GTK_WIDGET_FLAGS (wid) & GTK_CAN_DEFAULT) != 0)
300
301 /**
302  * GTK_WIDGET_HAS_DEFAULT:
303  * @wid: a #GtkWidget.
304  *
305  * Evaluates to %TRUE if the widget currently is receiving the default action.
306  */
307 #define GTK_WIDGET_HAS_DEFAULT(wid)       ((GTK_WIDGET_FLAGS (wid) & GTK_HAS_DEFAULT) != 0)
308
309 /**
310  * GTK_WIDGET_HAS_GRAB:
311  * @wid: a #GtkWidget.
312  *
313  * Evaluates to %TRUE if the widget is in the grab_widgets stack, and will be
314  * the preferred one for receiving events other than ones of cosmetic value.
315  */
316 #define GTK_WIDGET_HAS_GRAB(wid)          ((GTK_WIDGET_FLAGS (wid) & GTK_HAS_GRAB) != 0)
317
318 /**
319  * GTK_WIDGET_RC_STYLE:
320  * @wid: a #GtkWidget.
321  *
322  * Evaluates to %TRUE if the widget's style has been looked up through the rc
323  * mechanism.
324  */
325 #define GTK_WIDGET_RC_STYLE(wid)          ((GTK_WIDGET_FLAGS (wid) & GTK_RC_STYLE) != 0)
326 #ifndef GTK_DISABLE_DEPRECATED
327 /**
328  * GTK_WIDGET_COMPOSITE_CHILD:
329  * @wid: a #GtkWidget.
330  *
331  * Evaluates to %TRUE if the widget is a composite child of its parent.
332  *
333  * Deprecated: 2.20: Use the "composite-child" property instead.
334  */
335 #define GTK_WIDGET_COMPOSITE_CHILD(wid)   ((GTK_WIDGET_FLAGS (wid) & GTK_COMPOSITE_CHILD) != 0)
336 #endif
337
338 /**
339  * GTK_WIDGET_APP_PAINTABLE:
340  * @wid: a #GtkWidget.
341  *
342  * Evaluates to %TRUE if the #GTK_APP_PAINTABLE flag has been set on the widget.
343  */
344 #define GTK_WIDGET_APP_PAINTABLE(wid)     ((GTK_WIDGET_FLAGS (wid) & GTK_APP_PAINTABLE) != 0)
345
346 /**
347  * GTK_WIDGET_RECEIVES_DEFAULT:
348  * @wid: a #GtkWidget.
349  *
350  * Evaluates to %TRUE if the widget when focused will receive the default action
351  * even if there is a different widget set as default.
352  */
353 #define GTK_WIDGET_RECEIVES_DEFAULT(wid)  ((GTK_WIDGET_FLAGS (wid) & GTK_RECEIVES_DEFAULT) != 0)
354
355 /**
356  * GTK_WIDGET_DOUBLE_BUFFERED:
357  * @wid: a #GtkWidget.
358  *
359  * Evaluates to %TRUE if the #GTK_DOUBLE_BUFFERED flag has been set on the widget.
360  */
361 #define GTK_WIDGET_DOUBLE_BUFFERED(wid)   ((GTK_WIDGET_FLAGS (wid) & GTK_DOUBLE_BUFFERED) != 0)
362
363
364 /* Macros for setting and clearing widget flags.
365  */
366 /**
367  * GTK_WIDGET_SET_FLAGS:
368  * @wid: a #GtkWidget.
369  * @flag: the flags to set.
370  *
371  * Turns on certain widget flags.
372  */
373 #define GTK_WIDGET_SET_FLAGS(wid,flag)    G_STMT_START{ (GTK_WIDGET_FLAGS (wid) |= (flag)); }G_STMT_END
374
375 /**
376  * GTK_WIDGET_UNSET_FLAGS:
377  * @wid: a #GtkWidget.
378  * @flag: the flags to unset.
379  *
380  * Turns off certain widget flags.
381  */
382 #define GTK_WIDGET_UNSET_FLAGS(wid,flag)  G_STMT_START{ (GTK_WIDGET_FLAGS (wid) &= ~(flag)); }G_STMT_END
383
384 #define GTK_TYPE_REQUISITION              (gtk_requisition_get_type ())
385
386 /* forward declaration to avoid excessive includes (and concurrent includes)
387  */
388 typedef struct _GtkRequisition     GtkRequisition;
389 typedef struct _GtkSelectionData   GtkSelectionData;
390 typedef struct _GtkWidgetClass     GtkWidgetClass;
391 typedef struct _GtkWidgetAuxInfo   GtkWidgetAuxInfo;
392 typedef struct _GtkWidgetShapeInfo GtkWidgetShapeInfo;
393 typedef struct _GtkClipboard       GtkClipboard;
394 typedef struct _GtkTooltip         GtkTooltip;
395 typedef struct _GtkWindow          GtkWindow;
396
397 /**
398  * GtkAllocation:
399  * @x: the X position of the widget's area relative to its parents allocation.
400  * @y: the Y position of the widget's area relative to its parents allocation.
401  * @width: the width of the widget's allocated area.
402  * @height: the height of the widget's allocated area.
403  *
404  * A <structname>GtkAllocation</structname> of a widget represents region which has been allocated to the
405  * widget by its parent. It is a subregion of its parents allocation. See
406  * <xref linkend="size-allocation"/> for more information.
407  */
408 typedef         GdkRectangle       GtkAllocation;
409
410 /**
411  * GtkCallback:
412  * @widget: the widget to operate on
413  * @data: user-supplied data
414  *
415  * The type of the callback functions used for e.g. iterating over
416  * the children of a container, see gtk_container_foreach().
417  */
418 typedef void    (*GtkCallback)     (GtkWidget        *widget,
419                                     gpointer          data);
420
421 /**
422  * GtkRequisition:
423  * @width: the widget's desired width
424  * @height: the widget's desired height
425  *
426  * A <structname>GtkRequisition</structname> represents the desired size of a widget. See
427  * <xref linkend="size-requisition"/> for more information.
428  */
429 struct _GtkRequisition
430 {
431   gint width;
432   gint height;
433 };
434
435 /* The widget is the base of the tree for displayable objects.
436  *  (A displayable object is one which takes up some amount
437  *  of screen real estate). It provides a common base and interface
438  *  which actual widgets must adhere to.
439  */
440 struct _GtkWidget
441 {
442   /* The object structure needs to be the first
443    *  element in the widget structure in order for
444    *  the object mechanism to work correctly. This
445    *  allows a GtkWidget pointer to be cast to a
446    *  GtkObject pointer.
447    */
448   GtkObject object;
449   
450   /* 16 bits of internally used private flags.
451    * this will be packed into the same 4 byte alignment frame that
452    * state and saved_state go. we therefore don't waste any new
453    * space on this.
454    */
455   guint16 GSEAL (private_flags);
456   
457   /* The state of the widget. There are actually only
458    *  5 widget states (defined in "gtkenums.h").
459    */
460   guint8 GSEAL (state);
461   
462   /* The saved state of the widget. When a widget's state
463    *  is changed to GTK_STATE_INSENSITIVE via
464    *  "gtk_widget_set_state" or "gtk_widget_set_sensitive"
465    *  the old state is kept around in this field. The state
466    *  will be restored once the widget gets sensitive again.
467    */
468   guint8 GSEAL (saved_state);
469   
470   /* The widget's name. If the widget does not have a name
471    *  (the name is NULL), then its name (as returned by
472    *  "gtk_widget_get_name") is its class's name.
473    * Among other things, the widget name is used to determine
474    *  the style to use for a widget.
475    */
476   gchar *GSEAL (name);
477   
478   /*< public >*/
479
480   /* The style for the widget. The style contains the
481    *  colors the widget should be drawn in for each state
482    *  along with graphics contexts used to draw with and
483    *  the font to use for text.
484    */
485   GtkStyle *GSEAL (style);
486   
487   /* The widget's desired size.
488    */
489   GtkRequisition GSEAL (requisition);
490   
491   /* The widget's allocated size.
492    */
493   GtkAllocation GSEAL (allocation);
494   
495   /* The widget's window or its parent window if it does
496    *  not have a window. (Which will be indicated by the
497    *  GTK_NO_WINDOW flag being set).
498    */
499   GdkWindow *GSEAL (window);
500   
501   /* The widget's parent.
502    */
503   GtkWidget *GSEAL (parent);
504 };
505
506 /**
507  * GtkWidgetClass:
508  * @parent_class:
509  * @activate_signal:
510  * @set_scroll_adjustments_signal:
511  *
512  * <structfield>activate_signal</structfield>
513  * The signal to emit when a widget of this class is activated,
514  * gtk_widget_activate() handles the emission. Implementation of this
515  * signal is optional.
516  *
517  *
518  * <structfield>set_scroll_adjustment_signal</structfield>
519  * This signal is emitted  when a widget of this class is added
520  * to a scrolling aware parent, gtk_widget_set_scroll_adjustments()
521  * handles the emission.
522  * Implementation of this signal is optional.
523  */
524 struct _GtkWidgetClass
525 {
526   /* The object class structure needs to be the first
527    *  element in the widget class structure in order for
528    *  the class mechanism to work correctly. This allows a
529    *  GtkWidgetClass pointer to be cast to a GtkObjectClass
530    *  pointer.
531    */
532   GtkObjectClass parent_class;
533
534   /*< public >*/
535   
536   guint activate_signal;
537
538   guint set_scroll_adjustments_signal;
539
540   /*< private >*/
541   
542   /* seldomly overidden */
543   void (*dispatch_child_properties_changed) (GtkWidget   *widget,
544                                              guint        n_pspecs,
545                                              GParamSpec **pspecs);
546
547   /* basics */
548   void (* show)                (GtkWidget        *widget);
549   void (* show_all)            (GtkWidget        *widget);
550   void (* hide)                (GtkWidget        *widget);
551   void (* hide_all)            (GtkWidget        *widget);
552   void (* map)                 (GtkWidget        *widget);
553   void (* unmap)               (GtkWidget        *widget);
554   void (* realize)             (GtkWidget        *widget);
555   void (* unrealize)           (GtkWidget        *widget);
556   void (* size_request)        (GtkWidget        *widget,
557                                 GtkRequisition   *requisition);
558   void (* size_allocate)       (GtkWidget        *widget,
559                                 GtkAllocation    *allocation);
560   void (* state_changed)       (GtkWidget        *widget,
561                                 GtkStateType      previous_state);
562   void (* parent_set)          (GtkWidget        *widget,
563                                 GtkWidget        *previous_parent);
564   void (* hierarchy_changed)   (GtkWidget        *widget,
565                                 GtkWidget        *previous_toplevel);
566   void (* style_set)           (GtkWidget        *widget,
567                                 GtkStyle         *previous_style);
568   void (* direction_changed)   (GtkWidget        *widget,
569                                 GtkTextDirection  previous_direction);
570   void (* grab_notify)         (GtkWidget        *widget,
571                                 gboolean          was_grabbed);
572   void (* child_notify)        (GtkWidget        *widget,
573                                 GParamSpec       *pspec);
574   
575   /* Mnemonics */
576   gboolean (* mnemonic_activate) (GtkWidget    *widget,
577                                   gboolean      group_cycling);
578   
579   /* explicit focus */
580   void     (* grab_focus)      (GtkWidget        *widget);
581   gboolean (* focus)           (GtkWidget        *widget,
582                                 GtkDirectionType  direction);
583   
584   /* events */
585   gboolean (* event)                    (GtkWidget           *widget,
586                                          GdkEvent            *event);
587   gboolean (* button_press_event)       (GtkWidget           *widget,
588                                          GdkEventButton      *event);
589   gboolean (* button_release_event)     (GtkWidget           *widget,
590                                          GdkEventButton      *event);
591   gboolean (* scroll_event)             (GtkWidget           *widget,
592                                          GdkEventScroll      *event);
593   gboolean (* motion_notify_event)      (GtkWidget           *widget,
594                                          GdkEventMotion      *event);
595   gboolean (* delete_event)             (GtkWidget           *widget,
596                                          GdkEventAny         *event);
597   gboolean (* destroy_event)            (GtkWidget           *widget,
598                                          GdkEventAny         *event);
599   gboolean (* expose_event)             (GtkWidget           *widget,
600                                          GdkEventExpose      *event);
601   gboolean (* key_press_event)          (GtkWidget           *widget,
602                                          GdkEventKey         *event);
603   gboolean (* key_release_event)        (GtkWidget           *widget,
604                                          GdkEventKey         *event);
605   gboolean (* enter_notify_event)       (GtkWidget           *widget,
606                                          GdkEventCrossing    *event);
607   gboolean (* leave_notify_event)       (GtkWidget           *widget,
608                                          GdkEventCrossing    *event);
609   gboolean (* configure_event)          (GtkWidget           *widget,
610                                          GdkEventConfigure   *event);
611   gboolean (* focus_in_event)           (GtkWidget           *widget,
612                                          GdkEventFocus       *event);
613   gboolean (* focus_out_event)          (GtkWidget           *widget,
614                                          GdkEventFocus       *event);
615   gboolean (* map_event)                (GtkWidget           *widget,
616                                          GdkEventAny         *event);
617   gboolean (* unmap_event)              (GtkWidget           *widget,
618                                          GdkEventAny         *event);
619   gboolean (* property_notify_event)    (GtkWidget           *widget,
620                                          GdkEventProperty    *event);
621   gboolean (* selection_clear_event)    (GtkWidget           *widget,
622                                          GdkEventSelection   *event);
623   gboolean (* selection_request_event)  (GtkWidget           *widget,
624                                          GdkEventSelection   *event);
625   gboolean (* selection_notify_event)   (GtkWidget           *widget,
626                                          GdkEventSelection   *event);
627   gboolean (* proximity_in_event)       (GtkWidget           *widget,
628                                          GdkEventProximity   *event);
629   gboolean (* proximity_out_event)      (GtkWidget           *widget,
630                                          GdkEventProximity   *event);
631   gboolean (* visibility_notify_event)  (GtkWidget           *widget,
632                                          GdkEventVisibility  *event);
633   gboolean (* client_event)             (GtkWidget           *widget,
634                                          GdkEventClient      *event);
635   gboolean (* no_expose_event)          (GtkWidget           *widget,
636                                          GdkEventAny         *event);
637   gboolean (* window_state_event)       (GtkWidget           *widget,
638                                          GdkEventWindowState *event);
639   
640   /* selection */
641   void (* selection_get)           (GtkWidget          *widget,
642                                     GtkSelectionData   *selection_data,
643                                     guint               info,
644                                     guint               time_);
645   void (* selection_received)      (GtkWidget          *widget,
646                                     GtkSelectionData   *selection_data,
647                                     guint               time_);
648
649   /* Source side drag signals */
650   void (* drag_begin)              (GtkWidget          *widget,
651                                     GdkDragContext     *context);
652   void (* drag_end)                (GtkWidget          *widget,
653                                     GdkDragContext     *context);
654   void (* drag_data_get)           (GtkWidget          *widget,
655                                     GdkDragContext     *context,
656                                     GtkSelectionData   *selection_data,
657                                     guint               info,
658                                     guint               time_);
659   void (* drag_data_delete)        (GtkWidget          *widget,
660                                     GdkDragContext     *context);
661
662   /* Target side drag signals */
663   void (* drag_leave)              (GtkWidget          *widget,
664                                     GdkDragContext     *context,
665                                     guint               time_);
666   gboolean (* drag_motion)         (GtkWidget          *widget,
667                                     GdkDragContext     *context,
668                                     gint                x,
669                                     gint                y,
670                                     guint               time_);
671   gboolean (* drag_drop)           (GtkWidget          *widget,
672                                     GdkDragContext     *context,
673                                     gint                x,
674                                     gint                y,
675                                     guint               time_);
676   void (* drag_data_received)      (GtkWidget          *widget,
677                                     GdkDragContext     *context,
678                                     gint                x,
679                                     gint                y,
680                                     GtkSelectionData   *selection_data,
681                                     guint               info,
682                                     guint               time_);
683
684   /* Signals used only for keybindings */
685   gboolean (* popup_menu)          (GtkWidget          *widget);
686
687   /* If a widget has multiple tooltips/whatsthis, it should show the
688    * one for the current focus location, or if that doesn't make
689    * sense, should cycle through them showing each tip alongside
690    * whatever piece of the widget it applies to.
691    */
692   gboolean (* show_help)           (GtkWidget          *widget,
693                                     GtkWidgetHelpType   help_type);
694   
695   /* accessibility support 
696    */
697   AtkObject*   (*get_accessible)     (GtkWidget *widget);
698
699   void         (*screen_changed)     (GtkWidget *widget,
700                                       GdkScreen *previous_screen);
701   gboolean     (*can_activate_accel) (GtkWidget *widget,
702                                       guint      signal_id);
703
704   /* Sent when a grab is broken. */
705   gboolean (*grab_broken_event) (GtkWidget           *widget,
706                                  GdkEventGrabBroken  *event);
707
708   void         (* composited_changed) (GtkWidget *widget);
709
710   gboolean     (* query_tooltip)      (GtkWidget  *widget,
711                                        gint        x,
712                                        gint        y,
713                                        gboolean    keyboard_tooltip,
714                                        GtkTooltip *tooltip);
715   /* Signals without a C default handler class slot:
716    * gboolean   (*damage_event) (GtkWidget      *widget,
717    *                             GdkEventExpose *event);
718    */
719
720   /* Padding for future expansion */
721   void (*_gtk_reserved5) (void);
722   void (*_gtk_reserved6) (void);
723   void (*_gtk_reserved7) (void);
724 };
725
726 struct _GtkWidgetAuxInfo
727 {
728   gint x;
729   gint y;
730   gint width;
731   gint height;
732
733   guint x_set : 1;
734   guint y_set : 1;
735
736   GtkRequisition natural_size;
737 };
738
739 struct _GtkWidgetShapeInfo
740 {
741   gint16     offset_x;
742   gint16     offset_y;
743   GdkBitmap *shape_mask;
744 };
745
746 GType      gtk_widget_get_type            (void) G_GNUC_CONST;
747 GtkWidget* gtk_widget_new                 (GType                type,
748                                            const gchar         *first_property_name,
749                                            ...);
750 void       gtk_widget_destroy             (GtkWidget           *widget);
751 void       gtk_widget_destroyed           (GtkWidget           *widget,
752                                            GtkWidget          **widget_pointer);
753 #ifndef GTK_DISABLE_DEPRECATED
754 GtkWidget* gtk_widget_ref                 (GtkWidget           *widget);
755 void       gtk_widget_unref               (GtkWidget           *widget);
756 void       gtk_widget_set                 (GtkWidget           *widget,
757                                            const gchar         *first_property_name,
758                                            ...) G_GNUC_NULL_TERMINATED;
759 #endif /* GTK_DISABLE_DEPRECATED */
760 void       gtk_widget_unparent            (GtkWidget           *widget);
761 void       gtk_widget_show                (GtkWidget           *widget);
762 void       gtk_widget_show_now            (GtkWidget           *widget);
763 void       gtk_widget_hide                (GtkWidget           *widget);
764 void       gtk_widget_show_all            (GtkWidget           *widget);
765 void       gtk_widget_hide_all            (GtkWidget           *widget);
766 void       gtk_widget_set_no_show_all     (GtkWidget           *widget,
767                                            gboolean             no_show_all);
768 gboolean   gtk_widget_get_no_show_all     (GtkWidget           *widget);
769 void       gtk_widget_map                 (GtkWidget           *widget);
770 void       gtk_widget_unmap               (GtkWidget           *widget);
771 void       gtk_widget_realize             (GtkWidget           *widget);
772 void       gtk_widget_unrealize           (GtkWidget           *widget);
773
774 /* Queuing draws */
775 void       gtk_widget_queue_draw          (GtkWidget           *widget);
776 void       gtk_widget_queue_draw_area     (GtkWidget           *widget,
777                                            gint                 x,
778                                            gint                 y,
779                                            gint                 width,
780                                            gint                 height);
781 #ifndef GTK_DISABLE_DEPRECATED
782 void       gtk_widget_queue_clear         (GtkWidget           *widget);
783 void       gtk_widget_queue_clear_area    (GtkWidget           *widget,
784                                            gint                 x,
785                                            gint                 y,
786                                            gint                 width,
787                                            gint                 height);
788 #endif /* GTK_DISABLE_DEPRECATED */
789
790
791 void       gtk_widget_queue_resize        (GtkWidget           *widget);
792 void       gtk_widget_queue_resize_no_redraw (GtkWidget *widget);
793 #ifndef GTK_DISABLE_DEPRECATED
794 void       gtk_widget_draw                (GtkWidget           *widget,
795                                            const GdkRectangle  *area);
796 #endif /* GTK_DISABLE_DEPRECATED */
797 void       gtk_widget_size_request        (GtkWidget           *widget,
798                                            GtkRequisition      *requisition);
799 void       gtk_widget_size_allocate       (GtkWidget           *widget,
800                                            GtkAllocation       *allocation);
801 void       gtk_widget_get_desired_size    (GtkWidget           *widget,
802                                            GtkRequisition      *minimum_size,
803                                            GtkRequisition      *natural_size);
804 void       gtk_widget_get_child_requisition (GtkWidget         *widget,
805                                              GtkRequisition    *requisition);
806 void       gtk_widget_add_accelerator     (GtkWidget           *widget,
807                                            const gchar         *accel_signal,
808                                            GtkAccelGroup       *accel_group,
809                                            guint                accel_key,
810                                            GdkModifierType      accel_mods,
811                                            GtkAccelFlags        accel_flags);
812 gboolean   gtk_widget_remove_accelerator  (GtkWidget           *widget,
813                                            GtkAccelGroup       *accel_group,
814                                            guint                accel_key,
815                                            GdkModifierType      accel_mods);
816 void       gtk_widget_set_accel_path      (GtkWidget           *widget,
817                                            const gchar         *accel_path,
818                                            GtkAccelGroup       *accel_group);
819 const gchar* _gtk_widget_get_accel_path   (GtkWidget           *widget,
820                                            gboolean            *locked);
821 GList*     gtk_widget_list_accel_closures (GtkWidget           *widget);
822 gboolean   gtk_widget_can_activate_accel  (GtkWidget           *widget,
823                                            guint                signal_id);
824 gboolean   gtk_widget_mnemonic_activate   (GtkWidget           *widget,
825                                            gboolean             group_cycling);
826 gboolean   gtk_widget_event               (GtkWidget           *widget,
827                                            GdkEvent            *event);
828 gint       gtk_widget_send_expose         (GtkWidget           *widget,
829                                            GdkEvent            *event);
830
831 gboolean   gtk_widget_activate               (GtkWidget        *widget);
832 gboolean   gtk_widget_set_scroll_adjustments (GtkWidget        *widget,
833                                               GtkAdjustment    *hadjustment,
834                                               GtkAdjustment    *vadjustment);
835      
836 void       gtk_widget_reparent            (GtkWidget           *widget,
837                                            GtkWidget           *new_parent);
838 gboolean   gtk_widget_intersect           (GtkWidget           *widget,
839                                            const GdkRectangle  *area,
840                                            GdkRectangle        *intersection);
841 GdkRegion *gtk_widget_region_intersect    (GtkWidget           *widget,
842                                            const GdkRegion     *region);
843
844 void    gtk_widget_freeze_child_notify    (GtkWidget           *widget);
845 void    gtk_widget_child_notify           (GtkWidget           *widget,
846                                            const gchar         *child_property);
847 void    gtk_widget_thaw_child_notify      (GtkWidget           *widget);
848
849 void       gtk_widget_set_can_focus       (GtkWidget           *widget,
850                                            gboolean             can_focus);
851 gboolean   gtk_widget_get_can_focus       (GtkWidget           *widget);
852 gboolean   gtk_widget_has_focus           (GtkWidget           *widget);
853 gboolean   gtk_widget_is_focus            (GtkWidget           *widget);
854 void       gtk_widget_grab_focus          (GtkWidget           *widget);
855
856 void       gtk_widget_set_can_default     (GtkWidget           *widget,
857                                            gboolean             can_default);
858 gboolean   gtk_widget_get_can_default     (GtkWidget           *widget);
859 gboolean   gtk_widget_has_default         (GtkWidget           *widget);
860 void       gtk_widget_grab_default        (GtkWidget           *widget);
861
862 void      gtk_widget_set_receives_default (GtkWidget           *widget,
863                                            gboolean             receives_default);
864 gboolean  gtk_widget_get_receives_default (GtkWidget           *widget);
865
866 gboolean   gtk_widget_has_grab            (GtkWidget           *widget);
867
868 void                  gtk_widget_set_name               (GtkWidget    *widget,
869                                                          const gchar  *name);
870 G_CONST_RETURN gchar* gtk_widget_get_name               (GtkWidget    *widget);
871
872 void                  gtk_widget_set_state              (GtkWidget    *widget,
873                                                          GtkStateType  state);
874 GtkStateType          gtk_widget_get_state              (GtkWidget    *widget);
875
876 void                  gtk_widget_set_sensitive          (GtkWidget    *widget,
877                                                          gboolean      sensitive);
878 gboolean              gtk_widget_get_sensitive          (GtkWidget    *widget);
879 gboolean              gtk_widget_is_sensitive           (GtkWidget    *widget);
880
881 void                  gtk_widget_set_visible            (GtkWidget    *widget,
882                                                          gboolean      visible);
883 gboolean              gtk_widget_get_visible            (GtkWidget    *widget);
884
885 void                  gtk_widget_set_has_window         (GtkWidget    *widget,
886                                                          gboolean      has_window);
887 gboolean              gtk_widget_get_has_window         (GtkWidget    *widget);
888
889 gboolean              gtk_widget_is_toplevel            (GtkWidget    *widget);
890 gboolean              gtk_widget_is_drawable            (GtkWidget    *widget);
891
892 void                  gtk_widget_set_app_paintable      (GtkWidget    *widget,
893                                                          gboolean      app_paintable);
894 gboolean              gtk_widget_get_app_paintable      (GtkWidget    *widget);
895
896 void                  gtk_widget_set_double_buffered    (GtkWidget    *widget,
897                                                          gboolean      double_buffered);
898 gboolean              gtk_widget_get_double_buffered    (GtkWidget    *widget);
899
900 void                  gtk_widget_set_redraw_on_allocate (GtkWidget    *widget,
901                                                          gboolean      redraw_on_allocate);
902
903 void                  gtk_widget_set_parent             (GtkWidget    *widget,
904                                                          GtkWidget    *parent);
905 GtkWidget           * gtk_widget_get_parent             (GtkWidget    *widget);
906
907 void                  gtk_widget_set_parent_window      (GtkWidget    *widget,
908                                                          GdkWindow    *parent_window);
909 GdkWindow           * gtk_widget_get_parent_window      (GtkWidget    *widget);
910
911 void                  gtk_widget_set_child_visible      (GtkWidget    *widget,
912                                                          gboolean      is_visible);
913 gboolean              gtk_widget_get_child_visible      (GtkWidget    *widget);
914
915 void                  gtk_widget_set_window             (GtkWidget    *widget,
916                                                          GdkWindow    *window);
917 GdkWindow           * gtk_widget_get_window             (GtkWidget    *widget);
918
919 void                  gtk_widget_get_allocation         (GtkWidget     *widget,
920                                                          GtkAllocation *allocation);
921 void                  gtk_widget_set_allocation         (GtkWidget     *widget,
922                                                          const GtkAllocation *allocation);
923
924 gboolean   gtk_widget_child_focus         (GtkWidget           *widget,
925                                            GtkDirectionType     direction);
926 gboolean   gtk_widget_keynav_failed       (GtkWidget           *widget,
927                                            GtkDirectionType     direction);
928 void       gtk_widget_error_bell          (GtkWidget           *widget);
929
930 void       gtk_widget_set_size_request    (GtkWidget           *widget,
931                                            gint                 width,
932                                            gint                 height);
933 void       gtk_widget_get_size_request    (GtkWidget           *widget,
934                                            gint                *width,
935                                            gint                *height);
936 #ifndef GTK_DISABLE_DEPRECATED
937 void       gtk_widget_set_uposition       (GtkWidget           *widget,
938                                            gint                 x,
939                                            gint                 y);
940 void       gtk_widget_set_usize           (GtkWidget           *widget,
941                                            gint                 width,
942                                            gint                 height);
943 #endif
944
945 void       gtk_widget_set_events          (GtkWidget           *widget,
946                                            gint                 events);
947 void       gtk_widget_add_events          (GtkWidget           *widget,
948                                            gint                 events);
949 void       gtk_widget_set_extension_events (GtkWidget           *widget,
950                                             GdkExtensionMode    mode);
951
952 GdkExtensionMode gtk_widget_get_extension_events (GtkWidget     *widget);
953 GtkWidget*   gtk_widget_get_toplevel    (GtkWidget      *widget);
954 GtkWidget*   gtk_widget_get_ancestor    (GtkWidget      *widget,
955                                          GType           widget_type);
956 GdkColormap* gtk_widget_get_colormap    (GtkWidget      *widget);
957 GdkVisual*   gtk_widget_get_visual      (GtkWidget      *widget);
958
959 GdkScreen *   gtk_widget_get_screen      (GtkWidget *widget);
960 gboolean      gtk_widget_has_screen      (GtkWidget *widget);
961 GdkDisplay *  gtk_widget_get_display     (GtkWidget *widget);
962 GdkWindow *   gtk_widget_get_root_window (GtkWidget *widget);
963 GtkSettings*  gtk_widget_get_settings    (GtkWidget *widget);
964 GtkClipboard *gtk_widget_get_clipboard   (GtkWidget *widget,
965                                           GdkAtom    selection);
966 GdkPixmap *   gtk_widget_get_snapshot    (GtkWidget    *widget,
967                                           GdkRectangle *clip_rect);
968
969 #ifndef GTK_DISABLE_DEPRECATED
970
971 /**
972  * gtk_widget_set_visual:
973  * @widget: a #GtkWidget
974  * @visual: a visual
975  *
976  * This function is deprecated; it does nothing.
977  */
978 #define gtk_widget_set_visual(widget,visual)  ((void) 0)
979
980 /**
981  * gtk_widget_push_visual:
982  * @visual: a visual
983  *
984  * This function is deprecated; it does nothing.
985  */
986 #define gtk_widget_push_visual(visual)        ((void) 0)
987
988 /**
989  * gtk_widget_pop_visual:
990  *
991  * This function is deprecated; it does nothing.
992  */
993 #define gtk_widget_pop_visual()               ((void) 0)
994
995 /**
996  * gtk_widget_set_default_visual:
997  * @visual: a visual
998  *
999  * This function is deprecated; it does nothing.
1000  */
1001 #define gtk_widget_set_default_visual(visual) ((void) 0)
1002
1003 #endif /* GTK_DISABLE_DEPRECATED */
1004
1005 /* Accessibility support */
1006 AtkObject*       gtk_widget_get_accessible               (GtkWidget          *widget);
1007
1008 /* The following functions must not be called on an already
1009  * realized widget. Because it is possible that somebody
1010  * can call get_colormap() or get_visual() and save the
1011  * result, these functions are probably only safe to
1012  * call in a widget's init() function.
1013  */
1014 void         gtk_widget_set_colormap    (GtkWidget      *widget,
1015                                          GdkColormap    *colormap);
1016
1017 gint         gtk_widget_get_events      (GtkWidget      *widget);
1018 void         gtk_widget_get_pointer     (GtkWidget      *widget,
1019                                          gint           *x,
1020                                          gint           *y);
1021
1022 gboolean     gtk_widget_is_ancestor     (GtkWidget      *widget,
1023                                          GtkWidget      *ancestor);
1024
1025 gboolean     gtk_widget_translate_coordinates (GtkWidget  *src_widget,
1026                                                GtkWidget  *dest_widget,
1027                                                gint        src_x,
1028                                                gint        src_y,
1029                                                gint       *dest_x,
1030                                                gint       *dest_y);
1031
1032 /* Hide widget and return TRUE.
1033  */
1034 gboolean     gtk_widget_hide_on_delete  (GtkWidget      *widget);
1035
1036 /* Widget styles.
1037  */
1038 void       gtk_widget_set_style         (GtkWidget      *widget,
1039                                          GtkStyle       *style);
1040 void       gtk_widget_ensure_style      (GtkWidget      *widget);
1041 GtkStyle*  gtk_widget_get_style         (GtkWidget      *widget);
1042
1043 void        gtk_widget_modify_style       (GtkWidget            *widget,
1044                                            GtkRcStyle           *style);
1045 GtkRcStyle *gtk_widget_get_modifier_style (GtkWidget            *widget);
1046 void        gtk_widget_modify_fg          (GtkWidget            *widget,
1047                                            GtkStateType          state,
1048                                            const GdkColor       *color);
1049 void        gtk_widget_modify_bg          (GtkWidget            *widget,
1050                                            GtkStateType          state,
1051                                            const GdkColor       *color);
1052 void        gtk_widget_modify_text        (GtkWidget            *widget,
1053                                            GtkStateType          state,
1054                                            const GdkColor       *color);
1055 void        gtk_widget_modify_base        (GtkWidget            *widget,
1056                                            GtkStateType          state,
1057                                            const GdkColor       *color);
1058 void        gtk_widget_modify_cursor      (GtkWidget            *widget,
1059                                            const GdkColor       *primary,
1060                                            const GdkColor       *secondary);
1061 void        gtk_widget_modify_font        (GtkWidget            *widget,
1062                                            PangoFontDescription *font_desc);
1063
1064 #ifndef GTK_DISABLE_DEPRECATED
1065
1066 /**
1067  * gtk_widget_set_rc_style:
1068  * @widget: a #GtkWidget.
1069  *
1070  * Equivalent to <literal>gtk_widget_set_style (widget, NULL)</literal>.
1071  *
1072  * Deprecated: Use gtk_widget_set_style() with a %NULL @style argument instead.
1073  */
1074 #define gtk_widget_set_rc_style(widget)          (gtk_widget_set_style (widget, NULL))
1075
1076 /**
1077  * gtk_widget_restore_default_style:
1078  * @widget: a #GtkWidget.
1079  *
1080  * Equivalent to <literal>gtk_widget_set_style (widget, NULL)</literal>.
1081  *
1082  * Deprecated: Use gtk_widget_set_style() with a %NULL @style argument instead.
1083  */
1084 #define gtk_widget_restore_default_style(widget) (gtk_widget_set_style (widget, NULL))
1085 #endif
1086
1087 PangoContext *gtk_widget_create_pango_context (GtkWidget   *widget);
1088 PangoContext *gtk_widget_get_pango_context    (GtkWidget   *widget);
1089 PangoLayout  *gtk_widget_create_pango_layout  (GtkWidget   *widget,
1090                                                const gchar *text);
1091
1092 GdkPixbuf    *gtk_widget_render_icon          (GtkWidget   *widget,
1093                                                const gchar *stock_id,
1094                                                GtkIconSize  size,
1095                                                const gchar *detail);
1096
1097 /* handle composite names for GTK_COMPOSITE_CHILD widgets,
1098  * the returned name is newly allocated.
1099  */
1100 void   gtk_widget_set_composite_name    (GtkWidget      *widget,
1101                                          const gchar    *name);
1102 gchar* gtk_widget_get_composite_name    (GtkWidget      *widget);
1103      
1104 /* Descend recursively and set rc-style on all widgets without user styles */
1105 void       gtk_widget_reset_rc_styles   (GtkWidget      *widget);
1106
1107 /* Push/pop pairs, to change default values upon a widget's creation.
1108  * This will override the values that got set by the
1109  * gtk_widget_set_default_* () functions.
1110  */
1111 void         gtk_widget_push_colormap        (GdkColormap *cmap);
1112 void         gtk_widget_push_composite_child (void);
1113 void         gtk_widget_pop_composite_child  (void);
1114 void         gtk_widget_pop_colormap         (void);
1115
1116 /* widget style properties
1117  */
1118 void gtk_widget_class_install_style_property        (GtkWidgetClass     *klass,
1119                                                      GParamSpec         *pspec);
1120 void gtk_widget_class_install_style_property_parser (GtkWidgetClass     *klass,
1121                                                      GParamSpec         *pspec,
1122                                                      GtkRcPropertyParser parser);
1123 GParamSpec*  gtk_widget_class_find_style_property   (GtkWidgetClass     *klass,
1124                                                      const gchar        *property_name);
1125 GParamSpec** gtk_widget_class_list_style_properties (GtkWidgetClass     *klass,
1126                                                      guint              *n_properties);
1127 void gtk_widget_style_get_property (GtkWidget        *widget,
1128                                     const gchar    *property_name,
1129                                     GValue           *value);
1130 void gtk_widget_style_get_valist   (GtkWidget        *widget,
1131                                     const gchar    *first_property_name,
1132                                     va_list         var_args);
1133 void gtk_widget_style_get          (GtkWidget        *widget,
1134                                     const gchar    *first_property_name,
1135                                     ...) G_GNUC_NULL_TERMINATED;
1136
1137
1138 /* Set certain default values to be used at widget creation time.
1139  */
1140 void         gtk_widget_set_default_colormap (GdkColormap *colormap);
1141 GtkStyle*    gtk_widget_get_default_style    (void);
1142 #ifndef GDK_MULTIHEAD_SAFE
1143 GdkColormap* gtk_widget_get_default_colormap (void);
1144 GdkVisual*   gtk_widget_get_default_visual   (void);
1145 #endif
1146
1147 /* Functions for setting directionality for widgets
1148  */
1149
1150 void             gtk_widget_set_direction         (GtkWidget        *widget,
1151                                                    GtkTextDirection  dir);
1152 GtkTextDirection gtk_widget_get_direction         (GtkWidget        *widget);
1153
1154 void             gtk_widget_set_default_direction (GtkTextDirection  dir);
1155 GtkTextDirection gtk_widget_get_default_direction (void);
1156
1157 /* Compositing manager functionality */
1158 gboolean gtk_widget_is_composited (GtkWidget *widget);
1159
1160 /* Counterpart to gdk_window_shape_combine_mask.
1161  */
1162 void         gtk_widget_shape_combine_mask (GtkWidget *widget,
1163                                             GdkBitmap *shape_mask,
1164                                             gint       offset_x,
1165                                             gint       offset_y);
1166 void         gtk_widget_input_shape_combine_mask (GtkWidget *widget,
1167                                                   GdkBitmap *shape_mask,
1168                                                   gint       offset_x,
1169                                                   gint       offset_y);
1170
1171 /* internal function */
1172 void         gtk_widget_reset_shapes       (GtkWidget *widget);
1173
1174 /* Compute a widget's path in the form "GtkWindow.MyLabel", and
1175  * return newly alocated strings.
1176  */
1177 void         gtk_widget_path               (GtkWidget *widget,
1178                                             guint     *path_length,
1179                                             gchar    **path,
1180                                             gchar    **path_reversed);
1181 void         gtk_widget_class_path         (GtkWidget *widget,
1182                                             guint     *path_length,
1183                                             gchar    **path,
1184                                             gchar    **path_reversed);
1185
1186 GList* gtk_widget_list_mnemonic_labels  (GtkWidget *widget);
1187 void   gtk_widget_add_mnemonic_label    (GtkWidget *widget,
1188                                          GtkWidget *label);
1189 void   gtk_widget_remove_mnemonic_label (GtkWidget *widget,
1190                                          GtkWidget *label);
1191
1192 void                  gtk_widget_set_tooltip_window    (GtkWidget   *widget,
1193                                                         GtkWindow   *custom_window);
1194 GtkWindow *gtk_widget_get_tooltip_window    (GtkWidget   *widget);
1195 void       gtk_widget_trigger_tooltip_query (GtkWidget   *widget);
1196 void       gtk_widget_set_tooltip_text      (GtkWidget   *widget,
1197                                              const gchar *text);
1198 gchar *    gtk_widget_get_tooltip_text      (GtkWidget   *widget);
1199 void       gtk_widget_set_tooltip_markup    (GtkWidget   *widget,
1200                                              const gchar *markup);
1201 gchar *    gtk_widget_get_tooltip_markup    (GtkWidget   *widget);
1202 void       gtk_widget_set_has_tooltip       (GtkWidget   *widget,
1203                                              gboolean     has_tooltip);
1204 gboolean   gtk_widget_get_has_tooltip       (GtkWidget   *widget);
1205
1206 GType           gtk_requisition_get_type (void) G_GNUC_CONST;
1207 GtkRequisition *gtk_requisition_copy     (const GtkRequisition *requisition);
1208 void            gtk_requisition_free     (GtkRequisition       *requisition);
1209
1210 #if     defined (GTK_TRACE_OBJECTS) && defined (__GNUC__)
1211 #  define gtk_widget_ref g_object_ref
1212 #  define gtk_widget_unref g_object_unref
1213 #endif  /* GTK_TRACE_OBJECTS && __GNUC__ */
1214
1215 void              _gtk_widget_grab_notify                 (GtkWidget    *widget,
1216                                                            gboolean     was_grabbed);
1217
1218 GtkWidgetAuxInfo *_gtk_widget_get_aux_info                (GtkWidget    *widget,
1219                                                            gboolean      create);
1220 void              _gtk_widget_propagate_hierarchy_changed (GtkWidget    *widget,
1221                                                            GtkWidget    *previous_toplevel);
1222 void              _gtk_widget_propagate_screen_changed    (GtkWidget    *widget,
1223                                                            GdkScreen    *previous_screen);
1224 void              _gtk_widget_propagate_composited_changed (GtkWidget    *widget);
1225
1226 void       _gtk_widget_set_pointer_window  (GtkWidget      *widget,
1227                                             GdkWindow      *pointer_window);
1228 GdkWindow *_gtk_widget_get_pointer_window  (GtkWidget      *widget);
1229 gboolean   _gtk_widget_is_pointer_widget   (GtkWidget      *widget);
1230 void       _gtk_widget_synthesize_crossing (GtkWidget      *from,
1231                                             GtkWidget      *to,
1232                                             GdkCrossingMode mode);
1233
1234 GdkColormap* _gtk_widget_peek_colormap (void);
1235
1236 void         _gtk_widget_buildable_finish_accelerator (GtkWidget *widget,
1237                                                        GtkWidget *toplevel,
1238                                                        gpointer   user_data);
1239
1240 G_END_DECLS
1241
1242 #endif /* __GTK_WIDGET_H__ */