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, see <http://www.gnu.org/licenses/>.
19 * Modified by the GTK+ Team and others 1997-2000. See the AUTHORS
20 * file for a list of people on the GTK+ Team. See the ChangeLog
21 * files for a list of changes. These files are distributed with
22 * GTK+ at ftp://ftp.gtk.org/pub/gtk/.
25 #ifndef __GTK_WIDGET_H__
26 #define __GTK_WIDGET_H__
28 #if !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION)
29 #error "Only <gtk/gtk.h> can be included directly."
33 #include <gtk/gtkaccelgroup.h>
34 #include <gtk/gtkborder.h>
35 #include <gtk/gtktypes.h>
40 /* Kinds of widget-specific help */
43 GTK_WIDGET_HELP_TOOLTIP,
44 GTK_WIDGET_HELP_WHATS_THIS
47 /* Macro for casting a pointer to a GtkWidget or GtkWidgetClass pointer.
48 * Macros for testing whether `widget' or `klass' are of type GTK_TYPE_WIDGET.
50 #define GTK_TYPE_WIDGET (gtk_widget_get_type ())
51 #define GTK_WIDGET(widget) (G_TYPE_CHECK_INSTANCE_CAST ((widget), GTK_TYPE_WIDGET, GtkWidget))
52 #define GTK_WIDGET_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GTK_TYPE_WIDGET, GtkWidgetClass))
53 #define GTK_IS_WIDGET(widget) (G_TYPE_CHECK_INSTANCE_TYPE ((widget), GTK_TYPE_WIDGET))
54 #define GTK_IS_WIDGET_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_WIDGET))
55 #define GTK_WIDGET_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_WIDGET, GtkWidgetClass))
57 #define GTK_TYPE_REQUISITION (gtk_requisition_get_type ())
59 typedef struct _GtkWidgetPrivate GtkWidgetPrivate;
60 typedef struct _GtkWidgetClass GtkWidgetClass;
61 typedef struct _GtkWidgetClassPrivate GtkWidgetClassPrivate;
62 typedef struct _GtkWidgetAuxInfo GtkWidgetAuxInfo;
66 * @x: the X position of the widget's area relative to its parents allocation.
67 * @y: the Y position of the widget's area relative to its parents allocation.
68 * @width: the width of the widget's allocated area.
69 * @height: the height of the widget's allocated area.
71 * A <structname>GtkAllocation</structname> of a widget represents region
72 * which has been allocated to the widget by its parent. It is a subregion
73 * of its parents allocation. See <xref linkend="geometry-management"/> for
76 typedef GdkRectangle GtkAllocation;
80 * @widget: the widget to operate on
81 * @data: (closure): user-supplied data
83 * The type of the callback functions used for e.g. iterating over
84 * the children of a container, see gtk_container_foreach().
86 typedef void (*GtkCallback) (GtkWidget *widget,
92 * @frame_clock: the frame clock for the widget (same as calling gtk_widget_get_frame_clock())
93 * @user_data: user data passed to gtk_widget_add_tick_callback().
95 * Callback type for adding a function to update animations. See gtk_widget_add_tick_callback().
97 * Returns: %G_SOURCE_CONTINUE if the tick callback should continue to be called,
98 * %G_SOURCE_REMOVE if the tick callback should be removed.
102 typedef gboolean (*GtkTickCallback) (GtkWidget *widget,
103 GdkFrameClock *frame_clock,
108 * @width: the widget's desired width
109 * @height: the widget's desired height
111 * A <structname>GtkRequisition</structname> represents the desired size of a widget. See
112 * <xref linkend="geometry-management"/> for more information.
114 struct _GtkRequisition
120 /* The widget is the base of the tree for displayable objects.
121 * (A displayable object is one which takes up some amount
122 * of screen real estate). It provides a common base and interface
123 * which actual widgets must adhere to.
127 GInitiallyUnowned parent_instance;
129 GtkWidgetPrivate *priv;
134 * @parent_class: The object class structure needs to be the first
135 * element in the widget class structure in order for the class mechanism
136 * to work correctly. This allows a GtkWidgetClass pointer to be cast to
137 * a GObjectClass pointer.
138 * @activate_signal: The signal to emit when a widget of this class is
139 * activated, gtk_widget_activate() handles the emission.
140 * Implementation of this signal is optional.
141 * @get_request_mode: This allows a widget to tell its parent container whether
142 * it prefers to be allocated in %GTK_SIZE_REQUEST_HEIGHT_FOR_WIDTH or
143 * %GTK_SIZE_REQUEST_WIDTH_FOR_HEIGHT mode.
144 * %GTK_SIZE_REQUEST_HEIGHT_FOR_WIDTH means the widget prefers to have
145 * #GtkWidgetClass.get_preferred_width() called and then
146 * #GtkWidgetClass.get_preferred_height_for_width().
147 * %GTK_SIZE_REQUEST_CONSTANT_SIZE disables any height-for-width or
148 * width-for-height geometry management for a said widget and is the
150 * It's important to note (as described below) that any widget
151 * which trades height-for-width or width-for-height must respond properly
152 * to both of the virtual methods #GtkWidgetClass.get_preferred_height_for_width()
153 * and #GtkWidgetClass.get_preferred_width_for_height() since it might be
154 * queried in either #GtkSizeRequestMode by its parent container.
155 * @get_preferred_height: This is called by containers to obtain the minimum
156 * and natural height of a widget. A widget that does not actually trade
157 * any height for width or width for height only has to implement these
158 * two virtual methods (#GtkWidgetClass.get_preferred_width() and
159 * #GtkWidgetClass.get_preferred_height()).
160 * @get_preferred_width_for_height: This is analogous to
161 * #GtkWidgetClass.get_preferred_height_for_width() except that it
162 * operates in the oposite orientation. It's rare that a widget actually
163 * does %GTK_SIZE_REQUEST_WIDTH_FOR_HEIGHT requests but this can happen
164 * when, for example, a widget or container gets additional columns to
165 * compensate for a smaller allocated height.
166 * @get_preferred_width: This is called by containers to obtain the minimum
167 * and natural width of a widget. A widget will never be allocated a width
168 * less than its minimum and will only ever be allocated a width greater
169 * than the natural width once all of the said widget's siblings have
170 * received their natural widths.
171 * Furthermore, a widget will only ever be allocated a width greater than
172 * its natural width if it was configured to receive extra expand space
173 * from its parent container.
174 * @get_preferred_height_for_width: This is similar to
175 * #GtkWidgetClass.get_preferred_height() except that it is passed a
176 * contextual width to request height for. By implementing this virtual
177 * method it is possible for a #GtkLabel to tell its parent how much height
178 * would be required if the label were to be allocated a said width.
179 * @adjust_size_request: Convert an initial size request from a widget's
180 * #GtkSizeRequestMode virtual method implementations into a size request to
181 * be used by parent containers in laying out the widget.
182 * adjust_size_request adjusts <emphasis>from</emphasis> a child widget's
183 * original request <emphasis>to</emphasis> what a parent container should
184 * use for layout. The @for_size argument will be -1 if the request should
185 * not be for a particular size in the opposing orientation, i.e. if the
186 * request is not height-for-width or width-for-height. If @for_size is
187 * greater than -1, it is the proposed allocation in the opposing
188 * orientation that we need the request for. Implementations of
189 * adjust_size_request should chain up to the default implementation,
190 * which applies #GtkWidget's margin properties and imposes any values
191 * from gtk_widget_set_size_request(). Chaining up should be last,
192 * <emphasis>after</emphasis> your subclass adjusts the request, so
193 * #GtkWidget can apply constraints and add the margin properly.
194 * @adjust_size_allocation: Convert an initial size allocation assigned
195 * by a #GtkContainer using gtk_widget_size_allocate(), into an actual
196 * size allocation to be used by the widget. adjust_size_allocation
197 * adjusts <emphasis>to</emphasis> a child widget's actual allocation
198 * <emphasis>from</emphasis> what a parent container computed for the
199 * child. The adjusted allocation must be entirely within the original
200 * allocation. In any custom implementation, chain up to the default
201 * #GtkWidget implementation of this method, which applies the margin
202 * and alignment properties of #GtkWidget. Chain up
203 * <emphasis>before</emphasis> performing your own adjustments so your
204 * own adjustments remove more allocation after the #GtkWidget base
205 * class has already removed margin and alignment. The natural size
206 * passed in should be adjusted in the same way as the allocated size,
207 * which allows adjustments to perform alignments or other changes
208 * based on natural size.
210 struct _GtkWidgetClass
212 GInitiallyUnownedClass parent_class;
216 guint activate_signal;
218 /* seldomly overidden */
219 void (*dispatch_child_properties_changed) (GtkWidget *widget,
221 GParamSpec **pspecs);
224 void (* destroy) (GtkWidget *widget);
225 void (* show) (GtkWidget *widget);
226 void (* show_all) (GtkWidget *widget);
227 void (* hide) (GtkWidget *widget);
228 void (* map) (GtkWidget *widget);
229 void (* unmap) (GtkWidget *widget);
230 void (* realize) (GtkWidget *widget);
231 void (* unrealize) (GtkWidget *widget);
232 void (* size_allocate) (GtkWidget *widget,
233 GtkAllocation *allocation);
234 void (* state_changed) (GtkWidget *widget,
235 GtkStateType previous_state);
236 void (* state_flags_changed) (GtkWidget *widget,
237 GtkStateFlags previous_state_flags);
238 void (* parent_set) (GtkWidget *widget,
239 GtkWidget *previous_parent);
240 void (* hierarchy_changed) (GtkWidget *widget,
241 GtkWidget *previous_toplevel);
242 void (* style_set) (GtkWidget *widget,
243 GtkStyle *previous_style);
244 void (* direction_changed) (GtkWidget *widget,
245 GtkTextDirection previous_direction);
246 void (* grab_notify) (GtkWidget *widget,
247 gboolean was_grabbed);
248 void (* child_notify) (GtkWidget *widget,
249 GParamSpec *child_property);
250 gboolean (* draw) (GtkWidget *widget,
254 GtkSizeRequestMode (* get_request_mode) (GtkWidget *widget);
256 void (* get_preferred_height) (GtkWidget *widget,
257 gint *minimum_height,
258 gint *natural_height);
259 void (* get_preferred_width_for_height) (GtkWidget *widget,
262 gint *natural_width);
263 void (* get_preferred_width) (GtkWidget *widget,
265 gint *natural_width);
266 void (* get_preferred_height_for_width) (GtkWidget *widget,
268 gint *minimum_height,
269 gint *natural_height);
272 gboolean (* mnemonic_activate) (GtkWidget *widget,
273 gboolean group_cycling);
276 void (* grab_focus) (GtkWidget *widget);
277 gboolean (* focus) (GtkWidget *widget,
278 GtkDirectionType direction);
280 /* keyboard navigation */
281 void (* move_focus) (GtkWidget *widget,
282 GtkDirectionType direction);
283 gboolean (* keynav_failed) (GtkWidget *widget,
284 GtkDirectionType direction);
287 gboolean (* event) (GtkWidget *widget,
289 gboolean (* button_press_event) (GtkWidget *widget,
290 GdkEventButton *event);
291 gboolean (* button_release_event) (GtkWidget *widget,
292 GdkEventButton *event);
293 gboolean (* scroll_event) (GtkWidget *widget,
294 GdkEventScroll *event);
295 gboolean (* motion_notify_event) (GtkWidget *widget,
296 GdkEventMotion *event);
297 gboolean (* delete_event) (GtkWidget *widget,
299 gboolean (* destroy_event) (GtkWidget *widget,
301 gboolean (* key_press_event) (GtkWidget *widget,
303 gboolean (* key_release_event) (GtkWidget *widget,
305 gboolean (* enter_notify_event) (GtkWidget *widget,
306 GdkEventCrossing *event);
307 gboolean (* leave_notify_event) (GtkWidget *widget,
308 GdkEventCrossing *event);
309 gboolean (* configure_event) (GtkWidget *widget,
310 GdkEventConfigure *event);
311 gboolean (* focus_in_event) (GtkWidget *widget,
312 GdkEventFocus *event);
313 gboolean (* focus_out_event) (GtkWidget *widget,
314 GdkEventFocus *event);
315 gboolean (* map_event) (GtkWidget *widget,
317 gboolean (* unmap_event) (GtkWidget *widget,
319 gboolean (* property_notify_event) (GtkWidget *widget,
320 GdkEventProperty *event);
321 gboolean (* selection_clear_event) (GtkWidget *widget,
322 GdkEventSelection *event);
323 gboolean (* selection_request_event) (GtkWidget *widget,
324 GdkEventSelection *event);
325 gboolean (* selection_notify_event) (GtkWidget *widget,
326 GdkEventSelection *event);
327 gboolean (* proximity_in_event) (GtkWidget *widget,
328 GdkEventProximity *event);
329 gboolean (* proximity_out_event) (GtkWidget *widget,
330 GdkEventProximity *event);
331 gboolean (* visibility_notify_event) (GtkWidget *widget,
332 GdkEventVisibility *event);
333 gboolean (* window_state_event) (GtkWidget *widget,
334 GdkEventWindowState *event);
335 gboolean (* damage_event) (GtkWidget *widget,
336 GdkEventExpose *event);
337 gboolean (* grab_broken_event) (GtkWidget *widget,
338 GdkEventGrabBroken *event);
341 void (* selection_get) (GtkWidget *widget,
342 GtkSelectionData *selection_data,
345 void (* selection_received) (GtkWidget *widget,
346 GtkSelectionData *selection_data,
349 /* Source side drag signals */
350 void (* drag_begin) (GtkWidget *widget,
351 GdkDragContext *context);
352 void (* drag_end) (GtkWidget *widget,
353 GdkDragContext *context);
354 void (* drag_data_get) (GtkWidget *widget,
355 GdkDragContext *context,
356 GtkSelectionData *selection_data,
359 void (* drag_data_delete) (GtkWidget *widget,
360 GdkDragContext *context);
362 /* Target side drag signals */
363 void (* drag_leave) (GtkWidget *widget,
364 GdkDragContext *context,
366 gboolean (* drag_motion) (GtkWidget *widget,
367 GdkDragContext *context,
371 gboolean (* drag_drop) (GtkWidget *widget,
372 GdkDragContext *context,
376 void (* drag_data_received) (GtkWidget *widget,
377 GdkDragContext *context,
380 GtkSelectionData *selection_data,
383 gboolean (* drag_failed) (GtkWidget *widget,
384 GdkDragContext *context,
385 GtkDragResult result);
387 /* Signals used only for keybindings */
388 gboolean (* popup_menu) (GtkWidget *widget);
390 /* If a widget has multiple tooltips/whatsthis, it should show the
391 * one for the current focus location, or if that doesn't make
392 * sense, should cycle through them showing each tip alongside
393 * whatever piece of the widget it applies to.
395 gboolean (* show_help) (GtkWidget *widget,
396 GtkWidgetHelpType help_type);
398 /* accessibility support
400 AtkObject * (* get_accessible) (GtkWidget *widget);
402 void (* screen_changed) (GtkWidget *widget,
403 GdkScreen *previous_screen);
404 gboolean (* can_activate_accel) (GtkWidget *widget,
408 void (* composited_changed) (GtkWidget *widget);
410 gboolean (* query_tooltip) (GtkWidget *widget,
413 gboolean keyboard_tooltip,
414 GtkTooltip *tooltip);
416 void (* compute_expand) (GtkWidget *widget,
418 gboolean *vexpand_p);
420 void (* adjust_size_request) (GtkWidget *widget,
421 GtkOrientation orientation,
424 void (* adjust_size_allocation) (GtkWidget *widget,
425 GtkOrientation orientation,
429 gint *allocated_size);
431 void (* style_updated) (GtkWidget *widget);
433 gboolean (* touch_event) (GtkWidget *widget,
434 GdkEventTouch *event);
438 GtkWidgetClassPrivate *priv;
440 /* Padding for future expansion */
441 void (*_gtk_reserved2) (void);
442 void (*_gtk_reserved3) (void);
443 void (*_gtk_reserved4) (void);
444 void (*_gtk_reserved5) (void);
445 void (*_gtk_reserved6) (void);
446 void (*_gtk_reserved7) (void);
449 struct _GtkWidgetAuxInfo
460 GType gtk_widget_get_type (void) G_GNUC_CONST;
461 GtkWidget* gtk_widget_new (GType type,
462 const gchar *first_property_name,
464 void gtk_widget_destroy (GtkWidget *widget);
465 void gtk_widget_destroyed (GtkWidget *widget,
466 GtkWidget **widget_pointer);
467 void gtk_widget_unparent (GtkWidget *widget);
468 void gtk_widget_show (GtkWidget *widget);
469 void gtk_widget_hide (GtkWidget *widget);
470 void gtk_widget_show_now (GtkWidget *widget);
471 void gtk_widget_show_all (GtkWidget *widget);
472 void gtk_widget_set_no_show_all (GtkWidget *widget,
473 gboolean no_show_all);
474 gboolean gtk_widget_get_no_show_all (GtkWidget *widget);
475 void gtk_widget_map (GtkWidget *widget);
476 void gtk_widget_unmap (GtkWidget *widget);
477 void gtk_widget_realize (GtkWidget *widget);
478 void gtk_widget_unrealize (GtkWidget *widget);
480 void gtk_widget_draw (GtkWidget *widget,
483 void gtk_widget_queue_draw (GtkWidget *widget);
484 void gtk_widget_queue_draw_area (GtkWidget *widget,
489 void gtk_widget_queue_draw_region (GtkWidget *widget,
490 const cairo_region_t*region);
491 void gtk_widget_queue_resize (GtkWidget *widget);
492 void gtk_widget_queue_resize_no_redraw (GtkWidget *widget);
494 GdkFrameClock* gtk_widget_get_frame_clock (GtkWidget *widget);
496 GDK_DEPRECATED_IN_3_0_FOR(gtk_widget_get_preferred_size)
497 void gtk_widget_size_request (GtkWidget *widget,
498 GtkRequisition *requisition);
499 void gtk_widget_size_allocate (GtkWidget *widget,
500 GtkAllocation *allocation);
502 GtkSizeRequestMode gtk_widget_get_request_mode (GtkWidget *widget);
503 void gtk_widget_get_preferred_width (GtkWidget *widget,
505 gint *natural_width);
506 void gtk_widget_get_preferred_height_for_width (GtkWidget *widget,
508 gint *minimum_height,
509 gint *natural_height);
510 void gtk_widget_get_preferred_height (GtkWidget *widget,
511 gint *minimum_height,
512 gint *natural_height);
513 void gtk_widget_get_preferred_width_for_height (GtkWidget *widget,
516 gint *natural_width);
517 void gtk_widget_get_preferred_size (GtkWidget *widget,
518 GtkRequisition *minimum_size,
519 GtkRequisition *natural_size);
521 GDK_DEPRECATED_IN_3_0_FOR(gtk_widget_get_preferred_size)
522 void gtk_widget_get_child_requisition (GtkWidget *widget,
523 GtkRequisition *requisition);
524 void gtk_widget_add_accelerator (GtkWidget *widget,
525 const gchar *accel_signal,
526 GtkAccelGroup *accel_group,
528 GdkModifierType accel_mods,
529 GtkAccelFlags accel_flags);
530 gboolean gtk_widget_remove_accelerator (GtkWidget *widget,
531 GtkAccelGroup *accel_group,
533 GdkModifierType accel_mods);
534 void gtk_widget_set_accel_path (GtkWidget *widget,
535 const gchar *accel_path,
536 GtkAccelGroup *accel_group);
537 GList* gtk_widget_list_accel_closures (GtkWidget *widget);
538 gboolean gtk_widget_can_activate_accel (GtkWidget *widget,
540 gboolean gtk_widget_mnemonic_activate (GtkWidget *widget,
541 gboolean group_cycling);
542 gboolean gtk_widget_event (GtkWidget *widget,
544 gint gtk_widget_send_expose (GtkWidget *widget,
546 gboolean gtk_widget_send_focus_change (GtkWidget *widget,
549 gboolean gtk_widget_activate (GtkWidget *widget);
551 void gtk_widget_reparent (GtkWidget *widget,
552 GtkWidget *new_parent);
553 gboolean gtk_widget_intersect (GtkWidget *widget,
554 const GdkRectangle *area,
555 GdkRectangle *intersection);
556 cairo_region_t *gtk_widget_region_intersect (GtkWidget *widget,
557 const cairo_region_t *region);
559 void gtk_widget_freeze_child_notify (GtkWidget *widget);
560 void gtk_widget_child_notify (GtkWidget *widget,
561 const gchar *child_property);
562 void gtk_widget_thaw_child_notify (GtkWidget *widget);
564 void gtk_widget_set_can_focus (GtkWidget *widget,
566 gboolean gtk_widget_get_can_focus (GtkWidget *widget);
567 gboolean gtk_widget_has_focus (GtkWidget *widget);
568 gboolean gtk_widget_is_focus (GtkWidget *widget);
570 gboolean gtk_widget_has_visible_focus (GtkWidget *widget);
571 void gtk_widget_grab_focus (GtkWidget *widget);
573 void gtk_widget_set_can_default (GtkWidget *widget,
574 gboolean can_default);
575 gboolean gtk_widget_get_can_default (GtkWidget *widget);
576 gboolean gtk_widget_has_default (GtkWidget *widget);
577 void gtk_widget_grab_default (GtkWidget *widget);
579 void gtk_widget_set_receives_default (GtkWidget *widget,
580 gboolean receives_default);
581 gboolean gtk_widget_get_receives_default (GtkWidget *widget);
583 gboolean gtk_widget_has_grab (GtkWidget *widget);
585 gboolean gtk_widget_device_is_shadowed (GtkWidget *widget,
589 void gtk_widget_set_name (GtkWidget *widget,
591 const gchar * gtk_widget_get_name (GtkWidget *widget);
593 void gtk_widget_set_state (GtkWidget *widget,
595 GtkStateType gtk_widget_get_state (GtkWidget *widget);
597 void gtk_widget_set_state_flags (GtkWidget *widget,
600 void gtk_widget_unset_state_flags (GtkWidget *widget,
601 GtkStateFlags flags);
602 GtkStateFlags gtk_widget_get_state_flags (GtkWidget *widget);
604 void gtk_widget_set_sensitive (GtkWidget *widget,
606 gboolean gtk_widget_get_sensitive (GtkWidget *widget);
607 gboolean gtk_widget_is_sensitive (GtkWidget *widget);
609 void gtk_widget_set_visible (GtkWidget *widget,
611 gboolean gtk_widget_get_visible (GtkWidget *widget);
612 gboolean gtk_widget_is_visible (GtkWidget *widget);
614 void gtk_widget_set_has_window (GtkWidget *widget,
615 gboolean has_window);
616 gboolean gtk_widget_get_has_window (GtkWidget *widget);
618 gboolean gtk_widget_is_toplevel (GtkWidget *widget);
619 gboolean gtk_widget_is_drawable (GtkWidget *widget);
620 void gtk_widget_set_realized (GtkWidget *widget,
622 gboolean gtk_widget_get_realized (GtkWidget *widget);
623 void gtk_widget_set_mapped (GtkWidget *widget,
625 gboolean gtk_widget_get_mapped (GtkWidget *widget);
627 void gtk_widget_set_app_paintable (GtkWidget *widget,
628 gboolean app_paintable);
629 gboolean gtk_widget_get_app_paintable (GtkWidget *widget);
631 void gtk_widget_set_double_buffered (GtkWidget *widget,
632 gboolean double_buffered);
633 gboolean gtk_widget_get_double_buffered (GtkWidget *widget);
635 void gtk_widget_set_redraw_on_allocate (GtkWidget *widget,
636 gboolean redraw_on_allocate);
638 void gtk_widget_set_parent (GtkWidget *widget,
640 GtkWidget * gtk_widget_get_parent (GtkWidget *widget);
642 void gtk_widget_set_parent_window (GtkWidget *widget,
643 GdkWindow *parent_window);
644 GdkWindow * gtk_widget_get_parent_window (GtkWidget *widget);
646 void gtk_widget_set_child_visible (GtkWidget *widget,
647 gboolean is_visible);
648 gboolean gtk_widget_get_child_visible (GtkWidget *widget);
650 void gtk_widget_set_window (GtkWidget *widget,
652 GdkWindow * gtk_widget_get_window (GtkWidget *widget);
654 void gtk_widget_register_window (GtkWidget *widget,
657 void gtk_widget_unregister_window (GtkWidget *widget,
660 int gtk_widget_get_allocated_width (GtkWidget *widget);
661 int gtk_widget_get_allocated_height (GtkWidget *widget);
663 void gtk_widget_get_allocation (GtkWidget *widget,
664 GtkAllocation *allocation);
665 void gtk_widget_set_allocation (GtkWidget *widget,
666 const GtkAllocation *allocation);
668 void gtk_widget_get_requisition (GtkWidget *widget,
669 GtkRequisition *requisition);
671 gboolean gtk_widget_child_focus (GtkWidget *widget,
672 GtkDirectionType direction);
673 gboolean gtk_widget_keynav_failed (GtkWidget *widget,
674 GtkDirectionType direction);
675 void gtk_widget_error_bell (GtkWidget *widget);
677 void gtk_widget_set_size_request (GtkWidget *widget,
680 void gtk_widget_get_size_request (GtkWidget *widget,
683 void gtk_widget_set_events (GtkWidget *widget,
685 void gtk_widget_add_events (GtkWidget *widget,
687 void gtk_widget_set_device_events (GtkWidget *widget,
689 GdkEventMask events);
690 void gtk_widget_add_device_events (GtkWidget *widget,
692 GdkEventMask events);
694 void gtk_widget_set_opacity (GtkWidget *widget,
697 double gtk_widget_get_opacity (GtkWidget *widget);
699 void gtk_widget_set_device_enabled (GtkWidget *widget,
702 gboolean gtk_widget_get_device_enabled (GtkWidget *widget,
705 GtkWidget* gtk_widget_get_toplevel (GtkWidget *widget);
706 GtkWidget* gtk_widget_get_ancestor (GtkWidget *widget,
708 GdkVisual* gtk_widget_get_visual (GtkWidget *widget);
709 void gtk_widget_set_visual (GtkWidget *widget,
712 GdkScreen * gtk_widget_get_screen (GtkWidget *widget);
713 gboolean gtk_widget_has_screen (GtkWidget *widget);
714 GdkDisplay * gtk_widget_get_display (GtkWidget *widget);
715 GdkWindow * gtk_widget_get_root_window (GtkWidget *widget);
716 GtkSettings* gtk_widget_get_settings (GtkWidget *widget);
717 GtkClipboard *gtk_widget_get_clipboard (GtkWidget *widget,
721 /* Expand flags and related support */
722 gboolean gtk_widget_get_hexpand (GtkWidget *widget);
723 void gtk_widget_set_hexpand (GtkWidget *widget,
725 gboolean gtk_widget_get_hexpand_set (GtkWidget *widget);
726 void gtk_widget_set_hexpand_set (GtkWidget *widget,
728 gboolean gtk_widget_get_vexpand (GtkWidget *widget);
729 void gtk_widget_set_vexpand (GtkWidget *widget,
731 gboolean gtk_widget_get_vexpand_set (GtkWidget *widget);
732 void gtk_widget_set_vexpand_set (GtkWidget *widget,
734 void gtk_widget_queue_compute_expand (GtkWidget *widget);
735 gboolean gtk_widget_compute_expand (GtkWidget *widget,
736 GtkOrientation orientation);
739 /* Multidevice support */
740 gboolean gtk_widget_get_support_multidevice (GtkWidget *widget);
741 void gtk_widget_set_support_multidevice (GtkWidget *widget,
742 gboolean support_multidevice);
744 /* Accessibility support */
746 void gtk_widget_class_set_accessible_type (GtkWidgetClass *widget_class,
749 void gtk_widget_class_set_accessible_role (GtkWidgetClass *widget_class,
751 AtkObject* gtk_widget_get_accessible (GtkWidget *widget);
754 /* Margin and alignment */
755 GtkAlign gtk_widget_get_halign (GtkWidget *widget);
756 void gtk_widget_set_halign (GtkWidget *widget,
758 GtkAlign gtk_widget_get_valign (GtkWidget *widget);
759 void gtk_widget_set_valign (GtkWidget *widget,
761 gint gtk_widget_get_margin_left (GtkWidget *widget);
762 void gtk_widget_set_margin_left (GtkWidget *widget,
764 gint gtk_widget_get_margin_right (GtkWidget *widget);
765 void gtk_widget_set_margin_right (GtkWidget *widget,
767 gint gtk_widget_get_margin_top (GtkWidget *widget);
768 void gtk_widget_set_margin_top (GtkWidget *widget,
770 gint gtk_widget_get_margin_bottom (GtkWidget *widget);
771 void gtk_widget_set_margin_bottom (GtkWidget *widget,
775 gint gtk_widget_get_events (GtkWidget *widget);
776 GdkEventMask gtk_widget_get_device_events (GtkWidget *widget,
778 GDK_DEPRECATED_IN_3_4_FOR(gdk_window_get_device_position)
779 void gtk_widget_get_pointer (GtkWidget *widget,
783 gboolean gtk_widget_is_ancestor (GtkWidget *widget,
784 GtkWidget *ancestor);
786 gboolean gtk_widget_translate_coordinates (GtkWidget *src_widget,
787 GtkWidget *dest_widget,
793 /* Hide widget and return TRUE.
795 gboolean gtk_widget_hide_on_delete (GtkWidget *widget);
797 /* Functions to override widget styling */
798 void gtk_widget_override_color (GtkWidget *widget,
800 const GdkRGBA *color);
801 void gtk_widget_override_background_color (GtkWidget *widget,
803 const GdkRGBA *color);
805 void gtk_widget_override_font (GtkWidget *widget,
806 const PangoFontDescription *font_desc);
808 void gtk_widget_override_symbolic_color (GtkWidget *widget,
810 const GdkRGBA *color);
811 void gtk_widget_override_cursor (GtkWidget *widget,
812 const GdkRGBA *cursor,
813 const GdkRGBA *secondary_cursor);
815 void gtk_widget_reset_style (GtkWidget *widget);
817 PangoContext *gtk_widget_create_pango_context (GtkWidget *widget);
818 PangoContext *gtk_widget_get_pango_context (GtkWidget *widget);
819 PangoLayout *gtk_widget_create_pango_layout (GtkWidget *widget,
822 GdkPixbuf *gtk_widget_render_icon_pixbuf (GtkWidget *widget,
823 const gchar *stock_id,
826 /* handle composite names for GTK_COMPOSITE_CHILD widgets,
827 * the returned name is newly allocated.
829 void gtk_widget_set_composite_name (GtkWidget *widget,
831 gchar* gtk_widget_get_composite_name (GtkWidget *widget);
833 /* Push/pop pairs, to change default values upon a widget's creation.
834 * This will override the values that got set by the
835 * gtk_widget_set_default_* () functions.
837 void gtk_widget_push_composite_child (void);
838 void gtk_widget_pop_composite_child (void);
840 /* widget style properties
842 void gtk_widget_class_install_style_property (GtkWidgetClass *klass,
844 void gtk_widget_class_install_style_property_parser (GtkWidgetClass *klass,
846 GtkRcPropertyParser parser);
847 GParamSpec* gtk_widget_class_find_style_property (GtkWidgetClass *klass,
848 const gchar *property_name);
849 GParamSpec** gtk_widget_class_list_style_properties (GtkWidgetClass *klass,
850 guint *n_properties);
851 void gtk_widget_style_get_property (GtkWidget *widget,
852 const gchar *property_name,
854 void gtk_widget_style_get_valist (GtkWidget *widget,
855 const gchar *first_property_name,
857 void gtk_widget_style_get (GtkWidget *widget,
858 const gchar *first_property_name,
859 ...) G_GNUC_NULL_TERMINATED;
861 /* Functions for setting directionality for widgets */
863 void gtk_widget_set_direction (GtkWidget *widget,
864 GtkTextDirection dir);
865 GtkTextDirection gtk_widget_get_direction (GtkWidget *widget);
867 void gtk_widget_set_default_direction (GtkTextDirection dir);
868 GtkTextDirection gtk_widget_get_default_direction (void);
870 /* Compositing manager functionality */
871 gboolean gtk_widget_is_composited (GtkWidget *widget);
873 /* Counterpart to gdk_window_shape_combine_region.
875 void gtk_widget_shape_combine_region (GtkWidget *widget,
876 cairo_region_t *region);
877 void gtk_widget_input_shape_combine_region (GtkWidget *widget,
878 cairo_region_t *region);
880 GList* gtk_widget_list_mnemonic_labels (GtkWidget *widget);
881 void gtk_widget_add_mnemonic_label (GtkWidget *widget,
883 void gtk_widget_remove_mnemonic_label (GtkWidget *widget,
886 void gtk_widget_set_tooltip_window (GtkWidget *widget,
887 GtkWindow *custom_window);
888 GtkWindow *gtk_widget_get_tooltip_window (GtkWidget *widget);
889 void gtk_widget_trigger_tooltip_query (GtkWidget *widget);
890 void gtk_widget_set_tooltip_text (GtkWidget *widget,
892 gchar * gtk_widget_get_tooltip_text (GtkWidget *widget);
893 void gtk_widget_set_tooltip_markup (GtkWidget *widget,
894 const gchar *markup);
895 gchar * gtk_widget_get_tooltip_markup (GtkWidget *widget);
896 void gtk_widget_set_has_tooltip (GtkWidget *widget,
897 gboolean has_tooltip);
898 gboolean gtk_widget_get_has_tooltip (GtkWidget *widget);
900 gboolean gtk_cairo_should_draw_window (cairo_t *cr,
902 void gtk_cairo_transform_to_window (cairo_t *cr,
906 GType gtk_requisition_get_type (void) G_GNUC_CONST;
907 GtkRequisition *gtk_requisition_new (void) G_GNUC_MALLOC;
908 GtkRequisition *gtk_requisition_copy (const GtkRequisition *requisition);
909 void gtk_requisition_free (GtkRequisition *requisition);
911 gboolean gtk_widget_in_destruction (GtkWidget *widget);
913 GtkStyleContext * gtk_widget_get_style_context (GtkWidget *widget);
915 GtkWidgetPath * gtk_widget_get_path (GtkWidget *widget);
918 GdkModifierType gtk_widget_get_modifier_mask (GtkWidget *widget,
919 GdkModifierIntent intent);
922 void gtk_widget_insert_action_group (GtkWidget *widget,
924 GActionGroup *group);
929 guint gtk_widget_add_tick_callback (GtkWidget *widget,
930 GtkTickCallback callback,
932 GDestroyNotify notify);
935 void gtk_widget_remove_tick_callback (GtkWidget *widget,
940 #endif /* __GTK_WIDGET_H__ */