gtkwidget.h 65.9 KB
Newer Older
Cody Russell's avatar
Cody Russell committed
1
/* GTK - The GIMP Toolkit
Elliot Lee's avatar
Elliot Lee committed
2 3 4
 * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald
 *
 * This library is free software; you can redistribute it and/or
5
 * modify it under the terms of the GNU Lesser General Public
Elliot Lee's avatar
Elliot Lee committed
6 7 8 9 10
 * License as published by the Free Software Foundation; either
 * version 2 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * 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.
Elliot Lee's avatar
Elliot Lee committed
13
 *
14
 * You should have received a copy of the GNU Lesser General Public
Javier Jardón's avatar
Javier Jardón committed
15
 * License along with this library. If not, see <http://www.gnu.org/licenses/>.
Elliot Lee's avatar
Elliot Lee committed
16
 */
17 18

/*
19
 * Modified by the GTK+ Team and others 1997-2000.  See the AUTHORS
20 21
 * file for a list of people on the GTK+ Team.  See the ChangeLog
 * files for a list of changes.  These files are distributed with
22
 * GTK+ at ftp://ftp.gtk.org/pub/gtk/.
23 24
 */

25 26 27
#ifndef __GTK_WIDGET_H__
#define __GTK_WIDGET_H__

28
#if !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION)
29 30 31
#error "Only <gtk/gtk.h> can be included directly."
#endif

Elliot Lee's avatar
Elliot Lee committed
32
#include <gdk/gdk.h>
Tim Janik's avatar
Tim Janik committed
33
#include <gtk/gtkaccelgroup.h>
Matthias Clasen's avatar
Matthias Clasen committed
34
#include <gtk/gtkborder.h>
35
#include <gtk/gtktypes.h>
36
#include <atk/atk.h>
Elliot Lee's avatar
Elliot Lee committed
37

Matthias Clasen's avatar
Matthias Clasen committed
38
G_BEGIN_DECLS
39

40
/* Kinds of widget-specific help */
41 42 43
/**
 * GtkWidgetHelpType:
 * @GTK_WIDGET_HELP_TOOLTIP: Tooltip.
44
 * @GTK_WIDGET_HELP_WHATS_THIS: What’s this.
45 46 47
 *
 * Kinds of widget-specific help. Used by the ::show-help signal.
 */
48 49 50 51 52 53
typedef enum
{
  GTK_WIDGET_HELP_TOOLTIP,
  GTK_WIDGET_HELP_WHATS_THIS
} GtkWidgetHelpType;

54
/* Macro for casting a pointer to a GtkWidget or GtkWidgetClass pointer.
55
 * Macros for testing whether widget or klass are of type GTK_TYPE_WIDGET.
Elliot Lee's avatar
Elliot Lee committed
56
 */
57
#define GTK_TYPE_WIDGET			  (gtk_widget_get_type ())
Manish Singh's avatar
Manish Singh committed
58 59 60 61 62
#define GTK_WIDGET(widget)		  (G_TYPE_CHECK_INSTANCE_CAST ((widget), GTK_TYPE_WIDGET, GtkWidget))
#define GTK_WIDGET_CLASS(klass)		  (G_TYPE_CHECK_CLASS_CAST ((klass), GTK_TYPE_WIDGET, GtkWidgetClass))
#define GTK_IS_WIDGET(widget)		  (G_TYPE_CHECK_INSTANCE_TYPE ((widget), GTK_TYPE_WIDGET))
#define GTK_IS_WIDGET_CLASS(klass)	  (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_WIDGET))
#define GTK_WIDGET_GET_CLASS(obj)         (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_WIDGET, GtkWidgetClass))
Elliot Lee's avatar
Elliot Lee committed
63

64
#define GTK_TYPE_REQUISITION              (gtk_requisition_get_type ())
65

66 67 68
typedef struct _GtkWidgetPrivate       GtkWidgetPrivate;
typedef struct _GtkWidgetClass	       GtkWidgetClass;
typedef struct _GtkWidgetClassPrivate  GtkWidgetClassPrivate;
Elliot Lee's avatar
Elliot Lee committed
69

70 71
/**
 * GtkAllocation:
72 73 74 75
 * @x: the X position of the widget’s area relative to its parents allocation.
 * @y: the Y position of the widget’s area relative to its parents allocation.
 * @width: the width of the widget’s allocated area.
 * @height: the height of the widget’s allocated area.
76
 *
77
 * A #GtkAllocation-struct of a widget represents region
78
 * which has been allocated to the widget by its parent. It is a subregion
79
 * of its parents allocation. See
80
 * [GtkWidget’s geometry management section][geometry-management] for
81
 * more information.
82 83 84 85 86 87
 */
typedef 	GdkRectangle	   GtkAllocation;

/**
 * GtkCallback:
 * @widget: the widget to operate on
88
 * @data: (closure): user-supplied data
89 90 91 92 93 94 95
 *
 * The type of the callback functions used for e.g. iterating over
 * the children of a container, see gtk_container_foreach().
 */
typedef void    (*GtkCallback)     (GtkWidget        *widget,
				    gpointer          data);

96 97 98 99 100 101 102 103
/**
 * GtkTickCallback:
 * @widget: the widget
 * @frame_clock: the frame clock for the widget (same as calling gtk_widget_get_frame_clock())
 * @user_data: user data passed to gtk_widget_add_tick_callback().
 *
 * Callback type for adding a function to update animations. See gtk_widget_add_tick_callback().
 *
104 105
 * Returns: %G_SOURCE_CONTINUE if the tick callback should continue to be called,
 *  %G_SOURCE_REMOVE if the tick callback should be removed.
106 107
 *
 * Since: 3.8
108 109 110 111 112
 */
typedef gboolean (*GtkTickCallback) (GtkWidget     *widget,
                                     GdkFrameClock *frame_clock,
                                     gpointer       user_data);

113 114
/**
 * GtkRequisition:
115 116
 * @width: the widget’s desired width
 * @height: the widget’s desired height
117
 *
118
 * A #GtkRequisition-struct represents the desired size of a widget. See
119
 * [GtkWidget’s geometry management section][geometry-management] for
120
 * more information.
Elliot Lee's avatar
Elliot Lee committed
121 122 123
 */
struct _GtkRequisition
{
124 125
  gint width;
  gint height;
Elliot Lee's avatar
Elliot Lee committed
126 127 128 129 130 131 132 133 134
};

/* The widget is the base of the tree for displayable objects.
 *  (A displayable object is one which takes up some amount
 *  of screen real estate). It provides a common base and interface
 *  which actual widgets must adhere to.
 */
struct _GtkWidget
{
135
  GInitiallyUnowned parent_instance;
136

137 138
  /*< private >*/

139
  GtkWidgetPrivate *priv;
Elliot Lee's avatar
Elliot Lee committed
140 141
};

