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