gtkwidget.h 64.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
GDK_AVAILABLE_IN_3_8
Owen W. Taylor's avatar
Owen W. Taylor committed
667 668
GdkFrameClock* gtk_widget_get_frame_clock (GtkWidget           *widget);

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

680
GDK_AVAILABLE_IN_ALL
681
GtkSizeRequestMode  gtk_widget_get_request_mode               (GtkWidget      *widget);
682
GDK_AVAILABLE_IN_ALL
683 684 685
void                gtk_widget_get_preferred_width            (GtkWidget      *widget,
                                                               gint           *minimum_width,
                                                               gint           *natural_width);
686
GDK_AVAILABLE_IN_ALL
687 688 689 690
void                gtk_widget_get_preferred_height_for_width (GtkWidget      *widget,
                                                               gint            width,
                                                               gint           *minimum_height,
                                                               gint           *natural_height);
691
GDK_AVAILABLE_IN_ALL
692 693 694
void                gtk_widget_get_preferred_height           (GtkWidget      *widget,
                                                               gint           *minimum_height,
                                                               gint           *natural_height);
695
GDK_AVAILABLE_IN_ALL
696 697 698 699
void                gtk_widget_get_preferred_width_for_height (GtkWidget      *widget,
                                                               gint            height,
                                                               gint           *minimum_width,
                                                               gint           *natural_width);
700 701 702 703 704 705 706
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);
707
GDK_AVAILABLE_IN_ALL
708 709 710 711
void                gtk_widget_get_preferred_size             (GtkWidget      *widget,
                                                               GtkRequisition *minimum_size,
                                                               GtkRequisition *natural_size);

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

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

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

771
GDK_AVAILABLE_IN_ALL
772 773
void       gtk_widget_set_can_focus       (GtkWidget           *widget,
                                           gboolean             can_focus);
774
GDK_AVAILABLE_IN_ALL
775
gboolean   gtk_widget_get_can_focus       (GtkWidget           *widget);
776
GDK_AVAILABLE_IN_ALL
777
gboolean   gtk_widget_has_focus           (GtkWidget           *widget);
778
GDK_AVAILABLE_IN_ALL
779
gboolean   gtk_widget_is_focus            (GtkWidget           *widget);
780
GDK_AVAILABLE_IN_3_2
781
gboolean   gtk_widget_has_visible_focus   (GtkWidget           *widget);
782
GDK_AVAILABLE_IN_ALL
783 784
void       gtk_widget_grab_focus          (GtkWidget           *widget);

785
GDK_AVAILABLE_IN_ALL
786 787
void       gtk_widget_set_can_default     (GtkWidget           *widget,
                                           gboolean             can_default);
788
GDK_AVAILABLE_IN_ALL
789
gboolean   gtk_widget_get_can_default     (GtkWidget           *widget);
790
GDK_AVAILABLE_IN_ALL
791
gboolean   gtk_widget_has_default         (GtkWidget           *widget);
792
GDK_AVAILABLE_IN_ALL
793
void       gtk_widget_grab_default        (GtkWidget           *widget);
794

795
GDK_AVAILABLE_IN_ALL
796 797
void      gtk_widget_set_receives_default (GtkWidget           *widget,
                                           gboolean             receives_default);
798
GDK_AVAILABLE_IN_ALL
799 800
gboolean  gtk_widget_get_receives_default (GtkWidget           *widget);

801
GDK_AVAILABLE_IN_ALL
802 803
gboolean   gtk_widget_has_grab            (GtkWidget           *widget);

804
GDK_AVAILABLE_IN_ALL
805 806 807 808
gboolean   gtk_widget_device_is_shadowed  (GtkWidget           *widget,
                                           GdkDevice           *device);


809
GDK_AVAILABLE_IN_ALL
810 811
void                  gtk_widget_set_name               (GtkWidget    *widget,
							 const gchar  *name);
812
GDK_AVAILABLE_IN_ALL
813
const gchar *         gtk_widget_get_name               (GtkWidget    *widget);
814

815
GDK_DEPRECATED_IN_3_0_FOR(gtk_widget_set_state_flags)
816 817
void                  gtk_widget_set_state              (GtkWidget    *widget,
							 GtkStateType  state);
818 819

