gtkwidget.c 197 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/. 
 */

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

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


enum {
  SHOW,
  HIDE,
  MAP,
  UNMAP,
  REALIZE,
  UNREALIZE,
  SIZE_REQUEST,
  SIZE_ALLOCATE,
  STATE_CHANGED,
69
  PARENT_SET,
Owen Taylor's avatar
Owen Taylor committed
70
  HIERARCHY_CHANGED,
71
  STYLE_SET,
72
  DIRECTION_CHANGED,
73
  GRAB_NOTIFY,
Tim Janik's avatar
Tim Janik committed
74
  CHILD_NOTIFY,
75
  MNEMONIC_ACTIVATE,
76
  GRAB_FOCUS,
77
  FOCUS,
Elliot Lee's avatar
Elliot Lee committed
78
  EVENT,
79
  EVENT_AFTER,
Elliot Lee's avatar
Elliot Lee committed
80 81
  BUTTON_PRESS_EVENT,
  BUTTON_RELEASE_EVENT,
82
  SCROLL_EVENT,
Elliot Lee's avatar
Elliot Lee committed
83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99
  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,
100
  SELECTION_GET,
Elliot Lee's avatar
Elliot Lee committed
101 102 103
  SELECTION_RECEIVED,
  PROXIMITY_IN_EVENT,
  PROXIMITY_OUT_EVENT,
104 105 106 107 108 109 110 111
  DRAG_BEGIN,
  DRAG_END,
  DRAG_DATA_DELETE,
  DRAG_LEAVE,
  DRAG_MOTION,
  DRAG_DROP,
  DRAG_DATA_GET,
  DRAG_DATA_RECEIVED,
112
  CLIENT_EVENT,
113
  NO_EXPOSE_EVENT,
114
  VISIBILITY_NOTIFY_EVENT,
Havoc Pennington's avatar
Havoc Pennington committed
115
  WINDOW_STATE_EVENT,
Owen Taylor's avatar
Owen Taylor committed
116
  POPUP_MENU,
117
  SHOW_HELP,
118
  ACCEL_CLOSURES_CHANGED,
Owen Taylor's avatar
Owen Taylor committed
119
  SCREEN_CHANGED,
Elliot Lee's avatar
Elliot Lee committed
120 121 122
  LAST_SIGNAL
};

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

144 145 146 147 148
typedef	struct	_GtkStateData	 GtkStateData;

struct _GtkStateData
{
  GtkStateType  state;
149
  guint		state_restoration : 1;
150
  guint         parent_sensitive : 1;
151
  guint		use_forall : 1;
152
};
Elliot Lee's avatar
Elliot Lee committed
153

Tim Janik's avatar
Tim Janik committed
154 155 156 157 158

/* --- 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
159 160 161
						  guint              prop_id,
						  const GValue      *value,
						  GParamSpec        *pspec);
Tim Janik's avatar
Tim Janik committed
162
static void	gtk_widget_get_property		 (GObject           *object,
Alexander Larsson's avatar
Alexander Larsson committed
163 164 165
						  guint              prop_id,
						  GValue            *value,
						  GParamSpec        *pspec);
Tim Janik's avatar
Tim Janik committed
166
static void	gtk_widget_dispose		 (GObject	    *object);
Tim Janik's avatar
Tim Janik committed
167 168 169 170 171 172 173 174 175
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,
176
						  GtkRequisition    *requisition);
Tim Janik's avatar
Tim Janik committed
177
static void	gtk_widget_real_size_allocate	 (GtkWidget	    *widget,
178
						  GtkAllocation	    *allocation);
Tim Janik's avatar
Tim Janik committed
179
static void	gtk_widget_style_set		 (GtkWidget	    *widget,
180
						  GtkStyle          *previous_style);
Tim Janik's avatar
Tim Janik committed
181
static void	gtk_widget_direction_changed	 (GtkWidget	    *widget,
182
						  GtkTextDirection   previous_direction);
183

Tim Janik's avatar
Tim Janik committed
184
static void	gtk_widget_real_grab_focus	 (GtkWidget         *focus_widget);
185
static gboolean gtk_widget_real_show_help        (GtkWidget         *widget,
186 187
                                                  GtkWidgetHelpType  help_type);

Tim Janik's avatar
Tim Janik committed
188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203
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);
204
static void             gtk_widget_reset_rc_style               (GtkWidget        *widget);
Tim Janik's avatar
Tim Janik committed
205 206 207 208 209 210 211 212 213 214 215
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);
216 217
static void             gtk_widget_invalidate_widget_windows    (GtkWidget        *widget,
								 GdkRegion        *region);
218
static GdkScreen *      gtk_widget_get_screen_unchecked         (GtkWidget        *widget);
219

220 221 222 223
static void gtk_widget_set_usize_internal (GtkWidget *widget,
					   gint       width,
					   gint       height);

Tim Janik's avatar
Tim Janik committed
224 225

/* --- variables --- */
226 227 228 229 230 231 232 233
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;
234

