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 #ifndef __GTK_WIDGET_H__
28 #define __GTK_WIDGET_H__
31 #include <gtk/gtkaccelgroup.h>
32 #include <gtk/gtkobject.h>
33 #include <gtk/gtkadjustment.h>
34 #include <gtk/gtkstyle.h>
35 #include <atk/atkobject.h>
39 #endif /* __cplusplus */
42 /* The flags that are used by GtkWidget on top of the
43 * flags field of GtkObject.
47 GTK_TOPLEVEL = 1 << 4,
48 GTK_NO_WINDOW = 1 << 5,
49 GTK_REALIZED = 1 << 6,
52 GTK_SENSITIVE = 1 << 9,
53 GTK_PARENT_SENSITIVE = 1 << 10,
54 GTK_CAN_FOCUS = 1 << 11,
55 GTK_HAS_FOCUS = 1 << 12,
57 /* widget is allowed to receive the default via gtk_widget_grab_default
58 * and will reserve space to draw the default if possible
60 GTK_CAN_DEFAULT = 1 << 13,
62 /* the widget currently is receiving the default action and should be drawn
63 * appropriately if possible
65 GTK_HAS_DEFAULT = 1 << 14,
67 GTK_HAS_GRAB = 1 << 15,
68 GTK_RC_STYLE = 1 << 16,
69 GTK_COMPOSITE_CHILD = 1 << 17,
70 GTK_NO_REPARENT = 1 << 18,
71 GTK_APP_PAINTABLE = 1 << 19,
73 /* the widget when focused will receive the default action and have
74 * HAS_DEFAULT set even if there is a different widget set as default
76 GTK_RECEIVES_DEFAULT = 1 << 20,
78 GTK_DOUBLE_BUFFERED = 1 << 21
81 /* Macro for casting a pointer to a GtkWidget or GtkWidgetClass pointer.
82 * Macros for testing whether `widget' or `klass' are of type GTK_TYPE_WIDGET.
84 #define GTK_TYPE_WIDGET (gtk_widget_get_type ())
85 #define GTK_WIDGET(widget) (GTK_CHECK_CAST ((widget), GTK_TYPE_WIDGET, GtkWidget))
86 #define GTK_WIDGET_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), GTK_TYPE_WIDGET, GtkWidgetClass))
87 #define GTK_IS_WIDGET(widget) (GTK_CHECK_TYPE ((widget), GTK_TYPE_WIDGET))
88 #define GTK_IS_WIDGET_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((klass), GTK_TYPE_WIDGET))
89 #define GTK_WIDGET_GET_CLASS(obj) (GTK_CHECK_GET_CLASS ((obj), GTK_TYPE_WIDGET, GtkWidgetClass))
91 /* Macros for extracting various fields from GtkWidget and GtkWidgetClass.
93 #define GTK_WIDGET_TYPE(wid) (GTK_OBJECT_TYPE (wid))
94 #define GTK_WIDGET_STATE(wid) (GTK_WIDGET (wid)->state)
95 #define GTK_WIDGET_SAVED_STATE(wid) (GTK_WIDGET (wid)->saved_state)
97 /* Macros for extracting the widget flags from GtkWidget.
99 #define GTK_WIDGET_FLAGS(wid) (GTK_OBJECT_FLAGS (wid))
100 #define GTK_WIDGET_TOPLEVEL(wid) ((GTK_WIDGET_FLAGS (wid) & GTK_TOPLEVEL) != 0)
101 #define GTK_WIDGET_NO_WINDOW(wid) ((GTK_WIDGET_FLAGS (wid) & GTK_NO_WINDOW) != 0)
102 #define GTK_WIDGET_REALIZED(wid) ((GTK_WIDGET_FLAGS (wid) & GTK_REALIZED) != 0)
103 #define GTK_WIDGET_MAPPED(wid) ((GTK_WIDGET_FLAGS (wid) & GTK_MAPPED) != 0)
104 #define GTK_WIDGET_VISIBLE(wid) ((GTK_WIDGET_FLAGS (wid) & GTK_VISIBLE) != 0)
105 #define GTK_WIDGET_DRAWABLE(wid) (GTK_WIDGET_VISIBLE (wid) && GTK_WIDGET_MAPPED (wid))
106 #define GTK_WIDGET_SENSITIVE(wid) ((GTK_WIDGET_FLAGS (wid) & GTK_SENSITIVE) != 0)
107 #define GTK_WIDGET_PARENT_SENSITIVE(wid) ((GTK_WIDGET_FLAGS (wid) & GTK_PARENT_SENSITIVE) != 0)
108 #define GTK_WIDGET_IS_SENSITIVE(wid) (GTK_WIDGET_SENSITIVE (wid) && \
109 GTK_WIDGET_PARENT_SENSITIVE (wid))
110 #define GTK_WIDGET_CAN_FOCUS(wid) ((GTK_WIDGET_FLAGS (wid) & GTK_CAN_FOCUS) != 0)
111 #define GTK_WIDGET_HAS_FOCUS(wid) ((GTK_WIDGET_FLAGS (wid) & GTK_HAS_FOCUS) != 0)
112 #define GTK_WIDGET_CAN_DEFAULT(wid) ((GTK_WIDGET_FLAGS (wid) & GTK_CAN_DEFAULT) != 0)
113 #define GTK_WIDGET_HAS_DEFAULT(wid) ((GTK_WIDGET_FLAGS (wid) & GTK_HAS_DEFAULT) != 0)
114 #define GTK_WIDGET_HAS_GRAB(wid) ((GTK_WIDGET_FLAGS (wid) & GTK_HAS_GRAB) != 0)
115 #define GTK_WIDGET_RC_STYLE(wid) ((GTK_WIDGET_FLAGS (wid) & GTK_RC_STYLE) != 0)
116 #define GTK_WIDGET_COMPOSITE_CHILD(wid) ((GTK_WIDGET_FLAGS (wid) & GTK_COMPOSITE_CHILD) != 0)
117 #define GTK_WIDGET_APP_PAINTABLE(wid) ((GTK_WIDGET_FLAGS (wid) & GTK_APP_PAINTABLE) != 0)
118 #define GTK_WIDGET_RECEIVES_DEFAULT(wid) ((GTK_WIDGET_FLAGS (wid) & GTK_RECEIVES_DEFAULT) != 0)
119 #define GTK_WIDGET_DOUBLE_BUFFERED(wid) ((GTK_WIDGET_FLAGS (wid) & GTK_DOUBLE_BUFFERED) != 0)
121 /* Macros for setting and clearing widget flags.
123 #define GTK_WIDGET_SET_FLAGS(wid,flag) G_STMT_START{ (GTK_WIDGET_FLAGS (wid) |= (flag)); }G_STMT_END
124 #define GTK_WIDGET_UNSET_FLAGS(wid,flag) G_STMT_START{ (GTK_WIDGET_FLAGS (wid) &= ~(flag)); }G_STMT_END
127 /* forward declaration to avoid excessive includes (and concurrent includes)
129 typedef struct _GtkRequisition GtkRequisition;
130 typedef struct _GdkRectangle GtkAllocation;
131 typedef struct _GtkSelectionData GtkSelectionData;
132 typedef struct _GtkWidgetClass GtkWidgetClass;
133 typedef struct _GtkWidgetAuxInfo GtkWidgetAuxInfo;
134 typedef struct _GtkWidgetShapeInfo GtkWidgetShapeInfo;
135 typedef void (*GtkCallback) (GtkWidget *widget,
138 /* A requisition is a desired amount of space which a
139 * widget may request.
141 struct _GtkRequisition
147 /* The widget is the base of the tree for displayable objects.
148 * (A displayable object is one which takes up some amount
149 * of screen real estate). It provides a common base and interface
150 * which actual widgets must adhere to.
154 /* The object structure needs to be the first
155 * element in the widget structure in order for
156 * the object mechanism to work correctly. This
157 * allows a GtkWidget pointer to be cast to a
162 /* 16 bits of internally used private flags.
163 * this will be packed into the same 4 byte alignment frame that
164 * state and saved_state go. we therefore don't waste any new
167 guint16 private_flags;
169 /* The state of the widget. There are actually only
170 * 5 widget states (defined in "gtkenums.h").
174 /* The saved state of the widget. When a widgets state
175 * is changed to GTK_STATE_INSENSITIVE via
176 * "gtk_widget_set_state" or "gtk_widget_set_sensitive"
177 * the old state is kept around in this field. The state
178 * will be restored once the widget gets sensitive again.
182 /* The widgets name. If the widget does not have a name
183 * (the name is NULL), then its name (as returned by
184 * "gtk_widget_get_name") is its classes name.
185 * Among other things, the widget name is used to determine
186 * the style to use for a widget.
190 /* The style for the widget. The style contains the
191 * colors the widget should be drawn in for each state
192 * along with graphics contexts used to draw with and
193 * the font to use for text.
197 /* The widgets desired size.
199 GtkRequisition requisition;
201 /* The widgets allocated size.
203 GtkAllocation allocation;
205 /* The widgets window or its parent window if it does
206 * not have a window. (Which will be indicated by the
207 * GTK_NO_WINDOW flag being set).
211 /* The widgets parent.
216 struct _GtkWidgetClass
218 /* The object class structure needs to be the first
219 * element in the widget class structure in order for
220 * the class mechanism to work correctly. This allows a
221 * GtkWidgetClass pointer to be cast to a GtkObjectClass
224 GtkObjectClass parent_class;
226 /* The signal to emit when a widget of this class is activated,
227 * gtk_widget_activate() handles the emission.
228 * Implementation of this signal is optional.
230 guint activate_signal;
232 /* This signal is emitted when a widget of this class is added
233 * to a scrolling aware parent, gtk_widget_set_scroll_adjustments()
234 * handles the emission.
235 * Implementation of this signal is optional.
237 guint set_scroll_adjustments_signal;
239 /* seldomly overidden */
240 void (*dispatch_child_properties_changed) (GtkWidget *widget,
242 GParamSpec **pspecs);
245 void (* show) (GtkWidget *widget);
246 void (* show_all) (GtkWidget *widget);
247 void (* hide) (GtkWidget *widget);
248 void (* hide_all) (GtkWidget *widget);
249 void (* map) (GtkWidget *widget);
250 void (* unmap) (GtkWidget *widget);
251 void (* realize) (GtkWidget *widget);
252 void (* unrealize) (GtkWidget *widget);
253 void (* size_request) (GtkWidget *widget,
254 GtkRequisition *requisition);
255 void (* size_allocate) (GtkWidget *widget,
256 GtkAllocation *allocation);
257 void (* state_changed) (GtkWidget *widget,
258 GtkStateType previous_state);
259 void (* parent_set) (GtkWidget *widget,
260 GtkWidget *previous_parent);
261 void (* hierarchy_changed) (GtkWidget *widget);
262 void (* style_set) (GtkWidget *widget,
263 GtkStyle *previous_style);
264 void (* direction_changed) (GtkWidget *widget,
265 GtkTextDirection previous_direction);
266 void (* grab_notify) (GtkWidget *widget,
267 gboolean was_grabbed);
268 void (* child_notify) (GtkWidget *widget,
272 void (* add_accelerator) (GtkWidget *widget,
273 guint accel_signal_id,
274 GtkAccelGroup *accel_group,
276 GdkModifierType accel_mods,
277 GtkAccelFlags accel_flags);
278 void (* remove_accelerator) (GtkWidget *widget,
279 GtkAccelGroup *accel_group,
281 GdkModifierType accel_mods);
284 gboolean (* mnemonic_activate) (GtkWidget *widget,
285 gboolean group_cycling);
288 void (* grab_focus) (GtkWidget *widget);
289 gboolean (* focus) (GtkWidget *widget,
290 GtkDirectionType direction);
293 gboolean (* event) (GtkWidget *widget,
295 gboolean (* button_press_event) (GtkWidget *widget,
296 GdkEventButton *event);
297 gboolean (* button_release_event) (GtkWidget *widget,
298 GdkEventButton *event);
299 gboolean (* scroll_event) (GtkWidget *widget,
300 GdkEventScroll *event);
301 gboolean (* motion_notify_event) (GtkWidget *widget,
302 GdkEventMotion *event);
303 gboolean (* delete_event) (GtkWidget *widget,
305 gboolean (* destroy_event) (GtkWidget *widget,
307 gboolean (* expose_event) (GtkWidget *widget,
308 GdkEventExpose *event);
309 gboolean (* key_press_event) (GtkWidget *widget,
311 gboolean (* key_release_event) (GtkWidget *widget,
313 gboolean (* enter_notify_event) (GtkWidget *widget,
314 GdkEventCrossing *event);
315 gboolean (* leave_notify_event) (GtkWidget *widget,
316 GdkEventCrossing *event);
317 gboolean (* configure_event) (GtkWidget *widget,
318 GdkEventConfigure *event);
319 gboolean (* focus_in_event) (GtkWidget *widget,
320 GdkEventFocus *event);
321 gboolean (* focus_out_event) (GtkWidget *widget,
322 GdkEventFocus *event);
323 gboolean (* map_event) (GtkWidget *widget,
325 gboolean (* unmap_event) (GtkWidget *widget,
327 gboolean (* property_notify_event) (GtkWidget *widget,
328 GdkEventProperty *event);
329 gboolean (* selection_clear_event) (GtkWidget *widget,
330 GdkEventSelection *event);
331 gboolean (* selection_request_event) (GtkWidget *widget,
332 GdkEventSelection *event);
333 gboolean (* selection_notify_event) (GtkWidget *widget,
334 GdkEventSelection *event);
335 gboolean (* proximity_in_event) (GtkWidget *widget,
336 GdkEventProximity *event);
337 gboolean (* proximity_out_event) (GtkWidget *widget,
338 GdkEventProximity *event);
339 gboolean (* visibility_notify_event) (GtkWidget *widget,
340 GdkEventVisibility *event);
341 gboolean (* client_event) (GtkWidget *widget,
342 GdkEventClient *event);
343 gboolean (* no_expose_event) (GtkWidget *widget,
345 gboolean (* window_state_event) (GtkWidget *widget,
346 GdkEventWindowState *event);
349 void (* selection_get) (GtkWidget *widget,
350 GtkSelectionData *selection_data,
353 void (* selection_received) (GtkWidget *widget,
354 GtkSelectionData *selection_data,
357 /* Source side drag signals */
358 void (* drag_begin) (GtkWidget *widget,
359 GdkDragContext *context);
360 void (* drag_end) (GtkWidget *widget,
361 GdkDragContext *context);
362 void (* drag_data_get) (GtkWidget *widget,
363 GdkDragContext *context,
364 GtkSelectionData *selection_data,
367 void (* drag_data_delete) (GtkWidget *widget,
368 GdkDragContext *context);
370 /* Target side drag signals */
371 void (* drag_leave) (GtkWidget *widget,
372 GdkDragContext *context,
374 gboolean (* drag_motion) (GtkWidget *widget,
375 GdkDragContext *context,
379 gboolean (* drag_drop) (GtkWidget *widget,
380 GdkDragContext *context,
384 void (* drag_data_received) (GtkWidget *widget,
385 GdkDragContext *context,
388 GtkSelectionData *selection_data,
392 /* Signals used only for keybindings */
393 void (* popup_menu) (GtkWidget *widget);
396 /* accessibility support
398 AtkObject* (* get_accessible) (GtkWidget *widget);
400 /* Padding for future expansion */
407 struct _GtkWidgetAuxInfo
417 struct _GtkWidgetShapeInfo
421 GdkBitmap *shape_mask;
424 GtkType gtk_widget_get_type (void) G_GNUC_CONST;
425 GtkWidget* gtk_widget_new (GtkType type,
426 const gchar *first_property_name,
428 GtkWidget* gtk_widget_ref (GtkWidget *widget);
429 void gtk_widget_unref (GtkWidget *widget);
430 void gtk_widget_destroy (GtkWidget *widget);
431 void gtk_widget_destroyed (GtkWidget *widget,
432 GtkWidget **widget_pointer);
433 #ifndef GTK_DISABLE_DEPRECATED
434 void gtk_widget_set (GtkWidget *widget,
435 const gchar *first_property_name,
437 #endif /* GTK_DISABLE_DEPRECATED */
438 void gtk_widget_unparent (GtkWidget *widget);
439 void gtk_widget_show (GtkWidget *widget);
440 void gtk_widget_show_now (GtkWidget *widget);
441 void gtk_widget_hide (GtkWidget *widget);
442 void gtk_widget_show_all (GtkWidget *widget);
443 void gtk_widget_hide_all (GtkWidget *widget);
444 void gtk_widget_map (GtkWidget *widget);
445 void gtk_widget_unmap (GtkWidget *widget);
446 void gtk_widget_realize (GtkWidget *widget);
447 void gtk_widget_unrealize (GtkWidget *widget);
450 void gtk_widget_queue_draw (GtkWidget *widget);
451 void gtk_widget_queue_draw_area (GtkWidget *widget,
456 #ifndef GTK_DISABLE_DEPRECATED
457 void gtk_widget_queue_clear (GtkWidget *widget);
458 void gtk_widget_queue_clear_area (GtkWidget *widget,
463 #endif /* GTK_DISABLE_DEPRECATED */
466 void gtk_widget_queue_resize (GtkWidget *widget);
467 #ifndef GTK_DISABLE_DEPRECATED
468 void gtk_widget_draw (GtkWidget *widget,
470 #endif /* GTK_DISABLE_DEPRECATED */
471 void gtk_widget_size_request (GtkWidget *widget,
472 GtkRequisition *requisition);
473 void gtk_widget_size_allocate (GtkWidget *widget,
474 GtkAllocation *allocation);
475 void gtk_widget_get_child_requisition (GtkWidget *widget,
476 GtkRequisition *requisition);
477 void gtk_widget_add_accelerator (GtkWidget *widget,
478 const gchar *accel_signal,
479 GtkAccelGroup *accel_group,
482 GtkAccelFlags accel_flags);
483 void gtk_widget_remove_accelerator (GtkWidget *widget,
484 GtkAccelGroup *accel_group,
487 void gtk_widget_remove_accelerators (GtkWidget *widget,
488 const gchar *accel_signal,
489 gboolean visible_only);
490 guint gtk_widget_accelerator_signal (GtkWidget *widget,
491 GtkAccelGroup *accel_group,
494 void gtk_widget_lock_accelerators (GtkWidget *widget);
495 void gtk_widget_unlock_accelerators (GtkWidget *widget);
496 gboolean gtk_widget_accelerators_locked (GtkWidget *widget);
497 gboolean gtk_widget_mnemonic_activate (GtkWidget *widget,
498 gboolean group_cycling);
499 gboolean gtk_widget_event (GtkWidget *widget,
501 gint gtk_widget_send_expose (GtkWidget *widget,
504 gboolean gtk_widget_activate (GtkWidget *widget);
505 gboolean gtk_widget_set_scroll_adjustments (GtkWidget *widget,
506 GtkAdjustment *hadjustment,
507 GtkAdjustment *vadjustment);
509 void gtk_widget_reparent (GtkWidget *widget,
510 GtkWidget *new_parent);
511 gboolean gtk_widget_intersect (GtkWidget *widget,
513 GdkRectangle *intersection);
514 GdkRegion *gtk_widget_region_intersect (GtkWidget *widget,
517 void gtk_widget_freeze_child_notify (GtkWidget *widget);
518 void gtk_widget_child_notify (GtkWidget *widget,
519 const gchar *child_property);
520 void gtk_widget_thaw_child_notify (GtkWidget *widget);
522 gboolean gtk_widget_is_focus (GtkWidget *widget);
523 void gtk_widget_grab_focus (GtkWidget *widget);
524 void gtk_widget_grab_default (GtkWidget *widget);
526 void gtk_widget_set_name (GtkWidget *widget,
528 G_CONST_RETURN gchar* gtk_widget_get_name (GtkWidget *widget);
529 void gtk_widget_set_state (GtkWidget *widget,
531 void gtk_widget_set_sensitive (GtkWidget *widget,
533 void gtk_widget_set_app_paintable (GtkWidget *widget,
534 gboolean app_paintable);
535 void gtk_widget_set_double_buffered (GtkWidget *widget,
536 gboolean double_buffered);
537 void gtk_widget_set_parent (GtkWidget *widget,
539 void gtk_widget_set_parent_window (GtkWidget *widget,
540 GdkWindow *parent_window);
541 GdkWindow *gtk_widget_get_parent_window (GtkWidget *widget);
542 gboolean gtk_widget_child_focus (GtkWidget *widget,
543 GtkDirectionType direction);
544 void gtk_widget_set_uposition (GtkWidget *widget,
547 void gtk_widget_set_usize (GtkWidget *widget,
550 void gtk_widget_set_events (GtkWidget *widget,
552 void gtk_widget_add_events (GtkWidget *widget,
554 void gtk_widget_set_extension_events (GtkWidget *widget,
555 GdkExtensionMode mode);
557 GdkExtensionMode gtk_widget_get_extension_events (GtkWidget *widget);
558 GtkWidget* gtk_widget_get_toplevel (GtkWidget *widget);
559 GtkWidget* gtk_widget_get_ancestor (GtkWidget *widget,
560 GtkType widget_type);
561 GdkColormap* gtk_widget_get_colormap (GtkWidget *widget);
562 GdkVisual* gtk_widget_get_visual (GtkWidget *widget);
565 /* Accessibility support */
566 AtkObject* gtk_widget_get_accessible (GtkWidget *widget);
568 /* The following functions must not be called on an already
569 * realized widget. Because it is possible that somebody
570 * can call get_colormap() or get_visual() and save the
571 * result, these functions are probably only safe to
572 * call in a widget's init() function.
574 void gtk_widget_set_colormap (GtkWidget *widget,
575 GdkColormap *colormap);
577 gint gtk_widget_get_events (GtkWidget *widget);
578 void gtk_widget_get_pointer (GtkWidget *widget,
582 gboolean gtk_widget_is_ancestor (GtkWidget *widget,
583 GtkWidget *ancestor);
585 /* Hide widget and return TRUE.
587 gboolean gtk_widget_hide_on_delete (GtkWidget *widget);
591 void gtk_widget_set_style (GtkWidget *widget,
593 void gtk_widget_set_rc_style (GtkWidget *widget);
594 void gtk_widget_ensure_style (GtkWidget *widget);
595 GtkStyle* gtk_widget_get_style (GtkWidget *widget);
596 void gtk_widget_restore_default_style (GtkWidget *widget);
598 void gtk_widget_modify_style (GtkWidget *widget,
600 GtkRcStyle *gtk_widget_get_modifier_style (GtkWidget *widget);
601 void gtk_widget_modify_fg (GtkWidget *widget,
604 void gtk_widget_modify_bg (GtkWidget *widget,
607 void gtk_widget_modify_text (GtkWidget *widget,
610 void gtk_widget_modify_base (GtkWidget *widget,
613 void gtk_widget_modify_font (GtkWidget *widget,
614 PangoFontDescription *font_desc);
616 PangoContext *gtk_widget_create_pango_context (GtkWidget *widget);
617 PangoContext *gtk_widget_get_pango_context (GtkWidget *widget);
618 PangoLayout *gtk_widget_create_pango_layout (GtkWidget *widget,
621 GdkPixbuf *gtk_widget_render_icon (GtkWidget *widget,
622 const gchar *stock_id,
624 const gchar *detail);
626 /* handle composite names for GTK_COMPOSITE_CHILD widgets,
627 * the returned name is newly allocated.
629 void gtk_widget_set_composite_name (GtkWidget *widget,
631 gchar* gtk_widget_get_composite_name (GtkWidget *widget);
633 /* Descend recursively and set rc-style on all widgets without user styles */
634 void gtk_widget_reset_rc_styles (GtkWidget *widget);
636 /* Push/pop pairs, to change default values upon a widget's creation.
637 * This will override the values that got set by the
638 * gtk_widget_set_default_* () functions.
640 void gtk_widget_push_style (GtkStyle *style);
641 void gtk_widget_push_colormap (GdkColormap *cmap);
642 void gtk_widget_push_composite_child (void);
643 void gtk_widget_pop_composite_child (void);
644 void gtk_widget_pop_style (void);
645 void gtk_widget_pop_colormap (void);
647 /* widget style properties
649 void gtk_widget_class_install_style_property (GtkWidgetClass *klass,
651 void gtk_widget_class_install_style_property_parser (GtkWidgetClass *klass,
653 GtkRcPropertyParser parser);
654 void gtk_widget_style_get_property (GtkWidget *widget,
655 const gchar *property_name,
657 void gtk_widget_style_get_valist (GtkWidget *widget,
658 const gchar *first_property_name,
660 void gtk_widget_style_get (GtkWidget *widget,
661 const gchar *first_property_name,
665 /* Set certain default values to be used at widget creation time.
667 void gtk_widget_set_default_style (GtkStyle *style);
668 void gtk_widget_set_default_colormap (GdkColormap *colormap);
669 GtkStyle* gtk_widget_get_default_style (void);
670 GdkColormap* gtk_widget_get_default_colormap (void);
671 GdkVisual* gtk_widget_get_default_visual (void);
673 /* Functions for setting directionality for widgets
676 void gtk_widget_set_direction (GtkWidget *widget,
677 GtkTextDirection dir);
678 GtkTextDirection gtk_widget_get_direction (GtkWidget *widget);
680 void gtk_widget_set_default_direction (GtkTextDirection dir);
681 GtkTextDirection gtk_widget_get_default_direction (void);
683 /* Counterpart to gdk_window_shape_combine_mask.
685 void gtk_widget_shape_combine_mask (GtkWidget *widget,
686 GdkBitmap *shape_mask,
690 /* internal function */
691 void gtk_widget_reset_shapes (GtkWidget *widget);
693 /* Compute a widget's path in the form "GtkWindow.MyLabel", and
694 * return newly alocated strings.
696 void gtk_widget_path (GtkWidget *widget,
699 gchar **path_reversed);
700 void gtk_widget_class_path (GtkWidget *widget,
703 gchar **path_reversed);
705 GtkRequisition *gtk_requisition_copy (const GtkRequisition *requisition);
706 void gtk_requisition_free (GtkRequisition *requisition);
708 #if defined (GTK_TRACE_OBJECTS) && defined (__GNUC__)
709 # define gtk_widget_ref gtk_object_ref
710 # define gtk_widget_unref gtk_object_unref
711 #endif /* GTK_TRACE_OBJECTS && __GNUC__ */
713 GtkWidgetAuxInfo *_gtk_widget_get_aux_info (GtkWidget *widget,
718 #endif /* __cplusplus */
721 #endif /* __GTK_WIDGET_H__ */