GDK_DEPRECATED_IN_3_0_FOR(gtk_widget_get_state_flags)
820
GtkStateType          gtk_widget_get_state              (GtkWidget    *widget);
821

822
GDK_AVAILABLE_IN_ALL
823 824 825
void                  gtk_widget_set_state_flags        (GtkWidget     *widget,
                                                         GtkStateFlags  flags,
                                                         gboolean       clear);
826
GDK_AVAILABLE_IN_ALL
827 828
void                  gtk_widget_unset_state_flags      (GtkWidget     *widget,
                                                         GtkStateFlags  flags);
829
GDK_AVAILABLE_IN_ALL
830 831
GtkStateFlags         gtk_widget_get_state_flags        (GtkWidget     *widget);

832
GDK_AVAILABLE_IN_ALL
833 834
void                  gtk_widget_set_sensitive          (GtkWidget    *widget,
							 gboolean      sensitive);
835
GDK_AVAILABLE_IN_ALL
836
gboolean              gtk_widget_get_sensitive          (GtkWidget    *widget);
837
GDK_AVAILABLE_IN_ALL
838 839
gboolean              gtk_widget_is_sensitive           (GtkWidget    *widget);

840
GDK_AVAILABLE_IN_ALL
841 842
void                  gtk_widget_set_visible            (GtkWidget    *widget,
                                                         gboolean      visible);
843
GDK_AVAILABLE_IN_ALL
844
gboolean              gtk_widget_get_visible            (GtkWidget    *widget);
845
GDK_AVAILABLE_IN_ALL
846
gboolean              gtk_widget_is_visible             (GtkWidget    *widget);
847

848
GDK_AVAILABLE_IN_ALL
849 850
void                  gtk_widget_set_has_window         (GtkWidget    *widget,
                                                         gboolean      has_window);
851
GDK_AVAILABLE_IN_ALL
852 853
gboolean              gtk_widget_get_has_window         (GtkWidget    *widget);

854
GDK_AVAILABLE_IN_ALL
855
gboolean              gtk_widget_is_toplevel            (GtkWidget    *widget);
856
GDK_AVAILABLE_IN_ALL
857
gboolean              gtk_widget_is_drawable            (GtkWidget    *widget);
858
GDK_AVAILABLE_IN_ALL
859 860
void                  gtk_widget_set_realized           (GtkWidget    *widget,
                                                         gboolean      realized);
861
GDK_AVAILABLE_IN_ALL
862
gboolean              gtk_widget_get_realized           (GtkWidget    *widget);
863
GDK_AVAILABLE_IN_ALL
864 865
void                  gtk_widget_set_mapped             (GtkWidget    *widget,
                                                         gboolean      mapped);
866
GDK_AVAILABLE_IN_ALL
867 868
gboolean              gtk_widget_get_mapped             (GtkWidget    *widget);

869
GDK_AVAILABLE_IN_ALL
870 871
void                  gtk_widget_set_app_paintable      (GtkWidget    *widget,
							 gboolean      app_paintable);
872
GDK_AVAILABLE_IN_ALL
873 874
gboolean              gtk_widget_get_app_paintable      (GtkWidget    *widget);

875
GDK_DEPRECATED_IN_3_14
876 877
void                  gtk_widget_set_double_buffered    (GtkWidget    *widget,
							 gboolean      double_buffered);
878
GDK_DEPRECATED_IN_3_14
879 880
gboolean              gtk_widget_get_double_buffered    (GtkWidget    *widget);

881
GDK_AVAILABLE_IN_ALL
882 883
void                  gtk_widget_set_redraw_on_allocate (GtkWidget    *widget,
							 gboolean      redraw_on_allocate);
884

885
GDK_AVAILABLE_IN_ALL
886 887
void                  gtk_widget_set_parent             (GtkWidget    *widget,
							 GtkWidget    *parent);
888
GDK_AVAILABLE_IN_ALL
889
GtkWidget           * gtk_widget_get_parent             (GtkWidget    *widget);
890

891
GDK_AVAILABLE_IN_ALL
892 893
void                  gtk_widget_set_parent_window      (GtkWidget    *widget,
							 GdkWindow    *parent_window);
894
GDK_AVAILABLE_IN_ALL
895
GdkWindow           * gtk_widget_get_parent_window      (GtkWidget    *widget);
896