Tim Janik's avatar
Tim Janik committed
235 236
static GQuark		quark_property_parser = 0;
static GQuark		quark_aux_info = 0;
237 238
static GQuark		quark_accel_path = 0;
static GQuark		quark_accel_closures = 0;
Tim Janik's avatar
Tim Janik committed
239 240 241 242 243 244 245 246 247 248 249 250
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;
GParamSpecPool         *_gtk_widget_child_property_pool = NULL;
GObjectNotifyContext   *_gtk_widget_child_property_notify_context = NULL;

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

279 280
      widget_type = g_type_register_static (GTK_TYPE_OBJECT, "GtkWidget", 
					    &widget_info, G_TYPE_FLAG_ABSTRACT);
281 282 283 284

      g_type_add_interface_static (widget_type, ATK_TYPE_IMPLEMENTOR,
                                   &accessibility_info) ;

Elliot Lee's avatar
Elliot Lee committed
285
    }
286
  
Elliot Lee's avatar
Elliot Lee committed
287 288 289
  return widget_type;
}

Tim Janik's avatar
Tim Janik committed
290 291 292 293 294 295 296 297
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
298 299 300
static void
gtk_widget_class_init (GtkWidgetClass *klass)
{
Tim Janik's avatar
Tim Janik committed
301
  static GObjectNotifyContext cpn_context = { 0, NULL, NULL };
302 303
  GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
  GtkObjectClass *object_class = GTK_OBJECT_CLASS (klass);
Owen Taylor's avatar
Owen Taylor committed
304
  GtkBindingSet *binding_set;
305
  
Tim Janik's avatar
Tim Janik committed
306 307 308 309
  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");
310 311
  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
312 313 314 315 316 317 318 319 320 321 322 323 324 325
  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");

  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;
326

Tim Janik's avatar
Tim Janik committed
327
  gobject_class->dispose = gtk_widget_dispose;
328
  gobject_class->finalize = gtk_widget_finalize;
Alexander Larsson's avatar
Alexander Larsson committed
329 330
  gobject_class->set_property = gtk_widget_set_property;
  gobject_class->get_property = gtk_widget_get_property;
331 332

  object_class->destroy = gtk_widget_real_destroy;
333
  
334 335
  klass->activate_signal = 0;
  klass->set_scroll_adjustments_signal = 0;
Tim Janik's avatar
Tim Janik committed
336
  klass->dispatch_child_properties_changed = gtk_widget_dispatch_child_properties_changed;
337 338 339 340 341 342 343 344 345 346 347 348
  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
349
  klass->hierarchy_changed = NULL;
350
  klass->style_set = gtk_widget_style_set;
351
  klass->direction_changed = gtk_widget_direction_changed;
Tim Janik's avatar
Tim Janik committed
352 353
  klass->grab_notify = NULL;
  klass->child_notify = NULL;
354
  klass->mnemonic_activate = gtk_widget_real_mnemonic_activate;
355
  klass->grab_focus = gtk_widget_real_grab_focus;
356
  klass->focus = gtk_widget_real_focus;
357 358 359 360 361 362 363 364 365 366 367 368
  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;
369 370
  klass->focus_in_event = gtk_widget_real_focus_in_event;
  klass->focus_out_event = gtk_widget_real_focus_out_event;
371 372
  klass->map_event = NULL;
  klass->unmap_event = NULL;
Havoc Pennington's avatar
Havoc Pennington committed
373
  klass->window_state_event = NULL;
374
  klass->property_notify_event = _gtk_selection_property_notify;
375
  klass->selection_clear_event = gtk_selection_clear;
376 377
  klass->selection_request_event = _gtk_selection_request;
  klass->selection_notify_event = _gtk_selection_notify;
378 379 380 381 382 383 384 385 386 387
  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
388
  klass->screen_changed = NULL;
389 390 391 392 393 394

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

395 396
  klass->no_expose_event = NULL;

Alexander Larsson's avatar
Alexander Larsson committed
397 398 399 400 401 402 403 404 405 406
  g_object_class_install_property (gobject_class,
				   PROP_NAME,
				   g_param_spec_string ("name",
 							_("Widget name"),
							_("The name of the widget"),
							NULL,
							G_PARAM_READWRITE));
  g_object_class_install_property (gobject_class,
				   PROP_PARENT,
				   g_param_spec_object ("parent",
407
							_("Parent widget"), 
Soren Sandmann's avatar
Soren Sandmann committed
408
							_("The parent widget of this widget. Must be a Container widget"),
Alexander Larsson's avatar
Alexander Larsson committed
409 410
							GTK_TYPE_CONTAINER,
							G_PARAM_READWRITE));
Havoc Pennington's avatar
Havoc Pennington committed
411

Alexander Larsson's avatar
Alexander Larsson committed
412
  g_object_class_install_property (gobject_class,
Havoc Pennington's avatar
Havoc Pennington committed
413 414 415
				   PROP_WIDTH_REQUEST,
				   g_param_spec_int ("width_request",
 						     _("Width request"),
Soren Sandmann's avatar
Soren Sandmann committed
416
 						     _("Override for width request of the widget, or -1 if natural request should be used"),
Alexander Larsson's avatar
Alexander Larsson committed
417 418 419 420 421
 						     -1,
 						     G_MAXINT,
 						     -1,
 						     G_PARAM_READWRITE));
  g_object_class_install_property (gobject_class,
Havoc Pennington's avatar
Havoc Pennington committed
422 423 424
				   PROP_HEIGHT_REQUEST,
				   g_param_spec_int ("height_request",
 						     _("Height request"),
Soren Sandmann's avatar
Soren Sandmann committed
425
 						     _("Override for height request of the widget, or -1 if natural request should be used"),
Alexander Larsson's avatar
Alexander Larsson committed
426 427 428 429 430 431 432 433 434 435 436 437 438 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
 						     -1,
 						     G_MAXINT,
 						     -1,
 						     G_PARAM_READWRITE));
  g_object_class_install_property (gobject_class,
				   PROP_VISIBLE,
				   g_param_spec_boolean ("visible",
 							 _("Visible"),
 							 _("Whether the widget is visible"),
 							 FALSE,
 							 G_PARAM_READWRITE));
  g_object_class_install_property (gobject_class,
				   PROP_SENSITIVE,
				   g_param_spec_boolean ("sensitive",
 							 _("Sensitive"),
 							 _("Whether the widget responds to input"),
 							 TRUE,
 							 G_PARAM_READWRITE));
  g_object_class_install_property (gobject_class,
				   PROP_APP_PAINTABLE,
				   g_param_spec_boolean ("app_paintable",
 							 _("Application paintable"),
 							 _("Whether the application will paint directly on the widget"),
 							 FALSE,
 							 G_PARAM_READWRITE));
  g_object_class_install_property (gobject_class,
				   PROP_CAN_FOCUS,
				   g_param_spec_boolean ("can_focus",
 							 _("Can focus"),
 							 _("Whether the widget can accept the input focus"),
 							 FALSE,
 							 G_PARAM_READWRITE));
  g_object_class_install_property (gobject_class,
				   PROP_HAS_FOCUS,
				   g_param_spec_boolean ("has_focus",
 							 _("Has focus"),
 							 _("Whether the widget has the input focus"),
 							 FALSE,
 							 G_PARAM_READWRITE));
465 466 467 468 469 470 471
  g_object_class_install_property (gobject_class,
				   PROP_HAS_FOCUS,
				   g_param_spec_boolean ("is_focus",
 							 _("Is focus"),
 							 _("Whether the widget is the focus widget within the toplevel"),
 							 FALSE,
 							 G_PARAM_READWRITE));
Alexander Larsson's avatar
Alexander Larsson committed
472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489
  g_object_class_install_property (gobject_class,
				   PROP_CAN_DEFAULT,
				   g_param_spec_boolean ("can_default",
 							 _("Can default"),
 							 _("Whether the widget can be the default widget"),
 							 FALSE,
 							 G_PARAM_READWRITE));
  g_object_class_install_property (gobject_class,
				   PROP_HAS_DEFAULT,
				   g_param_spec_boolean ("has_default",
 							 _("Has default"),
 							 _("Whether the widget is the default widget"),
 							 FALSE,
 							 G_PARAM_READWRITE));
  g_object_class_install_property (gobject_class,
				   PROP_RECEIVES_DEFAULT,
				   g_param_spec_boolean ("receives_default",
 							 _("Receives default"),
Soren Sandmann's avatar
Soren Sandmann committed
490
 							 _("If TRUE, the widget will receive the default action when it is focused"),
Alexander Larsson's avatar
Alexander Larsson committed
491 492 493 494 495 496
 							 FALSE,
 							 G_PARAM_READWRITE));
  g_object_class_install_property (gobject_class,
				   PROP_COMPOSITE_CHILD,
				   g_param_spec_boolean ("composite_child",
 							 _("Composite child"),
497
 							 _("Whether the widget is part of a composite widget"),
Alexander Larsson's avatar
Alexander Larsson committed
498
 							 FALSE,
499
 							 G_PARAM_READABLE));
Alexander Larsson's avatar
Alexander Larsson committed
500 501 502 503
  g_object_class_install_property (gobject_class,
				   PROP_STYLE,
				   g_param_spec_object ("style",
 							_("Style"),
Soren Sandmann's avatar
Soren Sandmann committed
504
 							_("The style of the widget, which contains information about how it will look (colors etc)"),
Alexander Larsson's avatar
Alexander Larsson committed
505 506 507 508 509 510
 							GTK_TYPE_STYLE,
 							G_PARAM_READWRITE));
  g_object_class_install_property (gobject_class,
				   PROP_EVENTS,
				   g_param_spec_flags ("events",
 						       _("Events"),
Soren Sandmann's avatar
Soren Sandmann committed
511
 						       _("The event mask that decides what kind of GdkEvents this widget gets"),
512
 						       GDK_TYPE_EVENT_MASK,
Alexander Larsson's avatar
Alexander Larsson committed
513 514 515 516 517 518
 						       GDK_STRUCTURE_MASK,
 						       G_PARAM_READWRITE));
  g_object_class_install_property (gobject_class,
				   PROP_EXTENSION_EVENTS,
				   g_param_spec_enum ("extension_events",
 						      _("Extension events"),
Soren Sandmann's avatar
Soren Sandmann committed
519
 						      _("The mask that decides what kind of extension events this widget gets"),
520
 						      GDK_TYPE_EXTENSION_MODE,
Alexander Larsson's avatar
Alexander Larsson committed
521 522
 						      GDK_EXTENSION_EVENTS_NONE,
 						      G_PARAM_READWRITE));
Elliot Lee's avatar
Elliot Lee committed
523
  widget_signals[SHOW] =
Manish Singh's avatar
Manish Singh committed
524 525 526 527 528 529 530
    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
531
  widget_signals[HIDE] =
Manish Singh's avatar
Manish Singh committed
532 533 534 535 536 537 538
    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
539
  widget_signals[MAP] =
Manish Singh's avatar
Manish Singh committed
540 541 542 543 544 545 546
    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
547
  widget_signals[UNMAP] =
Manish Singh's avatar
Manish Singh committed
548 549 550 551 552 553 554
    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
555
  widget_signals[REALIZE] =
Manish Singh's avatar
Manish Singh committed
556 557 558 559 560 561 562
    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
563
  widget_signals[UNREALIZE] =
Manish Singh's avatar
Manish Singh committed
564 565 566 567 568 569 570
    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
571
  widget_signals[SIZE_REQUEST] =
572
    g_signal_new ("size_request",
Manish Singh's avatar
Manish Singh committed
573 574 575 576 577 578 579
		  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);
580
  widget_signals[SIZE_ALLOCATE] = 
Manish Singh's avatar
Manish Singh committed
581 582 583 584 585 586 587 588
    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
589
  widget_signals[STATE_CHANGED] =
Manish Singh's avatar
Manish Singh committed
590 591 592 593 594 595 596 597
    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);
