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/gtkstyle.h>
38 #include <gtk/gtkborder.h>
39 #include <gtk/gtksettings.h>
40 #include <gtk/gtkstylecontext.h>
41 #include <gtk/gtkwidgetpath.h>
46 /* Kinds of widget-specific help */
49 GTK_WIDGET_HELP_TOOLTIP,
50 GTK_WIDGET_HELP_WHATS_THIS
53 /* Macro for casting a pointer to a GtkWidget or GtkWidgetClass pointer.
54 * Macros for testing whether `widget' or `klass' are of type GTK_TYPE_WIDGET.
56 #define GTK_TYPE_WIDGET (gtk_widget_get_type ())
57 #define GTK_WIDGET(widget) (G_TYPE_CHECK_INSTANCE_CAST ((widget), GTK_TYPE_WIDGET, GtkWidget))
58 #define GTK_WIDGET_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GTK_TYPE_WIDGET, GtkWidgetClass))
59 #define GTK_IS_WIDGET(widget) (G_TYPE_CHECK_INSTANCE_TYPE ((widget), GTK_TYPE_WIDGET))
60 #define GTK_IS_WIDGET_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_WIDGET))
61 #define GTK_WIDGET_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_WIDGET, GtkWidgetClass))
63 #define GTK_TYPE_REQUISITION (gtk_requisition_get_type ())
65 /* forward declaration to avoid excessive includes (and concurrent includes)
67 typedef struct _GtkRequisition GtkRequisition;
68 typedef struct _GtkSelectionData GtkSelectionData;
69 typedef struct _GtkWidgetPrivate GtkWidgetPrivate;
70 typedef struct _GtkWidgetClass GtkWidgetClass;
71 typedef struct _GtkWidgetAuxInfo GtkWidgetAuxInfo;
72 typedef struct _GtkClipboard GtkClipboard;
73 typedef struct _GtkTooltip GtkTooltip;
74 typedef struct _GtkWindow GtkWindow;
79 * @x: the X position of the widget's area relative to its parents allocation.
80 * @y: the Y position of the widget's area relative to its parents allocation.
81 * @width: the width of the widget's allocated area.
82 * @height: the height of the widget's allocated area.
84 * A <structname>GtkAllocation</structname> of a widget represents region
85 * which has been allocated to the widget by its parent. It is a subregion
86 * of its parents allocation. See <xref linkend="geometry-management"/> for
89 typedef GdkRectangle GtkAllocation;
93 * @widget: the widget to operate on
94 * @data: user-supplied data
96 * The type of the callback functions used for e.g. iterating over
97 * the children of a container, see gtk_container_foreach().
99 typedef void (*GtkCallback) (GtkWidget *widget,
104 * @width: the widget's desired width
105 * @height: the widget's desired height
107 * A <structname>GtkRequisition</structname> represents the desired size of a widget. See
108 * <xref linkend="geometry-management"/> for more information.
110 struct _GtkRequisition
116 /* The widget is the base of the tree for displayable objects.
117 * (A displayable object is one which takes up some amount
118 * of screen real estate). It provides a common base and interface
119 * which actual widgets must adhere to.
123 GInitiallyUnowned parent_instance;
125 GtkWidgetPrivate *priv;
130 * @parent_class: The object class structure needs to be the first
131 * element in the widget class structure in order for the class mechanism
132 * to work correctly. This allows a GtkWidgetClass pointer to be cast to
133 * a GObjectClass pointer.
134 * @activate_signal: The signal to emit when a widget of this class is
135 * activated, gtk_widget_activate() handles the emission.
136 * Implementation of this signal is optional.
137 * @get_request_mode: This allows a widget to tell its parent container whether
138 * it prefers to be allocated in %GTK_SIZE_REQUEST_HEIGHT_FOR_WIDTH or
139 * %GTK_SIZE_REQUEST_WIDTH_FOR_HEIGHT mode.
140 * %GTK_SIZE_REQUEST_HEIGHT_FOR_WIDTH means the widget prefers to have
141 * #GtkWidgetClass.get_preferred_width() called and then
142 * #GtkWidgetClass.get_preferred_height_for_width().
143 * %GTK_SIZE_REQUEST_CONSTANT_SIZE disables any height-for-width or
144 * width-for-height geometry management for a said widget and is the
146 * It's important to note (as described below) that any widget
147 * which trades height-for-width or width-for-height must respond properly
148 * to both of the virtual methods #GtkWidgetClass.get_preferred_height_for_width()
149 * and #GtkWidgetClass.get_preferred_width_for_height() since it might be
150 * queried in either #GtkSizeRequestMode by its parent container.
151 * @get_preferred_height: This is called by containers to obtain the minimum
152 * and natural height of a widget. A widget that does not actually trade
153 * any height for width or width for height only has to implement these
154 * two virtual methods (#GtkWidgetClass.get_preferred_width() and
155 * #GtkWidgetClass.get_preferred_height()).
156 * @get_preferred_width_for_height: This is analogous to
157 * #GtkWidgetClass.get_preferred_height_for_width() except that it
158 * operates in the oposite orientation. It's rare that a widget actually
159 * does %GTK_SIZE_REQUEST_WIDTH_FOR_HEIGHT requests but this can happen
160 * when, for example, a widget or container gets additional columns to
161 * compensate for a smaller allocated height.
162 * @get_preferred_width: This is called by containers to obtain the minimum
163 * and natural width of a widget. A widget will never be allocated a width
164 * less than its minimum and will only ever be allocated a width greater
165 * than the natural width once all of the said widget's siblings have
166 * received their natural widths.
167 * Furthermore, a widget will only ever be allocated a width greater than
168 * its natural width if it was configured to receive extra expand space
169 * from its parent container.
170 * @get_preferred_height_for_width: This is similar to
171 * #GtkWidgetClass.get_preferred_height() except that it is passed a
172 * contextual width to request height for. By implementing this virtual
173 * method it is possible for a #GtkLabel to tell its parent how much height
174 * would be required if the label were to be allocated a said width.
175 * @adjust_size_request: Convert an initial size request from a widget's
176 * #GtkSizeRequest virtual method implementations into a size request to
177 * be used by parent containers in laying out the widget.
178 * adjust_size_request adjusts <emphasis>from</emphasis> a child widget's
179 * original request <emphasis>to</emphasis> what a parent container should
180 * use for layout. The @for_size argument will be -1 if the request should
181 * not be for a particular size in the opposing orientation, i.e. if the
182 * request is not height-for-width or width-for-height. If @for_size is
183 * greater than -1, it is the proposed allocation in the opposing
184 * orientation that we need the request for. Implementations of
185 * adjust_size_request should chain up to the default implementation,
186 * which applies #GtkWidget's margin properties and imposes any values
187 * from gtk_widget_set_size_request(). Chaining up should be last,
188 * <emphasis>after</emphasis> your subclass adjusts the request, so
189 * #GtkWidget can apply constraints and add the margin properly.
190 * @adjust_size_allocation: Convert an initial size allocation assigned
191 * by a #GtkContainer using gtk_widget_size_allocate(), into an actual
192 * size allocation to be used by the widget. adjust_size_allocation
193 * adjusts <emphasis>to</emphasis> a child widget's actual allocation
194 * <emphasis>from</emphasis> what a parent container computed for the
195 * child. The adjusted allocation must be entirely within the original
196 * allocation. In any custom implementation, chain up to the default
197 * #GtkWidget implementation of this method, which applies the margin
198 * and alignment properties of #GtkWidget. Chain up
199 * <emphasis>before</emphasis> performing your own adjustments so your
200 * own adjustments remove more allocation after the #GtkWidget base
201 * class has already removed margin and alignment. The natural size
202 * passed in should be adjusted in the same way as the allocated size,
203 * which allows adjustments to perform alignments or other changes
204 * based on natural size.
206 struct _GtkWidgetClass
208 GInitiallyUnownedClass parent_class;
212 guint activate_signal;
214 /* seldomly overidden */
215 void (*dispatch_child_properties_changed) (GtkWidget *widget,
217 GParamSpec **pspecs);
220 void (* destroy) (GtkWidget *widget);
221 void (* show) (GtkWidget *widget);
222 void (* show_all) (GtkWidget *widget);
223 void (* hide) (GtkWidget *widget);
224 void (* map) (GtkWidget *widget);
225 void (* unmap) (GtkWidget *widget);
226 void (* realize) (GtkWidget *widget);
227 void (* unrealize) (GtkWidget *widget);
228 void (* size_allocate) (GtkWidget *widget,
229 GtkAllocation *allocation);
230 void (* state_changed) (GtkWidget *widget,
231 GtkStateType previous_state);
232 void (* state_flags_changed) (GtkWidget *widget,
233 GtkStateFlags previous_state_flags);
234 void (* parent_set) (GtkWidget *widget,
235 GtkWidget *previous_parent);
236 void (* hierarchy_changed) (GtkWidget *widget,
237 GtkWidget *previous_toplevel);
238 void (* style_set) (GtkWidget *widget,
239 GtkStyle *previous_style);
240 void (* direction_changed) (GtkWidget *widget,
241 GtkTextDirection previous_direction);
242 void (* grab_notify) (GtkWidget *widget,
243 gboolean was_grabbed);
244 void (* child_notify) (GtkWidget *widget,
246 gboolean (* draw) (GtkWidget *widget,
250 GtkSizeRequestMode (* get_request_mode) (GtkWidget *widget);
252 void (* get_preferred_height) (GtkWidget *widget,
253 gint *minimum_height,
254 gint *natural_height);
255 void (* get_preferred_width_for_height) (GtkWidget *widget,
258 gint *natural_width);
259 void (* get_preferred_width) (GtkWidget *widget,
261 gint *natural_width);
262 void (* get_preferred_height_for_width) (GtkWidget *widget,
264 gint *minimum_height,
265 gint *natural_height);
268 gboolean (* mnemonic_activate) (GtkWidget *widget,
269 gboolean group_cycling);
272 void (* grab_focus) (GtkWidget *widget);
273 gboolean (* focus) (GtkWidget *widget,
274 GtkDirectionType direction);
276 /* keyboard navigation */
277 void (* move_focus) (GtkWidget *widget,
278 GtkDirectionType direction);
279 gboolean (* keynav_failed) (GtkWidget *widget,
280 GtkDirectionType direction);
283 gboolean (* event) (GtkWidget *widget,
285 gboolean (* button_press_event) (GtkWidget *widget,
286 GdkEventButton *event);
287 gboolean (* button_release_event) (GtkWidget *widget,
288 GdkEventButton *event);
289 gboolean (* scroll_event) (GtkWidget *widget,
290 GdkEventScroll *event);
291 gboolean (* motion_notify_event) (GtkWidget *widget,
292 GdkEventMotion *event);
293 gboolean (* delete_event) (GtkWidget *widget,
295 gboolean (* destroy_event) (GtkWidget *widget,
297 gboolean (* key_press_event) (GtkWidget *widget,
299 gboolean (* key_release_event) (GtkWidget *widget,
301 gboolean (* enter_notify_event) (GtkWidget *widget,
302 GdkEventCrossing *event);
303 gboolean (* leave_notify_event) (GtkWidget *widget,
304 GdkEventCrossing *event);
305 gboolean (* configure_event) (GtkWidget *widget,
306 GdkEventConfigure *event);
307 gboolean (* focus_in_event) (GtkWidget *widget,
308 GdkEventFocus *event);
309 gboolean (* focus_out_event) (GtkWidget *widget,
310 GdkEventFocus *event);
311 gboolean (* map_event) (GtkWidget *widget,
313 gboolean (* unmap_event) (GtkWidget *widget,
315 gboolean (* property_notify_event) (GtkWidget *widget,
316 GdkEventProperty *event);
317 gboolean (* selection_clear_event) (GtkWidget *widget,
318 GdkEventSelection *event);
319 gboolean (* selection_request_event) (GtkWidget *widget,
320 GdkEventSelection *event);
321 gboolean (* selection_notify_event) (GtkWidget *widget,
322 GdkEventSelection *event);
323 gboolean (* proximity_in_event) (GtkWidget *widget,
324 GdkEventProximity *event);
325 gboolean (* proximity_out_event) (GtkWidget *widget,
326 GdkEventProximity *event);
327 gboolean (* visibility_notify_event) (GtkWidget *widget,
328 GdkEventVisibility *event);
329 gboolean (* window_state_event) (GtkWidget *widget,
330 GdkEventWindowState *event);
331 gboolean (* damage_event) (GtkWidget *widget,
332 GdkEventExpose *event);
333 gboolean (* grab_broken_event) (GtkWidget *widget,
334 GdkEventGrabBroken *event);
337 void (* selection_get) (GtkWidget *widget,
338 GtkSelectionData *selection_data,
341 void (* selection_received) (GtkWidget *widget,
342 GtkSelectionData *selection_data,
345 /* Source side drag signals */
346 void (* drag_begin) (GtkWidget *widget,
347 GdkDragContext *context);
348 void (* drag_end) (GtkWidget *widget,
349 GdkDragContext *context);
350 void (* drag_data_get) (GtkWidget *widget,
351 GdkDragContext *context,
352 GtkSelectionData *selection_data,
355 void (* drag_data_delete) (GtkWidget *widget,
356 GdkDragContext *context);
358 /* Target side drag signals */
359 void (* drag_leave) (GtkWidget *widget,
360 GdkDragContext *context,
362 gboolean (* drag_motion) (GtkWidget *widget,
363 GdkDragContext *context,
367 gboolean (* drag_drop) (GtkWidget *widget,
368 GdkDragContext *context,
372 void (* drag_data_received) (GtkWidget *widget,
373 GdkDragContext *context,
376 GtkSelectionData *selection_data,
379 gboolean (* drag_failed) (GtkWidget *widget,
380 GdkDragContext *context,
381 GtkDragResult result);
383 /* Signals used only for keybindings */
384 gboolean (* popup_menu) (GtkWidget *widget);
386 /* If a widget has multiple tooltips/whatsthis, it should show the
387 * one for the current focus location, or if that doesn't make
388 * sense, should cycle through them showing each tip alongside
389 * whatever piece of the widget it applies to.
391 gboolean (* show_help) (GtkWidget *widget,
392 GtkWidgetHelpType help_type);
394 /* accessibility support
396 AtkObject * (* get_accessible) (GtkWidget *widget);
398 void (* screen_changed) (GtkWidget *widget,
399 GdkScreen *previous_screen);
400 gboolean (* can_activate_accel) (GtkWidget *widget,
404 void (* composited_changed) (GtkWidget *widget);
406 gboolean (* query_tooltip) (GtkWidget *widget,
409 gboolean keyboard_tooltip,
410 GtkTooltip *tooltip);
412 void (* compute_expand) (GtkWidget *widget,
414 gboolean *vexpand_p);
416 void (* adjust_size_request) (GtkWidget *widget,
417 GtkOrientation orientation,
420 void (* adjust_size_allocation) (GtkWidget *widget,
421 GtkOrientation orientation,
425 gint *allocated_size);
427 void (* style_updated) (GtkWidget *widget);
431 /* Padding for future expansion */
432 void (*_gtk_reserved1) (void);
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 const gchar* _gtk_widget_get_accel_path (GtkWidget *widget,
531 GList* gtk_widget_list_accel_closures (GtkWidget *widget);
532 gboolean gtk_widget_can_activate_accel (GtkWidget *widget,
534 gboolean gtk_widget_mnemonic_activate (GtkWidget *widget,
535 gboolean group_cycling);
536 gboolean gtk_widget_event (GtkWidget *widget,
538 gint gtk_widget_send_expose (GtkWidget *widget,
540 gboolean gtk_widget_send_focus_change (GtkWidget *widget,
543 gboolean gtk_widget_activate (GtkWidget *widget);
545 void gtk_widget_reparent (GtkWidget *widget,
546 GtkWidget *new_parent);
547 gboolean gtk_widget_intersect (GtkWidget *widget,
548 const GdkRectangle *area,
549 GdkRectangle *intersection);
550 cairo_region_t *gtk_widget_region_intersect (GtkWidget *widget,
551 const cairo_region_t *region);
553 void gtk_widget_freeze_child_notify (GtkWidget *widget);
554 void gtk_widget_child_notify (GtkWidget *widget,
555 const gchar *child_property);
556 void gtk_widget_thaw_child_notify (GtkWidget *widget);
558 void gtk_widget_set_can_focus (GtkWidget *widget,
560 gboolean gtk_widget_get_can_focus (GtkWidget *widget);
561 gboolean gtk_widget_has_focus (GtkWidget *widget);
562 gboolean gtk_widget_is_focus (GtkWidget *widget);
563 void gtk_widget_grab_focus (GtkWidget *widget);
565 void gtk_widget_set_can_default (GtkWidget *widget,
566 gboolean can_default);
567 gboolean gtk_widget_get_can_default (GtkWidget *widget);
568 gboolean gtk_widget_has_default (GtkWidget *widget);
569 void gtk_widget_grab_default (GtkWidget *widget);
571 void gtk_widget_set_receives_default (GtkWidget *widget,
572 gboolean receives_default);
573 gboolean gtk_widget_get_receives_default (GtkWidget *widget);
575 gboolean gtk_widget_has_grab (GtkWidget *widget);
577 gboolean gtk_widget_device_is_shadowed (GtkWidget *widget,
581 void gtk_widget_set_name (GtkWidget *widget,
583 G_CONST_RETURN gchar* gtk_widget_get_name (GtkWidget *widget);
585 void gtk_widget_set_state (GtkWidget *widget,
587 GtkStateType gtk_widget_get_state (GtkWidget *widget);
589 void gtk_widget_set_state_flags (GtkWidget *widget,
592 void gtk_widget_unset_state_flags (GtkWidget *widget,
593 GtkStateFlags flags);
594 GtkStateFlags gtk_widget_get_state_flags (GtkWidget *widget);
596 void gtk_widget_set_sensitive (GtkWidget *widget,
598 gboolean gtk_widget_get_sensitive (GtkWidget *widget);
599 gboolean gtk_widget_is_sensitive (GtkWidget *widget);
601 void gtk_widget_set_visible (GtkWidget *widget,
603 gboolean gtk_widget_get_visible (GtkWidget *widget);
605 void gtk_widget_set_has_window (GtkWidget *widget,
606 gboolean has_window);
607 gboolean gtk_widget_get_has_window (GtkWidget *widget);
609 gboolean gtk_widget_is_toplevel (GtkWidget *widget);
610 gboolean gtk_widget_is_drawable (GtkWidget *widget);
611 void gtk_widget_set_realized (GtkWidget *widget,
613 gboolean gtk_widget_get_realized (GtkWidget *widget);
614 void gtk_widget_set_mapped (GtkWidget *widget,
616 gboolean gtk_widget_get_mapped (GtkWidget *widget);
618 void gtk_widget_set_app_paintable (GtkWidget *widget,
619 gboolean app_paintable);
620 gboolean gtk_widget_get_app_paintable (GtkWidget *widget);
622 void gtk_widget_set_double_buffered (GtkWidget *widget,
623 gboolean double_buffered);
624 gboolean gtk_widget_get_double_buffered (GtkWidget *widget);
626 void gtk_widget_set_redraw_on_allocate (GtkWidget *widget,
627 gboolean redraw_on_allocate);
629 void gtk_widget_set_parent (GtkWidget *widget,
631 GtkWidget * gtk_widget_get_parent (GtkWidget *widget);
633 void gtk_widget_set_parent_window (GtkWidget *widget,
634 GdkWindow *parent_window);
635 GdkWindow * gtk_widget_get_parent_window (GtkWidget *widget);
637 void gtk_widget_set_child_visible (GtkWidget *widget,
638 gboolean is_visible);
639 gboolean gtk_widget_get_child_visible (GtkWidget *widget);
641 void gtk_widget_set_window (GtkWidget *widget,
643 GdkWindow * gtk_widget_get_window (GtkWidget *widget);
645 int gtk_widget_get_allocated_width (GtkWidget *widget);
646 int gtk_widget_get_allocated_height (GtkWidget *widget);
648 void gtk_widget_get_allocation (GtkWidget *widget,
649 GtkAllocation *allocation);
650 void gtk_widget_set_allocation (GtkWidget *widget,
651 const GtkAllocation *allocation);
653 void gtk_widget_get_requisition (GtkWidget *widget,
654 GtkRequisition *requisition);
656 gboolean gtk_widget_child_focus (GtkWidget *widget,
657 GtkDirectionType direction);
658 gboolean gtk_widget_keynav_failed (GtkWidget *widget,
659 GtkDirectionType direction);
660 void gtk_widget_error_bell (GtkWidget *widget);
662 void gtk_widget_set_size_request (GtkWidget *widget,
665 void gtk_widget_get_size_request (GtkWidget *widget,
668 void gtk_widget_set_events (GtkWidget *widget,
670 void gtk_widget_add_events (GtkWidget *widget,
672 void gtk_widget_set_device_events (GtkWidget *widget,
674 GdkEventMask events);
675 void gtk_widget_add_device_events (GtkWidget *widget,
677 GdkEventMask events);
679 void gtk_widget_set_device_enabled (GtkWidget *widget,
682 gboolean gtk_widget_get_device_enabled (GtkWidget *widget,
685 GtkWidget* gtk_widget_get_toplevel (GtkWidget *widget);
686 GtkWidget* gtk_widget_get_ancestor (GtkWidget *widget,
688 GdkVisual* gtk_widget_get_visual (GtkWidget *widget);
689 void gtk_widget_set_visual (GtkWidget *widget,
692 GdkScreen * gtk_widget_get_screen (GtkWidget *widget);
693 gboolean gtk_widget_has_screen (GtkWidget *widget);
694 GdkDisplay * gtk_widget_get_display (GtkWidget *widget);
695 GdkWindow * gtk_widget_get_root_window (GtkWidget *widget);
696 GtkSettings* gtk_widget_get_settings (GtkWidget *widget);
697 GtkClipboard *gtk_widget_get_clipboard (GtkWidget *widget,
701 /* Expand flags and related support */
702 gboolean gtk_widget_get_hexpand (GtkWidget *widget);
703 void gtk_widget_set_hexpand (GtkWidget *widget,
705 gboolean gtk_widget_get_hexpand_set (GtkWidget *widget);
706 void gtk_widget_set_hexpand_set (GtkWidget *widget,
708 gboolean gtk_widget_get_vexpand (GtkWidget *widget);
709 void gtk_widget_set_vexpand (GtkWidget *widget,
711 gboolean gtk_widget_get_vexpand_set (GtkWidget *widget);
712 void gtk_widget_set_vexpand_set (GtkWidget *widget,
714 void gtk_widget_queue_compute_expand (GtkWidget *widget);
715 gboolean gtk_widget_compute_expand (GtkWidget *widget,
716 GtkOrientation orientation);
719 /* Multidevice support */
720 gboolean gtk_widget_get_support_multidevice (GtkWidget *widget);
721 void gtk_widget_set_support_multidevice (GtkWidget *widget,
722 gboolean support_multidevice);
724 /* Accessibility support */
725 AtkObject* gtk_widget_get_accessible (GtkWidget *widget);
728 /* Margin and alignment */
729 GtkAlign gtk_widget_get_halign (GtkWidget *widget);
730 void gtk_widget_set_halign (GtkWidget *widget,
732 GtkAlign gtk_widget_get_valign (GtkWidget *widget);
733 void gtk_widget_set_valign (GtkWidget *widget,
735 gint gtk_widget_get_margin_left (GtkWidget *widget);
736 void gtk_widget_set_margin_left (GtkWidget *widget,
738 gint gtk_widget_get_margin_right (GtkWidget *widget);
739 void gtk_widget_set_margin_right (GtkWidget *widget,
741 gint gtk_widget_get_margin_top (GtkWidget *widget);
742 void gtk_widget_set_margin_top (GtkWidget *widget,
744 gint gtk_widget_get_margin_bottom (GtkWidget *widget);
745 void gtk_widget_set_margin_bottom (GtkWidget *widget,
749 gint gtk_widget_get_events (GtkWidget *widget);
750 GdkEventMask gtk_widget_get_device_events (GtkWidget *widget,
752 void gtk_widget_get_pointer (GtkWidget *widget,
756 gboolean gtk_widget_is_ancestor (GtkWidget *widget,
757 GtkWidget *ancestor);
759 gboolean gtk_widget_translate_coordinates (GtkWidget *src_widget,
760 GtkWidget *dest_widget,
766 /* Hide widget and return TRUE.
768 gboolean gtk_widget_hide_on_delete (GtkWidget *widget);
770 /* Functions to override widget styling */
771 void gtk_widget_override_color (GtkWidget *widget,
773 const GdkRGBA *color);
774 void gtk_widget_override_background_color (GtkWidget *widget,
776 const GdkRGBA *color);
778 void gtk_widget_override_font (GtkWidget *widget,
779 const PangoFontDescription *font_desc);
781 void gtk_widget_override_symbolic_color (GtkWidget *widget,
783 const GdkRGBA *color);
784 void gtk_widget_override_cursor (GtkWidget *widget,
785 const GdkRGBA *cursor,
786 const GdkRGBA *secondary_cursor);
788 void gtk_widget_reset_style (GtkWidget *widget);
790 #if !defined(GTK_DISABLE_DEPRECATED) || defined(GTK_COMPILATION)
792 void gtk_widget_style_attach (GtkWidget *widget);
796 gboolean gtk_widget_has_rc_style (GtkWidget *widget);
797 void gtk_widget_set_style (GtkWidget *widget,
799 void gtk_widget_ensure_style (GtkWidget *widget);
800 GtkStyle * gtk_widget_get_style (GtkWidget *widget);
802 void gtk_widget_modify_style (GtkWidget *widget,
804 GtkRcStyle *gtk_widget_get_modifier_style (GtkWidget *widget);
805 void gtk_widget_modify_fg (GtkWidget *widget,
807 const GdkColor *color);
808 void gtk_widget_modify_bg (GtkWidget *widget,
810 const GdkColor *color);
811 void gtk_widget_modify_text (GtkWidget *widget,
813 const GdkColor *color);
814 void gtk_widget_modify_base (GtkWidget *widget,
816 const GdkColor *color);
817 void gtk_widget_modify_cursor (GtkWidget *widget,
818 const GdkColor *primary,
819 const GdkColor *secondary);
820 void gtk_widget_modify_font (GtkWidget *widget,
821 PangoFontDescription *font_desc);
823 /* Descend recursively and set rc-style on all widgets without user styles */
824 void gtk_widget_reset_rc_styles (GtkWidget *widget);
826 /* Set certain default values to be used at widget creation time */
827 GtkStyle* gtk_widget_get_default_style (void);
829 /* Compute a widget's path in the form "GtkWindow.MyLabel", and
830 * return newly alocated strings.
832 void gtk_widget_path (GtkWidget *widget,
835 gchar **path_reversed);
836 void gtk_widget_class_path (GtkWidget *widget,
839 gchar **path_reversed);
841 GdkPixbuf *gtk_widget_render_icon (GtkWidget *widget,
842 const gchar *stock_id,
844 const gchar *detail);
845 #endif /* GTK_DISABLE_DEPRECATED */
847 PangoContext *gtk_widget_create_pango_context (GtkWidget *widget);
848 PangoContext *gtk_widget_get_pango_context (GtkWidget *widget);
849 PangoLayout *gtk_widget_create_pango_layout (GtkWidget *widget,
852 GdkPixbuf *gtk_widget_render_icon_pixbuf (GtkWidget *widget,
853 const gchar *stock_id,
856 /* handle composite names for GTK_COMPOSITE_CHILD widgets,
857 * the returned name is newly allocated.
859 void gtk_widget_set_composite_name (GtkWidget *widget,
861 gchar* gtk_widget_get_composite_name (GtkWidget *widget);
863 /* Push/pop pairs, to change default values upon a widget's creation.
864 * This will override the values that got set by the
865 * gtk_widget_set_default_* () functions.
867 void gtk_widget_push_composite_child (void);
868 void gtk_widget_pop_composite_child (void);
870 /* widget style properties
872 void gtk_widget_class_install_style_property (GtkWidgetClass *klass,
874 void gtk_widget_class_install_style_property_parser (GtkWidgetClass *klass,
876 GtkRcPropertyParser parser);
877 GParamSpec* gtk_widget_class_find_style_property (GtkWidgetClass *klass,
878 const gchar *property_name);
879 GParamSpec** gtk_widget_class_list_style_properties (GtkWidgetClass *klass,
880 guint *n_properties);
881 void gtk_widget_style_get_property (GtkWidget *widget,
882 const gchar *property_name,
884 void gtk_widget_style_get_valist (GtkWidget *widget,
885 const gchar *first_property_name,
887 void gtk_widget_style_get (GtkWidget *widget,
888 const gchar *first_property_name,
889 ...) G_GNUC_NULL_TERMINATED;
891 /* Functions for setting directionality for widgets */
893 void gtk_widget_set_direction (GtkWidget *widget,
894 GtkTextDirection dir);
895 GtkTextDirection gtk_widget_get_direction (GtkWidget *widget);
897 void gtk_widget_set_default_direction (GtkTextDirection dir);
898 GtkTextDirection gtk_widget_get_default_direction (void);
900 /* Compositing manager functionality */
901 gboolean gtk_widget_is_composited (GtkWidget *widget);
903 /* Counterpart to gdk_window_shape_combine_region.
905 void gtk_widget_shape_combine_region (GtkWidget *widget,
906 cairo_region_t *region);
907 void gtk_widget_input_shape_combine_region (GtkWidget *widget,
908 cairo_region_t *region);
910 GList* gtk_widget_list_mnemonic_labels (GtkWidget *widget);
911 void gtk_widget_add_mnemonic_label (GtkWidget *widget,
913 void gtk_widget_remove_mnemonic_label (GtkWidget *widget,
916 void gtk_widget_set_tooltip_window (GtkWidget *widget,
917 GtkWindow *custom_window);
918 GtkWindow *gtk_widget_get_tooltip_window (GtkWidget *widget);
919 void gtk_widget_trigger_tooltip_query (GtkWidget *widget);
920 void gtk_widget_set_tooltip_text (GtkWidget *widget,
922 gchar * gtk_widget_get_tooltip_text (GtkWidget *widget);
923 void gtk_widget_set_tooltip_markup (GtkWidget *widget,
924 const gchar *markup);
925 gchar * gtk_widget_get_tooltip_markup (GtkWidget *widget);
926 void gtk_widget_set_has_tooltip (GtkWidget *widget,
927 gboolean has_tooltip);
928 gboolean gtk_widget_get_has_tooltip (GtkWidget *widget);
930 gboolean gtk_cairo_should_draw_window (cairo_t *cr,
932 void gtk_cairo_transform_to_window (cairo_t *cr,
936 GType gtk_requisition_get_type (void) G_GNUC_CONST;
937 GtkRequisition *gtk_requisition_new (void) G_GNUC_MALLOC;
938 GtkRequisition *gtk_requisition_copy (const GtkRequisition *requisition);
939 void gtk_requisition_free (GtkRequisition *requisition);
941 GdkEventExpose * _gtk_cairo_get_event (cairo_t *cr);
943 void _gtk_widget_draw_internal (GtkWidget *widget,
945 gboolean clip_to_size);
946 void _gtk_widget_set_has_default (GtkWidget *widget,
947 gboolean has_default);
948 void _gtk_widget_set_has_grab (GtkWidget *widget,
950 void _gtk_widget_set_is_toplevel (GtkWidget *widget,
951 gboolean is_toplevel);
953 void _gtk_widget_grab_notify (GtkWidget *widget,
954 gboolean was_grabbed);
956 GtkWidgetAuxInfo *_gtk_widget_get_aux_info (GtkWidget *widget,
958 void _gtk_widget_propagate_hierarchy_changed (GtkWidget *widget,
959 GtkWidget *previous_toplevel);
960 void _gtk_widget_propagate_screen_changed (GtkWidget *widget,
961 GdkScreen *previous_screen);
962 void _gtk_widget_propagate_composited_changed (GtkWidget *widget);
964 void _gtk_widget_set_device_window (GtkWidget *widget,
966 GdkWindow *pointer_window);
967 GdkWindow *_gtk_widget_get_device_window (GtkWidget *widget,
969 GList * _gtk_widget_list_devices (GtkWidget *widget);
971 void _gtk_widget_synthesize_crossing (GtkWidget *from,
974 GdkCrossingMode mode);
976 gpointer _gtk_widget_peek_request_cache (GtkWidget *widget);
978 void _gtk_widget_buildable_finish_accelerator (GtkWidget *widget,
982 gboolean gtk_widget_in_destruction (GtkWidget *widget);
984 GtkStyleContext * gtk_widget_get_style_context (GtkWidget *widget);
986 GtkWidgetPath * gtk_widget_get_path (GtkWidget *widget);
991 #endif /* __GTK_WIDGET_H__ */