897
GDK_AVAILABLE_IN_ALL
898 899
void                  gtk_widget_set_child_visible      (GtkWidget    *widget,
							 gboolean      is_visible);
900
GDK_AVAILABLE_IN_ALL
901
gboolean              gtk_widget_get_child_visible      (GtkWidget    *widget);
902

903
GDK_AVAILABLE_IN_ALL
904 905
void                  gtk_widget_set_window             (GtkWidget    *widget,
                                                         GdkWindow    *window);
906
GDK_AVAILABLE_IN_ALL
907
GdkWindow           * gtk_widget_get_window             (GtkWidget    *widget);
908 909 910 911 912 913
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);
914

915
GDK_AVAILABLE_IN_ALL
916
int                   gtk_widget_get_allocated_width    (GtkWidget     *widget);
917
GDK_AVAILABLE_IN_ALL
918
int                   gtk_widget_get_allocated_height   (GtkWidget     *widget);
919 920
GDK_AVAILABLE_IN_3_10
int                   gtk_widget_get_allocated_baseline (GtkWidget     *widget);
921

922
GDK_AVAILABLE_IN_ALL
923 924
void                  gtk_widget_get_allocation         (GtkWidget     *widget,
                                                         GtkAllocation *allocation);
925
GDK_AVAILABLE_IN_ALL
926 927
void                  gtk_widget_set_allocation         (GtkWidget     *widget,
                                                         const GtkAllocation *allocation);
928 929
GDK_AVAILABLE_IN_3_14
void                  gtk_widget_set_clip               (GtkWidget     *widget,
Matthias Clasen's avatar
Matthias Clasen committed
930
                                                         const GtkAllocation *clip);
931 932
GDK_AVAILABLE_IN_3_14
void                  gtk_widget_get_clip               (GtkWidget     *widget,
Matthias Clasen's avatar
Matthias Clasen committed
933
                                                         GtkAllocation *clip);
934

935 936
GDK_DEPRECATED_IN_3_0_FOR(gtk_widget_get_preferred_width & gtk_widget_get_preferred_height)

937 938 939
void                  gtk_widget_get_requisition        (GtkWidget     *widget,
                                                         GtkRequisition *requisition);

940
GDK_AVAILABLE_IN_ALL
941 942
gboolean   gtk_widget_child_focus         (GtkWidget           *widget,
                                           GtkDirectionType     direction);
943
GDK_AVAILABLE_IN_ALL
944 945
gboolean   gtk_widget_keynav_failed       (GtkWidget           *widget,
                                           GtkDirectionType     direction);
946
GDK_AVAILABLE_IN_ALL
947
void       gtk_widget_error_bell          (GtkWidget           *widget);
Havoc Pennington's avatar
Havoc Pennington committed
948

949
GDK_AVAILABLE_IN_ALL
Havoc Pennington's avatar
Havoc Pennington committed
950 951 952
void       gtk_widget_set_size_request    (GtkWidget           *widget,
                                           gint                 width,
                                           gint                 height);
953
GDK_AVAILABLE_IN_ALL
Havoc Pennington's avatar
Havoc Pennington committed
954 955 956
void       gtk_widget_get_size_request    (GtkWidget           *widget,
                                           gint                *width,
                                           gint                *height);
957
GDK_AVAILABLE_IN_ALL
958 959
void	   gtk_widget_set_events	  (GtkWidget	       *widget,
					   gint			events);
960
GDK_AVAILABLE_IN_ALL
961 962
void       gtk_widget_add_events          (GtkWidget           *widget,
					   gint	                events);
963
GDK_AVAILABLE_IN_ALL
964 965 966
void	   gtk_widget_set_device_events	  (GtkWidget	       *widget,
                                           GdkDevice           *device,
					   GdkEventMask		events);
967
GDK_AVAILABLE_IN_ALL
968 969 970
void       gtk_widget_add_device_events   (GtkWidget           *widget,
                                           GdkDevice           *device,
					   GdkEventMask         events);
971 972 973 974 975
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);
976

977
GDK_AVAILABLE_IN_ALL
978 979 980
void       gtk_widget_set_device_enabled  (GtkWidget    *widget,
                                           GdkDevice    *device,
                                           gboolean      enabled);