142 143
/**
 * GtkWidgetClass:
144 145 146
 * @parent_class: The object class structure needs to be the first
 *   element in the widget class structure in order for the class mechanism
 *   to work correctly. This allows a GtkWidgetClass pointer to be cast to
147
 *   a GObjectClass pointer.
148 149 150
 * @activate_signal: The signal to emit when a widget of this class is
 *   activated, gtk_widget_activate() handles the emission.
 *   Implementation of this signal is optional.
151 152 153 154 155 156 157 158 159 160 161 162 163 164 165
 * @dispatch_child_properties_changed: Seldomly overidden.
 * @destroy: Signals that all holders of a reference to the widget
 *   should release the reference that they hold.
 * @show: Signal emitted when widget is shown
 * @show_all: Recursively shows a widget, and any child widgets (if the widget is
 * a container).
 * @hide: Signal emitted when widget is hidden.
 * @map: Signal emitted when widget is going to be mapped, that is
 *   when the widget is visible (which is controlled with
 *   gtk_widget_set_visible()) and all its parents up to the toplevel
 *   widget are also visible.
 * @unmap: Signal emitted when widget is going to be unmapped, which
 *   means that either it or any of its parents up to the toplevel
 *   widget have been set as hidden.
 * @realize: Signal emitted when widget is associated with a
166
 *   #GdkWindow, which means that gtk_widget_realize() has been called or
167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190
 *   the widget has been mapped (that is, it is going to be drawn).
 * @unrealize: Signal emitted when the GdkWindow associated with
 *   widget is destroyed, which means that gtk_widget_unrealize() has
 *   been called or the widget has been unmapped (that is, it is going
 *   to be hidden).
 * @size_allocate: Signal emitted to get the widget allocation.
 * @state_changed: Signal emitted when the widget state
 *   changes. Deprecated: 3.0
 * @state_flags_changed: Signal emitted when the widget state changes,
 *   see gtk_widget_get_state_flags().
 * @parent_set: Signal emitted when a new parent has been set on a
 *   widget.
 * @hierarchy_changed: Signal emitted when the anchored state of a
 *   widget changes.
 * @style_set: Signal emitted when a new style has been set on a
 * widget. Deprecated: 3.0
 * @direction_changed: Signal emitted when the text direction of a
 *   widget changes.
 * @grab_notify: Signal emitted when a widget becomes shadowed by a
 *   GTK+ grab (not a pointer or keyboard grab) on another widget, or
 *   when it becomes unshadowed due to a grab being removed.
 * @child_notify: Signal emitted for each child property that has
 *   changed on an object.
 * @draw: Signal emitted when a widget is supposed to render itself.
191 192 193 194 195
 * @get_request_mode: This allows a widget to tell its parent container whether
 *   it prefers to be allocated in %GTK_SIZE_REQUEST_HEIGHT_FOR_WIDTH or
 *   %GTK_SIZE_REQUEST_WIDTH_FOR_HEIGHT mode.
 *   %GTK_SIZE_REQUEST_HEIGHT_FOR_WIDTH means the widget prefers to have
 *   #GtkWidgetClass.get_preferred_width() called and then
196 197 198 199
 *   #GtkWidgetClass.get_preferred_height_for_width().
 *   %GTK_SIZE_REQUEST_CONSTANT_SIZE disables any height-for-width or
 *   width-for-height geometry management for a said widget and is the
 *   default return.
200
 *   It’s important to note (as described below) that any widget
201 202 203 204
 *   which trades height-for-width or width-for-height must respond properly 
 *   to both of the virtual methods #GtkWidgetClass.get_preferred_height_for_width()
 *   and #GtkWidgetClass.get_preferred_width_for_height() since it might be 
 *   queried in either #GtkSizeRequestMode by its parent container.
205 206 207 208 209 210 211
 * @get_preferred_height: This is called by containers to obtain the minimum
 *   and natural height of a widget. A widget that does not actually trade
 *   any height for width or width for height only has to implement these
 *   two virtual methods (#GtkWidgetClass.get_preferred_width() and
 *   #GtkWidgetClass.get_preferred_height()).
 * @get_preferred_width_for_height: This is analogous to
 *   #GtkWidgetClass.get_preferred_height_for_width() except that it
212
 *   operates in the oposite orientation. It’s rare that a widget actually
213 214 215 216 217 218
 *   does %GTK_SIZE_REQUEST_WIDTH_FOR_HEIGHT requests but this can happen
 *   when, for example, a widget or container gets additional columns to
 *   compensate for a smaller allocated height.
 * @get_preferred_width: This is called by containers to obtain the minimum
 *   and natural width of a widget. A widget will never be allocated a width
 *   less than its minimum and will only ever be allocated a width greater
219
 *   than the natural width once all of the said widget’s siblings have
220 221 222 223 224 225 226 227 228
 *   received their natural widths.
 *   Furthermore, a widget will only ever be allocated a width greater than
 *   its natural width if it was configured to receive extra expand space
 *   from its parent container.
 * @get_preferred_height_for_width: This is similar to
 *   #GtkWidgetClass.get_preferred_height() except that it is passed a
 *   contextual width to request height for. By implementing this virtual
 *   method it is possible for a #GtkLabel to tell its parent how much height
 *   would be required if the label were to be allocated a said width.
229 230 231
 * @mnemonic_activate: Activates the @widget if @group_cycling is
 *   %FALSE, and just grabs the focus if @group_cycling is %TRUE.
 * @grab_focus: Causes @widget to have the keyboard focus for the
232
 *   #GtkWindow it’s inside.
233 234 235 236 237 238 239 240 241 242 243 244 245 246 247
 * @focus:
 * @move_focus: Signal emitted when a change of focus is requested
 * @keynav_failed: Signal emitted if keyboard navigation fails.
 * @event: The GTK+ main loop will emit three signals for each GDK
 *   event delivered to a widget: one generic ::event signal, another,
 *   more specific, signal that matches the type of event delivered
 *   (e.g. "key-press-event") and finally a generic "event-after"
 *   signal.
 * @button_press_event: Signal will be emitted when a button
 *   (typically from a mouse) is pressed.
 * @button_release_event: Signal will be emitted when a button
 *   (typically from a mouse) is released.
 * @scroll_event: Signal emitted when a button in the 4 to 7 range is
 *   pressed.
 * @motion_notify_event: Signal emitted when the pointer moves over
248
 *   the widget’s #GdkWindow.
249 250 251 252 253 254
 * @delete_event: Signal emitted if a user requests that a toplevel
 *   window is closed.
 * @destroy_event: Signal is emitted when a #GdkWindow is destroyed.
 * @key_press_event: Signal emitted when a key is pressed.
 * @key_release_event: Signal is emitted when a key is released.
 * @enter_notify_event: Signal event will be emitted when the pointer
255
 *   enters the widget’s window.
256
 * @leave_notify_event: Will be emitted when the pointer leaves the
257
 *   widget’s window.
258
 * @configure_event: Signal will be emitted when the size, position or
259
 *   stacking of the widget’s window has changed.
260
 * @focus_in_event: Signal emitted when the keyboard focus enters the
261
 * widget’s window.
262
 * @focus_out_event: Signal emitted when the keyboard focus leaves the
263 264 265
 * widget’s window.
 * @map_event: Signal emitted when the widget’s window is mapped.
 * @unmap_event: Signal will be emitted when the widget’s window is
266 267
 *   unmapped.
 * @property_notify_event: Signal will be emitted when a property on
268
 *   the widget’s window has been changed or deleted.
269
 * @selection_clear_event: Signal will be emitted when the the
270
 *   widget’s window has lost ownership of a selection.
271 272 273 274 275 276
 * @selection_request_event: Signal will be emitted when another
 *   client requests ownership of the selection owned by the widget's
 *   window.
 * @selection_notify_event:
 * @proximity_in_event:
 * @proximity_out_event:
277
 * @visibility_notify_event: Signal emitted when the widget’s window is
278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316
 *   obscured or unobscured.
 * @window_state_event: Signal emitted when the state of the toplevel
 *   window associated to the widget changes.
 * @damage_event: Signal emitted when a redirected window belonging to
 *   widget gets drawn into.
 * @grab_broken_event: Signal emitted when a pointer or keyboard grab
 *   on a window belonging to widget gets broken.
 * @selection_get:
 * @selection_received:
 * @drag_begin: Signal emitted on the drag source when a drag is
 *   started.
 * @drag_end: Signal emitted on the drag source when a drag is
 *   finished.
 * @drag_data_get: Signal emitted on the drag source when the drop
 *   site requests the data which is dragged.
 * @drag_data_delete: Signal emitted on the drag source when a drag
 *   with the action %GDK_ACTION_MOVE is successfully completed.
 * @drag_leave: Signal emitted on the drop site when the cursor leaves
 *   the widget.
 * @drag_motion: signal emitted on the drop site when the user moves
 *   the cursor over the widget during a drag.
 * @drag_drop: Signal emitted on the drop site when the user drops the
 *   data onto the widget.
 * @drag_data_received: Signal emitted on the drop site when the
 *   dragged data has been received.
 * @drag_failed: Signal emitted on the drag source when a drag has
 *   failed.
 * @popup_menu: Signal emitted whenever a widget should pop up a
 *   context menu.
 * @show_help:
 * @get_accessible: Returns the accessible object that describes the
 *   widget to an assistive technology.
 * @screen_changed: Signal emitted when the screen of a widget has
 *   changed.
 * @can_activate_accel: Signal allows applications and derived widgets
 *   to override the default GtkWidget handling for determining whether
 *   an accelerator can be activated.
 * @composited_changed: Signal emitted when the composited status of
 *   widgets screen changes. See gdk_screen_is_composited().
317 318
 * @query_tooltip: Signal emitted when “has-tooltip” is %TRUE and the
 *   hover timeout has expired with the cursor hovering “above”
319 320 321
 *   widget; or emitted when widget got focus in keyboard mode.
 * @compute_expand: Computes whether a container should give this
 *   widget extra space when possible.
322 323 324
 * @adjust_size_request: Convert an initial size request from a widget's
 *   #GtkSizeRequestMode virtual method implementations into a size request to
 *   be used by parent containers in laying out the widget.
325 326
 *   adjust_size_request adjusts from a child widget's
 *   original request to what a parent container should
327 328 329 330 331 332
 *   use for layout. The @for_size argument will be -1 if the request should
 *   not be for a particular size in the opposing orientation, i.e. if the
 *   request is not height-for-width or width-for-height. If @for_size is
 *   greater than -1, it is the proposed allocation in the opposing
 *   orientation that we need the request for. Implementations of
 *   adjust_size_request should chain up to the default implementation,
333
 *   which applies #GtkWidget’s margin properties and imposes any values
334
 *   from gtk_widget_set_size_request(). Chaining up should be last,
335
 *   after your subclass adjusts the request, so
336 337 338 339
 *   #GtkWidget can apply constraints and add the margin properly.
 * @adjust_size_allocation: Convert an initial size allocation assigned
 *   by a #GtkContainer using gtk_widget_size_allocate(), into an actual
 *   size allocation to be used by the widget. adjust_size_allocation
340
 *   adjusts to a child widget’s actual allocation
341
 *   from what a parent container computed for the
342 343 344 345
 *   child. The adjusted allocation must be entirely within the original
 *   allocation. In any custom implementation, chain up to the default
 *   #GtkWidget implementation of this method, which applies the margin
 *   and alignment properties of #GtkWidget. Chain up
346
 *   before performing your own adjustments so your
347 348 349 350 351
 *   own adjustments remove more allocation after the #GtkWidget base
 *   class has already removed margin and alignment. The natural size
 *   passed in should be adjusted in the same way as the allocated size,
 *   which allows adjustments to perform alignments or other changes
 *   based on natural size.
352 353 354 355 356 357 358 359 360
 * @style_updated: Signal emitted when the GtkStyleContext of a widget
 *   is changed.
 * @touch_event:
 * @get_preferred_height_and_baseline_for_width:
 * @adjust_baseline_request:
 * @adjust_baseline_allocation:
 * @queue_draw_region: Invalidates the area of widget defined by
 *   region by calling gdk_window_invalidate_region() on the widget's
 *   window and all its child windows.
361
 */
