gtkwidget.c 220 KB
Newer Older
Elliot Lee's avatar
Elliot Lee committed
1 2 3 4
/* GTK - The GIMP Toolkit
 * 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
15 16 17
 * License along with this library; if not, write to the
 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
 * Boston, MA 02111-1307, USA.
Elliot Lee's avatar
Elliot Lee committed
18
 */
19 20

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

27
#include <config.h>
Elliot Lee's avatar
Elliot Lee committed
28 29
#include <stdarg.h>
#include <string.h>
30
#include <locale.h>
31
#include "gtkalias.h"
Elliot Lee's avatar
Elliot Lee committed
32
#include "gtkcontainer.h"
33
#include "gtkaccelmap.h"
34
#include "gtkclipboard.h"
35
#include "gtkiconfactory.h"
36
#include "gtkintl.h"
Elliot Lee's avatar
Elliot Lee committed
37
#include "gtkmain.h"
38
#include "gtkmarshalers.h"
Elliot Lee's avatar
Elliot Lee committed
39 40
#include "gtkrc.h"
#include "gtkselection.h"
41
#include "gtksettings.h"
42
#include "gtksizegroup.h"
Elliot Lee's avatar
Elliot Lee committed
43 44
#include "gtkwidget.h"
#include "gtkwindow.h"
Tim Janik's avatar
Tim Janik committed
45
#include "gtkbindings.h"
46
#include "gtkprivate.h"
Elliot Lee's avatar
Elliot Lee committed
47
#include "gdk/gdk.h"
48
#include "gdk/gdkprivate.h" /* Used in gtk_reset_shapes_recurse to avoid copy */
Tim Janik's avatar
Tim Janik committed
49 50
#include <gobject/gvaluecollector.h>
#include <gobject/gobjectnotifyqueue.c>
Owen Taylor's avatar
Owen Taylor committed
51
#include "gdk/gdkkeysyms.h"
Alexander Larsson's avatar
Alexander Larsson committed
52
#include "gtkintl.h"
53
#include "gtkaccessible.h"
54
#include "gtktooltips.h"
55
#include "gtkinvisible.h"
Elliot Lee's avatar
Elliot Lee committed
56

57
#define WIDGET_CLASS(w)	 GTK_WIDGET_GET_CLASS (w)
Tim Janik's avatar
Tim Janik committed
58
#define	INIT_PATH_SIZE	(512)
Elliot Lee's avatar
Elliot Lee committed
59 60 61 62 63 64 65 66 67 68 69 70


enum {
  SHOW,
  HIDE,
  MAP,
  UNMAP,
  REALIZE,
  UNREALIZE,
  SIZE_REQUEST,
  SIZE_ALLOCATE,
  STATE_CHANGED,
71
  PARENT_SET,
Owen Taylor's avatar
Owen Taylor committed
72
  HIERARCHY_CHANGED,
73
  STYLE_SET,
74
  DIRECTION_CHANGED,
75
  GRAB_NOTIFY,
Tim Janik's avatar
Tim Janik committed
76
  CHILD_NOTIFY,
77
  MNEMONIC_ACTIVATE,
78
  GRAB_FOCUS,
79
  FOCUS,
Elliot Lee's avatar
Elliot Lee committed
80
  EVENT,
81
  EVENT_AFTER,
Elliot Lee's avatar
Elliot Lee committed
82 83
  BUTTON_PRESS_EVENT,
  BUTTON_RELEASE_EVENT,
84
  SCROLL_EVENT,
Elliot Lee's avatar
Elliot Lee committed
85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101
  MOTION_NOTIFY_EVENT,
  DELETE_EVENT,
  DESTROY_EVENT,
  EXPOSE_EVENT,
  KEY_PRESS_EVENT,
  KEY_RELEASE_EVENT,
  ENTER_NOTIFY_EVENT,
  LEAVE_NOTIFY_EVENT,
  CONFIGURE_EVENT,
  FOCUS_IN_EVENT,
  FOCUS_OUT_EVENT,
  MAP_EVENT,
  UNMAP_EVENT,
  PROPERTY_NOTIFY_EVENT,
  SELECTION_CLEAR_EVENT,
  SELECTION_REQUEST_EVENT,
  SELECTION_NOTIFY_EVENT,
102
  SELECTION_GET,
Elliot Lee's avatar
Elliot Lee committed
103 104 105
  SELECTION_RECEIVED,
  PROXIMITY_IN_EVENT,
  PROXIMITY_OUT_EVENT,
106 107 108 109 110 111 112 113
  DRAG_BEGIN,
  DRAG_END,
  DRAG_DATA_DELETE,
  DRAG_LEAVE,
  DRAG_MOTION,
  DRAG_DROP,
  DRAG_DATA_GET,
  DRAG_DATA_RECEIVED,
114
  CLIENT_EVENT,
115
  NO_EXPOSE_EVENT,
116
  VISIBILITY_NOTIFY_EVENT,
Havoc Pennington's avatar
Havoc Pennington committed
117
  WINDOW_STATE_EVENT,
Owen Taylor's avatar
Owen Taylor committed
118
  POPUP_MENU,
119
  SHOW_HELP,
120
  ACCEL_CLOSURES_CHANGED,
Owen Taylor's avatar
Owen Taylor committed
121
  SCREEN_CHANGED,
122
  CAN_ACTIVATE_ACCEL,
Elliot Lee's avatar
Elliot Lee committed
123 124 125
  LAST_SIGNAL
};

126
enum {
Alexander Larsson's avatar
Alexander Larsson committed
127 128 129
  PROP_0,
  PROP_NAME,
  PROP_PARENT,
Havoc Pennington's avatar
Havoc Pennington committed
130 131
  PROP_WIDTH_REQUEST,
  PROP_HEIGHT_REQUEST,
Alexander Larsson's avatar
Alexander Larsson committed
132 133 134 135 136
  PROP_VISIBLE,
  PROP_SENSITIVE,
  PROP_APP_PAINTABLE,
  PROP_CAN_FOCUS,
  PROP_HAS_FOCUS,
137
  PROP_IS_FOCUS,
Alexander Larsson's avatar
Alexander Larsson committed
138 139 140 141 142 143
  PROP_CAN_DEFAULT,
  PROP_HAS_DEFAULT,
  PROP_RECEIVES_DEFAULT,
  PROP_COMPOSITE_CHILD,
  PROP_STYLE,
  PROP_EVENTS,
144 145
  PROP_EXTENSION_EVENTS,
  PROP_NO_SHOW_ALL
146 147
};

148 149 150 151 152
typedef	struct	_GtkStateData	 GtkStateData;

struct _GtkStateData
{
  GtkStateType  state;
153
  guint		state_restoration : 1;
154
  guint         parent_sensitive : 1;
155
  guint		use_forall : 1;
156
};
Elliot Lee's avatar
Elliot Lee committed
157

Tim Janik's avatar
Tim Janik committed
158 159 160 161 162

/* --- prototypes --- */
static void	gtk_widget_class_init		 (GtkWidgetClass    *klass);
static void	gtk_widget_init			 (GtkWidget	    *widget);
static void	gtk_widget_set_property		 (GObject           *object,
Alexander Larsson's avatar
Alexander Larsson committed
163 164 165
						  guint              prop_id,
						  const GValue      *value,
						  GParamSpec        *pspec);
Tim Janik's avatar
Tim Janik committed
166
static void	gtk_widget_get_property		 (GObject           *object,
Alexander Larsson's avatar
Alexander Larsson committed
167 168 169
						  guint              prop_id,
						  GValue            *value,
						  GParamSpec        *pspec);