981
GDK_AVAILABLE_IN_ALL
982 983 984
gboolean   gtk_widget_get_device_enabled  (GtkWidget    *widget,
                                           GdkDevice    *device);

985
GDK_AVAILABLE_IN_ALL
986
GtkWidget*   gtk_widget_get_toplevel	(GtkWidget	*widget);
987
GDK_AVAILABLE_IN_ALL
988
GtkWidget*   gtk_widget_get_ancestor	(GtkWidget	*widget,
Manish Singh's avatar
Manish Singh committed
989
					 GType		 widget_type);
990
GDK_AVAILABLE_IN_ALL
991
GdkVisual*   gtk_widget_get_visual	(GtkWidget	*widget);
992
GDK_AVAILABLE_IN_ALL
993 994
void         gtk_widget_set_visual	(GtkWidget	*widget,
                                         GdkVisual      *visual);
995

996
GDK_AVAILABLE_IN_ALL
997
GdkScreen *   gtk_widget_get_screen      (GtkWidget *widget);
998
GDK_AVAILABLE_IN_ALL
999
gboolean      gtk_widget_has_screen      (GtkWidget *widget);
1000 1001
GDK_AVAILABLE_IN_3_10
gint          gtk_widget_get_scale_factor (GtkWidget *widget);
1002
GDK_AVAILABLE_IN_ALL
1003
GdkDisplay *  gtk_widget_get_display     (GtkWidget *widget);
1004
GDK_DEPRECATED_IN_3_12
1005
GdkWindow *   gtk_widget_get_root_window (GtkWidget *widget);
1006
GDK_AVAILABLE_IN_ALL
1007
GtkSettings*  gtk_widget_get_settings    (GtkWidget *widget);
1008
GDK_AVAILABLE_IN_ALL
1009 1010
GtkClipboard *gtk_widget_get_clipboard   (GtkWidget *widget,
					  GdkAtom    selection);
1011

1012 1013

/* Expand flags and related support */
1014
GDK_AVAILABLE_IN_ALL
1015
gboolean gtk_widget_get_hexpand          (GtkWidget      *widget);
1016
GDK_AVAILABLE_IN_ALL
1017 1018
void     gtk_widget_set_hexpand          (GtkWidget      *widget,
                                          gboolean        expand);
1019
GDK_AVAILABLE_IN_ALL
1020
gboolean gtk_widget_get_hexpand_set      (GtkWidget      *widget);
1021
GDK_AVAILABLE_IN_ALL
1022 1023
void     gtk_widget_set_hexpand_set      (GtkWidget      *widget,
                                          gboolean        set);
1024
GDK_AVAILABLE_IN_ALL
1025
gboolean gtk_widget_get_vexpand          (GtkWidget      *widget);
1026
GDK_AVAILABLE_IN_ALL
1027 1028
void     gtk_widget_set_vexpand          (GtkWidget      *widget,
                                          gboolean        expand);
1029
GDK_AVAILABLE_IN_ALL
1030
gboolean gtk_widget_get_vexpand_set      (GtkWidget      *widget);
1031
GDK_AVAILABLE_IN_ALL
1032 1033
void     gtk_widget_set_vexpand_set      (GtkWidget      *widget,
                                          gboolean        set);
1034
GDK_AVAILABLE_IN_ALL
1035
void     gtk_widget_queue_compute_expand (GtkWidget      *widget);
1036
GDK_AVAILABLE_IN_ALL
1037 1038 1039 1040
gboolean gtk_widget_compute_expand       (GtkWidget      *widget,
                                          GtkOrientation  orientation);


1041
/* Multidevice support */
1042
GDK_AVAILABLE_IN_ALL
1043
gboolean         gtk_widget_get_support_multidevice (GtkWidget      *widget);
1044
GDK_AVAILABLE_IN_ALL
1045 1046 1047
void             gtk_widget_set_support_multidevice (GtkWidget      *widget,
                                                     gboolean        support_multidevice);

1048
/* Accessibility support */
1049
GDK_AVAILABLE_IN_3_2
1050 1051
void             gtk_widget_class_set_accessible_type    (GtkWidgetClass     *widget_class,
                                                          GType               type);
1052
GDK_AVAILABLE_IN_3_2
1053 1054
void             gtk_widget_class_set_accessible_role    (GtkWidgetClass     *widget_class,
                                                          AtkRole             role);
