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