Elliot Lee's avatar
Elliot Lee committed
362 363
struct _GtkWidgetClass
{
364
  GInitiallyUnownedClass parent_class;
365 366

  /*< public >*/
367

368
  guint activate_signal;
369

Tim Janik's avatar
Tim Janik committed
370 371 372 373 374
  /* seldomly overidden */
  void (*dispatch_child_properties_changed) (GtkWidget   *widget,
					     guint        n_pspecs,
					     GParamSpec **pspecs);

Elliot Lee's avatar
Elliot Lee committed
375
  /* basics */
376
  void (* destroy)             (GtkWidget        *widget);
377 378 379 380 381 382 383 384 385 386 387
  void (* show)		       (GtkWidget        *widget);
  void (* show_all)            (GtkWidget        *widget);
  void (* hide)		       (GtkWidget        *widget);
  void (* map)		       (GtkWidget        *widget);
  void (* unmap)	       (GtkWidget        *widget);
  void (* realize)	       (GtkWidget        *widget);
  void (* unrealize)	       (GtkWidget        *widget);
  void (* size_allocate)       (GtkWidget        *widget,
				GtkAllocation    *allocation);
  void (* state_changed)       (GtkWidget        *widget,
				GtkStateType   	  previous_state);
388 389
  void (* state_flags_changed) (GtkWidget        *widget,
				GtkStateFlags  	  previous_state_flags);
390 391
  void (* parent_set)	       (GtkWidget        *widget,
				GtkWidget        *previous_parent);
392 393
  void (* hierarchy_changed)   (GtkWidget        *widget,
				GtkWidget        *previous_toplevel);
394 395 396 397
  void (* style_set)	       (GtkWidget        *widget,
				GtkStyle         *previous_style);
  void (* direction_changed)   (GtkWidget        *widget,
				GtkTextDirection  previous_direction);
398 399
  void (* grab_notify)         (GtkWidget        *widget,
				gboolean          was_grabbed);
Tim Janik's avatar
Tim Janik committed
400
  void (* child_notify)        (GtkWidget	 *widget,
401
				GParamSpec       *child_property);
Benjamin Otte's avatar
Benjamin Otte committed
402 403
  gboolean (* draw)	       (GtkWidget	 *widget,
                                cairo_t          *cr);
404

405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422
  /* size requests */
  GtkSizeRequestMode (* get_request_mode)               (GtkWidget      *widget);

  void               (* get_preferred_height)           (GtkWidget       *widget,
                                                         gint            *minimum_height,
                                                         gint            *natural_height);
  void               (* get_preferred_width_for_height) (GtkWidget       *widget,
                                                         gint             height,
                                                         gint            *minimum_width,
                                                         gint            *natural_width);
  void               (* get_preferred_width)            (GtkWidget       *widget,
                                                         gint            *minimum_width,
                                                         gint            *natural_width);
  void               (* get_preferred_height_for_width) (GtkWidget       *widget,
                                                         gint             width,
                                                         gint            *minimum_height,
                                                         gint            *natural_height);

423
  /* Mnemonics */
424 425 426
  gboolean (* mnemonic_activate)        (GtkWidget           *widget,
                                         gboolean             group_cycling);

427
  /* explicit focus */
428 429 430 431 432 433 434 435 436 437
  void     (* grab_focus)               (GtkWidget           *widget);
  gboolean (* focus)                    (GtkWidget           *widget,
                                         GtkDirectionType     direction);