1055
GDK_AVAILABLE_IN_ALL
1056 1057
AtkObject*       gtk_widget_get_accessible               (GtkWidget          *widget);

1058 1059

/* Margin and alignment */
1060
GDK_AVAILABLE_IN_ALL
1061
GtkAlign gtk_widget_get_halign        (GtkWidget *widget);
1062
GDK_AVAILABLE_IN_ALL
1063
void     gtk_widget_set_halign        (GtkWidget *widget,
1064
                                       GtkAlign   align);
1065
GDK_AVAILABLE_IN_ALL
1066
GtkAlign gtk_widget_get_valign        (GtkWidget *widget);
1067
GDK_AVAILABLE_IN_3_10
1068
GtkAlign gtk_widget_get_valign_with_baseline (GtkWidget *widget);
1069
GDK_AVAILABLE_IN_ALL
1070
void     gtk_widget_set_valign        (GtkWidget *widget,
1071
                                       GtkAlign   align);
1072
GDK_DEPRECATED_IN_3_12_FOR(gtk_widget_get_margin_start)
1073
gint     gtk_widget_get_margin_left   (GtkWidget *widget);
1074
GDK_DEPRECATED_IN_3_12_FOR(gtk_widget_set_margin_start)
1075
void     gtk_widget_set_margin_left   (GtkWidget *widget,
1076
                                       gint       margin);
1077
GDK_DEPRECATED_IN_3_12_FOR(gtk_widget_get_margin_end)
1078
gint     gtk_widget_get_margin_right  (GtkWidget *widget);
1079
GDK_DEPRECATED_IN_3_12_FOR(gtk_widget_set_margin_end)
1080
void     gtk_widget_set_margin_right  (GtkWidget *widget,
1081
                                       gint       margin);
1082 1083 1084 1085 1086 1087 1088 1089 1090 1091
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);
1092
GDK_AVAILABLE_IN_ALL
1093
gint     gtk_widget_get_margin_top    (GtkWidget *widget);
1094
GDK_AVAILABLE_IN_ALL
1095
void     gtk_widget_set_margin_top    (GtkWidget *widget,
1096
                                       gint       margin);
1097
GDK_AVAILABLE_IN_ALL
1098
gint     gtk_widget_get_margin_bottom (GtkWidget *widget);
1099
GDK_AVAILABLE_IN_ALL
1100
void     gtk_widget_set_margin_bottom (GtkWidget *widget,
1101
                                       gint       margin);
1102 1103


1104
GDK_AVAILABLE_IN_ALL
1105
gint	     gtk_widget_get_events	(GtkWidget	*widget);
1106
GDK_AVAILABLE_IN_ALL
1107 1108
GdkEventMask gtk_widget_get_device_events (GtkWidget	*widget,
                                           GdkDevice    *device);
1109
GDK_DEPRECATED_IN_3_4_FOR(gdk_window_get_device_position)
1110 1111 1112 1113
void	     gtk_widget_get_pointer	(GtkWidget	*widget,
					 gint		*x,
					 gint		*y);

1114
GDK_AVAILABLE_IN_ALL
1115
gboolean     gtk_widget_is_ancestor	(GtkWidget	*widget,
1116 1117
					 GtkWidget	*ancestor);

1118
GDK_AVAILABLE_IN_ALL
1119 1120 1121 1122 1123 1124 1125
gboolean     gtk_widget_translate_coordinates (GtkWidget  *src_widget,
					       GtkWidget  *dest_widget,
					       gint        src_x,
					       gint        src_y,
					       gint       *dest_x,
					       gint       *dest_y);

1126 1127
/* Hide widget and return TRUE.
 */
1128
GDK_AVAILABLE_IN_ALL
1129
gboolean     gtk_widget_hide_on_delete	(GtkWidget	*widget);
1130

1131
/* Functions to override widget styling */
1132
GDK_DEPRECATED_IN_3_16
1133 1134 1135
void         gtk_widget_override_color            (GtkWidget     *widget,
                                                   GtkStateFlags  state,
                                                   const GdkRGBA *color);
1136
GDK_DEPRECATED_IN_3_16
1137 1138 1139 1140
void         gtk_widget_override_background_color (GtkWidget     *widget,
                                                   GtkStateFlags  state,
                                                   const GdkRGBA *color);