598
  widget_signals[PARENT_SET] =
Manish Singh's avatar
Manish Singh committed
599 600 601 602 603 604 605 606
    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
607
  widget_signals[HIERARCHY_CHANGED] =
Manish Singh's avatar
Manish Singh committed
608 609 610 611 612 613 614 615
    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);
616
  widget_signals[STYLE_SET] =
Manish Singh's avatar
Manish Singh committed
617 618 619 620 621 622 623 624
    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);
625
  widget_signals[DIRECTION_CHANGED] =
Manish Singh's avatar
Manish Singh committed
626 627 628 629 630 631 632 633
    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);
634
  widget_signals[GRAB_NOTIFY] =
Manish Singh's avatar
Manish Singh committed
635 636 637 638 639 640 641 642
    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);
Tim Janik's avatar
Tim Janik committed
643
  widget_signals[CHILD_NOTIFY] =
644
    g_signal_new ("child_notify",
Manish Singh's avatar
Manish Singh committed
645
		   G_TYPE_FROM_CLASS (gobject_class),
Tim Janik's avatar
Tim Janik committed
646 647 648 649
		   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
650 651
		   G_TYPE_NONE, 1,
		   G_TYPE_PARAM);
652
  widget_signals[MNEMONIC_ACTIVATE] =
653
    g_signal_new ("mnemonic_activate",
Manish Singh's avatar
Manish Singh committed
654 655 656 657 658 659 660
		  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);