  /* keyboard navigation */
  void     (* move_focus)               (GtkWidget           *widget,
                                         GtkDirectionType     direction);
  gboolean (* keynav_failed)            (GtkWidget           *widget,
                                         GtkDirectionType     direction);

Elliot Lee's avatar
Elliot Lee committed
438
  /* events */
439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486
  gboolean (* event)			(GtkWidget	     *widget,
					 GdkEvent	     *event);
  gboolean (* button_press_event)	(GtkWidget	     *widget,
					 GdkEventButton      *event);
  gboolean (* button_release_event)	(GtkWidget	     *widget,
					 GdkEventButton      *event);
  gboolean (* scroll_event)		(GtkWidget           *widget,
					 GdkEventScroll      *event);
  gboolean (* motion_notify_event)	(GtkWidget	     *widget,
					 GdkEventMotion      *event);
  gboolean (* delete_event)		(GtkWidget	     *widget,
					 GdkEventAny	     *event);
  gboolean (* destroy_event)		(GtkWidget	     *widget,
					 GdkEventAny	     *event);
  gboolean (* key_press_event)		(GtkWidget	     *widget,
					 GdkEventKey	     *event);
  gboolean (* key_release_event)	(GtkWidget	     *widget,
					 GdkEventKey	     *event);
  gboolean (* enter_notify_event)	(GtkWidget	     *widget,
					 GdkEventCrossing    *event);
  gboolean (* leave_notify_event)	(GtkWidget	     *widget,
					 GdkEventCrossing    *event);
  gboolean (* configure_event)		(GtkWidget	     *widget,
					 GdkEventConfigure   *event);
  gboolean (* focus_in_event)		(GtkWidget	     *widget,
					 GdkEventFocus       *event);
  gboolean (* focus_out_event)		(GtkWidget	     *widget,
					 GdkEventFocus       *event);
  gboolean (* map_event)		(GtkWidget	     *widget,
					 GdkEventAny	     *event);
  gboolean (* unmap_event)		(GtkWidget	     *widget,
					 GdkEventAny	     *event);
  gboolean (* property_notify_event)	(GtkWidget	     *widget,
					 GdkEventProperty    *event);
  gboolean (* selection_clear_event)	(GtkWidget	     *widget,
					 GdkEventSelection   *event);
  gboolean (* selection_request_event)	(GtkWidget	     *widget,
					 GdkEventSelection   *event);
  gboolean (* selection_notify_event)	(GtkWidget	     *widget,
					 GdkEventSelection   *event);
  gboolean (* proximity_in_event)	(GtkWidget	     *widget,
					 GdkEventProximity   *event);
  gboolean (* proximity_out_event)	(GtkWidget	     *widget,
					 GdkEventProximity   *event);
  gboolean (* visibility_notify_event)	(GtkWidget	     *widget,
					 GdkEventVisibility  *event);
  gboolean (* window_state_event)	(GtkWidget	     *widget,
					 GdkEventWindowState *event);
487 488 489 490 491
  gboolean (* damage_event)             (GtkWidget           *widget,
                                         GdkEventExpose      *event);
  gboolean (* grab_broken_event)        (GtkWidget           *widget,
                                         GdkEventGrabBroken  *event);

Elliot Lee's avatar
Elliot Lee committed
492
  /* selection */
493
  void     (* selection_get)       (GtkWidget          *widget,
494 495
				    GtkSelectionData   *selection_data,
				    guint               info,
496
				    guint               time_);
497
  void     (* selection_received)  (GtkWidget          *widget,
498
				    GtkSelectionData   *selection_data,
499
				    guint               time_);
500 501

  /* Source side drag signals */
502
  void     (* drag_begin)          (GtkWidget         *widget,
503
				    GdkDragContext     *context);
504
  void     (* drag_end)	           (GtkWidget	       *widget,
505
				    GdkDragContext     *context);
506
  void     (* drag_data_get)       (GtkWidget          *widget,
507 508 509
				    GdkDragContext     *context,
				    GtkSelectionData   *selection_data,
				    guint               info,
510
				    guint               time_);
511
  void     (* drag_data_delete)    (GtkWidget          *widget,
512 513 514
				    GdkDragContext     *context);

  /* Target side drag signals */
515
  void     (* drag_leave)          (GtkWidget          *widget,
516
				    GdkDragContext     *context,
517
				    guint               time_);
518 519 520 521
  gboolean (* drag_motion)         (GtkWidget	       *widget,
				    GdkDragContext     *context,
				    gint                x,
				    gint                y,
522
				    guint               time_);
523 524 525 526
  gboolean (* drag_drop)           (GtkWidget	       *widget,
				    GdkDragContext     *context,
				    gint                x,
				    gint                y,
527
				    guint               time_);
528
  void     (* drag_data_received)  (GtkWidget          *widget,
529
				    GdkDragContext     *context,
530 531
				    gint                x,
				    gint                y,
532 533
				    GtkSelectionData   *selection_data,
				    guint               info,
534
				    guint               time_);
535 536 537
  gboolean (* drag_failed)         (GtkWidget          *widget,
                                    GdkDragContext     *context,
                                    GtkDragResult       result);
538 539

  /* Signals used only for keybindings */
540
  gboolean (* popup_menu)          (GtkWidget          *widget);
541 542 543 544 545 546

  /* If a widget has multiple tooltips/whatsthis, it should show the
   * one for the current focus location, or if that doesn't make
   * sense, should cycle through them showing each tip alongside
   * whatever piece of the widget it applies to.
   */
547
  gboolean (* show_help)           (GtkWidget          *widget,
548
                                    GtkWidgetHelpType   help_type);
549 550

  /* accessibility support
551
   */
552
  AtkObject *  (* get_accessible)     (GtkWidget *widget);
553

554 555 556 557
  void         (* screen_changed)     (GtkWidget *widget,
                                       GdkScreen *previous_screen);
  gboolean     (* can_activate_accel) (GtkWidget *widget,
                                       guint      signal_id);
558

559

560
  void         (* composited_changed) (GtkWidget *widget);
561

Kristian Rietveld's avatar
Kristian Rietveld committed
562 563 564 565 566
  gboolean     (* query_tooltip)      (GtkWidget  *widget,
				       gint        x,
				       gint        y,
				       gboolean    keyboard_tooltip,
				       GtkTooltip *tooltip);
567

568 569 570 571
  void         (* compute_expand)     (GtkWidget  *widget,
                                       gboolean   *hexpand_p,
                                       gboolean   *vexpand_p);

572 573 574 575 576
  void         (* adjust_size_request)    (GtkWidget         *widget,
                                           GtkOrientation     orientation,
                                           gint              *minimum_size,
                                           gint              *natural_size);
  void         (* adjust_size_allocation) (GtkWidget         *widget,
577
                                           GtkOrientation     orientation,
578
                                           gint              *minimum_size,
579 580 581
                                           gint              *natural_size,
                                           gint              *allocated_pos,
                                           gint              *allocated_size);
582

583 584
  void         (* style_updated)          (GtkWidget *widget);

585 586 587
  gboolean     (* touch_event)            (GtkWidget     *widget,
                                           GdkEventTouch *event);

588 589 590 591 592 593 594 595 596 597 598
  void         (* get_preferred_height_and_baseline_for_width)  (GtkWidget     *widget,
								 gint           width,
								 gint          *minimum_height,
								 gint          *natural_height,
								 gint          *minimum_baseline,
								 gint          *natural_baseline);
  void         (* adjust_baseline_request)(GtkWidget         *widget,
                                           gint              *minimum_baseline,
                                           gint              *natural_baseline);
  void         (* adjust_baseline_allocation) (GtkWidget         *widget,
					       gint              *baseline);
599 600
  void         (*queue_draw_region)           (GtkWidget         *widget,
					       const cairo_region_t *region);
601

602 603
  /*< private >*/

604 605
  GtkWidgetClassPrivate *priv;

606
  /* Padding for future expansion */
607 608
  void (*_gtk_reserved6) (void);
  void (*_gtk_reserved7) (void);
Elliot Lee's avatar
Elliot Lee committed
609 610 611
};