Tim Janik's avatar
Tim Janik committed
170
static void	gtk_widget_dispose		 (GObject	    *object);
Tim Janik's avatar
Tim Janik committed
171 172 173 174 175 176 177 178 179
static void	gtk_widget_real_destroy		 (GtkObject	    *object);
static void	gtk_widget_finalize		 (GObject	    *object);
static void	gtk_widget_real_show		 (GtkWidget	    *widget);
static void	gtk_widget_real_hide		 (GtkWidget	    *widget);
static void	gtk_widget_real_map		 (GtkWidget	    *widget);
static void	gtk_widget_real_unmap		 (GtkWidget	    *widget);
static void	gtk_widget_real_realize		 (GtkWidget	    *widget);
static void	gtk_widget_real_unrealize	 (GtkWidget	    *widget);
static void	gtk_widget_real_size_request	 (GtkWidget	    *widget,
180
						  GtkRequisition    *requisition);
Tim Janik's avatar
Tim Janik committed
181
static void	gtk_widget_real_size_allocate	 (GtkWidget	    *widget,
182
						  GtkAllocation	    *allocation);
Tim Janik's avatar
Tim Janik committed
183
static void	gtk_widget_style_set		 (GtkWidget	    *widget,
184
						  GtkStyle          *previous_style);
Tim Janik's avatar
Tim Janik committed
185
static void	gtk_widget_direction_changed	 (GtkWidget	    *widget,
186
						  GtkTextDirection   previous_direction);
187

Tim Janik's avatar
Tim Janik committed
188
static void	gtk_widget_real_grab_focus	 (GtkWidget         *focus_widget);
189
static gboolean gtk_widget_real_show_help        (GtkWidget         *widget,
190 191
                                                  GtkWidgetHelpType  help_type);

Tim Janik's avatar
Tim Janik committed
192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207
static void	gtk_widget_dispatch_child_properties_changed	(GtkWidget        *object,
								 guint             n_pspecs,
								 GParamSpec      **pspecs);
static gboolean		gtk_widget_real_key_press_event   	(GtkWidget        *widget,
								 GdkEventKey      *event);
static gboolean		gtk_widget_real_key_release_event 	(GtkWidget        *widget,
								 GdkEventKey      *event);
static gboolean		gtk_widget_real_focus_in_event   	 (GtkWidget       *widget,
								  GdkEventFocus   *event);
static gboolean		gtk_widget_real_focus_out_event   	(GtkWidget        *widget,
								 GdkEventFocus    *event);
static gboolean		gtk_widget_real_focus			(GtkWidget        *widget,
								 GtkDirectionType  direction);
static PangoContext*	gtk_widget_peek_pango_context		(GtkWidget	  *widget);
static void		gtk_widget_propagate_state		(GtkWidget	  *widget,
								 GtkStateData 	  *data);
208
static void             gtk_widget_reset_rc_style               (GtkWidget        *widget);
Tim Janik's avatar
Tim Janik committed
209 210 211 212 213 214 215 216 217 218 219
static void		gtk_widget_set_style_internal		(GtkWidget	  *widget,
								 GtkStyle	  *style,
								 gboolean	   initial_emission);
static gint		gtk_widget_event_internal		(GtkWidget	  *widget,
								 GdkEvent	  *event);
static gboolean		gtk_widget_real_mnemonic_activate	(GtkWidget	  *widget,
								 gboolean	   group_cycling);
static void		gtk_widget_aux_info_destroy		(GtkWidgetAuxInfo *aux_info);
static AtkObject*	gtk_widget_real_get_accessible		(GtkWidget	  *widget);
static void		gtk_widget_accessible_interface_init	(AtkImplementorIface *iface);
static AtkObject*	gtk_widget_ref_accessible		(AtkImplementor *implementor);
220 221
static void             gtk_widget_invalidate_widget_windows    (GtkWidget        *widget,
								 GdkRegion        *region);
222
static GdkScreen *      gtk_widget_get_screen_unchecked         (GtkWidget        *widget);
Soeren Sandmann's avatar
Soeren Sandmann committed
223
static void		gtk_widget_queue_shallow_draw		(GtkWidget        *widget);
224 225 226
static gboolean         gtk_widget_real_can_activate_accel      (GtkWidget *widget,
                                                                 guint      signal_id);
     
227 228 229 230
static void gtk_widget_set_usize_internal (GtkWidget *widget,
					   gint       width,
					   gint       height);

Tim Janik's avatar
Tim Janik committed
231 232

/* --- variables --- */
233 234 235 236 237 238 239 240
static gpointer         parent_class = NULL;
static guint            widget_signals[LAST_SIGNAL] = { 0 };
static GMemChunk       *aux_info_mem_chunk = NULL;
static GtkStyle        *gtk_default_style = NULL;
static GSList          *colormap_stack = NULL;
static guint            composite_child_stack = 0;
static GtkTextDirection gtk_default_direction = GTK_TEXT_DIR_LTR;
static GParamSpecPool  *style_property_spec_pool = NULL;
241

Tim Janik's avatar
Tim Janik committed
242 243
static GQuark		quark_property_parser = 0;
static GQuark		quark_aux_info = 0;
244 245
static GQuark		quark_accel_path = 0;
static GQuark		quark_accel_closures = 0;
Tim Janik's avatar
Tim Janik committed
246 247 248 249 250 251 252 253
static GQuark		quark_event_mask = 0;
static GQuark		quark_extension_event_mode = 0;
static GQuark		quark_parent_window = 0;
static GQuark		quark_shape_info = 0;
static GQuark		quark_colormap = 0;
static GQuark		quark_pango_context = 0;
static GQuark		quark_rc_style = 0;
static GQuark		quark_accessible_object = 0;
254
static GQuark		quark_mnemonic_labels = 0;
Tim Janik's avatar
Tim Janik committed
255 256 257 258
GParamSpecPool         *_gtk_widget_child_property_pool = NULL;
GObjectNotifyContext   *_gtk_widget_child_property_notify_context = NULL;

/* --- functions --- */
Manish Singh's avatar
Manish Singh committed
259
GType
260
gtk_widget_get_type (void)
Elliot Lee's avatar
Elliot Lee committed
261
{
Manish Singh's avatar
Manish Singh committed
262
  static GType widget_type = 0;
263
  
Elliot Lee's avatar
Elliot Lee committed
264 265
  if (!widget_type)
    {
266
      static const GTypeInfo widget_info =
Elliot Lee's avatar
Elliot Lee committed
267 268
      {
	sizeof (GtkWidgetClass),
Manish Singh's avatar
Manish Singh committed
269 270
	NULL,		/* base_init */
	NULL,		/* base_finalize */
271
	(GClassInitFunc) gtk_widget_class_init,
Manish Singh's avatar
Manish Singh committed
272 273
	NULL,		/* class_finalize */
	NULL,		/* class_init */
274
	sizeof (GtkWidget),
Manish Singh's avatar
Manish Singh committed
275
	0,		/* n_preallocs */
276
	(GInstanceInitFunc) gtk_widget_init,
Manish Singh's avatar
Manish Singh committed
277
	NULL,		/* value_table */
Elliot Lee's avatar
Elliot Lee committed
278
      };
279
      
280 281 282 283 284 285 286
      static const GInterfaceInfo accessibility_info =
      {
        (GInterfaceInitFunc) gtk_widget_accessible_interface_init,
        (GInterfaceFinalizeFunc) NULL,
        NULL /* interface data */
      };

287 288
      widget_type = g_type_register_static (GTK_TYPE_OBJECT, "GtkWidget", 
					    &widget_info, G_TYPE_FLAG_ABSTRACT);
289 290 291 292

      g_type_add_interface_static (widget_type, ATK_TYPE_IMPLEMENTOR,
                                   &accessibility_info) ;

Elliot Lee's avatar
Elliot Lee committed
293
    }
294
  
Elliot Lee's avatar
Elliot Lee committed
295 296 297
  return widget_type;
}

Tim Janik's avatar
Tim Janik committed
298 299 300 301 302 303 304 305
static void
child_property_notify_dispatcher (GObject     *object,
				  guint        n_pspecs,
				  GParamSpec **pspecs)
{
  GTK_WIDGET_GET_CLASS (object)->dispatch_child_properties_changed (GTK_WIDGET (object), n_pspecs, pspecs);
}

