1 /* GTK - The GIMP Toolkit
2 * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald
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.
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.
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.
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/.
27 #if defined(GTK_DISABLE_SINGLE_INCLUDES) && !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION)
28 #error "Only <gtk/gtk.h> can be included directly."
31 #ifndef __GTK_WIDGET_H__
32 #define __GTK_WIDGET_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>
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
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.
99 * Tells about certain properties of the widget.
103 GTK_TOPLEVEL = 1 << 4,
104 GTK_NO_WINDOW = 1 << 5,
105 GTK_REALIZED = 1 << 6,
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
124 /* Kinds of widget-specific help */
127 GTK_WIDGET_HELP_TOOLTIP,
128 GTK_WIDGET_HELP_WHATS_THIS
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.
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))
141 /* Macros for extracting various fields from GtkWidget and GtkWidgetClass.
143 #ifndef GTK_DISABLE_DEPRECATED
146 * @wid: a #GtkWidget.
148 * Gets the type of a widget.
150 * Deprecated: 2.20: Use G_OBJECT_TYPE() instead.
152 #define GTK_WIDGET_TYPE(wid) (GTK_OBJECT_TYPE (wid))
157 * @wid: a #GtkWidget.
159 * Returns the current state of the widget, as a #GtkStateType.
161 * Deprecated: 2.20: Use gtk_widget_get_state() instead.
163 #define GTK_WIDGET_STATE(wid) (GTK_WIDGET (wid)->state)
164 /* FIXME: Deprecating GTK_WIDGET_STATE requires fixing GTK internals. */
166 #ifndef GTK_DISABLE_DEPRECATED
168 * GTK_WIDGET_SAVED_STATE:
169 * @wid: a #GtkWidget.
171 * Returns the saved state of the widget, as a #GtkStateType.
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().
177 * Deprecated: 2.20: Do not used it.
179 #define GTK_WIDGET_SAVED_STATE(wid) (GTK_WIDGET (wid)->saved_state)
183 /* Macros for extracting the widget flags from GtkWidget.
187 * @wid: a #GtkWidget.
189 * Returns the widget flags from @wid.
191 * Deprecated: 2.20: Do not use it.
193 #define GTK_WIDGET_FLAGS(wid) (GTK_OBJECT_FLAGS (wid))
194 /* FIXME: Deprecating GTK_WIDGET_FLAGS requires fixing GTK internals. */
196 #ifndef GTK_DISABLE_DEPRECATED
198 * GTK_WIDGET_TOPLEVEL:
199 * @wid: a #GtkWidget.
201 * Evaluates to %TRUE if the widget is a toplevel widget.
203 * Deprecated: 2.20: Use gtk_widget_is_toplevel() instead.
205 #define GTK_WIDGET_TOPLEVEL(wid) ((GTK_WIDGET_FLAGS (wid) & GTK_TOPLEVEL) != 0)
208 #ifndef GTK_DISABLE_DEPRECATED
210 * GTK_WIDGET_NO_WINDOW:
211 * @wid: a #GtkWidget.
213 * Evaluates to %TRUE if the widget doesn't have an own #GdkWindow.
215 * Deprecated: 2.20: Use gtk_widget_get_has_window() instead.
217 #define GTK_WIDGET_NO_WINDOW(wid) ((GTK_WIDGET_FLAGS (wid) & GTK_NO_WINDOW) != 0)
221 * GTK_WIDGET_REALIZED:
222 * @wid: a #GtkWidget.
224 * Evaluates to %TRUE if the widget is realized.
226 #define GTK_WIDGET_REALIZED(wid) ((GTK_WIDGET_FLAGS (wid) & GTK_REALIZED) != 0)
230 * @wid: a #GtkWidget.
232 * Evaluates to %TRUE if the widget is mapped.
234 #define GTK_WIDGET_MAPPED(wid) ((GTK_WIDGET_FLAGS (wid) & GTK_MAPPED) != 0)
236 #ifndef GTK_DISABLE_DEPRECATED
238 * GTK_WIDGET_VISIBLE:
239 * @wid: a #GtkWidget.
241 * Evaluates to %TRUE if the widget is visible.
243 * Deprecated: 2.20: Use gtk_widget_get_visible() instead.
245 #define GTK_WIDGET_VISIBLE(wid) ((GTK_WIDGET_FLAGS (wid) & GTK_VISIBLE) != 0)
248 #ifndef GTK_DISABLE_DEPRECATED
250 * GTK_WIDGET_DRAWABLE:
251 * @wid: a #GtkWidget.
253 * Evaluates to %TRUE if the widget is mapped and visible.
255 * Deprecated: 2.20: Use gtk_widget_is_drawable() instead.
257 #define GTK_WIDGET_DRAWABLE(wid) (GTK_WIDGET_VISIBLE (wid) && GTK_WIDGET_MAPPED (wid))
260 #ifndef GTK_DISABLE_DEPRECATED
262 * GTK_WIDGET_SENSITIVE:
263 * @wid: a #GtkWidget.
265 * Evaluates to %TRUE if the #GTK_SENSITIVE flag has be set on the widget.
267 #define GTK_WIDGET_SENSITIVE(wid) ((GTK_WIDGET_FLAGS (wid) & GTK_SENSITIVE) != 0)
271 * GTK_WIDGET_PARENT_SENSITIVE:
272 * @wid: a #GtkWidget.
274 * Evaluates to %TRUE if the #GTK_PARENT_SENSITIVE flag has be set on the widget.
276 #define GTK_WIDGET_PARENT_SENSITIVE(wid) ((GTK_WIDGET_FLAGS (wid) & GTK_PARENT_SENSITIVE) != 0)
278 #ifndef GTK_DISABLE_DEPRECATED
280 * GTK_WIDGET_IS_SENSITIVE:
281 * @wid: a #GtkWidget.
283 * Evaluates to %TRUE if the widget is effectively sensitive.
285 * Deprecated: 2.20: Use gtk_widget_is_sensitive() instead.
287 #define GTK_WIDGET_IS_SENSITIVE(wid) (GTK_WIDGET_SENSITIVE (wid) && \
288 GTK_WIDGET_PARENT_SENSITIVE (wid))
291 #ifndef GTK_DISABLE_DEPRECATED
293 * GTK_WIDGET_CAN_FOCUS:
294 * @wid: a #GtkWidget.
296 * Evaluates to %TRUE if the widget is able to handle focus grabs.
298 * Deprecated: 2.20: Use gtk_widget_get_can_focus() instead.
300 #define GTK_WIDGET_CAN_FOCUS(wid) ((GTK_WIDGET_FLAGS (wid) & GTK_CAN_FOCUS) != 0)
303 #ifndef GTK_DISABLE_DEPRECATED
305 * GTK_WIDGET_HAS_FOCUS:
306 * @wid: a #GtkWidget.
308 * Evaluates to %TRUE if the widget has grabbed the focus and no other
309 * widget has done so more recently.
311 * Deprecated: 2.20: Use gtk_widget_has_focus() instead.
313 #define GTK_WIDGET_HAS_FOCUS(wid) ((GTK_WIDGET_FLAGS (wid) & GTK_HAS_FOCUS) != 0)
316 #ifndef GTK_DISABLE_DEPRECATED
318 * GTK_WIDGET_CAN_DEFAULT:
319 * @wid: a #GtkWidget.
321 * Evaluates to %TRUE if the widget is allowed to receive the default action
322 * via gtk_widget_grab_default().
324 * Deprecated: 2.20: Use gtk_widget_get_can_default() instead.
326 #define GTK_WIDGET_CAN_DEFAULT(wid) ((GTK_WIDGET_FLAGS (wid) & GTK_CAN_DEFAULT) != 0)
329 #ifndef GTK_DISABLE_DEPRECATED
331 * GTK_WIDGET_HAS_DEFAULT:
332 * @wid: a #GtkWidget.
334 * Evaluates to %TRUE if the widget currently is receiving the default action.
336 * Deprecated: 2.20: Use gtk_widget_has_default() instead.
338 #define GTK_WIDGET_HAS_DEFAULT(wid) ((GTK_WIDGET_FLAGS (wid) & GTK_HAS_DEFAULT) != 0)
341 #ifndef GTK_DISABLE_DEPRECATED
343 * GTK_WIDGET_HAS_GRAB:
344 * @wid: a #GtkWidget.
346 * Evaluates to %TRUE if the widget is in the grab_widgets stack, and will be
347 * the preferred one for receiving events other than ones of cosmetic value.
349 * Deprecated: 2.20: Use gtk_widget_has_grab() instead.
351 #define GTK_WIDGET_HAS_GRAB(wid) ((GTK_WIDGET_FLAGS (wid) & GTK_HAS_GRAB) != 0)
354 #ifndef GTK_DISABLE_DEPRECATED
356 * GTK_WIDGET_RC_STYLE:
357 * @wid: a #GtkWidget.
359 * Evaluates to %TRUE if the widget's style has been looked up through the rc
362 * Deprecated: 2.20: Use gtk_widget_has_rc_style() instead.
364 #define GTK_WIDGET_RC_STYLE(wid) ((GTK_WIDGET_FLAGS (wid) & GTK_RC_STYLE) != 0)
367 #ifndef GTK_DISABLE_DEPRECATED
369 * GTK_WIDGET_COMPOSITE_CHILD:
370 * @wid: a #GtkWidget.
372 * Evaluates to %TRUE if the widget is a composite child of its parent.
374 * Deprecated: 2.20: Use the #GtkWidget:composite-child property instead.
376 #define GTK_WIDGET_COMPOSITE_CHILD(wid) ((GTK_WIDGET_FLAGS (wid) & GTK_COMPOSITE_CHILD) != 0)
379 #ifndef GTK_DISABLE_DEPRECATED
381 * GTK_WIDGET_APP_PAINTABLE:
382 * @wid: a #GtkWidget.
384 * Evaluates to %TRUE if the #GTK_APP_PAINTABLE flag has been set on the widget.
386 * Deprecated: 2.20: Use gtk_widget_get_app_paintable() instead.
388 #define GTK_WIDGET_APP_PAINTABLE(wid) ((GTK_WIDGET_FLAGS (wid) & GTK_APP_PAINTABLE) != 0)
391 #ifndef GTK_DISABLE_DEPRECATED
393 * GTK_WIDGET_RECEIVES_DEFAULT:
394 * @wid: a #GtkWidget.
396 * Evaluates to %TRUE if the widget when focused will receive the default action
397 * even if there is a different widget set as default.
399 * Deprecated: 2.20: Use gtk_widget_get_receives_default() instead.
401 #define GTK_WIDGET_RECEIVES_DEFAULT(wid) ((GTK_WIDGET_FLAGS (wid) & GTK_RECEIVES_DEFAULT) != 0)
404 #ifndef GTK_DISABLE_DEPRECATED
406 * GTK_WIDGET_DOUBLE_BUFFERED:
407 * @wid: a #GtkWidget.
409 * Evaluates to %TRUE if the #GTK_DOUBLE_BUFFERED flag has been set on the widget.
411 * Deprecated: 2.20: Use gtk_widget_get_double_buffered() instead.
413 #define GTK_WIDGET_DOUBLE_BUFFERED(wid) ((GTK_WIDGET_FLAGS (wid) & GTK_DOUBLE_BUFFERED) != 0)
417 /* Macros for setting and clearing widget flags.
420 * GTK_WIDGET_SET_FLAGS:
421 * @wid: a #GtkWidget.
422 * @flag: the flags to set.
424 * Turns on certain widget flags.
426 #define GTK_WIDGET_SET_FLAGS(wid,flag) G_STMT_START{ (GTK_WIDGET_FLAGS (wid) |= (flag)); }G_STMT_END
429 * GTK_WIDGET_UNSET_FLAGS:
430 * @wid: a #GtkWidget.
431 * @flag: the flags to unset.
433 * Turns off certain widget flags.
435 #define GTK_WIDGET_UNSET_FLAGS(wid,flag) G_STMT_START{ (GTK_WIDGET_FLAGS (wid) &= ~(flag)); }G_STMT_END
437 #define GTK_TYPE_REQUISITION (gtk_requisition_get_type ())
439 /* forward declaration to avoid excessive includes (and concurrent includes)
441 typedef struct _GtkRequisition GtkRequisition;
442 typedef struct _GtkSelectionData GtkSelectionData;
443 typedef struct _GtkWidgetClass GtkWidgetClass;
444 typedef struct _GtkWidgetAuxInfo GtkWidgetAuxInfo;
445 typedef struct _GtkWidgetShapeInfo GtkWidgetShapeInfo;
446 typedef struct _GtkClipboard GtkClipboard;
447 typedef struct _GtkTooltip GtkTooltip;
448 typedef struct _GtkWindow GtkWindow;
452 * @x: the X position of the widget's area relative to its parents allocation.
453 * @y: the Y position of the widget's area relative to its parents allocation.
454 * @width: the width of the widget's allocated area.
455 * @height: the height of the widget's allocated area.
457 * A <structname>GtkAllocation</structname> of a widget represents region which has been allocated to the
458 * widget by its parent. It is a subregion of its parents allocation. See
459 * <xref linkend="size-allocation"/> for more information.
461 typedef GdkRectangle GtkAllocation;
465 * @widget: the widget to operate on
466 * @data: user-supplied data
468 * The type of the callback functions used for e.g. iterating over
469 * the children of a container, see gtk_container_foreach().
471 typedef void (*GtkCallback) (GtkWidget *widget,
476 * @width: the widget's desired width
477 * @height: the widget's desired height
479 * A <structname>GtkRequisition</structname> represents the desired size of a widget. See
480 * <xref linkend="size-requisition"/> for more information.
482 struct _GtkRequisition
488 /* The widget is the base of the tree for displayable objects.
489 * (A displayable object is one which takes up some amount
490 * of screen real estate). It provides a common base and interface
491 * which actual widgets must adhere to.
495 /* The object structure needs to be the first
496 * element in the widget structure in order for
497 * the object mechanism to work correctly. This
498 * allows a GtkWidget pointer to be cast to a
503 /* 16 bits of internally used private flags.
504 * this will be packed into the same 4 byte alignment frame that
505 * state and saved_state go. we therefore don't waste any new
508 guint16 GSEAL (private_flags);
510 /* The state of the widget. There are actually only
511 * 5 widget states (defined in "gtkenums.h").
513 guint8 GSEAL (state);
515 /* The saved state of the widget. When a widget's state
516 * is changed to GTK_STATE_INSENSITIVE via
517 * "gtk_widget_set_state" or "gtk_widget_set_sensitive"
518 * the old state is kept around in this field. The state
519 * will be restored once the widget gets sensitive again.
521 guint8 GSEAL (saved_state);
523 /* The widget's name. If the widget does not have a name
524 * (the name is NULL), then its name (as returned by
525 * "gtk_widget_get_name") is its class's name.
526 * Among other things, the widget name is used to determine
527 * the style to use for a widget.
533 /* The style for the widget. The style contains the
534 * colors the widget should be drawn in for each state
535 * along with graphics contexts used to draw with and
536 * the font to use for text.
538 GtkStyle *GSEAL (style);
540 /* The widget's desired size.
542 GtkRequisition GSEAL (requisition);
544 /* The widget's allocated size.
546 GtkAllocation GSEAL (allocation);
548 /* The widget's window or its parent window if it does
549 * not have a window. (Which will be indicated by the
550 * GTK_NO_WINDOW flag being set).
552 GdkWindow *GSEAL (window);
554 /* The widget's parent.
556 GtkWidget *GSEAL (parent);
563 * @set_scroll_adjustments_signal:
565 * <structfield>activate_signal</structfield>
566 * The signal to emit when a widget of this class is activated,
567 * gtk_widget_activate() handles the emission. Implementation of this
568 * signal is optional.
571 * <structfield>set_scroll_adjustment_signal</structfield>
572 * This signal is emitted when a widget of this class is added
573 * to a scrolling aware parent, gtk_widget_set_scroll_adjustments()
574 * handles the emission.
575 * Implementation of this signal is optional.
577 struct _GtkWidgetClass
579 /* The object class structure needs to be the first
580 * element in the widget class structure in order for
581 * the class mechanism to work correctly. This allows a
582 * GtkWidgetClass pointer to be cast to a GtkObjectClass
585 GtkObjectClass parent_class;
589 guint activate_signal;
591 guint set_scroll_adjustments_signal;
595 /* seldomly overidden */
596 void (*dispatch_child_properties_changed) (GtkWidget *widget,
598 GParamSpec **pspecs);
601 void (* show) (GtkWidget *widget);
602 void (* show_all) (GtkWidget *widget);
603 void (* hide) (GtkWidget *widget);
604 void (* hide_all) (GtkWidget *widget);
605 void (* map) (GtkWidget *widget);
606 void (* unmap) (GtkWidget *widget);
607 void (* realize) (GtkWidget *widget);
608 void (* unrealize) (GtkWidget *widget);
609 void (* size_request) (GtkWidget *widget,
610 GtkRequisition *requisition);
611 void (* size_allocate) (GtkWidget *widget,
612 GtkAllocation *allocation);
613 void (* state_changed) (GtkWidget *widget,
614 GtkStateType previous_state);
615 void (* parent_set) (GtkWidget *widget,
616 GtkWidget *previous_parent);
617 void (* hierarchy_changed) (GtkWidget *widget,
618 GtkWidget *previous_toplevel);
619 void (* style_set) (GtkWidget *widget,
620 GtkStyle *previous_style);
621 void (* direction_changed) (GtkWidget *widget,
622 GtkTextDirection previous_direction);
623 void (* grab_notify) (GtkWidget *widget,
624 gboolean was_grabbed);
625 void (* child_notify) (GtkWidget *widget,
629 gboolean (* mnemonic_activate) (GtkWidget *widget,
630 gboolean group_cycling);
633 void (* grab_focus) (GtkWidget *widget);
634 gboolean (* focus) (GtkWidget *widget,
635 GtkDirectionType direction);
638 gboolean (* event) (GtkWidget *widget,
640 gboolean (* button_press_event) (GtkWidget *widget,
641 GdkEventButton *event);
642 gboolean (* button_release_event) (GtkWidget *widget,
643 GdkEventButton *event);
644 gboolean (* scroll_event) (GtkWidget *widget,
645 GdkEventScroll *event);
646 gboolean (* motion_notify_event) (GtkWidget *widget,
647 GdkEventMotion *event);
648 gboolean (* delete_event) (GtkWidget *widget,
650 gboolean (* destroy_event) (GtkWidget *widget,
652 gboolean (* expose_event) (GtkWidget *widget,
653 GdkEventExpose *event);
654 gboolean (* key_press_event) (GtkWidget *widget,
656 gboolean (* key_release_event) (GtkWidget *widget,
658 gboolean (* enter_notify_event) (GtkWidget *widget,
659 GdkEventCrossing *event);
660 gboolean (* leave_notify_event) (GtkWidget *widget,
661 GdkEventCrossing *event);
662 gboolean (* configure_event) (GtkWidget *widget,
663 GdkEventConfigure *event);
664 gboolean (* focus_in_event) (GtkWidget *widget,
665 GdkEventFocus *event);
666 gboolean (* focus_out_event) (GtkWidget *widget,
667 GdkEventFocus *event);
668 gboolean (* map_event) (GtkWidget *widget,
670 gboolean (* unmap_event) (GtkWidget *widget,
672 gboolean (* property_notify_event) (GtkWidget *widget,
673 GdkEventProperty *event);
674 gboolean (* selection_clear_event) (GtkWidget *widget,
675 GdkEventSelection *event);
676 gboolean (* selection_request_event) (GtkWidget *widget,
677 GdkEventSelection *event);
678 gboolean (* selection_notify_event) (GtkWidget *widget,
679 GdkEventSelection *event);
680 gboolean (* proximity_in_event) (GtkWidget *widget,
681 GdkEventProximity *event);
682 gboolean (* proximity_out_event) (GtkWidget *widget,
683 GdkEventProximity *event);
684 gboolean (* visibility_notify_event) (GtkWidget *widget,
685 GdkEventVisibility *event);
686 gboolean (* client_event) (GtkWidget *widget,
687 GdkEventClient *event);
688 gboolean (* no_expose_event) (GtkWidget *widget,
690 gboolean (* window_state_event) (GtkWidget *widget,
691 GdkEventWindowState *event);
694 void (* selection_get) (GtkWidget *widget,
695 GtkSelectionData *selection_data,
698 void (* selection_received) (GtkWidget *widget,
699 GtkSelectionData *selection_data,
702 /* Source side drag signals */
703 void (* drag_begin) (GtkWidget *widget,
704 GdkDragContext *context);
705 void (* drag_end) (GtkWidget *widget,
706 GdkDragContext *context);
707 void (* drag_data_get) (GtkWidget *widget,
708 GdkDragContext *context,
709 GtkSelectionData *selection_data,
712 void (* drag_data_delete) (GtkWidget *widget,
713 GdkDragContext *context);
715 /* Target side drag signals */
716 void (* drag_leave) (GtkWidget *widget,
717 GdkDragContext *context,
719 gboolean (* drag_motion) (GtkWidget *widget,
720 GdkDragContext *context,
724 gboolean (* drag_drop) (GtkWidget *widget,
725 GdkDragContext *context,
729 void (* drag_data_received) (GtkWidget *widget,
730 GdkDragContext *context,
733 GtkSelectionData *selection_data,
737 /* Signals used only for keybindings */
738 gboolean (* popup_menu) (GtkWidget *widget);
740 /* If a widget has multiple tooltips/whatsthis, it should show the
741 * one for the current focus location, or if that doesn't make
742 * sense, should cycle through them showing each tip alongside
743 * whatever piece of the widget it applies to.
745 gboolean (* show_help) (GtkWidget *widget,
746 GtkWidgetHelpType help_type);
748 /* accessibility support
750 AtkObject* (*get_accessible) (GtkWidget *widget);
752 void (*screen_changed) (GtkWidget *widget,
753 GdkScreen *previous_screen);
754 gboolean (*can_activate_accel) (GtkWidget *widget,
757 /* Sent when a grab is broken. */
758 gboolean (*grab_broken_event) (GtkWidget *widget,
759 GdkEventGrabBroken *event);
761 void (* composited_changed) (GtkWidget *widget);
763 gboolean (* query_tooltip) (GtkWidget *widget,
766 gboolean keyboard_tooltip,
767 GtkTooltip *tooltip);
768 /* Signals without a C default handler class slot:
769 * gboolean (*damage_event) (GtkWidget *widget,
770 * GdkEventExpose *event);
773 /* Padding for future expansion */
774 void (*_gtk_reserved5) (void);
775 void (*_gtk_reserved6) (void);
776 void (*_gtk_reserved7) (void);
779 struct _GtkWidgetAuxInfo
789 struct _GtkWidgetShapeInfo
793 GdkBitmap *shape_mask;
796 GType gtk_widget_get_type (void) G_GNUC_CONST;
797 GtkWidget* gtk_widget_new (GType type,
798 const gchar *first_property_name,
800 void gtk_widget_destroy (GtkWidget *widget);
801 void gtk_widget_destroyed (GtkWidget *widget,
802 GtkWidget **widget_pointer);
803 #ifndef GTK_DISABLE_DEPRECATED
804 GtkWidget* gtk_widget_ref (GtkWidget *widget);
805 void gtk_widget_unref (GtkWidget *widget);
806 void gtk_widget_set (GtkWidget *widget,
807 const gchar *first_property_name,
808 ...) G_GNUC_NULL_TERMINATED;
809 #endif /* GTK_DISABLE_DEPRECATED */
810 void gtk_widget_unparent (GtkWidget *widget);
811 void gtk_widget_show (GtkWidget *widget);
812 void gtk_widget_show_now (GtkWidget *widget);
813 void gtk_widget_hide (GtkWidget *widget);
814 void gtk_widget_show_all (GtkWidget *widget);
815 void gtk_widget_hide_all (GtkWidget *widget);
816 void gtk_widget_set_no_show_all (GtkWidget *widget,
817 gboolean no_show_all);
818 gboolean gtk_widget_get_no_show_all (GtkWidget *widget);
819 void gtk_widget_map (GtkWidget *widget);
820 void gtk_widget_unmap (GtkWidget *widget);
821 void gtk_widget_realize (GtkWidget *widget);
822 void gtk_widget_unrealize (GtkWidget *widget);
825 void gtk_widget_queue_draw (GtkWidget *widget);
826 void gtk_widget_queue_draw_area (GtkWidget *widget,
831 #ifndef GTK_DISABLE_DEPRECATED
832 void gtk_widget_queue_clear (GtkWidget *widget);
833 void gtk_widget_queue_clear_area (GtkWidget *widget,
838 #endif /* GTK_DISABLE_DEPRECATED */
841 void gtk_widget_queue_resize (GtkWidget *widget);
842 void gtk_widget_queue_resize_no_redraw (GtkWidget *widget);
843 #ifndef GTK_DISABLE_DEPRECATED
844 void gtk_widget_draw (GtkWidget *widget,
845 const GdkRectangle *area);
846 #endif /* GTK_DISABLE_DEPRECATED */
847 void gtk_widget_size_request (GtkWidget *widget,
848 GtkRequisition *requisition);
849 void gtk_widget_size_allocate (GtkWidget *widget,
850 GtkAllocation *allocation);
851 void gtk_widget_get_child_requisition (GtkWidget *widget,
852 GtkRequisition *requisition);
853 void gtk_widget_add_accelerator (GtkWidget *widget,
854 const gchar *accel_signal,
855 GtkAccelGroup *accel_group,
857 GdkModifierType accel_mods,
858 GtkAccelFlags accel_flags);
859 gboolean gtk_widget_remove_accelerator (GtkWidget *widget,
860 GtkAccelGroup *accel_group,
862 GdkModifierType accel_mods);
863 void gtk_widget_set_accel_path (GtkWidget *widget,
864 const gchar *accel_path,
865 GtkAccelGroup *accel_group);
866 const gchar* _gtk_widget_get_accel_path (GtkWidget *widget,
868 GList* gtk_widget_list_accel_closures (GtkWidget *widget);
869 gboolean gtk_widget_can_activate_accel (GtkWidget *widget,
871 gboolean gtk_widget_mnemonic_activate (GtkWidget *widget,
872 gboolean group_cycling);
873 gboolean gtk_widget_event (GtkWidget *widget,
875 gint gtk_widget_send_expose (GtkWidget *widget,
878 gboolean gtk_widget_activate (GtkWidget *widget);
879 gboolean gtk_widget_set_scroll_adjustments (GtkWidget *widget,
880 GtkAdjustment *hadjustment,
881 GtkAdjustment *vadjustment);
883 void gtk_widget_reparent (GtkWidget *widget,
884 GtkWidget *new_parent);
885 gboolean gtk_widget_intersect (GtkWidget *widget,
886 const GdkRectangle *area,
887 GdkRectangle *intersection);
888 GdkRegion *gtk_widget_region_intersect (GtkWidget *widget,
889 const GdkRegion *region);
891 void gtk_widget_freeze_child_notify (GtkWidget *widget);
892 void gtk_widget_child_notify (GtkWidget *widget,
893 const gchar *child_property);
894 void gtk_widget_thaw_child_notify (GtkWidget *widget);
896 void gtk_widget_set_can_focus (GtkWidget *widget,
898 gboolean gtk_widget_get_can_focus (GtkWidget *widget);
899 gboolean gtk_widget_has_focus (GtkWidget *widget);
900 gboolean gtk_widget_is_focus (GtkWidget *widget);
901 void gtk_widget_grab_focus (GtkWidget *widget);
903 void gtk_widget_set_can_default (GtkWidget *widget,
904 gboolean can_default);
905 gboolean gtk_widget_get_can_default (GtkWidget *widget);
906 gboolean gtk_widget_has_default (GtkWidget *widget);
907 void gtk_widget_grab_default (GtkWidget *widget);
909 void gtk_widget_set_receives_default (GtkWidget *widget,
910 gboolean receives_default);
911 gboolean gtk_widget_get_receives_default (GtkWidget *widget);
913 gboolean gtk_widget_has_grab (GtkWidget *widget);
915 void gtk_widget_set_name (GtkWidget *widget,
917 G_CONST_RETURN gchar* gtk_widget_get_name (GtkWidget *widget);
919 void gtk_widget_set_state (GtkWidget *widget,
921 GtkStateType gtk_widget_get_state (GtkWidget *widget);
923 void gtk_widget_set_sensitive (GtkWidget *widget,
925 gboolean gtk_widget_get_sensitive (GtkWidget *widget);
926 gboolean gtk_widget_is_sensitive (GtkWidget *widget);
928 void gtk_widget_set_visible (GtkWidget *widget,
930 gboolean gtk_widget_get_visible (GtkWidget *widget);
932 void gtk_widget_set_has_window (GtkWidget *widget,
933 gboolean has_window);
934 gboolean gtk_widget_get_has_window (GtkWidget *widget);
936 gboolean gtk_widget_is_toplevel (GtkWidget *widget);
937 gboolean gtk_widget_is_drawable (GtkWidget *widget);
938 void gtk_widget_set_realized (GtkWidget *widget,
940 gboolean gtk_widget_get_realized (GtkWidget *widget);
941 void gtk_widget_set_mapped (GtkWidget *widget,
943 gboolean gtk_widget_get_mapped (GtkWidget *widget);
945 void gtk_widget_set_app_paintable (GtkWidget *widget,
946 gboolean app_paintable);
947 gboolean gtk_widget_get_app_paintable (GtkWidget *widget);
949 void gtk_widget_set_double_buffered (GtkWidget *widget,
950 gboolean double_buffered);
951 gboolean gtk_widget_get_double_buffered (GtkWidget *widget);
953 void gtk_widget_set_redraw_on_allocate (GtkWidget *widget,
954 gboolean redraw_on_allocate);
956 void gtk_widget_set_parent (GtkWidget *widget,
958 GtkWidget * gtk_widget_get_parent (GtkWidget *widget);
960 void gtk_widget_set_parent_window (GtkWidget *widget,
961 GdkWindow *parent_window);
962 GdkWindow * gtk_widget_get_parent_window (GtkWidget *widget);
964 void gtk_widget_set_child_visible (GtkWidget *widget,
965 gboolean is_visible);
966 gboolean gtk_widget_get_child_visible (GtkWidget *widget);
968 void gtk_widget_set_window (GtkWidget *widget,
970 GdkWindow * gtk_widget_get_window (GtkWidget *widget);
972 void gtk_widget_get_allocation (GtkWidget *widget,
973 GtkAllocation *allocation);
974 void gtk_widget_set_allocation (GtkWidget *widget,
975 const GtkAllocation *allocation);
977 void gtk_widget_get_requisition (GtkWidget *widget,
978 GtkRequisition *requisition);
980 gboolean gtk_widget_child_focus (GtkWidget *widget,
981 GtkDirectionType direction);
982 gboolean gtk_widget_keynav_failed (GtkWidget *widget,
983 GtkDirectionType direction);
984 void gtk_widget_error_bell (GtkWidget *widget);
986 void gtk_widget_set_size_request (GtkWidget *widget,
989 void gtk_widget_get_size_request (GtkWidget *widget,
992 #ifndef GTK_DISABLE_DEPRECATED
993 void gtk_widget_set_uposition (GtkWidget *widget,
996 void gtk_widget_set_usize (GtkWidget *widget,
1001 void gtk_widget_set_events (GtkWidget *widget,
1003 void gtk_widget_add_events (GtkWidget *widget,
1005 void gtk_widget_set_extension_events (GtkWidget *widget,
1006 GdkExtensionMode mode);
1008 GdkExtensionMode gtk_widget_get_extension_events (GtkWidget *widget);
1009 GtkWidget* gtk_widget_get_toplevel (GtkWidget *widget);
1010 GtkWidget* gtk_widget_get_ancestor (GtkWidget *widget,
1012 GdkColormap* gtk_widget_get_colormap (GtkWidget *widget);
1013 GdkVisual* gtk_widget_get_visual (GtkWidget *widget);
1015 GdkScreen * gtk_widget_get_screen (GtkWidget *widget);
1016 gboolean gtk_widget_has_screen (GtkWidget *widget);
1017 GdkDisplay * gtk_widget_get_display (GtkWidget *widget);
1018 GdkWindow * gtk_widget_get_root_window (GtkWidget *widget);
1019 GtkSettings* gtk_widget_get_settings (GtkWidget *widget);
1020 GtkClipboard *gtk_widget_get_clipboard (GtkWidget *widget,
1022 GdkPixmap * gtk_widget_get_snapshot (GtkWidget *widget,
1023 GdkRectangle *clip_rect);
1025 #ifndef GTK_DISABLE_DEPRECATED
1028 * gtk_widget_set_visual:
1029 * @widget: a #GtkWidget
1032 * This function is deprecated; it does nothing.
1034 #define gtk_widget_set_visual(widget,visual) ((void) 0)
1037 * gtk_widget_push_visual:
1040 * This function is deprecated; it does nothing.
1042 #define gtk_widget_push_visual(visual) ((void) 0)
1045 * gtk_widget_pop_visual:
1047 * This function is deprecated; it does nothing.
1049 #define gtk_widget_pop_visual() ((void) 0)
1052 * gtk_widget_set_default_visual:
1055 * This function is deprecated; it does nothing.
1057 #define gtk_widget_set_default_visual(visual) ((void) 0)
1059 #endif /* GTK_DISABLE_DEPRECATED */
1061 /* Accessibility support */
1062 AtkObject* gtk_widget_get_accessible (GtkWidget *widget);
1064 /* The following functions must not be called on an already
1065 * realized widget. Because it is possible that somebody
1066 * can call get_colormap() or get_visual() and save the
1067 * result, these functions are probably only safe to
1068 * call in a widget's init() function.
1070 void gtk_widget_set_colormap (GtkWidget *widget,
1071 GdkColormap *colormap);
1073 gint gtk_widget_get_events (GtkWidget *widget);
1074 void gtk_widget_get_pointer (GtkWidget *widget,
1078 gboolean gtk_widget_is_ancestor (GtkWidget *widget,
1079 GtkWidget *ancestor);
1081 gboolean gtk_widget_translate_coordinates (GtkWidget *src_widget,
1082 GtkWidget *dest_widget,
1088 /* Hide widget and return TRUE.
1090 gboolean gtk_widget_hide_on_delete (GtkWidget *widget);
1094 void gtk_widget_style_attach (GtkWidget *style);
1096 gboolean gtk_widget_has_rc_style (GtkWidget *widget);
1097 void gtk_widget_set_style (GtkWidget *widget,
1099 void gtk_widget_ensure_style (GtkWidget *widget);
1100 GtkStyle * gtk_widget_get_style (GtkWidget *widget);
1102 void gtk_widget_modify_style (GtkWidget *widget,
1104 GtkRcStyle *gtk_widget_get_modifier_style (GtkWidget *widget);
1105 void gtk_widget_modify_fg (GtkWidget *widget,
1107 const GdkColor *color);
1108 void gtk_widget_modify_bg (GtkWidget *widget,
1110 const GdkColor *color);
1111 void gtk_widget_modify_text (GtkWidget *widget,
1113 const GdkColor *color);
1114 void gtk_widget_modify_base (GtkWidget *widget,
1116 const GdkColor *color);
1117 void gtk_widget_modify_cursor (GtkWidget *widget,
1118 const GdkColor *primary,
1119 const GdkColor *secondary);
1120 void gtk_widget_modify_font (GtkWidget *widget,
1121 PangoFontDescription *font_desc);
1123 #ifndef GTK_DISABLE_DEPRECATED
1126 * gtk_widget_set_rc_style:
1127 * @widget: a #GtkWidget.
1129 * Equivalent to <literal>gtk_widget_set_style (widget, NULL)</literal>.
1131 * Deprecated: 2.0: Use gtk_widget_set_style() with a %NULL @style argument instead.
1133 #define gtk_widget_set_rc_style(widget) (gtk_widget_set_style (widget, NULL))
1136 * gtk_widget_restore_default_style:
1137 * @widget: a #GtkWidget.
1139 * Equivalent to <literal>gtk_widget_set_style (widget, NULL)</literal>.
1141 * Deprecated: 2.0: Use gtk_widget_set_style() with a %NULL @style argument instead.
1143 #define gtk_widget_restore_default_style(widget) (gtk_widget_set_style (widget, NULL))
1146 PangoContext *gtk_widget_create_pango_context (GtkWidget *widget);
1147 PangoContext *gtk_widget_get_pango_context (GtkWidget *widget);
1148 PangoLayout *gtk_widget_create_pango_layout (GtkWidget *widget,
1151 GdkPixbuf *gtk_widget_render_icon (GtkWidget *widget,
1152 const gchar *stock_id,
1154 const gchar *detail);
1156 /* handle composite names for GTK_COMPOSITE_CHILD widgets,
1157 * the returned name is newly allocated.
1159 void gtk_widget_set_composite_name (GtkWidget *widget,
1161 gchar* gtk_widget_get_composite_name (GtkWidget *widget);
1163 /* Descend recursively and set rc-style on all widgets without user styles */
1164 void gtk_widget_reset_rc_styles (GtkWidget *widget);
1166 /* Push/pop pairs, to change default values upon a widget's creation.
1167 * This will override the values that got set by the
1168 * gtk_widget_set_default_* () functions.
1170 void gtk_widget_push_colormap (GdkColormap *cmap);
1171 void gtk_widget_push_composite_child (void);
1172 void gtk_widget_pop_composite_child (void);
1173 void gtk_widget_pop_colormap (void);
1175 /* widget style properties
1177 void gtk_widget_class_install_style_property (GtkWidgetClass *klass,
1179 void gtk_widget_class_install_style_property_parser (GtkWidgetClass *klass,
1181 GtkRcPropertyParser parser);
1182 GParamSpec* gtk_widget_class_find_style_property (GtkWidgetClass *klass,
1183 const gchar *property_name);
1184 GParamSpec** gtk_widget_class_list_style_properties (GtkWidgetClass *klass,
1185 guint *n_properties);
1186 void gtk_widget_style_get_property (GtkWidget *widget,
1187 const gchar *property_name,
1189 void gtk_widget_style_get_valist (GtkWidget *widget,
1190 const gchar *first_property_name,
1192 void gtk_widget_style_get (GtkWidget *widget,
1193 const gchar *first_property_name,
1194 ...) G_GNUC_NULL_TERMINATED;
1197 /* Set certain default values to be used at widget creation time.
1199 void gtk_widget_set_default_colormap (GdkColormap *colormap);
1200 GtkStyle* gtk_widget_get_default_style (void);
1201 #ifndef GDK_MULTIHEAD_SAFE
1202 GdkColormap* gtk_widget_get_default_colormap (void);
1203 GdkVisual* gtk_widget_get_default_visual (void);
1206 /* Functions for setting directionality for widgets
1209 void gtk_widget_set_direction (GtkWidget *widget,
1210 GtkTextDirection dir);
1211 GtkTextDirection gtk_widget_get_direction (GtkWidget *widget);
1213 void gtk_widget_set_default_direction (GtkTextDirection dir);
1214 GtkTextDirection gtk_widget_get_default_direction (void);
1216 /* Compositing manager functionality */
1217 gboolean gtk_widget_is_composited (GtkWidget *widget);
1219 /* Counterpart to gdk_window_shape_combine_mask.
1221 void gtk_widget_shape_combine_mask (GtkWidget *widget,
1222 GdkBitmap *shape_mask,
1225 void gtk_widget_input_shape_combine_mask (GtkWidget *widget,
1226 GdkBitmap *shape_mask,
1230 /* internal function */
1231 void gtk_widget_reset_shapes (GtkWidget *widget);
1233 /* Compute a widget's path in the form "GtkWindow.MyLabel", and
1234 * return newly alocated strings.
1236 void gtk_widget_path (GtkWidget *widget,
1239 gchar **path_reversed);
1240 void gtk_widget_class_path (GtkWidget *widget,
1243 gchar **path_reversed);
1245 GList* gtk_widget_list_mnemonic_labels (GtkWidget *widget);
1246 void gtk_widget_add_mnemonic_label (GtkWidget *widget,
1248 void gtk_widget_remove_mnemonic_label (GtkWidget *widget,
1251 void gtk_widget_set_tooltip_window (GtkWidget *widget,
1252 GtkWindow *custom_window);
1253 GtkWindow *gtk_widget_get_tooltip_window (GtkWidget *widget);
1254 void gtk_widget_trigger_tooltip_query (GtkWidget *widget);
1255 void gtk_widget_set_tooltip_text (GtkWidget *widget,
1257 gchar * gtk_widget_get_tooltip_text (GtkWidget *widget);
1258 void gtk_widget_set_tooltip_markup (GtkWidget *widget,
1259 const gchar *markup);
1260 gchar * gtk_widget_get_tooltip_markup (GtkWidget *widget);
1261 void gtk_widget_set_has_tooltip (GtkWidget *widget,
1262 gboolean has_tooltip);
1263 gboolean gtk_widget_get_has_tooltip (GtkWidget *widget);
1265 GType gtk_requisition_get_type (void) G_GNUC_CONST;
1266 GtkRequisition *gtk_requisition_copy (const GtkRequisition *requisition);
1267 void gtk_requisition_free (GtkRequisition *requisition);
1269 #if defined (GTK_TRACE_OBJECTS) && defined (__GNUC__)
1270 # define gtk_widget_ref g_object_ref
1271 # define gtk_widget_unref g_object_unref
1272 #endif /* GTK_TRACE_OBJECTS && __GNUC__ */
1274 void _gtk_widget_grab_notify (GtkWidget *widget,
1275 gboolean was_grabbed);
1277 GtkWidgetAuxInfo *_gtk_widget_get_aux_info (GtkWidget *widget,
1279 void _gtk_widget_propagate_hierarchy_changed (GtkWidget *widget,
1280 GtkWidget *previous_toplevel);
1281 void _gtk_widget_propagate_screen_changed (GtkWidget *widget,
1282 GdkScreen *previous_screen);
1283 void _gtk_widget_propagate_composited_changed (GtkWidget *widget);
1285 void _gtk_widget_set_pointer_window (GtkWidget *widget,
1286 GdkWindow *pointer_window);
1287 GdkWindow *_gtk_widget_get_pointer_window (GtkWidget *widget);
1288 gboolean _gtk_widget_is_pointer_widget (GtkWidget *widget);
1289 void _gtk_widget_synthesize_crossing (GtkWidget *from,
1291 GdkCrossingMode mode);
1293 GdkColormap* _gtk_widget_peek_colormap (void);
1295 void _gtk_widget_buildable_finish_accelerator (GtkWidget *widget,
1296 GtkWidget *toplevel,
1297 gpointer user_data);
1301 #endif /* __GTK_WIDGET_H__ */