612
GDK_AVAILABLE_IN_ALL
Manish Singh's avatar
Manish Singh committed
613
GType	   gtk_widget_get_type		  (void) G_GNUC_CONST;
614
GDK_AVAILABLE_IN_ALL
Manish Singh's avatar
Manish Singh committed
615
GtkWidget* gtk_widget_new		  (GType		type,
616
					   const gchar	       *first_property_name,
617
					   ...);
618
GDK_AVAILABLE_IN_ALL
619
void	   gtk_widget_destroy		  (GtkWidget	       *widget);
620
GDK_AVAILABLE_IN_ALL
621 622
void	   gtk_widget_destroyed		  (GtkWidget	       *widget,
					   GtkWidget	      **widget_pointer);
623
GDK_AVAILABLE_IN_ALL
624
void	   gtk_widget_unparent		  (GtkWidget	       *widget);
625
GDK_AVAILABLE_IN_ALL
626
void       gtk_widget_show                (GtkWidget           *widget);
627
GDK_AVAILABLE_IN_ALL
628
void       gtk_widget_hide                (GtkWidget           *widget);
629
GDK_AVAILABLE_IN_ALL
630
void       gtk_widget_show_now            (GtkWidget           *widget);
631
GDK_AVAILABLE_IN_ALL
632
void       gtk_widget_show_all            (GtkWidget           *widget);
633
GDK_AVAILABLE_IN_ALL
634
void       gtk_widget_set_no_show_all     (GtkWidget           *widget,
635
                                           gboolean             no_show_all);
636
GDK_AVAILABLE_IN_ALL
637
gboolean   gtk_widget_get_no_show_all     (GtkWidget           *widget);
638
GDK_AVAILABLE_IN_ALL
639
void	   gtk_widget_map		  (GtkWidget	       *widget);
640
GDK_AVAILABLE_IN_ALL
641
void	   gtk_widget_unmap		  (GtkWidget	       *widget);
642
GDK_AVAILABLE_IN_ALL
643
void	   gtk_widget_realize		  (GtkWidget	       *widget);
644
GDK_AVAILABLE_IN_ALL
645
void	   gtk_widget_unrealize		  (GtkWidget	       *widget);
646

647
GDK_AVAILABLE_IN_ALL
648 649
void       gtk_widget_draw                (GtkWidget           *widget,
                                           cairo_t             *cr);
650
/* Queuing draws */
651
GDK_AVAILABLE_IN_ALL
652
void	   gtk_widget_queue_draw	  (GtkWidget	       *widget);
653
GDK_AVAILABLE_IN_ALL
654 655 656 657 658
void	   gtk_widget_queue_draw_area	  (GtkWidget	       *widget,
					   gint                 x,
					   gint                 y,
					   gint                 width,
					   gint                 height);
659
GDK_AVAILABLE_IN_ALL
660
void	   gtk_widget_queue_draw_region   (GtkWidget	       *widget,
661
                                           const cairo_region_t*region);
662
GDK_AVAILABLE_IN_ALL
663
void	   gtk_widget_queue_resize	  (GtkWidget	       *widget);
664
GDK_AVAILABLE_IN_ALL
Soeren Sandmann's avatar
Soeren Sandmann committed
665
void	   gtk_widget_queue_resize_no_redraw (GtkWidget *widget);
666 667
GDK_AVAILABLE_IN_3_20
void       gtk_widget_queue_allocate      (GtkWidget           *widget);
668
GDK_AVAILABLE_IN_3_8
Owen W. Taylor's avatar
Owen W. Taylor committed
669 670
GdkFrameClock* gtk_widget_get_frame_clock (GtkWidget           *widget);

671
GDK_DEPRECATED_IN_3_0_FOR(gtk_widget_get_preferred_size)
672 673
void       gtk_widget_size_request        (GtkWidget           *widget,
                                           GtkRequisition      *requisition);
674
GDK_AVAILABLE_IN_ALL
675
void	   gtk_widget_size_allocate	  (GtkWidget	       *widget,
Elliot Lee's avatar
Elliot Lee committed
676
					   GtkAllocation       *allocation);
677 678 679 680
GDK_AVAILABLE_IN_3_10
void	   gtk_widget_size_allocate_with_baseline	  (GtkWidget	       *widget,
							   GtkAllocation       *allocation,
							   gint                 baseline);
681

682
GDK_AVAILABLE_IN_ALL
683
GtkSizeRequestMode  gtk_widget_get_request_mode               (GtkWidget      *widget);
684
GDK_AVAILABLE_IN_ALL
685 686 687
void                gtk_widget_get_preferred_width            (GtkWidget      *widget,
                                                               gint           *minimum_width,
                                                               gint           *natural_width);
688
GDK_AVAILABLE_IN_ALL
689 690 691 692
void                gtk_widget_get_preferred_height_for_width (GtkWidget      *widget,
                                                               gint            width,
                                                               gint           *minimum_height,
                                                               gint           *natural_height);
693
GDK_AVAILABLE_IN_ALL
694 695 696
void                gtk_widget_get_preferred_height           (GtkWidget      *widget,
                                                               gint           *minimum_height,
                                                               gint           *natural_height);
697
GDK_AVAILABLE_IN_ALL
698 699 700 701
void                gtk_widget_get_preferred_width_for_height (GtkWidget      *widget,
                                                               gint            height,
                                                               gint           *minimum_width,
                                                               gint           *natural_width);
702 703 704 705 706 707 708
GDK_AVAILABLE_IN_3_10
void   gtk_widget_get_preferred_height_and_baseline_for_width (GtkWidget     *widget,
							       gint           width,
							       gint          *minimum_height,
							       gint          *natural_height,
							       gint          *minimum_baseline,
							       gint          *natural_baseline);
709
GDK_AVAILABLE_IN_ALL
710 711 712 713
void                gtk_widget_get_preferred_size             (GtkWidget      *widget,
                                                               GtkRequisition *minimum_size,
                                                               GtkRequisition *natural_size);

714
GDK_DEPRECATED_IN_3_0_FOR(gtk_widget_get_preferred_size)
715 716
void       gtk_widget_get_child_requisition (GtkWidget         *widget,
                                             GtkRequisition    *requisition);
717
GDK_AVAILABLE_IN_ALL
Tim Janik's avatar
Tim Janik committed
718 719 720 721
void	   gtk_widget_add_accelerator	  (GtkWidget           *widget,
					   const gchar         *accel_signal,
					   GtkAccelGroup       *accel_group,
					   guint                accel_key,
722
					   GdkModifierType      accel_mods,
Tim Janik's avatar
Tim Janik committed
723
					   GtkAccelFlags        accel_flags);
724
GDK_AVAILABLE_IN_ALL
725
gboolean   gtk_widget_remove_accelerator  (GtkWidget           *widget,
Tim Janik's avatar
Tim Janik committed
726 727
					   GtkAccelGroup       *accel_group,
					   guint                accel_key,
728
					   GdkModifierType      accel_mods);
729
GDK_AVAILABLE_IN_ALL
730
void       gtk_widget_set_accel_path      (GtkWidget           *widget,
731 732
					   const gchar         *accel_path,
					   GtkAccelGroup       *accel_group);
733
GDK_AVAILABLE_IN_ALL
734
GList*     gtk_widget_list_accel_closures (GtkWidget	       *widget);
735
GDK_AVAILABLE_IN_ALL
736 737
gboolean   gtk_widget_can_activate_accel  (GtkWidget           *widget,
                                           guint                signal_id);