Elliot Lee's avatar
Elliot Lee committed
306 307 308
static void
gtk_widget_class_init (GtkWidgetClass *klass)
{
Tim Janik's avatar
Tim Janik committed
309
  static GObjectNotifyContext cpn_context = { 0, NULL, NULL };
310 311
  GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
  GtkObjectClass *object_class = GTK_OBJECT_CLASS (klass);
Owen Taylor's avatar
Owen Taylor committed
312
  GtkBindingSet *binding_set;
313
  
Tim Janik's avatar
Tim Janik committed
314 315 316 317
  parent_class = g_type_class_peek_parent (klass);

  quark_property_parser = g_quark_from_static_string ("gtk-rc-property-parser");
  quark_aux_info = g_quark_from_static_string ("gtk-aux-info");
318 319
  quark_accel_path = g_quark_from_static_string ("gtk-accel-path");
  quark_accel_closures = g_quark_from_static_string ("gtk-accel-closures");
Tim Janik's avatar
Tim Janik committed
320 321 322 323 324 325 326 327
  quark_event_mask = g_quark_from_static_string ("gtk-event-mask");
  quark_extension_event_mode = g_quark_from_static_string ("gtk-extension-event-mode");
  quark_parent_window = g_quark_from_static_string ("gtk-parent-window");
  quark_shape_info = g_quark_from_static_string ("gtk-shape-info");
  quark_colormap = g_quark_from_static_string ("gtk-colormap");
  quark_pango_context = g_quark_from_static_string ("gtk-pango-context");
  quark_rc_style = g_quark_from_static_string ("gtk-rc-style");
  quark_accessible_object = g_quark_from_static_string ("gtk-accessible-object");
328
  quark_mnemonic_labels = g_quark_from_static_string ("gtk-mnemonic-labels");
Tim Janik's avatar
Tim Janik committed
329 330 331 332 333 334

  style_property_spec_pool = g_param_spec_pool_new (FALSE);
  _gtk_widget_child_property_pool = g_param_spec_pool_new (TRUE);
  cpn_context.quark_notify_queue = g_quark_from_static_string ("GtkWidget-child-property-notify-queue");
  cpn_context.dispatcher = child_property_notify_dispatcher;
  _gtk_widget_child_property_notify_context = &cpn_context;
335

Tim Janik's avatar
Tim Janik committed
336
  gobject_class->dispose = gtk_widget_dispose;
337
  gobject_class->finalize = gtk_widget_finalize;
Alexander Larsson's avatar
Alexander Larsson committed
338 339
  gobject_class->set_property = gtk_widget_set_property;
  gobject_class->get_property = gtk_widget_get_property;
340 341

  object_class->destroy = gtk_widget_real_destroy;
342
  
343 344
  klass->activate_signal = 0;
  klass->set_scroll_adjustments_signal = 0;
Tim Janik's avatar
Tim Janik committed
345
  klass->dispatch_child_properties_changed = gtk_widget_dispatch_child_properties_changed;
346 347 348 349 350 351 352 353 354 355 356 357
  klass->show = gtk_widget_real_show;
  klass->show_all = gtk_widget_show;
  klass->hide = gtk_widget_real_hide;
  klass->hide_all = gtk_widget_hide;
  klass->map = gtk_widget_real_map;
  klass->unmap = gtk_widget_real_unmap;
  klass->realize = gtk_widget_real_realize;
  klass->unrealize = gtk_widget_real_unrealize;
  klass->size_request = gtk_widget_real_size_request;
  klass->size_allocate = gtk_widget_real_size_allocate;
  klass->state_changed = NULL;
  klass->parent_set = NULL;
Owen Taylor's avatar
Owen Taylor committed
358
  klass->hierarchy_changed = NULL;
359
  klass->style_set = gtk_widget_style_set;
360
  klass->direction_changed = gtk_widget_direction_changed;
Tim Janik's avatar
Tim Janik committed
361 362
  klass->grab_notify = NULL;
  klass->child_notify = NULL;
363
  klass->mnemonic_activate = gtk_widget_real_mnemonic_activate;
364
  klass->grab_focus = gtk_widget_real_grab_focus;
365
  klass->focus = gtk_widget_real_focus;
366 367 368 369 370 371 372 373 374 375 376 377
  klass->event = NULL;
  klass->button_press_event = NULL;
  klass->button_release_event = NULL;
  klass->motion_notify_event = NULL;
  klass->delete_event = NULL;
  klass->destroy_event = NULL;
  klass->expose_event = NULL;
  klass->key_press_event = gtk_widget_real_key_press_event;
  klass->key_release_event = gtk_widget_real_key_release_event;
  klass->enter_notify_event = NULL;
  klass->leave_notify_event = NULL;
  klass->configure_event = NULL;
378 379
  klass->focus_in_event = gtk_widget_real_focus_in_event;
  klass->focus_out_event = gtk_widget_real_focus_out_event;
380 381
  klass->map_event = NULL;
  klass->unmap_event = NULL;
Havoc Pennington's avatar
Havoc Pennington committed
382
  klass->window_state_event = NULL;
383
  klass->property_notify_event = _gtk_selection_property_notify;
384
  klass->selection_clear_event = gtk_selection_clear;
385 386
  klass->selection_request_event = _gtk_selection_request;
  klass->selection_notify_event = _gtk_selection_notify;
387 388 389 390 391 392 393 394 395 396
  klass->selection_received = NULL;
  klass->proximity_in_event = NULL;
  klass->proximity_out_event = NULL;
  klass->drag_begin = NULL;
  klass->drag_end = NULL;
  klass->drag_data_delete = NULL;
  klass->drag_leave = NULL;
  klass->drag_motion = NULL;
  klass->drag_drop = NULL;
  klass->drag_data_received = NULL;
Owen Taylor's avatar
Owen Taylor committed
397
  klass->screen_changed = NULL;
398
  klass->can_activate_accel = gtk_widget_real_can_activate_accel;
399 400 401 402 403 404

  klass->show_help = gtk_widget_real_show_help;
  
  /* Accessibility support */
  klass->get_accessible = gtk_widget_real_get_accessible;

405 406
  klass->no_expose_event = NULL;

Alexander Larsson's avatar
Alexander Larsson committed
407 408 409
  g_object_class_install_property (gobject_class,
				   PROP_NAME,
				   g_param_spec_string ("name",
410 411
 							P_("Widget name"),
							P_("The name of the widget"),
Alexander Larsson's avatar
Alexander Larsson committed
412 413 414 415 416
							NULL,
							G_PARAM_READWRITE));
  g_object_class_install_property (gobject_class,
				   PROP_PARENT,
				   g_param_spec_object ("parent",
417 418
							P_("Parent widget"), 
							P_("The parent widget of this widget. Must be a Container widget"),
Alexander Larsson's avatar
Alexander Larsson committed
419 420
							GTK_TYPE_CONTAINER,
							G_PARAM_READWRITE));
Havoc Pennington's avatar
Havoc Pennington committed
421

Alexander Larsson's avatar
Alexander Larsson committed
422
  g_object_class_install_property (gobject_class,
Havoc Pennington's avatar
Havoc Pennington committed
423 424
				   PROP_WIDTH_REQUEST,
				   g_param_spec_int ("width_request",
425 426
 						     P_("Width request"),
 						     P_("Override for width request of the widget, or -1 if natural request should be used"),
Alexander Larsson's avatar
Alexander Larsson committed
427 428 429 430 431
 						     -1,
 						     G_MAXINT,
 						     -1,
 						     G_PARAM_READWRITE));
  g_object_class_install_property (gobject_class,
Havoc Pennington's avatar
Havoc Pennington committed
432 433
				   PROP_HEIGHT_REQUEST,
				   g_param_spec_int ("height_request",
434 435
 						     P_("Height request"),
 						     P_("Override for height request of the widget, or -1 if natural request should be used"),
Alexander Larsson's avatar
Alexander Larsson committed
436 437 438 439 440 441 442
 						     -1,
 						     G_MAXINT,
 						     -1,
 						     G_PARAM_READWRITE));
  g_object_class_install_property (gobject_class,
				   PROP_VISIBLE,
				   g_param_spec_boolean ("visible",
443 444
 							 P_("Visible"),
 							 P_("Whether the widget is visible"),
Alexander Larsson's avatar
Alexander Larsson committed
445 446 447 448 449
 							 FALSE,
 							 G_PARAM_READWRITE));
  g_object_class_install_property (gobject_class,
				   PROP_SENSITIVE,
				   g_param_spec_boolean ("sensitive",
450 451
 							 P_("Sensitive"),
 							 P_("Whether the widget responds to input"),
Alexander Larsson's avatar
Alexander Larsson committed
452 453 454 455 456
 							 TRUE,
 							 G_PARAM_READWRITE));
  g_object_class_install_property (gobject_class,
				   PROP_APP_PAINTABLE,
				   g_param_spec_boolean ("app_paintable",
457 458
 							 P_("Application paintable"),
 							 P_("Whether the application will paint directly on the widget"),
Alexander Larsson's avatar
Alexander Larsson committed
459 460 461 462 463
 							 FALSE,
 							 G_PARAM_READWRITE));
  g_object_class_install_property (gobject_class,
				   PROP_CAN_FOCUS,
				   g_param_spec_boolean ("can_focus",
464 465
 							 P_("Can focus"),
 							 P_("Whether the widget can accept the input focus"),
Alexander Larsson's avatar
Alexander Larsson committed
466 467 468 469 470
 							 FALSE,
 							 G_PARAM_READWRITE));
  g_object_class_install_property (gobject_class,
				   PROP_HAS_FOCUS,
				   g_param_spec_boolean ("has_focus",
471 472
 							 P_("Has focus"),
 							 P_("Whether the widget has the input focus"),
Alexander Larsson's avatar
Alexander Larsson committed
473 474
 							 FALSE,
 							 G_PARAM_READWRITE));
475
  g_object_class_install_property (gobject_class,
476
				   PROP_IS_FOCUS,
477
				   g_param_spec_boolean ("is_focus",
478 479
 							 P_("Is focus"),
 							 P_("Whether the widget is the focus widget within the toplevel"),
480 481
 							 FALSE,
 							 G_PARAM_READWRITE));
Alexander Larsson's avatar
Alexander Larsson committed
482 483 484
  g_object_class_install_property (gobject_class,
				   PROP_CAN_DEFAULT,
				   g_param_spec_boolean ("can_default",
485 486
 							 P_("Can default"),
 							 P_("Whether the widget can be the default widget"),
Alexander Larsson's avatar
Alexander Larsson committed
487 488 489 490 491
 							 FALSE,
 							 G_PARAM_READWRITE));
  g_object_class_install_property (gobject_class,
				   PROP_HAS_DEFAULT,
				   g_param_spec_boolean ("has_default",
492 493
 							 P_("Has default"),
 							 P_("Whether the widget is the default widget"),
Alexander Larsson's avatar
Alexander Larsson committed
494 495 496 497 498
 							 FALSE,
 							 G_PARAM_READWRITE));
  g_object_class_install_property (gobject_class,
				   PROP_RECEIVES_DEFAULT,
				   g_param_spec_boolean ("receives_default",
499 500
 							 P_("Receives default"),
 							 P_("If TRUE, the widget will receive the default action when it is focused"),
Alexander Larsson's avatar
Alexander Larsson committed
501 502 503 504 505
 							 FALSE,
 							 G_PARAM_READWRITE));
  g_object_class_install_property (gobject_class,
				   PROP_COMPOSITE_CHILD,
				   g_param_spec_boolean ("composite_child",
506 507
 							 P_("Composite child"),
 							 P_("Whether the widget is part of a composite widget"),
Alexander Larsson's avatar
Alexander Larsson committed
508
 							 FALSE,
509
 							 G_PARAM_READABLE));
Alexander Larsson's avatar
Alexander Larsson committed
510 511 512
  g_object_class_install_property (gobject_class,
				   PROP_STYLE,
				   g_param_spec_object ("style",
513 514
 							P_("Style"),
 							P_("The style of the widget, which contains information about how it will look (colors etc)"),
Alexander Larsson's avatar
Alexander Larsson committed
515 516 517 518 519
 							GTK_TYPE_STYLE,
 							G_PARAM_READWRITE));
  g_object_class_install_property (gobject_class,
				   PROP_EVENTS,
				   g_param_spec_flags ("events",
520 521
 						       P_("Events"),
 						       P_("The event mask that decides what kind of GdkEvents this widget gets"),
522
 						       GDK_TYPE_EVENT_MASK,
Alexander Larsson's avatar
Alexander Larsson committed
523 524 525 526 527
 						       GDK_STRUCTURE_MASK,
 						       G_PARAM_READWRITE));
  g_object_class_install_property (gobject_class,
				   PROP_EXTENSION_EVENTS,
				   g_param_spec_enum ("extension_events",
528 529
 						      P_("Extension events"),
 						      P_("The mask that decides what kind of extension events this widget gets"),
530
 						      GDK_TYPE_EXTENSION_MODE,
Alexander Larsson's avatar
Alexander Larsson committed
531 532
 						      GDK_EXTENSION_EVENTS_NONE,
 						      G_PARAM_READWRITE));
533 534 535
  g_object_class_install_property (gobject_class,
				   PROP_NO_SHOW_ALL,
				   g_param_spec_boolean ("no_show_all",
536 537
 							 P_("No show all"),
 							 P_("Whether gtk_widget_show_all() should not affect this widget"),
538 539
 							 FALSE,
 							 G_PARAM_READWRITE));
Elliot Lee's avatar
Elliot Lee committed
540
  widget_signals[SHOW] =
Manish Singh's avatar
Manish Singh committed
541 542 543 544 545 546 547
    g_signal_new ("show",
		  G_TYPE_FROM_CLASS (gobject_class),
		  G_SIGNAL_RUN_FIRST,
		  G_STRUCT_OFFSET (GtkWidgetClass, show),
		  NULL, NULL,
		  _gtk_marshal_VOID__VOID,
		  G_TYPE_NONE, 0);
Elliot Lee's avatar
Elliot Lee committed
548
  widget_signals[HIDE] =
Manish Singh's avatar
Manish Singh committed
549 550 551 552 553 554 555
    g_signal_new ("hide",
		  G_TYPE_FROM_CLASS (gobject_class),
		  G_SIGNAL_RUN_FIRST,
		  G_STRUCT_OFFSET (GtkWidgetClass, hide),
		  NULL, NULL,
		  _gtk_marshal_VOID__VOID,
		  G_TYPE_NONE, 0);
Elliot Lee's avatar
Elliot Lee committed
556
  widget_signals[MAP] =
Manish Singh's avatar
Manish Singh committed
557 558 559 560 561 562 563
    g_signal_new ("map",
		  G_TYPE_FROM_CLASS (gobject_class),
		  G_SIGNAL_RUN_FIRST,
		  G_STRUCT_OFFSET (GtkWidgetClass, map),
		  NULL, NULL,
		  _gtk_marshal_VOID__VOID,
		  G_TYPE_NONE, 0);
Elliot Lee's avatar
Elliot Lee committed
564
  widget_signals[UNMAP] =
Manish Singh's avatar
Manish Singh committed
565 566 567 568 569 570 571
    g_signal_new ("unmap",
		  G_TYPE_FROM_CLASS (gobject_class),
		  G_SIGNAL_RUN_FIRST,
		  G_STRUCT_OFFSET (GtkWidgetClass, unmap),
		  NULL, NULL,
		  _gtk_marshal_VOID__VOID,
		  G_TYPE_NONE, 0);
Elliot Lee's avatar
Elliot Lee committed
572
  widget_signals[REALIZE] =
Manish Singh's avatar
Manish Singh committed
573 574 575 576 577 578 579
    g_signal_new ("realize",
		  G_TYPE_FROM_CLASS (gobject_class),
		  G_SIGNAL_RUN_FIRST,
		  G_STRUCT_OFFSET (GtkWidgetClass, realize),
		  NULL, NULL,
		  _gtk_marshal_VOID__VOID,
		  G_TYPE_NONE, 0);
Elliot Lee's avatar
Elliot Lee committed
580
  widget_signals[UNREALIZE] =
Manish Singh's avatar
Manish Singh committed
581 582 583 584 585 586 587
    g_signal_new ("unrealize",
		  G_TYPE_FROM_CLASS (gobject_class),
		  G_SIGNAL_RUN_LAST,
		  G_STRUCT_OFFSET (GtkWidgetClass, unrealize),
		  NULL, NULL,
		  _gtk_marshal_VOID__VOID,
		  G_TYPE_NONE, 0);
Elliot Lee's avatar
Elliot Lee committed
588
  widget_signals[SIZE_REQUEST] =
589
    g_signal_new ("size_request",
Manish Singh's avatar
Manish Singh committed
590 591 592 593 594 595 596
		  G_TYPE_FROM_CLASS (gobject_class),
		  G_SIGNAL_RUN_FIRST,
		  G_STRUCT_OFFSET (GtkWidgetClass, size_request),
		  NULL, NULL,
		  _gtk_marshal_VOID__BOXED,
		  G_TYPE_NONE, 1,
		  GTK_TYPE_REQUISITION | G_SIGNAL_TYPE_STATIC_SCOPE);
597
  widget_signals[SIZE_ALLOCATE] = 
Manish Singh's avatar
Manish Singh committed
598 599 600 601 602 603 604 605
    g_signal_new ("size_allocate",
		  G_TYPE_FROM_CLASS (gobject_class),
		  G_SIGNAL_RUN_FIRST,
		  G_STRUCT_OFFSET (GtkWidgetClass, size_allocate),
		  NULL, NULL,
		  _gtk_marshal_VOID__BOXED,
		  G_TYPE_NONE, 1,
		  GDK_TYPE_RECTANGLE | G_SIGNAL_TYPE_STATIC_SCOPE);
Elliot Lee's avatar
Elliot Lee committed
606
  widget_signals[STATE_CHANGED] =
Manish Singh's avatar
Manish Singh committed
607 608 609 610 611 612 613 614
    g_signal_new ("state_changed",
		  G_TYPE_FROM_CLASS (gobject_class),
		  G_SIGNAL_RUN_FIRST,
		  G_STRUCT_OFFSET (GtkWidgetClass, state_changed),
		  NULL, NULL,
		  _gtk_marshal_VOID__ENUM,
		  G_TYPE_NONE, 1,
		  GTK_TYPE_STATE_TYPE);
615
  widget_signals[PARENT_SET] =
Manish Singh's avatar
Manish Singh committed
616 617 618 619 620 621 622 623
    g_signal_new ("parent_set",
		  G_TYPE_FROM_CLASS (gobject_class),
		  G_SIGNAL_RUN_FIRST,
		  G_STRUCT_OFFSET (GtkWidgetClass, parent_set),
		  NULL, NULL,
		  _gtk_marshal_VOID__OBJECT,
		  G_TYPE_NONE, 1,
		  GTK_TYPE_WIDGET);
Owen Taylor's avatar
Owen Taylor committed
624
  widget_signals[HIERARCHY_CHANGED] =
Manish Singh's avatar
Manish Singh committed
625 626 627 628 629 630 631 632
    g_signal_new ("hierarchy_changed",
		  G_TYPE_FROM_CLASS (gobject_class),
		  G_SIGNAL_RUN_LAST,
		  G_STRUCT_OFFSET (GtkWidgetClass, hierarchy_changed),
		  NULL, NULL,
		  _gtk_marshal_VOID__OBJECT,
		  G_TYPE_NONE, 1,
		  GTK_TYPE_WIDGET);
633
  widget_signals[STYLE_SET] =
Manish Singh's avatar
Manish Singh committed
634 635 636 637 638 639 640 641
    g_signal_new ("style_set",
		  G_TYPE_FROM_CLASS (gobject_class),
		  G_SIGNAL_RUN_FIRST,
		  G_STRUCT_OFFSET (GtkWidgetClass, style_set),
		  NULL, NULL,
		  _gtk_marshal_VOID__OBJECT,
		  G_TYPE_NONE, 1,
		  GTK_TYPE_STYLE);
642
  widget_signals[DIRECTION_CHANGED] =
Manish Singh's avatar
Manish Singh committed
643 644 645 646 647 648 649 650
    g_signal_new ("direction_changed",
		  G_TYPE_FROM_CLASS (gobject_class),
		  G_SIGNAL_RUN_FIRST,
		  G_STRUCT_OFFSET (GtkWidgetClass, direction_changed),
		  NULL, NULL,
		  _gtk_marshal_VOID__ENUM,
		  G_TYPE_NONE, 1,
		  GTK_TYPE_TEXT_DIRECTION);
651
  widget_signals[GRAB_NOTIFY] =
Manish Singh's avatar
Manish Singh committed
652 653 654 655 656 657 658 659
    g_signal_new ("grab_notify",
		  G_TYPE_FROM_CLASS (gobject_class),
		  G_SIGNAL_RUN_FIRST,
                  G_STRUCT_OFFSET (GtkWidgetClass, grab_notify),
		  NULL, NULL,
		  _gtk_marshal_VOID__BOOLEAN,
		  G_TYPE_NONE, 1,
		  G_TYPE_BOOLEAN);
660 661 662 663 664 665 666 667 668

/**
 * GtkWidget::child-notify:
 * @widget: the object which received the signal.
 * @pspec: the #GParamSpec of the changed child property.
 *
 * The ::child-notify signal is emitted for each child property that has 
 * changed on an object. The signal's detail holds the property name. 
 */
Tim Janik's avatar
Tim Janik committed
669
  widget_signals[CHILD_NOTIFY] =
670
    g_signal_new ("child_notify",
Manish Singh's avatar
Manish Singh committed
671
		   G_TYPE_FROM_CLASS (gobject_class),
Tim Janik's avatar
Tim Janik committed
672 673 674 675
		   G_SIGNAL_RUN_FIRST | G_SIGNAL_NO_RECURSE | G_SIGNAL_DETAILED | G_SIGNAL_NO_HOOKS,
		   G_STRUCT_OFFSET (GtkWidgetClass, child_notify),
		   NULL, NULL,
		   g_cclosure_marshal_VOID__PARAM,
Manish Singh's avatar
Manish Singh committed
676 677
		   G_TYPE_NONE, 1,
		   G_TYPE_PARAM);
678
  widget_signals[MNEMONIC_ACTIVATE] =
679
    g_signal_new ("mnemonic_activate",
Manish Singh's avatar
Manish Singh committed
680 681 682 683 684 685 686
		  G_TYPE_FROM_CLASS (gobject_class),
		  G_SIGNAL_RUN_LAST,
		  G_STRUCT_OFFSET (GtkWidgetClass, mnemonic_activate),
		  _gtk_boolean_handled_accumulator, NULL,
		  _gtk_marshal_BOOLEAN__BOOLEAN,
		  G_TYPE_BOOLEAN, 1,
		  G_TYPE_BOOLEAN);
687
  widget_signals[GRAB_FOCUS] =
Manish Singh's avatar
Manish Singh committed
688 689 690 691 692 693 694
    g_signal_new ("grab_focus",
		  G_TYPE_FROM_CLASS (gobject_class),
		  G_SIGNAL_RUN_LAST | G_SIGNAL_ACTION,
		  G_STRUCT_OFFSET (GtkWidgetClass, grab_focus),
		  NULL, NULL,
		  _gtk_marshal_VOID__VOID,
		  G_TYPE_NONE, 0);
695
  widget_signals[FOCUS] =
696
    g_signal_new ("focus",
Manish Singh's avatar
Manish Singh committed
697 698 699 700 701 702 703
		  G_TYPE_FROM_CLASS (object_class),
		  G_SIGNAL_RUN_LAST,
		  G_STRUCT_OFFSET (GtkWidgetClass, focus),
		  _gtk_boolean_handled_accumulator, NULL,
		  _gtk_marshal_BOOLEAN__ENUM,
		  G_TYPE_BOOLEAN, 1,
		  GTK_TYPE_DIRECTION_TYPE);
Elliot Lee's avatar
Elliot Lee committed
704
  widget_signals[EVENT] =
705
    g_signal_new ("event",
Manish Singh's avatar
Manish Singh committed
706 707 708 709 710 711 712
		  G_TYPE_FROM_CLASS (gobject_class),
		  G_SIGNAL_RUN_LAST,
		  G_STRUCT_OFFSET (GtkWidgetClass, event),
		  _gtk_boolean_handled_accumulator, NULL,
		  _gtk_marshal_BOOLEAN__BOXED,
		  G_TYPE_BOOLEAN, 1,
		  GDK_TYPE_EVENT | G_SIGNAL_TYPE_STATIC_SCOPE);
713
  widget_signals[EVENT_AFTER] =
714
    g_signal_new ("event-after",
Manish Singh's avatar
Manish Singh committed
715 716 717 718 719 720 721
		  G_TYPE_FROM_CLASS (gobject_class),
		  0,
		  0,
		  NULL, NULL,
		  _gtk_marshal_VOID__BOXED,
		  G_TYPE_NONE, 1,
		  GDK_TYPE_EVENT | G_SIGNAL_TYPE_STATIC_SCOPE);
Elliot Lee's avatar
Elliot Lee committed
722
  widget_signals[BUTTON_PRESS_EVENT] =
723
    g_signal_new ("button_press_event",
Manish Singh's avatar
Manish Singh committed
724 725 726 727 728 729 730
		  G_TYPE_FROM_CLASS (gobject_class),
		  G_SIGNAL_RUN_LAST,
		  G_STRUCT_OFFSET (GtkWidgetClass, button_press_event),
		  _gtk_boolean_handled_accumulator, NULL,
		  _gtk_marshal_BOOLEAN__BOXED,
		  G_TYPE_BOOLEAN, 1,
		  GDK_TYPE_EVENT | G_SIGNAL_TYPE_STATIC_SCOPE);
Elliot Lee's avatar
Elliot Lee committed
731
  widget_signals[BUTTON_RELEASE_EVENT] =
732
    g_signal_new ("button_release_event",
Manish Singh's avatar
Manish Singh committed
733 734 735 736 737 738 739
		  G_TYPE_FROM_CLASS (gobject_class),
		  G_SIGNAL_RUN_LAST,
		  G_STRUCT_OFFSET (GtkWidgetClass, button_release_event),
		  _gtk_boolean_handled_accumulator, NULL,
		  _gtk_marshal_BOOLEAN__BOXED,
		  G_TYPE_BOOLEAN, 1,
		  GDK_TYPE_EVENT | G_SIGNAL_TYPE_STATIC_SCOPE);
740
  widget_signals[SCROLL_EVENT] =
741
    g_signal_new ("scroll_event",
Manish Singh's avatar
Manish Singh committed
742 743 744 745 746 747 748
		  G_TYPE_FROM_CLASS (gobject_class),
		  G_SIGNAL_RUN_LAST,
		  G_STRUCT_OFFSET (GtkWidgetClass, scroll_event),
		  _gtk_boolean_handled_accumulator, NULL,
		  _gtk_marshal_BOOLEAN__BOXED,
		  G_TYPE_BOOLEAN, 1,
		  GDK_TYPE_EVENT | G_SIGNAL_TYPE_STATIC_SCOPE);
Elliot Lee's avatar
Elliot Lee committed
749
  widget_signals[MOTION_NOTIFY_EVENT] =
750
    g_signal_new ("motion_notify_event",
Manish Singh's avatar
Manish Singh committed
751 752 753 754 755 756 757
		  G_TYPE_FROM_CLASS (gobject_class),
		  G_SIGNAL_RUN_LAST,
		  G_STRUCT_OFFSET (GtkWidgetClass, motion_notify_event),
		  _gtk_boolean_handled_accumulator, NULL,
		  _gtk_marshal_BOOLEAN__BOXED,
		  G_TYPE_BOOLEAN, 1,
		  GDK_TYPE_EVENT | G_SIGNAL_TYPE_STATIC_SCOPE);
Elliot Lee's avatar
Elliot Lee committed
758
  widget_signals[DELETE_EVENT] =
759
    g_signal_new ("delete_event",
Manish Singh's avatar
Manish Singh committed
760 761 762 763 764 765 766
		  G_TYPE_FROM_CLASS (gobject_class),
		  G_SIGNAL_RUN_LAST,
		  G_STRUCT_OFFSET (GtkWidgetClass, delete_event),
		  _gtk_boolean_handled_accumulator, NULL,
		  _gtk_marshal_BOOLEAN__BOXED,
		  G_TYPE_BOOLEAN, 1,
		  GDK_TYPE_EVENT | G_SIGNAL_TYPE_STATIC_SCOPE);
Elliot Lee's avatar
Elliot Lee committed
767
  widget_signals[DESTROY_EVENT] =
768
    g_signal_new ("destroy_event",
Manish Singh's avatar
Manish Singh committed
769 770 771 772 773 774 775
		  G_TYPE_FROM_CLASS (gobject_class),
		  G_SIGNAL_RUN_LAST,
		  G_STRUCT_OFFSET (GtkWidgetClass, destroy_event),
		  _gtk_boolean_handled_accumulator, NULL,
		  _gtk_marshal_BOOLEAN__BOXED,
		  G_TYPE_BOOLEAN, 1,
		  GDK_TYPE_EVENT | G_SIGNAL_TYPE_STATIC_SCOPE);
Elliot Lee's avatar
Elliot Lee committed
776
  widget_signals[EXPOSE_EVENT] =
777
    g_signal_new ("expose_event",
Manish Singh's avatar
Manish Singh committed
778 779 780 781 782 783 784
		  G_TYPE_FROM_CLASS (gobject_class),
		  G_SIGNAL_RUN_LAST,
		  G_STRUCT_OFFSET (GtkWidgetClass, expose_event),
		  _gtk_boolean_handled_accumulator, NULL,
		  _gtk_marshal_BOOLEAN__BOXED,
		  G_TYPE_BOOLEAN, 1,
		  GDK_TYPE_EVENT | G_SIGNAL_TYPE_STATIC_SCOPE);
Elliot Lee's avatar
Elliot Lee committed
785
  widget_signals[KEY_PRESS_EVENT] =
786
    g_signal_new ("key_press_event",
Manish Singh's avatar
Manish Singh committed
787 788 789 790 791 792 793
		  G_TYPE_FROM_CLASS (gobject_class),
		  G_SIGNAL_RUN_LAST,
		  G_STRUCT_OFFSET (GtkWidgetClass, key_press_event),
		  _gtk_boolean_handled_accumulator, NULL,
		  _gtk_marshal_BOOLEAN__BOXED,
		  G_TYPE_BOOLEAN, 1,
		  GDK_TYPE_EVENT | G_SIGNAL_TYPE_STATIC_SCOPE);
Elliot Lee's avatar
Elliot Lee committed
794
  widget_signals[KEY_RELEASE_EVENT] =
795
    g_signal_new ("key_release_event",
Manish Singh's avatar
Manish Singh committed
796 797 798 799 800 801 802
		  G_TYPE_FROM_CLASS (gobject_class),
		  G_SIGNAL_RUN_LAST,
		  G_STRUCT_OFFSET (GtkWidgetClass, key_release_event),
		  _gtk_boolean_handled_accumulator, NULL,
		  _gtk_marshal_BOOLEAN__BOXED,
		  G_TYPE_BOOLEAN, 1,
		  GDK_TYPE_EVENT | G_SIGNAL_TYPE_STATIC_SCOPE);
Elliot Lee's avatar
Elliot Lee committed
803
  widget_signals[ENTER_NOTIFY_EVENT] =
804
    g_signal_new ("enter_notify_event",
Manish Singh's avatar
Manish Singh committed
805 806 807 808 809 810 811
		  G_TYPE_FROM_CLASS (gobject_class),
		  G_SIGNAL_RUN_LAST,
		  G_STRUCT_OFFSET (GtkWidgetClass, enter_notify_event),
		  _gtk_boolean_handled_accumulator, NULL,
		  _gtk_marshal_BOOLEAN__BOXED,
		  G_TYPE_BOOLEAN, 1,
		  GDK_TYPE_EVENT | G_SIGNAL_TYPE_STATIC_SCOPE);
Elliot Lee's avatar
Elliot Lee committed
812
  widget_signals[LEAVE_NOTIFY_EVENT] =
813
    g_signal_new ("leave_notify_event",
Manish Singh's avatar
Manish Singh committed
814 815 816 817 818 819 820
		  G_TYPE_FROM_CLASS (gobject_class),
		  G_SIGNAL_RUN_LAST,
		  G_STRUCT_OFFSET (GtkWidgetClass, leave_notify_event),
		  _gtk_boolean_handled_accumulator, NULL,
		  _gtk_marshal_BOOLEAN__BOXED,
		  G_TYPE_BOOLEAN, 1,
		  GDK_TYPE_EVENT | G_SIGNAL_TYPE_STATIC_SCOPE);
Elliot Lee's avatar
Elliot Lee committed
821
  widget_signals[CONFIGURE_EVENT] =
822
    g_signal_new ("configure_event",
Manish Singh's avatar
Manish Singh committed
823 824 825 826 827 828 829
		  G_TYPE_FROM_CLASS (gobject_class),
		  G_SIGNAL_RUN_LAST,
		  G_STRUCT_OFFSET (GtkWidgetClass, configure_event),
		  _gtk_boolean_handled_accumulator, NULL,
		  _gtk_marshal_BOOLEAN__BOXED,
		  G_TYPE_BOOLEAN, 1,
		  GDK_TYPE_EVENT | G_SIGNAL_TYPE_STATIC_SCOPE);
Elliot Lee's avatar
Elliot Lee committed
830
  widget_signals[FOCUS_IN_EVENT] =
831
    g_signal_new ("focus_in_event",
Manish Singh's avatar
Manish Singh committed
832 833 834 835 836 837 838
		  G_TYPE_FROM_CLASS (gobject_class),
		  G_SIGNAL_RUN_LAST,
		  G_STRUCT_OFFSET (GtkWidgetClass, focus_in_event),
		  _gtk_boolean_handled_accumulator, NULL,
		  _gtk_marshal_BOOLEAN__BOXED,
		  G_TYPE_BOOLEAN, 1,
		  GDK_TYPE_EVENT | G_SIGNAL_TYPE_STATIC_SCOPE);
Elliot Lee's avatar
Elliot Lee committed
839
  widget_signals[FOCUS_OUT_EVENT] =
840
    g_signal_new ("focus_out_event",
Manish Singh's avatar
Manish Singh committed
841 842 843 844 845 846 847
		  G_TYPE_FROM_CLASS (gobject_class),
		  G_SIGNAL_RUN_LAST,
		  G_STRUCT_OFFSET (GtkWidgetClass, focus_out_event),
		  _gtk_boolean_handled_accumulator, NULL,
		  _gtk_marshal_BOOLEAN__BOXED,
		  G_TYPE_BOOLEAN, 1,
		  GDK_TYPE_EVENT | G_SIGNAL_TYPE_STATIC_SCOPE);
Elliot Lee's avatar
Elliot Lee committed
848
  widget_signals[MAP_EVENT] =
849
    g_signal_new ("map_event",
Manish Singh's avatar
Manish Singh committed
850 851 852 853 854 855 856
		  G_TYPE_FROM_CLASS (gobject_class),
		  G_SIGNAL_RUN_LAST,
		  G_STRUCT_OFFSET (GtkWidgetClass, map_event),
		  _gtk_boolean_handled_accumulator, NULL,
		  _gtk_marshal_BOOLEAN__BOXED,
		  G_TYPE_BOOLEAN, 1,
		  GDK_TYPE_EVENT | G_SIGNAL_TYPE_STATIC_SCOPE);
Elliot Lee's avatar
Elliot Lee committed
857
  widget_signals[UNMAP_EVENT] =
858
    g_signal_new ("unmap_event",
Manish Singh's avatar
Manish Singh committed
859 860 861 862 863 864 865
		  G_TYPE_FROM_CLASS (gobject_class),
		  G_SIGNAL_RUN_LAST,
		  G_STRUCT_OFFSET (GtkWidgetClass, unmap_event),
		  _gtk_boolean_handled_accumulator, NULL,
		  _gtk_marshal_BOOLEAN__BOXED,
		  G_TYPE_BOOLEAN, 1,
		  GDK_TYPE_EVENT | G_SIGNAL_TYPE_STATIC_SCOPE);
Elliot Lee's avatar
Elliot Lee committed
866
  widget_signals[PROPERTY_NOTIFY_EVENT] =
867
    g_signal_new ("property_notify_event",
Manish Singh's avatar
Manish Singh committed
868 869 870 871 872 873 874
		  G_TYPE_FROM_CLASS (gobject_class),
		  G_SIGNAL_RUN_LAST,
		  G_STRUCT_OFFSET (GtkWidgetClass, property_notify_event),
		  _gtk_boolean_handled_accumulator, NULL,
		  _gtk_marshal_BOOLEAN__BOXED,
		  G_TYPE_BOOLEAN, 1,
		  GDK_TYPE_EVENT | G_SIGNAL_TYPE_STATIC_SCOPE);
Elliot Lee's avatar
Elliot Lee committed
875
  widget_signals[SELECTION_CLEAR_EVENT] =
876
    g_signal_new ("selection_clear_event",
Manish Singh's avatar
Manish Singh committed
877 878 879 880 881 882 883
		  G_TYPE_FROM_CLASS (gobject_class),
		  G_SIGNAL_RUN_LAST,
		  G_STRUCT_OFFSET (GtkWidgetClass, selection_clear_event),
		  _gtk_boolean_handled_accumulator, NULL,
		  _gtk_marshal_BOOLEAN__BOXED,
		  G_TYPE_BOOLEAN, 1,
		  GDK_TYPE_EVENT | G_SIGNAL_TYPE_STATIC_SCOPE);
Elliot Lee's avatar
Elliot Lee committed
884
  widget_signals[SELECTION_REQUEST_EVENT] =
885
    g_signal_new ("selection_request_event",
Manish Singh's avatar
Manish Singh committed
886 887 888 889 890 891 892
		  G_TYPE_FROM_CLASS (gobject_class),
		  G_SIGNAL_RUN_LAST,
		  G_STRUCT_OFFSET (GtkWidgetClass, selection_request_event),
		  _gtk_boolean_handled_accumulator, NULL,
		  _gtk_marshal_BOOLEAN__BOXED,
		  G_TYPE_BOOLEAN, 1,
		  GDK_TYPE_EVENT | G_SIGNAL_TYPE_STATIC_SCOPE);
Elliot Lee's avatar
Elliot Lee committed
893
  widget_signals[SELECTION_NOTIFY_EVENT] =
894
    g_signal_new ("selection_notify_event",
Manish Singh's avatar
Manish Singh committed
895 896 897 898 899 900 901
		  G_TYPE_FROM_CLASS (gobject_class),
		  G_SIGNAL_RUN_LAST,
		  G_STRUCT_OFFSET (GtkWidgetClass, selection_notify_event),
		  _gtk_boolean_handled_accumulator, NULL,
		  _gtk_marshal_BOOLEAN__BOXED,
		  G_TYPE_BOOLEAN, 1,
		  GDK_TYPE_EVENT | G_SIGNAL_TYPE_STATIC_SCOPE);
Elliot Lee's avatar
Elliot Lee committed
902
  widget_signals[SELECTION_RECEIVED] =
903
    g_signal_new ("selection_received",
Manish Singh's avatar
Manish Singh committed
904
		  G_TYPE_FROM_CLASS (gobject_class),
905 906 907
		  G_SIGNAL_RUN_LAST,
		  G_STRUCT_OFFSET (GtkWidgetClass, selection_received),
		  NULL, NULL,
908
		  _gtk_marshal_VOID__BOXED_UINT,
909 910 911
		  G_TYPE_NONE, 2,
		  GTK_TYPE_SELECTION_DATA | G_SIGNAL_TYPE_STATIC_SCOPE,
		  G_TYPE_UINT);
912
  widget_signals[SELECTION_GET] =
913
    g_signal_new ("selection_get",
Manish Singh's avatar
Manish Singh committed
914
		  G_TYPE_FROM_CLASS (gobject_class),
915 916 917
		  G_SIGNAL_RUN_LAST,
		  G_STRUCT_OFFSET (GtkWidgetClass, selection_get),
		  NULL, NULL,
918
		  _gtk_marshal_VOID__BOXED_UINT_UINT,
919 920 921 922
		  G_TYPE_NONE, 3,
		  GTK_TYPE_SELECTION_DATA | G_SIGNAL_TYPE_STATIC_SCOPE,
		  G_TYPE_UINT,
		  G_TYPE_UINT);
Elliot Lee's avatar
Elliot Lee committed
923
  widget_signals[PROXIMITY_IN_EVENT] =
924
    g_signal_new ("proximity_in_event",
Manish Singh's avatar
Manish Singh committed
925 926 927 928 929 930 931
		  G_TYPE_FROM_CLASS (gobject_class),
		  G_SIGNAL_RUN_LAST,
		  G_STRUCT_OFFSET (GtkWidgetClass, proximity_in_event),
		  _gtk_boolean_handled_accumulator, NULL,
		  _gtk_marshal_BOOLEAN__BOXED,
		  G_TYPE_BOOLEAN, 1,
		  GDK_TYPE_EVENT | G_SIGNAL_TYPE_STATIC_SCOPE);
Elliot Lee's avatar
Elliot Lee committed
932
  widget_signals[PROXIMITY_OUT_EVENT] =
933
    g_signal_new ("proximity_out_event",
Manish Singh's avatar
Manish Singh committed
934 935 936 937 938 939 940
		  G_TYPE_FROM_CLASS (gobject_class),
		  G_SIGNAL_RUN_LAST,
		  G_STRUCT_OFFSET (GtkWidgetClass, proximity_out_event),
		  _gtk_boolean_handled_accumulator, NULL,
		  _gtk_marshal_BOOLEAN__BOXED,
		  G_TYPE_BOOLEAN, 1,
		  GDK_TYPE_EVENT | G_SIGNAL_TYPE_STATIC_SCOPE);
Matthias Clasen's avatar
Matthias Clasen committed
941 942 943 944 945 946 947 948 949 950 951

  /**
   * GtkWidget::drag-leave:
   * @widget: the object which received the signal.
   * @drag_context: the drag context
   * @time: the timestamp of the motion event
   *
   * The ::drag-leave signal is emitted on the drop site when the cursor leaves the widget.
   * A typical reason to connect to this signal is to undo things done in ::drag-motion, e.g.
   * undo highlighting with gtk_drag_unhighlight()
   */
952
  widget_signals[DRAG_LEAVE] =
Manish Singh's avatar
Manish Singh committed
953 954 955 956 957 958 959 960 961
    g_signal_new ("drag_leave",
		  G_TYPE_FROM_CLASS (gobject_class),
		  G_SIGNAL_RUN_LAST,
		  G_STRUCT_OFFSET (GtkWidgetClass, drag_leave),
		  NULL, NULL,
		  _gtk_marshal_VOID__OBJECT_UINT,
		  G_TYPE_NONE, 2,
		  GDK_TYPE_DRAG_CONTEXT,
		  G_TYPE_UINT);
Matthias Clasen's avatar
Matthias Clasen committed
962 963 964 965 966 967 968 969 970 971

  /**
   * GtkWidget::drag-begin:
   * @widget: the object which received the signal.
   * @drag_context: the drag context
   *
   * The ::drag-begin signal is emitted on the drag source when a drag is started. 
   * A typical reason to connect to this signal is to set up a custom drag icon with
   * gtk_drag_source_set_icon().
   */
972
  widget_signals[DRAG_BEGIN] =
Manish Singh's avatar
Manish Singh committed
973 974 975 976 977 978 979 980
    g_signal_new ("drag_begin",
		  G_TYPE_FROM_CLASS (gobject_class),
		  G_SIGNAL_RUN_LAST,
		  G_STRUCT_OFFSET (GtkWidgetClass, drag_begin),
		  NULL, NULL,
		  _gtk_marshal_VOID__OBJECT,
		  G_TYPE_NONE, 1,
		  GDK_TYPE_DRAG_CONTEXT);
Matthias Clasen's avatar
Matthias Clasen committed
981 982 983 984 985 986 987 988 989

  /**
   * GtkWidget::drag-end:
   * @widget: the object which received the signal.
   * @drag_context: the drag context
   *
   * The ::drag-end signal is emitted on the drag source when a drag is finished. 
   * A typical reason to connect to this signal is to undo things done in ::drag-begin.
   */
990
  widget_signals[DRAG_END] =
Manish Singh's avatar
Manish Singh committed
991 992 993 994 995 996 997 998
    g_signal_new ("drag_end",
		  G_TYPE_FROM_CLASS (gobject_class),
		  G_SIGNAL_RUN_LAST,
		  G_STRUCT_OFFSET (GtkWidgetClass, drag_end),
		  NULL, NULL,
		  _gtk_marshal_VOID__OBJECT,
		  G_TYPE_NONE, 1,
		  GDK_TYPE_DRAG_CONTEXT);
Matthias Clasen's avatar
Matthias Clasen committed
999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009

  /**
   * GtkWidget::drag-data-delete:
   * @widget: the object which received the signal.
   * @drag_context: the drag context
   *
   * The ::drag-data-delete signal is emitted on the drag source when a drag with the action
   * %GDK_ACTION_MOVE is successfully completed. The signal handler is responsible for deleting
   * the data that has been dropped. What "delete" means, depends on the context of the drag
   * operation. 
   */
1010
  widget_signals[DRAG_DATA_DELETE] =
Manish Singh's avatar
Manish Singh committed
1011 1012 1013 1014 1015 1016 1017 1018
    g_signal_new ("drag_data_delete",
		  G_TYPE_FROM_CLASS (gobject_class),
		  G_SIGNAL_RUN_LAST,
		  G_STRUCT_OFFSET (GtkWidgetClass, drag_data_delete),
		  NULL, NULL,
		  _gtk_marshal_VOID__OBJECT,
		  G_TYPE_NONE, 1,
		  GDK_TYPE_DRAG_CONTEXT);
Matthias Clasen's avatar
Matthias Clasen committed
1019 1020 1021 1022 1023 1024 1025 1026

  /**
   * GtkWidget::drag-motion:
   * @widget: the object which received the signal.
   * @drag_context: the drag context
   * @x: the x coordin