661
  widget_signals[GRAB_FOCUS] =
Manish Singh's avatar
Manish Singh committed
662 663 664 665 666 667 668
    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);
669
  widget_signals[FOCUS] =
670
    g_signal_new ("focus",
Manish Singh's avatar
Manish Singh committed
671 672 673 674 675 676 677
		  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
678
  widget_signals[EVENT] =
679
    g_signal_new ("event",
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, event),
		  _gtk_boolean_handled_accumulator, NULL,
		  _gtk_marshal_BOOLEAN__BOXED,
		  G_TYPE_BOOLEAN, 1,
		  GDK_TYPE_EVENT | G_SIGNAL_TYPE_STATIC_SCOPE);
687
  widget_signals[EVENT_AFTER] =
688
    g_signal_new ("event-after",
Manish Singh's avatar
Manish Singh committed
689 690 691 692 693 694 695
		  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
696
  widget_signals[BUTTON_PRESS_EVENT] =
697
    g_signal_new ("button_press_event",
Manish Singh's avatar
Manish Singh committed
698 699 700 701 702 703 704
		  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
705
  widget_signals[BUTTON_RELEASE_EVENT] =
706
    g_signal_new ("button_release_event",
Manish Singh's avatar
Manish Singh committed
707 708 709 710 711 712 713
		  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);
714
  widget_signals[SCROLL_EVENT] =
715
    g_signal_new ("scroll_event",
Manish Singh's avatar
Manish Singh committed
716 717 718 719 720 721 722
		  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
723
  widget_signals[MOTION_NOTIFY_EVENT] =
724
    g_signal_new ("motion_notify_event",
Manish Singh's avatar
Manish Singh committed
725 726 727 728 729 730 731
		  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
732
  widget_signals[DELETE_EVENT] =
733
    g_signal_new ("delete_event",
Manish Singh's avatar
Manish Singh committed
734 735 736 737 738 739 740
		  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
741
  widget_signals[DESTROY_EVENT] =
742
    g_signal_new ("destroy_event",
Manish Singh's avatar
Manish Singh committed
743 744 745 746 747 748 749
		  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
750
  widget_signals[EXPOSE_EVENT] =
751
    g_signal_new ("expose_event",
Manish Singh's avatar
Manish Singh committed
752 753 754 755 756 757 758
		  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
759
  widget_signals[KEY_PRESS_EVENT] =
760
    g_signal_new ("key_press_event",
Manish Singh's avatar
Manish Singh committed
761 762 763 764 765 766 767
		  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
768
  widget_signals[KEY_RELEASE_EVENT] =
769
    g_signal_new ("key_release_event",
Manish Singh's avatar
Manish Singh committed
770 771 772 773 774 775 776
		  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
777
  widget_signals[ENTER_NOTIFY_EVENT] =
778
    g_signal_new ("enter_notify_event",
Manish Singh's avatar
Manish Singh committed
779 780 781 782 783 784 785
		  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
786
  widget_signals[LEAVE_NOTIFY_EVENT] =
787
    g_signal_new ("leave_notify_event",
Manish Singh's avatar
Manish Singh committed
788 789 790 791 792 793 794
		  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
795
  widget_signals[CONFIGURE_EVENT] =
796
    g_signal_new ("configure_event",
Manish Singh's avatar
Manish Singh committed
797 798 799 800 801 802 803
		  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
804
  widget_signals[FOCUS_IN_EVENT] =
805
    g_signal_new ("focus_in_event",
Manish Singh's avatar
Manish Singh committed
806 807 808 809 810 811 812
		  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
813
  widget_signals[FOCUS_OUT_EVENT] =
814
    g_signal_new ("focus_out_event",
Manish Singh's avatar
Manish Singh committed
815 816 817 818 819 820 821
		  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
822
  widget_signals[MAP_EVENT] =
823
    g_signal_new ("map_event",
Manish Singh's avatar
Manish Singh committed
824 825 826 827 828 829 830
		  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
831
  widget_signals[UNMAP_EVENT] =
832
    g_signal_new ("unmap_event",
Manish Singh's avatar
Manish Singh committed
833 834 835 836 837 838 839
		  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
840
  widget_signals[PROPERTY_NOTIFY_EVENT] =
841
    g_signal_new ("property_notify_event",
Manish Singh's avatar
Manish Singh committed
842 843 844 845 846 847 848
		  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
849
  widget_signals[SELECTION_CLEAR_EVENT] =
850
    g_signal_new ("selection_clear_event",
Manish Singh's avatar
Manish Singh committed
851 852 853 854 855 856 857
		  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
858
  widget_signals[SELECTION_REQUEST_EVENT] =
859
    g_signal_new ("selection_request_event",
Manish Singh's avatar
Manish Singh committed
860 861 862 863 864 865 866
		  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
867
  widget_signals[SELECTION_NOTIFY_EVENT] =
868
    g_signal_new ("selection_notify_event",
Manish Singh's avatar
Manish Singh committed
869 870 871 872 873 874 875
		  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
876
  widget_signals[SELECTION_RECEIVED] =
877
    g_signal_new ("selection_received",
Manish Singh's avatar
Manish Singh committed
878
		  G_TYPE_FROM_CLASS (gobject_class),
879 880 881
		  G_SIGNAL_RUN_LAST,
		  G_STRUCT_OFFSET (GtkWidgetClass, selection_received),
		  NULL, NULL,
882
		  _gtk_marshal_VOID__BOXED_UINT,
883 884 885
		  G_TYPE_NONE, 2,
		  GTK_TYPE_SELECTION_DATA | G_SIGNAL_TYPE_STATIC_SCOPE,
		  G_TYPE_UINT);
886
  widget_signals[SELECTION_GET] =
887
    g_signal_new ("selection_get",
Manish Singh's avatar
Manish Singh committed
888
		  G_TYPE_FROM_CLASS (gobject_class),
889 890 891
		  G_SIGNAL_RUN_LAST,
		  G_STRUCT_OFFSET (GtkWidgetClass, selection_get),
		  NULL, NULL,
892
		  _gtk_marshal_VOID__BOXED_UINT_UINT,
893 894 895 896
		  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
897
  widget_signals[PROXIMITY_IN_EVENT] =
898
    g_signal_new ("proximity_in_event",
Manish Singh's avatar
Manish Singh committed
899 900 901 902 903 904 905
		  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
906
  widget_signals[PROXIMITY_OUT_EVENT] =
907
    g_signal_new ("proximity_out_event",
Manish Singh's avatar
Manish Singh committed
908 909 910 911 912 913 914
		  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);
915
  widget_signals[DRAG_LEAVE] =
Manish Singh's avatar
Manish Singh committed
916 917 918 919 920 921 922 923 924
    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);
925
  widget_signals[DRAG_BEGIN] =
Manish Singh's avatar
Manish Singh committed
926 927 928 929 930 931 932 933
    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);
934
  widget_signals[DRAG_END] =
Manish Singh's avatar
Manish Singh committed
935 936 937 938 939 940 941 942
    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);
943
  widget_signals[DRAG_DATA_DELETE] =
Manish Singh's avatar
Manish Singh committed
944 945 946 947 948 949 950 951
    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);
952
  widget_signals[DRAG_MOTION] =
953
    g_signal_new ("drag_motion",
Manish Singh's avatar
Manish Singh committed
954 955 956 957
		  G_TYPE_FROM_CLASS (gobject_class),
		  G_SIGNAL_RUN_LAST,
		  G_STRUCT_OFFSET (GtkWidgetClass, drag_motion),
		  _gtk_boolean_handled_accumulator, NULL,
958
		  _gtk_marshal_BOOLEAN__OBJECT_INT_INT_UINT,
959 960 961 962 963
		  G_TYPE_BOOLEAN, 4,
		  GDK_TYPE_DRAG_CONTEXT,
		  G_TYPE_INT,
		  G_TYPE_INT,
		  G_TYPE_UINT);
964
  widget_signals[DRAG_DROP] =
965
    g_signal_new ("drag_drop",
Manish Singh's avatar
Manish Singh committed
966 967 968 969
		  G_TYPE_FROM_CLASS (gobject_class),
		  G_SIGNAL_RUN_LAST,
		  G_STRUCT_OFFSET (GtkWidgetClass, drag_drop),
		  _gtk_boolean_handled_accumulator, NULL,
970
		  _gtk_marshal_BOOLEAN__OBJECT_INT_INT_UINT,
971 972 973 974 975
		  G_TYPE_BOOLEAN, 4,
		  GDK_TYPE_DRAG_CONTEXT,
		  G_TYPE_INT,
		  G_TYPE_INT,
		  G_TYPE_UINT);
976
  widget_signals[DRAG_DATA_GET] =
977
    g_signal_new ("drag_data_get",
Manish Singh's avatar
Manish Singh committed
978
		  G_TYPE_FROM_CLASS (gobject_class),
979 980 981
		  G_SIGNAL_RUN_LAST,
		  G_STRUCT_OFFSET (GtkWidgetClass, drag_data_get),
		  NULL, NULL,
982
		  _gtk_marshal_VOID__OBJECT_BOXED_UINT_UINT,
983 984 985 986 987
		  G_TYPE_NONE, 4,
		  GDK_TYPE_DRAG_CONTEXT,
		  GTK_TYPE_SELECTION_DATA | G_SIGNAL_TYPE_STATIC_SCOPE,
		  G_TYPE_UINT,
		  G_TYPE_UINT);
988
  widget_signals[DRAG_DATA_RECEIVED] =
989
    g_signal_new ("drag_data_received",
Manish Singh's avatar
Manish Singh committed
990
		  G_TYPE_FROM_CLASS (gobject_class),
991
		  G_SIGNAL_RUN_LAST,
Manish Singh's avatar
Manish Singh committed
992
		  G_STRUCT_OFFSET (GtkWidgetClass, drag_data_received),
993
		  NULL, NULL,
994
		  _gtk_marshal_VOID__OBJECT_INT_INT_BOXED_UINT_UINT,
995 996 997 998 999 1000 1001
		  G_TYPE_NONE, 6,
		  GDK_TYPE_DRAG_CONTEXT,
		  G_TYPE_INT,
		  G_TYPE_INT,
		  GTK_TYPE_SELECTION_DATA | G_SIGNAL_TYPE_STATIC_SCOPE,
		  G_TYPE_UINT,
		  G_TYPE_UINT);
Tim Janik's avatar
Tim Janik committed
1002
  widget_signals[VISIBILITY_NOTIFY_EVENT] =
1003
    g_signal_new ("visibility_notify_event",
Manish Singh's avatar
Manish Singh committed
1004
		  G_TYPE_FROM_CLASS (gobject_class),
1005
		  G_SIGNAL_RUN_LAST,
Manish Singh's avatar
Manish Singh committed
1006 1007
		  G_STRUCT_OFFSET (GtkWidgetClass, visibility_notify_event),
		  _gtk_boolean_handled_accumulator, NULL,
1008
		  _gtk_marshal_BOOLEAN__BOXED,
1009
		  G_TYPE_BOOLEAN, 1,
Manish Singh's avatar
Manish Singh committed
1010
		  GDK_TYPE_EVENT | G_SIGNAL_TYPE_STATIC_SCOPE);
1011
  widget_signals[CLIENT_EVENT] =
1012
    g_signal_new ("client_event",
Manish Singh's avatar
Manish Singh committed
1013
		  G_TYPE_FROM_CLASS (gobject_class),
1014
		  G_SIGNAL_RUN_LAST,
Manish Singh's avatar
Manish Singh committed
1015
		  G_STRUCT_OFFSET (GtkWidgetClass, client_event),
1016
		  _gtk_boolean_handled_accumulator, NULL,
1017
		  _gtk_marshal_BOOLEAN__BOXED,