738
GDK_AVAILABLE_IN_ALL
739
gboolean   gtk_widget_mnemonic_activate   (GtkWidget           *widget,
740
					   gboolean             group_cycling);
741
GDK_AVAILABLE_IN_ALL
742
gboolean   gtk_widget_event		  (GtkWidget	       *widget,
743
					   GdkEvent	       *event);
744
GDK_AVAILABLE_IN_ALL
745 746
gint       gtk_widget_send_expose         (GtkWidget           *widget,
					   GdkEvent            *event);
747
GDK_AVAILABLE_IN_ALL
748 749
gboolean   gtk_widget_send_focus_change   (GtkWidget           *widget,
                                           GdkEvent            *event);
750

751
GDK_AVAILABLE_IN_ALL
752
gboolean   gtk_widget_activate		     (GtkWidget	       *widget);
753
     
754
GDK_DEPRECATED_IN_3_14
755 756
void	   gtk_widget_reparent		  (GtkWidget	       *widget,
					   GtkWidget	       *new_parent);
757
GDK_AVAILABLE_IN_ALL
758
gboolean   gtk_widget_intersect		  (GtkWidget	       *widget,
759
					   const GdkRectangle  *area,
760
					   GdkRectangle	       *intersection);
761
GDK_DEPRECATED_IN_3_14
762 763
cairo_region_t *gtk_widget_region_intersect	  (GtkWidget	       *widget,
					   const cairo_region_t     *region);
764

765
GDK_AVAILABLE_IN_ALL
Tim Janik's avatar
Tim Janik committed
766
void	gtk_widget_freeze_child_notify	  (GtkWidget	       *widget);
767
GDK_AVAILABLE_IN_ALL
Tim Janik's avatar
Tim Janik committed
768 769
void	gtk_widget_child_notify		  (GtkWidget	       *widget,
					   const gchar	       *child_property);
770
GDK_AVAILABLE_IN_ALL
Tim Janik's avatar
Tim Janik committed
771 772
void	gtk_widget_thaw_child_notify	  (GtkWidget	       *widget);

773
GDK_AVAILABLE_IN_ALL
774 775
void       gtk_widget_set_can_focus       (GtkWidget           *widget,
                                           gboolean             can_focus);
776
GDK_AVAILABLE_IN_ALL
777
gboolean   gtk_widget_get_can_focus       (GtkWidget           *widget);
778
GDK_AVAILABLE_IN_ALL
779
gboolean   gtk_widget_has_focus           (GtkWidget           *widget);
780
GDK_AVAILABLE_IN_ALL
781
gboolean   gtk_widget_is_focus            (GtkWidget           *widget);
782
GDK_AVAILABLE_IN_3_2
783
gboolean   gtk_widget_has_visible_focus   (GtkWidget           *widget);
784
GDK_AVAILABLE_IN_ALL
785
void       gtk_widget_grab_focus          (GtkWidget           *widget);
786 787 788 789 790
GDK_AVAILABLE_IN_3_20
void       gtk_widget_set_focus_on_click  (GtkWidget           *widget,
                                           gboolean             focus_on_click);
GDK_AVAILABLE_IN_3_20
gboolean   gtk_widget_get_focus_on_click  (GtkWidget           *widget);
791

792
GDK_AVAILABLE_IN_ALL
793 794
void       gtk_widget_set_can_default     (GtkWidget           *widget,
                                           gboolean             can_default);
795
GDK_AVAILABLE_IN_ALL
796
gboolean   gtk_widget_get_can_default     (GtkWidget           *widget);
797
GDK_AVAILABLE_IN_ALL
798
gboolean   gtk_widget_has_default         (GtkWidget           *widget);
799
GDK_AVAILABLE_IN_ALL
800
void       gtk_widget_grab_default        (GtkWidget           *widget);
801

802
GDK_AVAILABLE_IN_ALL
803 804
void      gtk_widget_set_receives_default (GtkWidget           *widget,
                                           gboolean             receives_default);
805
GDK_AVAILABLE_IN_ALL
806 807
gboolean  gtk_widget_get_receives_default (GtkWidget           *widget);

808
GDK_AVAILABLE_IN_ALL
809 810
gboolean   gtk_widget_has_grab            (GtkWidget           *widget);

811
GDK_AVAILABLE_IN_ALL
812 813 814 815
gboolean   gtk_widget_device_is_shadowed  (GtkWidget           *widget,
                                           GdkDevice           *device);


816
GDK_AVAILABLE_IN_ALL
817 818
void                  gtk_widget_set_name               (GtkWidget    *widget,
							 const gchar  *name);
819
GDK_AVAILABLE_IN_ALL
820
const gchar *         gtk_widget_get_name               (GtkWidget    *widget);
821

822
GDK_DEPRECATED_IN_3_0_FOR(gtk_widget_set_state_flags)
823 824
void                  gtk_widget_set_state              (GtkWidget    *widget,
							 GtkStateType  state);
825 826

GDK_DEPRECATED_IN_3_0_FOR(gtk_widget_get_state_flags)
827
GtkStateType          gtk_widget_get_state              (GtkWidget    *widget);
828

829
GDK_AVAILABLE_IN_ALL
830 831 832
void                  gtk_widget_set_state_flags        (GtkWidget     *widget,
                                                         GtkStateFlags  flags,
                                                         gboolean       clear);
833
GDK_AVAILABLE_IN_ALL
834 835
void                  gtk_widget_unset_state_flags      (GtkWidget     *widget,
                                                         GtkStateFlags  flags);
836
GDK_AVAILABLE_IN_ALL
837 838
GtkStateFlags         gtk_widget_get_state_flags        (GtkWidget     *widget);

839
GDK_AVAILABLE_IN_ALL
840 841
void                  gtk_widget_set_sensitive          (GtkWidget    *widget,
							 gboolean      sensitive);
842
GDK_AVAILABLE_IN_ALL
843
gboolean              gtk_widget_get_sensitive          (GtkWidget    *widget);
844
GDK_AVAILABLE_IN_ALL
845 846
gboolean              gtk_widget_is_sensitive           (GtkWidget    *widget);

847
GDK_AVAILABLE_IN_ALL
848 849
void                  gtk_widget_set_visible            (GtkWidget    *widget,
                                                         gboolean      visible);
850
GDK_AVAILABLE_IN_ALL
851
gboolean              gtk_widget_get_visible            (GtkWidget    *widget);
852
GDK_AVAILABLE_IN_ALL
853
gboolean              gtk_widget_is_visible             (GtkWidget    *widget);
854

855
GDK_AVAILABLE_IN_ALL
856 857
void                  gtk_widget_set_has_window         (GtkWidget    *widget,
                                                         gboolean      has_window);
858
GDK_AVAILABLE_IN_ALL
859 860
gboolean              gtk_widget_get_has_window         (GtkWidget    *widget);

861
GDK_AVAILABLE_IN_ALL
862
gboolean              gtk_widget_is_toplevel            (GtkWidget    *widget);
863
GDK_AVAILABLE_IN_ALL
864
gboolean              gtk_widget_is_drawable            (GtkWidget    *widget);
865
GDK_AVAILABLE_IN_ALL
866 867
void                  gtk_widget_set_realized           (GtkWidget    *widget,
                                                         gboolean      realized);
868
GDK_AVAILABLE_IN_ALL
869
gboolean              gtk_widget_get_realized           (GtkWidget    *widget);
870
GDK_AVAILABLE_IN_ALL
871 872
void                  gtk_widget_set_mapped             (GtkWidget    *widget,
                                                         gboolean      mapped);
