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_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/gtkadjustment.h>
37 #include <gtk/gtkborder.h>
38 #include <gtk/gtksettings.h>
39 #include <gtk/gtkstylecontext.h>
40 #include <gtk/gtkwidgetpath.h>
45 /* Kinds of widget-specific help */
48 GTK_WIDGET_HELP_TOOLTIP,
49 GTK_WIDGET_HELP_WHATS_THIS
52 /* Macro for casting a pointer to a GtkWidget or GtkWidgetClass pointer.
53 * Macros for testing whether `widget' or `klass' are of type GTK_TYPE_WIDGET.
55 #define GTK_TYPE_WIDGET (gtk_widget_get_type ())
56 #define GTK_WIDGET(widget) (G_TYPE_CHECK_INSTANCE_CAST ((widget), GTK_TYPE_WIDGET, GtkWidget))
57 #define GTK_WIDGET_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GTK_TYPE_WIDGET, GtkWidgetClass))
58 #define GTK_IS_WIDGET(widget) (G_TYPE_CHECK_INSTANCE_TYPE ((widget), GTK_TYPE_WIDGET))
59 #define GTK_IS_WIDGET_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_WIDGET))
60 #define GTK_WIDGET_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_WIDGET, GtkWidgetClass))
62 #define GTK_TYPE_REQUISITION (gtk_requisition_get_type ())
64 /* forward declaration to avoid excessive includes (and concurrent includes)
66 typedef struct _GtkRequisition GtkRequisition;
67 typedef struct _GtkSelectionData GtkSelectionData;
68 typedef struct _GtkWidgetPrivate GtkWidgetPrivate;
69 typedef struct _GtkWidgetClass GtkWidgetClass;
70 typedef struct _GtkWidgetClassPrivate GtkWidgetClassPrivate;
71 typedef struct _GtkWidgetAuxInfo GtkWidgetAuxInfo;
72 typedef struct _GtkClipboard GtkClipboard;
73 typedef struct _GtkTooltip GtkTooltip;
74 typedef struct _GtkWindow GtkWindow;
78 * @x: the X position of the widget's area relative to its parents allocation.
79 * @y: the Y position of the widget's area relative to its parents allocation.
80 * @width: the width of the widget's allocated area.
81 * @height: the height of the widget's allocated area.
83 * A <structname>GtkAllocation</structname> of a widget represents region
84 * which has been allocated to the widget by its parent. It is a subregion
85 * of its parents allocation. See <xref linkend="geometry-management"/> for
88 typedef GdkRectangle GtkAllocation;
92 * @widget: the widget to operate on
93 * @data: user-supplied data
95 * The type of the callback functions used for e.g. iterating over
96 * the children of a container, see gtk_container_foreach().
98 typedef void (*GtkCallback) (GtkWidget *widget,
103 * @width: the widget's desired width
104 * @height: the widget's desired height
106 * A <structname>GtkRequisition</structname> represents the desired size of a widget. See
107 * <xref linkend="geometry-management"/> for more information.
109 struct _GtkRequisition
115 /* The widget is the base of the tree for displayable objects.
116 * (A displayable object is one which takes up some amount
117 * of screen real estate). It provides a common base and interface
118 * which actual widgets must adhere to.
122 GInitiallyUnowned parent_instance;
124 GtkWidgetPrivate *priv;
129 * @parent_class: The object class structure needs to be the first
130 * element in the widget class structure in order for the class mechanism
131 * to work correctly. This allows a GtkWidgetClass pointer to be cast to
132 * a GObjectClass pointer.
133 * @activate_signal: The signal to emit when a widget of this class is
134 * activated, gtk_widget_activate() handles the emission.
135 * Implementation of this signal is optional.
136 * @get_request_mode: This allows a widget to tell its parent container whether
137 * it prefers to be allocated in %GTK_SIZE_REQUEST_HEIGHT_FOR_WIDTH or
138 * %GTK_SIZE_REQUEST_WIDTH_FOR_HEIGHT mode.
139 * %GTK_SIZE_REQUEST_HEIGHT_FOR_WIDTH means the widget prefers to have
140 * #GtkWidgetClass.get_preferred_width() called and then
141 * #GtkWidgetClass.get_preferred_height_for_width().
142 * %GTK_SIZE_REQUEST_CONSTANT_SIZE disables any height-for-width or
143 * width-for-height geometry management for a said widget and is the
145 * It's important to note (as described below) that any widget
146 * which trades height-for-width or width-for-height must respond properly
147 * to both of the virtual methods #GtkWidgetClass.get_preferred_height_for_width()
148 * and #GtkWidgetClass.get_preferred_width_for_height() since it might be
149 * queried in either #GtkSizeRequestMode by its parent container.
150 * @get_preferred_height: This is called by containers to obtain the minimum
151 * and natural height of a widget. A widget that does not actually trade
152 * any height for width or width for height only has to implement these
153 * two virtual methods (#GtkWidgetClass.get_preferred_width() and
154 * #GtkWidgetClass.get_preferred_height()).
155 * @get_preferred_width_for_height: This is analogous to
156 * #GtkWidgetClass.get_preferred_height_for_width() except that it
157 * operates in the oposite orientation. It's rare that a widget actually
158 * does %GTK_SIZE_REQUEST_WIDTH_FOR_HEIGHT requests but this can happen
159 * when, for example, a widget or container gets additional columns to
160 * compensate for a smaller allocated height.
161 * @get_preferred_width: This is called by containers to obtain the minimum
162 * and natural width of a widget. A widget will never be allocated a width
163 * less than its minimum and will only ever be allocated a width greater
164 * than the natural width once all of the said widget's siblings have
165 * received their natural widths.
166 * Furthermore, a widget will only ever be allocated a width greater than
167 * its natural width if it was configured to receive extra expand space
168 * from its parent container.
169 * @get_preferred_height_for_width: This is similar to
170 * #GtkWidgetClass.get_preferred_height() except that it is passed a
171 * contextual width to request height for. By implementing this virtual
172 * method it is possible for a #GtkLabel to tell its parent how much height
173 * would be required if the label were to be allocated a said width.
174 * @adjust_size_request: Convert an initial size request from a widget's
175 * #GtkSizeRequest virtual method implementations into a size request to
176 * be used by parent containers in laying out the widget.
177 * adjust_size_request adjusts <emphasis>from</emphasis> a child widget's
178 * original request <emphasis>to</emphasis> what a parent container should
179 * use for layout. The @for_size argument will be -1 if the request should
180 * not be for a particular size in the opposing orientation, i.e. if the
181 * request is not height-for-width or width-for-height. If @for_size is
182 * greater than -1, it is the proposed allocation in the opposing
183 * orientation that we need the request for. Implementations of
184 * adjust_size_request should chain up to the default implementation,
185 * which applies #GtkWidget's margin properties and imposes any values
186 * from gtk_widget_set_size_request(). Chaining up should be last,
187 * <emphasis>after</emphasis> your subclass adjusts the request, so
188 * #GtkWidget can apply constraints and add the margin properly.
189 * @adjust_size_allocation: Convert an initial size allocation assigned
190 * by a #GtkContainer using gtk_widget_size_allocate(), into an actual
191 * size allocation to be used by the widget. adjust_size_allocation
192 * adjusts <emphasis>to</emphasis> a child widget's actual allocation
193 * <emphasis>from</emphasis> what a parent container computed for the
194 * child. The adjusted allocation must be entirely within the original
195 * allocation. In any custom implementation, chain up to the default
196 * #GtkWidget implementation of this method, which applies the margin
197 * and alignment properties of #GtkWidget. Chain up
198 * <emphasis>before</emphasis> performing your own adjustments so your
199 * own adjustments remove more allocation after the #GtkWidget base
200 * class has already removed margin and alignment. The natural size
201 * passed in should be adjusted in the same way as the allocated size,
202 * which allows adjustments to perform alignments or other changes
203 * based on natural size.
205 struct _GtkWidgetClass
207 GInitiallyUnownedClass parent_class;
211 guint activate_signal;
213 /* seldomly overidden */
214 void (*dispatch_child_properties_changed) (GtkWidget *widget,
216 GParamSpec **pspecs);
219 void (* destroy) (GtkWidget *widget);
220 void (* show) (GtkWidget *widget);
221 void (* show_all) (GtkWidget *widget);
222 void (* hide) (GtkWidget *widget);
223 void (* map) (GtkWidget *widget);
224 void (* unmap) (GtkWidget *widget);
225 void (* realize) (GtkWidget *widget);
226 void (* unrealize) (GtkWidget *widget);
227 void (* size_allocate) (GtkWidget *widget,
228 GtkAllocation *allocation);
229 void (* state_changed) (GtkWidget *widget,
230 GtkStateType previous_state);
231 void (* state_flags_changed) (GtkWidget *widget,
232 GtkStateFlags previous_state_flags);
233 void (* parent_set) (GtkWidget *widget,
234 GtkWidget *previous_parent);
235 void (* hierarchy_changed) (GtkWidget *widget,
236 GtkWidget *previous_toplevel);
237 void (* style_set) (GtkWidget *widget,
238 GtkStyle *previous_style);
239 void (* direction_changed) (GtkWidget *widget,
240 GtkTextDirection previous_direction);
241 void (* grab_notify) (GtkWidget *widget,
242 gboolean was_grabbed);
243 void (* child_notify) (GtkWidget *widget,
245 gboolean (* draw) (GtkWidget *widget,
249 GtkSizeRequestMode (* get_request_mode) (GtkWidget *widget);
251 void (* get_preferred_height) (GtkWidget *widget,
252 gint *minimum_height,
253 gint *natural_height);
254 void (* get_preferred_width_for_height) (GtkWidget *widget,
257 gint *natural_width);
258 void (* get_preferred_width) (GtkWidget *widget,
260 gint *natural_width);
261 void (* get_preferred_height_for_width) (GtkWidget *widget,
263 gint *minimum_height,
264 gint *natural_height);
267 gboolean (* mnemonic_activate) (GtkWidget *widget,
268 gboolean group_cycling);
271 void (* grab_focus) (GtkWidget *widget);
272 gboolean (* focus) (GtkWidget *widget,
273 GtkDirectionType direction);
275 /* keyboard navigation */
276 void (* move_focus) (GtkWidget *widget,
277 GtkDirectionType direction);
278 gboolean (* keynav_failed) (GtkWidget *widget,
279 GtkDirectionType direction);
282 gboolean (* event) (GtkWidget *widget,
284 gboolean (* button_press_event) (GtkWidget *widget,
285 GdkEventButton *event);
286 gboolean (* button_release_event) (GtkWidget *widget,
287 GdkEventButton *event);
288 gboolean (* scroll_event) (GtkWidget *widget,
289 GdkEventScroll *event);
290 gboolean (* motion_notify_event) (GtkWidget *widget,
291 GdkEventMotion *event);
292 gboolean (* delete_event) (GtkWidget *widget,
294 gboolean (* destroy_event) (GtkWidget *widget,
296 gboolean (* key_press_event) (GtkWidget *widget,
298 gboolean (* key_release_event) (GtkWidget *widget,
300 gboolean (* enter_notify_event) (GtkWidget *widget,
301 GdkEventCrossing *event);
302 gboolean (* leave_notify_event) (GtkWidget *widget,
303 GdkEventCrossing *event);
304 gboolean (* configure_event) (GtkWidget *widget,
305 GdkEventConfigure *event);
306 gboolean (* focus_in_event) (GtkWidget *widget,
307 GdkEventFocus *event);
308 gboolean (* focus_out_event) (GtkWidget *widget,
309 GdkEventFocus *event);
310 gboolean (* map_event) (GtkWidget *widget,
312 gboolean (* unmap_event) (GtkWidget *widget,
314 gboolean (* property_notify_event) (GtkWidget *widget,
315 GdkEventProperty *event);
316 gboolean (* selection_clear_event) (GtkWidget *widget,
317 GdkEventSelection *event);
318 gboolean (* selection_request_event) (GtkWidget *widget,
319 GdkEventSelection *event);
320 gboolean (* selection_notify_event) (GtkWidget *widget,
321 GdkEventSelection *event);
322 gboolean (* proximity_in_event) (GtkWidget *widget,
323 GdkEventProximity *event);
324 gboolean (* proximity_out_event) (GtkWidget *widget,
325 GdkEventProximity *event);
326 gboolean (* visibility_notify_event) (GtkWidget *widget,
327 GdkEventVisibility *event);
328 gboolean (* window_state_event) (GtkWidget *widget,
329 GdkEventWindowState *event);
330 gboolean (* damage_event) (GtkWidget *widget,
331 GdkEventExpose *event);
332 gboolean (* grab_broken_event) (GtkWidget *widget,
333 GdkEventGrabBroken *event);
336 void (* selection_get) (GtkWidget *widget,
337 GtkSelectionData *selection_data,
340 void (* selection_received) (GtkWidget *widget,
341 GtkSelectionData *selection_data,
344 /* Source side drag signals */
345 void (* drag_begin) (GtkWidget *widget,
346 GdkDragContext *context);
347 void (* drag_end) (GtkWidget *widget,
348 GdkDragContext *context);
349 void (* drag_data_get) (GtkWidget *widget,
350 GdkDragContext *context,
351 GtkSelectionData *selection_data,
354 void (* drag_data_delete) (GtkWidget *widget,
355 GdkDragContext *context);
357 /* Target side drag signals */
358 void (* drag_leave) (GtkWidget *widget,
359 GdkDragContext *context,
361 gboolean (* drag_motion) (GtkWidget *widget,
362 GdkDragContext *context,
366 gboolean (* drag_drop) (GtkWidget *widget,
367 GdkDragContext *context,
371 void (* drag_data_received) (GtkWidget *widget,
372 GdkDragContext *context,
375 GtkSelectionData *selection_data,
378 gboolean (* drag_failed) (GtkWidget *widget,
379 GdkDragContext *context,
380 GtkDragResult result);
382 /* Signals used only for keybindings */
383 gboolean (* popup_menu) (GtkWidget *widget);
385 /* If a widget has multiple tooltips/whatsthis, it should show the
386 * one for the current focus location, or if that doesn't make
387 * sense, should cycle through them showing each tip alongside
388 * whatever piece of the widget it applies to.
390 gboolean (* show_help) (GtkWidget *widget,
391 GtkWidgetHelpType help_type);
393 /* accessibility support
395 AtkObject * (* get_accessible) (GtkWidget *widget);
397 void (* screen_changed) (GtkWidget *widget,
398 GdkScreen *previous_screen);
399 gboolean (* can_activate_accel) (GtkWidget *widget,
403 void (* composited_changed) (GtkWidget *widget);
405 gboolean (* query_tooltip) (GtkWidget *widget,
408 gboolean keyboard_tooltip,
409 GtkTooltip *tooltip);
411 void (* compute_expand) (GtkWidget *widget,
413 gboolean *vexpand_p);
415 void (* adjust_size_request) (GtkWidget *widget,
416 GtkOrientation orientation,
419 void (* adjust_size_allocation) (GtkWidget *widget,
420 GtkOrientation orientation,
424 gint *allocated_size);
426 void (* style_updated) (GtkWidget *widget);
430 GtkWidgetClassPrivate *priv;
432 /* Padding for future expansion */
433 void (*_gtk_reserved2) (void);
434 void (*_gtk_reserved3) (void);
435 void (*_gtk_reserved4) (void);
436 void (*_gtk_reserved5) (void);
437 void (*_gtk_reserved6) (void);
438 void (*_gtk_reserved7) (void);
439 void (*_gtk_reserved8) (void);
442 struct _GtkWidgetAuxInfo
453 GType gtk_widget_get_type (void) G_GNUC_CONST;
454 GtkWidget* gtk_widget_new (GType type,
455 const gchar *first_property_name,
457 void gtk_widget_destroy (GtkWidget *widget);
458 void gtk_widget_destroyed (GtkWidget *widget,
459 GtkWidget **widget_pointer);
460 void gtk_widget_unparent (GtkWidget *widget);
461 void gtk_widget_show (GtkWidget *widget);
462 void gtk_widget_hide (GtkWidget *widget);
463 void gtk_widget_show_now (GtkWidget *widget);
464 void gtk_widget_show_all (GtkWidget *widget);
465 void gtk_widget_set_no_show_all (GtkWidget *widget,
466 gboolean no_show_all);
467 gboolean gtk_widget_get_no_show_all (GtkWidget *widget);
468 void gtk_widget_map (GtkWidget *widget);
469 void gtk_widget_unmap (GtkWidget *widget);
470 void gtk_widget_realize (GtkWidget *widget);
471 void gtk_widget_unrealize (GtkWidget *widget);
473 void gtk_widget_draw (GtkWidget *widget,
476 void gtk_widget_queue_draw (GtkWidget *widget);
477 void gtk_widget_queue_draw_area (GtkWidget *widget,
482 void gtk_widget_queue_draw_region (GtkWidget *widget,
483 const cairo_region_t*region);
484 void gtk_widget_queue_resize (GtkWidget *widget);
485 void gtk_widget_queue_resize_no_redraw (GtkWidget *widget);
486 #ifndef GTK_DISABLE_DEPRECATED
487 void gtk_widget_size_request (GtkWidget *widget,
488 GtkRequisition *requisition);
490 void gtk_widget_size_allocate (GtkWidget *widget,
491 GtkAllocation *allocation);
493 GtkSizeRequestMode gtk_widget_get_request_mode (GtkWidget *widget);
494 void gtk_widget_get_preferred_width (GtkWidget *widget,
496 gint *natural_width);
497 void gtk_widget_get_preferred_height_for_width (GtkWidget *widget,
499 gint *minimum_height,
500 gint *natural_height);
501 void gtk_widget_get_preferred_height (GtkWidget *widget,
502 gint *minimum_height,
503 gint *natural_height);
504 void gtk_widget_get_preferred_width_for_height (GtkWidget *widget,
507 gint *natural_width);
508 void gtk_widget_get_preferred_size (GtkWidget *widget,
509 GtkRequisition *minimum_size,
510 GtkRequisition *natural_size);
512 #ifndef GTK_DISABLE_DEPRECATED
513 void gtk_widget_get_child_requisition (GtkWidget *widget,
514 GtkRequisition *requisition);
516 void gtk_widget_add_accelerator (GtkWidget *widget,
517 const gchar *accel_signal,
518 GtkAccelGroup *accel_group,
520 GdkModifierType accel_mods,
521 GtkAccelFlags accel_flags);
522 gboolean gtk_widget_remove_accelerator (GtkWidget *widget,
523 GtkAccelGroup *accel_group,
525 GdkModifierType accel_mods);
526 void gtk_widget_set_accel_path (GtkWidget *widget,
527 const gchar *accel_path,
528 GtkAccelGroup *accel_group);
529 GList* gtk_widget_list_accel_closures (GtkWidget *widget);
530 gboolean gtk_widget_can_activate_accel (GtkWidget *widget,
532 gboolean gtk_widget_mnemonic_activate (GtkWidget *widget,
533 gboolean group_cycling);
534 gboolean gtk_widget_event (GtkWidget *widget,
536 gint gtk_widget_send_expose (GtkWidget *widget,
538 gboolean gtk_widget_send_focus_change (GtkWidget *widget,
541 gboolean gtk_widget_activate (GtkWidget *widget);
543 void gtk_widget_reparent (GtkWidget *widget,
544 GtkWidget *new_parent);
545 gboolean gtk_widget_intersect (GtkWidget *widget,
546 const GdkRectangle *area,
547 GdkRectangle *intersection);
548 cairo_region_t *gtk_widget_region_intersect (GtkWidget *widget,
549 const cairo_region_t *region);
551 void gtk_widget_freeze_child_notify (GtkWidget *widget);
552 void gtk_widget_child_notify (GtkWidget *widget,
553 const gchar *child_property);
554 void gtk_widget_thaw_child_notify (GtkWidget *widget);
556 void gtk_widget_set_can_focus (GtkWidget *widget,
558 gboolean gtk_widget_get_can_focus (GtkWidget *widget);
559 gboolean gtk_widget_has_focus (GtkWidget *widget);
560 gboolean gtk_widget_is_focus (GtkWidget *widget);
561 gboolean gtk_widget_has_visible_focus (GtkWidget *widget);
562 void gtk_widget_grab_focus (GtkWidget *widget);
564 void gtk_widget_set_can_default (GtkWidget *widget,
565 gboolean can_default);
566 gboolean gtk_widget_get_can_default (GtkWidget *widget);
567 gboolean gtk_widget_has_default (GtkWidget *widget);
568 void gtk_widget_grab_default (GtkWidget *widget);
570 void gtk_widget_set_receives_default (GtkWidget *widget,
571 gboolean receives_default);
572 gboolean gtk_widget_get_receives_default (GtkWidget *widget);
574 gboolean gtk_widget_has_grab (GtkWidget *widget);
576 gboolean gtk_widget_device_is_shadowed (GtkWidget *widget,
580 void gtk_widget_set_name (GtkWidget *widget,
582 const gchar * gtk_widget_get_name (GtkWidget *widget);
584 void gtk_widget_set_state (GtkWidget *widget,
586 GtkStateType gtk_widget_get_state (GtkWidget *widget);
588 void gtk_widget_set_state_flags (GtkWidget *widget,
591 void gtk_widget_unset_state_flags (GtkWidget *widget,
592 GtkStateFlags flags);
593 GtkStateFlags gtk_widget_get_state_flags (GtkWidget *widget);
595 void gtk_widget_set_sensitive (GtkWidget *widget,
597 gboolean gtk_widget_get_sensitive (GtkWidget *widget);
598 gboolean gtk_widget_is_sensitive (GtkWidget *widget);
600 void gtk_widget_set_visible (GtkWidget *widget,
602 gboolean gtk_widget_get_visible (GtkWidget *widget);
604 void gtk_widget_set_has_window (GtkWidget *widget,
605 gboolean has_window);
606 gboolean gtk_widget_get_has_window (GtkWidget *widget);
608 gboolean gtk_widget_is_toplevel (GtkWidget *widget);
609 gboolean gtk_widget_is_drawable (GtkWidget *widget);
610 void gtk_widget_set_realized (GtkWidget *widget,
612 gboolean gtk_widget_get_realized (GtkWidget *widget);
613 void gtk_widget_set_mapped (GtkWidget *widget,
615 gboolean gtk_widget_get_mapped (GtkWidget *widget);
617 void gtk_widget_set_app_paintable (GtkWidget *widget,
618 gboolean app_paintable);
619 gboolean gtk_widget_get_app_paintable (GtkWidget *widget);
621 void gtk_widget_set_double_buffered (GtkWidget *widget,
622 gboolean double_buffered);
623 gboolean gtk_widget_get_double_buffered (GtkWidget *widget);
625 void gtk_widget_set_redraw_on_allocate (GtkWidget *widget,
626 gboolean redraw_on_allocate);
628 void gtk_widget_set_parent (GtkWidget *widget,
630 GtkWidget * gtk_widget_get_parent (GtkWidget *widget);
632 void gtk_widget_set_parent_window (GtkWidget *widget,
633 GdkWindow *parent_window);
634 GdkWindow * gtk_widget_get_parent_window (GtkWidget *widget);
636 void gtk_widget_set_child_visible (GtkWidget *widget,
637 gboolean is_visible);
638 gboolean gtk_widget_get_child_visible (GtkWidget *widget);
640 void gtk_widget_set_window (GtkWidget *widget,
642 GdkWindow * gtk_widget_get_window (GtkWidget *widget);
644 int gtk_widget_get_allocated_width (GtkWidget *widget);
645 int gtk_widget_get_allocated_height (GtkWidget *widget);
647 void gtk_widget_get_allocation (GtkWidget *widget,
648 GtkAllocation *allocation);
649 void gtk_widget_set_allocation (GtkWidget *widget,
650 const GtkAllocation *allocation);
652 void gtk_widget_get_requisition (GtkWidget *widget,
653 GtkRequisition *requisition);
655 gboolean gtk_widget_child_focus (GtkWidget *widget,
656 GtkDirectionType direction);
657 gboolean gtk_widget_keynav_failed (GtkWidget *widget,
658 GtkDirectionType direction);
659 void gtk_widget_error_bell (GtkWidget *widget);
661 void gtk_widget_set_size_request (GtkWidget *widget,
664 void gtk_widget_get_size_request (GtkWidget *widget,
667 void gtk_widget_set_events (GtkWidget *widget,
669 void gtk_widget_add_events (GtkWidget *widget,
671 void gtk_widget_set_device_events (GtkWidget *widget,
673 GdkEventMask events);
674 void gtk_widget_add_device_events (GtkWidget *widget,
676 GdkEventMask events);
678 void gtk_widget_set_device_enabled (GtkWidget *widget,
681 gboolean gtk_widget_get_device_enabled (GtkWidget *widget,
684 GtkWidget* gtk_widget_get_toplevel (GtkWidget *widget);
685 GtkWidget* gtk_widget_get_ancestor (GtkWidget *widget,
687 GdkVisual* gtk_widget_get_visual (GtkWidget *widget);
688 void gtk_widget_set_visual (GtkWidget *widget,
691 GdkScreen * gtk_widget_get_screen (GtkWidget *widget);
692 gboolean gtk_widget_has_screen (GtkWidget *widget);
693 GdkDisplay * gtk_widget_get_display (GtkWidget *widget);
694 GdkWindow * gtk_widget_get_root_window (GtkWidget *widget);
695 GtkSettings* gtk_widget_get_settings (GtkWidget *widget);
696 GtkClipboard *gtk_widget_get_clipboard (GtkWidget *widget,
700 /* Expand flags and related support */
701 gboolean gtk_widget_get_hexpand (GtkWidget *widget);
702 void gtk_widget_set_hexpand (GtkWidget *widget,
704 gboolean gtk_widget_get_hexpand_set (GtkWidget *widget);
705 void gtk_widget_set_hexpand_set (GtkWidget *widget,
707 gboolean gtk_widget_get_vexpand (GtkWidget *widget);
708 void gtk_widget_set_vexpand (GtkWidget *widget,
710 gboolean gtk_widget_get_vexpand_set (GtkWidget *widget);
711 void gtk_widget_set_vexpand_set (GtkWidget *widget,
713 void gtk_widget_queue_compute_expand (GtkWidget *widget);
714 gboolean gtk_widget_compute_expand (GtkWidget *widget,
715 GtkOrientation orientation);
718 /* Multidevice support */
719 gboolean gtk_widget_get_support_multidevice (GtkWidget *widget);
720 void gtk_widget_set_support_multidevice (GtkWidget *widget,
721 gboolean support_multidevice);
723 /* Accessibility support */
724 void gtk_widget_class_set_accessible_type (GtkWidgetClass *widget_class,
726 void gtk_widget_class_set_accessible_role (GtkWidgetClass *widget_class,
728 AtkObject* gtk_widget_get_accessible (GtkWidget *widget);
731 /* Margin and alignment */
732 GtkAlign gtk_widget_get_halign (GtkWidget *widget);
733 void gtk_widget_set_halign (GtkWidget *widget,
735 GtkAlign gtk_widget_get_valign (GtkWidget *widget);
736 void gtk_widget_set_valign (GtkWidget *widget,
738 gint gtk_widget_get_margin_left (GtkWidget *widget);
739 void gtk_widget_set_margin_left (GtkWidget *widget,
741 gint gtk_widget_get_margin_right (GtkWidget *widget);
742 void gtk_widget_set_margin_right (GtkWidget *widget,
744 gint gtk_widget_get_margin_top (GtkWidget *widget);
745 void gtk_widget_set_margin_top (GtkWidget *widget,
747 gint gtk_widget_get_margin_bottom (GtkWidget *widget);
748 void gtk_widget_set_margin_bottom (GtkWidget *widget,
752 gint gtk_widget_get_events (GtkWidget *widget);
753 GdkEventMask gtk_widget_get_device_events (GtkWidget *widget,
755 GDK_DEPRECATED_FOR(gdk_window_get_device_position)
756 void gtk_widget_get_pointer (GtkWidget *widget,
760 gboolean gtk_widget_is_ancestor (GtkWidget *widget,
761 GtkWidget *ancestor);
763 gboolean gtk_widget_translate_coordinates (GtkWidget *src_widget,
764 GtkWidget *dest_widget,
770 /* Hide widget and return TRUE.
772 gboolean gtk_widget_hide_on_delete (GtkWidget *widget);
774 /* Functions to override widget styling */
775 void gtk_widget_override_color (GtkWidget *widget,
777 const GdkRGBA *color);
778 void gtk_widget_override_background_color (GtkWidget *widget,
780 const GdkRGBA *color);
782 void gtk_widget_override_font (GtkWidget *widget,
783 const PangoFontDescription *font_desc);
785 void gtk_widget_override_symbolic_color (GtkWidget *widget,
787 const GdkRGBA *color);
788 void gtk_widget_override_cursor (GtkWidget *widget,
789 const GdkRGBA *cursor,
790 const GdkRGBA *secondary_cursor);
792 void gtk_widget_reset_style (GtkWidget *widget);
794 PangoContext *gtk_widget_create_pango_context (GtkWidget *widget);
795 PangoContext *gtk_widget_get_pango_context (GtkWidget *widget);
796 PangoLayout *gtk_widget_create_pango_layout (GtkWidget *widget,
799 GdkPixbuf *gtk_widget_render_icon_pixbuf (GtkWidget *widget,
800 const gchar *stock_id,
803 /* handle composite names for GTK_COMPOSITE_CHILD widgets,
804 * the returned name is newly allocated.
806 void gtk_widget_set_composite_name (GtkWidget *widget,
808 gchar* gtk_widget_get_composite_name (GtkWidget *widget);
810 /* Push/pop pairs, to change default values upon a widget's creation.
811 * This will override the values that got set by the
812 * gtk_widget_set_default_* () functions.
814 void gtk_widget_push_composite_child (void);
815 void gtk_widget_pop_composite_child (void);
817 /* widget style properties
819 void gtk_widget_class_install_style_property (GtkWidgetClass *klass,
821 void gtk_widget_class_install_style_property_parser (GtkWidgetClass *klass,
823 GtkRcPropertyParser parser);
824 GParamSpec* gtk_widget_class_find_style_property (GtkWidgetClass *klass,
825 const gchar *property_name);
826 GParamSpec** gtk_widget_class_list_style_properties (GtkWidgetClass *klass,
827 guint *n_properties);
828 void gtk_widget_style_get_property (GtkWidget *widget,
829 const gchar *property_name,
831 void gtk_widget_style_get_valist (GtkWidget *widget,
832 const gchar *first_property_name,
834 void gtk_widget_style_get (GtkWidget *widget,
835 const gchar *first_property_name,
836 ...) G_GNUC_NULL_TERMINATED;
838 /* Functions for setting directionality for widgets */
840 void gtk_widget_set_direction (GtkWidget *widget,
841 GtkTextDirection dir);
842 GtkTextDirection gtk_widget_get_direction (GtkWidget *widget);
844 void gtk_widget_set_default_direction (GtkTextDirection dir);
845 GtkTextDirection gtk_widget_get_default_direction (void);
847 /* Compositing manager functionality */
848 gboolean gtk_widget_is_composited (GtkWidget *widget);
850 /* Counterpart to gdk_window_shape_combine_region.
852 void gtk_widget_shape_combine_region (GtkWidget *widget,
853 cairo_region_t *region);
854 void gtk_widget_input_shape_combine_region (GtkWidget *widget,
855 cairo_region_t *region);
857 GList* gtk_widget_list_mnemonic_labels (GtkWidget *widget);
858 void gtk_widget_add_mnemonic_label (GtkWidget *widget,
860 void gtk_widget_remove_mnemonic_label (GtkWidget *widget,
863 void gtk_widget_set_tooltip_window (GtkWidget *widget,
864 GtkWindow *custom_window);
865 GtkWindow *gtk_widget_get_tooltip_window (GtkWidget *widget);
866 void gtk_widget_trigger_tooltip_query (GtkWidget *widget);
867 void gtk_widget_set_tooltip_text (GtkWidget *widget,
869 gchar * gtk_widget_get_tooltip_text (GtkWidget *widget);
870 void gtk_widget_set_tooltip_markup (GtkWidget *widget,
871 const gchar *markup);
872 gchar * gtk_widget_get_tooltip_markup (GtkWidget *widget);
873 void gtk_widget_set_has_tooltip (GtkWidget *widget,
874 gboolean has_tooltip);
875 gboolean gtk_widget_get_has_tooltip (GtkWidget *widget);
877 gboolean gtk_cairo_should_draw_window (cairo_t *cr,
879 void gtk_cairo_transform_to_window (cairo_t *cr,
883 GType gtk_requisition_get_type (void) G_GNUC_CONST;
884 GtkRequisition *gtk_requisition_new (void) G_GNUC_MALLOC;
885 GtkRequisition *gtk_requisition_copy (const GtkRequisition *requisition);
886 void gtk_requisition_free (GtkRequisition *requisition);
888 gboolean gtk_widget_in_destruction (GtkWidget *widget);
890 GtkStyleContext * gtk_widget_get_style_context (GtkWidget *widget);
892 GtkWidgetPath * gtk_widget_get_path (GtkWidget *widget);
894 GdkModifierType gtk_widget_get_modifier_mask (GtkWidget *widget,
895 GdkModifierIntent intent);
900 #endif /* __GTK_WIDGET_H__ */