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