873
GDK_AVAILABLE_IN_ALL
874 875
gboolean              gtk_widget_get_mapped             (GtkWidget    *widget);

876
GDK_AVAILABLE_IN_ALL
877 878
void                  gtk_widget_set_app_paintable      (GtkWidget    *widget,
							 gboolean      app_paintable);
879
GDK_AVAILABLE_IN_ALL
880 881
gboolean              gtk_widget_get_app_paintable      (GtkWidget    *widget);

882
GDK_DEPRECATED_IN_3_14
883 884
void                  gtk_widget_set_double_buffered    (GtkWidget    *widget,
							 gboolean      double_buffered);
885
GDK_DEPRECATED_IN_3_14
886 887
gboolean              gtk_widget_get_double_buffered    (GtkWidget    *widget);

888
GDK_AVAILABLE_IN_ALL
889 890
void                  gtk_widget_set_redraw_on_allocate (GtkWidget    *widget,
							 gboolean      redraw_on_allocate);
891

892
GDK_AVAILABLE_IN_ALL
893 894
void                  gtk_widget_set_parent             (GtkWidget    *widget,
							 GtkWidget    *parent);
895
GDK_AVAILABLE_IN_ALL
896
GtkWidget           * gtk_widget_get_parent             (GtkWidget    *widget);
897

898
GDK_AVAILABLE_IN_ALL
899 900
void                  gtk_widget_set_parent_window      (GtkWidget    *widget,
							 GdkWindow    *parent_window);
901
GDK_AVAILABLE_IN_ALL
902
GdkWindow           * gtk_widget_get_parent_window      (GtkWidget    *widget);
903

904
GDK_AVAILABLE_IN_ALL
905 906
void                  gtk_widget_set_child_visible      (GtkWidget    *widget,
							 gboolean      is_visible);
907
GDK_AVAILABLE_IN_ALL
908
gboolean              gtk_widget_get_child_visible      (GtkWidget    *widget);
909

910
GDK_AVAILABLE_IN_ALL
911 912
void                  gtk_widget_set_window             (GtkWidget    *widget,
                                                         GdkWindow    *window);
913
GDK_AVAILABLE_IN_ALL
914
GdkWindow           * gtk_widget_get_window             (GtkWidget    *widget);
915 916 917 918 919 920
GDK_AVAILABLE_IN_3_8
void                  gtk_widget_register_window        (GtkWidget    *widget,
                                                         GdkWindow    *window);
GDK_AVAILABLE_IN_3_8
void                  gtk_widget_unregister_window      (GtkWidget    *widget,
                                                         GdkWindow    *window);
921

922
GDK_AVAILABLE_IN_ALL
923
int                   gtk_widget_get_allocated_width    (GtkWidget     *widget);
924
GDK_AVAILABLE_IN_ALL
925
int                   gtk_widget_get_allocated_height   (GtkWidget     *widget);
926 927
GDK_AVAILABLE_IN_3_10
int                   gtk_widget_get_allocated_baseline (GtkWidget     *widget);
928 929 930 931
GDK_AVAILABLE_IN_3_20
void                  gtk_widget_get_allocated_size     (GtkWidget     *widget,
                                                         GtkAllocation *allocation,
                                                         int           *baseline);
932

933
GDK_AVAILABLE_IN_ALL
934 935
void                  gtk_widget_get_allocation         (GtkWidget     *widget,
                                                         GtkAllocation *allocation);
936
GDK_AVAILABLE_IN_ALL
937 938
void                  gtk_widget_set_allocation         (GtkWidget     *widget,
                                                         const GtkAllocation *allocation);
939 940
GDK_AVAILABLE_IN_3_14
void                  gtk_widget_set_clip               (GtkWidget     *widget,
Matthias Clasen's avatar
Matthias Clasen committed
941
                                                         const GtkAllocation *clip);
942 943
GDK_AVAILABLE_IN_3_14
void                  gtk_widget_get_clip               (GtkWidget     *widget,
Matthias Clasen's avatar
Matthias Clasen committed
944
                                                         GtkAllocation *clip);
945

946 947
GDK_DEPRECATED_IN_3_0_FOR(gtk_widget_get_preferred_width & gtk_widget_get_preferred_height)

948 949 950
void                  gtk_widget_get_requisition        (GtkWidget     *widget,
                                                         GtkRequisition *requisition);

951
GDK_AVAILABLE_IN_ALL
952 953
gboolean   gtk_widget_child_focus         (GtkWidget           *widget,
                                           GtkDirectionType     direction);
954
GDK_AVAILABLE_IN_ALL
955 956
gboolean   gtk_widget_keynav_failed       (GtkWidget           *widget,
                                           GtkDirectionType     direction);
957
GDK_AVAILABLE_IN_ALL
958
void       gtk_widget_error_bell          (GtkWidget           *widget);
Havoc Pennington's avatar
Havoc Pennington committed
959

960
GDK_AVAILABLE_IN_ALL
Havoc Pennington's avatar
Havoc Pennington committed
961 962 963
void       gtk_widget_set_size_request    (GtkWidget           *widget,
                                           gint                 width,
                                           gint                 height);
964
GDK_AVAILABLE_IN_ALL
Havoc Pennington's avatar
Havoc Pennington committed
965 966 967
void       gtk_widget_get_size_request    (GtkWidget           *widget,
                                           gint                *width,
                                           gint                *height);
968
GDK_AVAILABLE_IN_ALL
969 970
void	   gtk_widget_set_events	  (GtkWidget	       *widget,
					   gint			events);
971
GDK_AVAILABLE_IN_ALL
972 973
void       gtk_widget_add_events          (GtkWidget           *widget,
					   gint	                events);
974
GDK_AVAILABLE_IN_ALL
975 976 977
void	   gtk_widget_set_device_events	  (GtkWidget	       *widget,
                                           GdkDevice           *device,
					   GdkEventMask		events);
978
GDK_AVAILABLE_IN_ALL
979 980 981
void       gtk_widget_add_device_events   (GtkWidget           *widget,
                                           GdkDevice           *device,
					   GdkEventMask         events);
982 983 984 985 986
GDK_AVAILABLE_IN_3_8
void	   gtk_widget_set_opacity	  (GtkWidget	       *widget,
					   double		opacity);
GDK_AVAILABLE_IN_3_8
double	   gtk_widget_get_opacity	  (GtkWidget	       *widget);
987

988
GDK_AVAILABLE_IN_ALL
989 990 991
void       gtk_widget_set_device_enabled  (GtkWidget    *widget,
                                           GdkDevice    *device,
                                           gboolean      enabled);
992
GDK_AVAILABLE_IN_ALL
993 994 995
gboolean   gtk_widget_get_device_enabled  (GtkWidget    *widget,
                                           GdkDevice    *device);

996
GDK_AVAILABLE_IN_ALL
997
GtkWidget*   gtk_widget_get_toplevel	(GtkWidget	*widget);
998
GDK_AVAILABLE_IN_ALL
999
GtkWidget*   gtk_widget_get_ancestor	(GtkWidget	*widget,
Manish Singh's avatar
Manish Singh committed
1000
					 GType		 widget_type);
1001
GDK_AVAILABLE_IN_ALL
1002
GdkVisual*   gtk_widget_get_visual	(GtkWidget	*widget);
1003
GDK_AVAILABLE_IN_ALL
1004 1005
void         gtk_widget_set_visual	(GtkWidget	*widget,
                                         GdkVisual      *visual);
1006

