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