1007
GDK_AVAILABLE_IN_ALL
1008
GdkScreen *   gtk_widget_get_screen      (GtkWidget *widget);
1009
GDK_AVAILABLE_IN_ALL
1010
gboolean      gtk_widget_has_screen      (GtkWidget *widget);
1011 1012
GDK_AVAILABLE_IN_3_10
gint          gtk_widget_get_scale_factor (GtkWidget *widget);
1013
GDK_AVAILABLE_IN_ALL
1014
GdkDisplay *  gtk_widget_get_display     (GtkWidget *widget);
1015
GDK_DEPRECATED_IN_3_12
1016
GdkWindow *   gtk_widget_get_root_window (GtkWidget *widget);
1017
GDK_AVAILABLE_IN_ALL
1018
GtkSettings*  gtk_widget_get_settings    (GtkWidget *widget);
1019
GDK_AVAILABLE_IN_ALL
1020 1021
GtkClipboard *gtk_widget_get_clipboard   (GtkWidget *widget,
					  GdkAtom    selection);
1022

1023 1024

/* Expand flags and related support */
1025
GDK_AVAILABLE_IN_ALL
1026
gboolean gtk_widget_get_hexpand          (GtkWidget      *widget);
1027
GDK_AVAILABLE_IN_ALL
1028 1029
void     gtk_widget_set_hexpand          (GtkWidget      *widget,
                                          gboolean        expand);
1030
GDK_AVAILABLE_IN_ALL
1031
gboolean gtk_widget_get_hexpand_set      (GtkWidget      *widget);
1032
GDK_AVAILABLE_IN_ALL
1033 1034
void     gtk_widget_set_hexpand_set      (GtkWidget      *widget,
                                          gboolean        set);
1035
GDK_AVAILABLE_IN_ALL
1036
gboolean gtk_widget_get_vexpand          (GtkWidget      *widget);
1037
GDK_AVAILABLE_IN_ALL
1038 1039
void     gtk_widget_set_vexpand          (GtkWidget      *widget,
                                          gboolean        expand);
1040
GDK_AVAILABLE_IN_ALL
1041
gboolean gtk_widget_get_vexpand_set      (GtkWidget      *widget);
1042
GDK_AVAILABLE_IN_ALL
1043 1044
void     gtk_widget_set_vexpand_set      (GtkWidget      *widget,
                                          gboolean        set);
1045
GDK_AVAILABLE_IN_ALL
1046
void     gtk_widget_queue_compute_expand (GtkWidget      *widget);
1047
GDK_AVAILABLE_IN_ALL
1048 1049 1050 1051
gboolean gtk_widget_compute_expand       (GtkWidget      *widget,
                                          GtkOrientation  orientation);


1052
/* Multidevice support */
1053
GDK_AVAILABLE_IN_ALL
1054
gboolean         gtk_widget_get_support_multidevice (GtkWidget      *widget);
1055
GDK_AVAILABLE_IN_ALL
1056 1057 1058
void             gtk_widget_set_support_multidevice (GtkWidget      *widget,
                                                     gboolean        support_multidevice);

1059
/* Accessibility support */
1060
GDK_AVAILABLE_IN_3_2
1061 1062
void             gtk_widget_class_set_accessible_type    (GtkWidgetClass     *widget_class,
                                                          GType               type);
1063
GDK_AVAILABLE_IN_3_2
1064 1065
void             gtk_widget_class_set_accessible_role    (GtkWidgetClass     *widget_class,
                                                          AtkRole             role);
1066
GDK_AVAILABLE_IN_ALL
1067 1068
AtkObject*       gtk_widget_get_accessible               (GtkWidget          *widget);

1069 1070

/* Margin and alignment */
1071
GDK_AVAILABLE_IN_ALL
1072
GtkAlign gtk_widget_get_halign        (GtkWidget *widget);
1073
GDK_AVAILABLE_IN_ALL
1074
void     gtk_widget_set_halign        (GtkWidget *widget,
1075
                                       GtkAlign   align);
1076
GDK_AVAILABLE_IN_ALL
1077
GtkAlign gtk_widget_get_valign        (GtkWidget *widget);
1078
GDK_AVAILABLE_IN_3_10
1079
GtkAlign gtk_widget_get_valign_with_baseline (GtkWidget *widget);
1080
GDK_AVAILABLE_IN_ALL
1081
void     gtk_widget_set_valign        (GtkWidget *widget,
1082
                                       GtkAlign   align);
1083
GDK_DEPRECATED_IN_3_12_FOR(gtk_widget_get_margin_start)
1084
gint     gtk_widget_get_margin_left   (GtkWidget *widget);
1085
GDK_DEPRECATED_IN_3_12_FOR(gtk_widget_set_margin_start)
1086
void     gtk_widget_set_margin_left   (GtkWidget *widget,
1087
                                       gint       margin);
1088
GDK_DEPRECATED_IN_3_12_FOR(gtk_widget_get_margin_end)
1089
gint     gtk_widget_get_margin_right  (GtkWidget *widget);
1090
GDK_DEPRECATED_IN_3_12_FOR(gtk_widget_set_margin_end)
1091
void     gtk_widget_set_margin_right  (GtkWidget *widget,
1092
                                       gint       margin);
1093 1094 1095 1096 1097 1098 1099 1100 1101 1102
GDK_AVAILABLE_IN_3_12
gint     gtk_widget_get_margin_start  (GtkWidget *widget);
GDK_AVAILABLE_IN_3_12
void     gtk_widget_set_margin_start  (GtkWidget *widget,
                                       gint       margin);
GDK_AVAILABLE_IN_3_12
gint     gtk_widget_get_margin_end    (GtkWidget *widget);
GDK_AVAILABLE_IN_3_12
void     gtk_widget_set_margin_end    (GtkWidget *widget,
                                       gint       margin);
1103
GDK_AVAILABLE_IN_ALL
1104
gint     gtk_widget_get_margin_top    (GtkWidget *widget);
1105
GDK_AVAILABLE_IN_ALL
1106
void     gtk_widget_set_margin_top    (GtkWidget *widget,
1107
                                       gint       margin);
1108
GDK_AVAILABLE_IN_ALL
1109
gint     gtk_widget_get_margin_bottom (GtkWidget *widget);
1110
GDK_AVAILABLE_IN_ALL
1111
void     gtk_widget_set_margin_bottom (GtkWidget *widget,
1112
                                       gint       margin);
1113 1114


1115
GDK_AVAILABLE_IN_ALL
1116
gint	     gtk_widget_get_events	(GtkWidget	*widget);
1117
GDK_AVAILABLE_IN_ALL
1118 1119
GdkEventMask gtk_widget_get_device_events (GtkWidget	*widget,
                                           GdkDevice    *device);
1120
GDK_DEPRECATED_IN_3_4_FOR(gdk_window_get_device_position)
1121 1122 1123 1124
void	     gtk_widget_get_pointer	(GtkWidget	*widget,
					 gint		*x,
					 gint		*y);

1125
GDK_AVAILABLE_IN_ALL
1126
gboolean     gtk_widget_is_ancestor	(GtkWidget	*widget,
1127 1128
					 GtkWidget	*ancestor);

1129
GDK_AVAILABLE_IN_ALL
1130 1131 1132 1133 1134 1135 1136
gboolean     gtk_widget_translate_coordinates (GtkWidget  *src_widget,
					       GtkWidget  *dest_widget,
					       gint        src_x,
					       gint        src_y,
					       gint       *dest_x,
					       gint       *dest_y);

1137 1138
/* Hide widget and return TRUE.
 */
1139
GDK_AVAILABLE_IN_ALL
1140
gboolean     gtk_widget_hide_on_delete	(GtkWidget	*widget);
1141

1142
/* Functions to override widget styling */
1143
GDK_DEPRECATED_IN_3_16
Carlos Garnacho's avatar