gtkwidget.c 297 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>
Elliot Lee's avatar
Elliot Lee committed
31
#include "gtkcontainer.h"
32
#include "gtkaccelmap.h"
33
#include "gtkclipboard.h"
34
#include "gtkiconfactory.h"
35
#include "gtkintl.h"
Elliot Lee's avatar
Elliot Lee committed
36
#include "gtkmain.h"
37
#include "gtkmarshalers.h"
Elliot Lee's avatar
Elliot Lee committed
38 39
#include "gtkrc.h"
#include "gtkselection.h"
40
#include "gtksettings.h"
41
#include "gtksizegroup.h"
Elliot Lee's avatar
Elliot Lee committed
42 43
#include "gtkwidget.h"
#include "gtkwindow.h"
Tim Janik's avatar
Tim Janik committed
44
#include "gtkbindings.h"
45
#include "gtkprivate.h"
Elliot Lee's avatar
Elliot Lee committed
46
#include "gdk/gdk.h"
47
#include "gdk/gdkprivate.h" /* Used in gtk_reset_shapes_recurse to avoid copy */
Tim Janik's avatar
Tim Janik committed
48 49
#include <gobject/gvaluecollector.h>
#include <gobject/gobjectnotifyqueue.c>
Owen Taylor's avatar
Owen Taylor committed
50
#include "gdk/gdkkeysyms.h"
51
#include "gtkaccessible.h"
Kristian Rietveld's avatar
Kristian Rietveld committed
52
#include "gtktooltip.h"
53
#include "gtkinvisible.h"
Johan Dahlin's avatar
Johan Dahlin committed
54
#include "gtkbuildable.h"
55
#include "gtkbuilderprivate.h"
56
#include "gtkalias.h"
Elliot Lee's avatar
Elliot Lee committed
57

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


enum {
  SHOW,
  HIDE,
  MAP,
  UNMAP,
  REALIZE,
  UNREALIZE,
  SIZE_REQUEST,
  SIZE_ALLOCATE,
  STATE_CHANGED,
72
  PARENT_SET,
Owen Taylor's avatar
Owen Taylor committed
73
  HIERARCHY_CHANGED,
74
  STYLE_SET,
75
  DIRECTION_CHANGED,
76
  GRAB_NOTIFY,
Tim Janik's avatar
Tim Janik committed
77
  CHILD_NOTIFY,
78
  MNEMONIC_ACTIVATE,
79
  GRAB_FOCUS,
80
  FOCUS,
81
  MOVE_FOCUS,
Elliot Lee's avatar
Elliot Lee committed
82
  EVENT,
83
  EVENT_AFTER,
Elliot Lee's avatar
Elliot Lee committed
84 85
  BUTTON_PRESS_EVENT,
  BUTTON_RELEASE_EVENT,
86
  SCROLL_EVENT,
Elliot Lee's avatar
Elliot Lee committed
87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103
  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,
104
  SELECTION_GET,
Elliot Lee's avatar
Elliot Lee committed
105 106 107
  SELECTION_RECEIVED,
  PROXIMITY_IN_EVENT,
  PROXIMITY_OUT_EVENT,
108 109 110 111 112 113 114 115
  DRAG_BEGIN,
  DRAG_END,
  DRAG_DATA_DELETE,
  DRAG_LEAVE,
  DRAG_MOTION,
  DRAG_DROP,
  DRAG_DATA_GET,
  DRAG_DATA_RECEIVED,
116
  CLIENT_EVENT,
117
  NO_EXPOSE_EVENT,
118
  VISIBILITY_NOTIFY_EVENT,
119
  WINDOW_STATE_EVENT,
Owen Taylor's avatar
Owen Taylor committed
120
  POPUP_MENU,
121
  SHOW_HELP,
122
  ACCEL_CLOSURES_CHANGED,
Owen Taylor's avatar
Owen Taylor committed
123
  SCREEN_CHANGED,
124
  CAN_ACTIVATE_ACCEL,
125
  GRAB_BROKEN,
Søren Sandmann's avatar
Søren Sandmann committed
126
  COMPOSITED_CHANGED,
Kristian Rietveld's avatar
Kristian Rietveld committed
127
  QUERY_TOOLTIP,
128
  KEYNAV_FAILED,
129
  DRAG_FAILED,
130
  DAMAGE_EVENT,
Elliot Lee's avatar
Elliot Lee committed
131 132 133
  LAST_SIGNAL
};

134
enum {
Alexander Larsson's avatar
Alexander Larsson committed
135 136 137
  PROP_0,
  PROP_NAME,
  PROP_PARENT,
Havoc Pennington's avatar
Havoc Pennington committed
138 139
  PROP_WIDTH_REQUEST,
  PROP_HEIGHT_REQUEST,
Alexander Larsson's avatar
Alexander Larsson committed
140 141 142 143 144
  PROP_VISIBLE,
  PROP_SENSITIVE,
  PROP_APP_PAINTABLE,
  PROP_CAN_FOCUS,
  PROP_HAS_FOCUS,
145
  PROP_IS_FOCUS,
Alexander Larsson's avatar
Alexander Larsson committed
146 147 148 149 150 151
  PROP_CAN_DEFAULT,
  PROP_HAS_DEFAULT,
  PROP_RECEIVES_DEFAULT,
  PROP_COMPOSITE_CHILD,
  PROP_STYLE,
  PROP_EVENTS,
152
  PROP_EXTENSION_EVENTS,
Kristian Rietveld's avatar
Kristian Rietveld committed
153 154
  PROP_NO_SHOW_ALL,
  PROP_HAS_TOOLTIP,
155 156
  PROP_TOOLTIP_MARKUP,
  PROP_TOOLTIP_TEXT
157 158
};

159 160 161 162 163
typedef	struct	_GtkStateData	 GtkStateData;

struct _GtkStateData
{
  GtkStateType  state;
164
  guint		state_restoration : 1;
165
  guint         parent_sensitive : 1;
166
  guint		use_forall : 1;
167
};
Elliot Lee's avatar
Elliot Lee committed
168

Tim Janik's avatar
Tim Janik committed
169
/* --- prototypes --- */
170 171 172
static void	gtk_widget_class_init		(GtkWidgetClass     *klass);
static void	gtk_widget_base_class_finalize	(GtkWidgetClass     *klass);
static void	gtk_widget_init			(GtkWidget          *widget);
Tim Janik's avatar
Tim Janik committed
173
static void	gtk_widget_set_property		 (GObject           *object,
Alexander Larsson's avatar
Alexander Larsson committed
174 175 176
						  guint              prop_id,
						  const GValue      *value,
						  GParamSpec        *pspec);
Tim Janik's avatar
Tim Janik committed
177
static void	gtk_widget_get_property		 (GObject           *object,
Alexander Larsson's avatar
Alexander Larsson committed
178 179 180
						  guint              prop_id,
						  GValue            *value,
						  GParamSpec        *pspec);
Tim Janik's avatar
Tim Janik committed
181
static void	gtk_widget_dispose		 (GObject	    *object);
Tim Janik's avatar
Tim Janik committed
182 183 184 185 186 187 188 189 190
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,
191
						  GtkRequisition    *requisition);
Tim Janik's avatar
Tim Janik committed
192
static void	gtk_widget_real_size_allocate	 (GtkWidget	    *widget,
193
						  GtkAllocation	    *allocation);
Tim Janik's avatar
Tim Janik committed
194
static void	gtk_widget_style_set		 (GtkWidget	    *widget,
195
						  GtkStyle          *previous_style);
Tim Janik's avatar
Tim Janik committed
196
static void	gtk_widget_direction_changed	 (GtkWidget	    *widget,
197
						  GtkTextDirection   previous_direction);
198

Tim Janik's avatar
Tim Janik committed
199
static void	gtk_widget_real_grab_focus	 (GtkWidget         *focus_widget);
Kristian Rietveld's avatar
Kristian Rietveld committed
200 201 202 203 204
static gboolean gtk_widget_real_query_tooltip    (GtkWidget         *widget,
						  gint               x,
						  gint               y,
						  gboolean           keyboard_tip,
						  GtkTooltip        *tooltip);
205
static gboolean gtk_widget_real_show_help        (GtkWidget         *widget,
206 207
                                                  GtkWidgetHelpType  help_type);

Tim Janik's avatar
Tim Janik committed
208 209 210 211 212 213 214 215 216 217 218 219 220
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);
221 222
static void             gtk_widget_real_move_focus              (GtkWidget        *widget,
                                                                 GtkDirectionType  direction);
223 224
static gboolean		gtk_widget_real_keynav_failed		(GtkWidget        *widget,
								 GtkDirectionType  direction);
Tim Janik's avatar
Tim Janik committed
225
static PangoContext*	gtk_widget_peek_pango_context		(GtkWidget	  *widget);
226
static void     	gtk_widget_update_pango_context		(GtkWidget	  *widget);
Tim Janik's avatar
Tim Janik committed
227 228
static void		gtk_widget_propagate_state		(GtkWidget	  *widget,
								 GtkStateData 	  *data);
229
static void             gtk_widget_reset_rc_style               (GtkWidget        *widget);
Tim Janik's avatar
Tim Janik committed
230 231 232 233 234 235 236 237 238 239 240
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);
241 242
static void             gtk_widget_invalidate_widget_windows    (GtkWidget        *widget,
								 GdkRegion        *region);
243
static GdkScreen *      gtk_widget_get_screen_unchecked         (GtkWidget        *widget);
Soeren Sandmann's avatar
Soeren Sandmann committed
244
static void		gtk_widget_queue_shallow_draw		(GtkWidget        *widget);
245 246
static gboolean         gtk_widget_real_can_activate_accel      (GtkWidget *widget,
                                                                 guint      signal_id);
Kristian Rietveld's avatar
Kristian Rietveld committed
247

248
static void             gtk_widget_real_set_has_tooltip         (GtkWidget *widget,
Kristian Rietveld's avatar
Kristian Rietveld committed
249 250
								 gboolean   has_tooltip,
								 gboolean   force);
Johan Dahlin's avatar
Johan Dahlin committed
251 252 253 254
static void             gtk_widget_buildable_interface_init     (GtkBuildableIface *iface);
static void             gtk_widget_buildable_set_name           (GtkBuildable     *buildable,
                                                                 const gchar      *name);
static const gchar *    gtk_widget_buildable_get_name           (GtkBuildable     *buildable);
255 256 257
static GObject *        gtk_widget_buildable_get_internal_child (GtkBuildable *buildable,
								 GtkBuilder   *builder,
								 const gchar  *childname);
258 259 260 261
static void             gtk_widget_buildable_set_buildable_property (GtkBuildable     *buildable,
								     GtkBuilder       *builder,
								     const gchar      *name,
								     const GValue     *value);
Johan Dahlin's avatar
Johan Dahlin committed
262 263 264 265 266 267
static gboolean         gtk_widget_buildable_custom_tag_start   (GtkBuildable     *buildable,
                                                                 GtkBuilder       *builder,
                                                                 GObject          *child,
                                                                 const gchar      *tagname,
                                                                 GMarkupParser    *parser,
                                                                 gpointer         *data);
268
static void             gtk_widget_buildable_custom_finished    (GtkBuildable     *buildable,
Johan Dahlin's avatar
Johan Dahlin committed
269 270 271 272
                                                                 GtkBuilder       *builder,
                                                                 GObject          *child,
                                                                 const gchar      *tagname,
                                                                 gpointer          data);
273
static void             gtk_widget_buildable_parser_finished    (GtkBuildable     *buildable,
Johan Dahlin's avatar
Johan Dahlin committed
274 275
                                                                 GtkBuilder       *builder);

276
     
277 278 279
static void gtk_widget_set_usize_internal (GtkWidget *widget,
					   gint       width,
					   gint       height);
280 281
static void gtk_widget_get_draw_rectangle (GtkWidget    *widget,
					   GdkRectangle *rect);
282

Tim Janik's avatar
Tim Janik committed
283 284

/* --- variables --- */
285
static gpointer         gtk_widget_parent_class = NULL;
286 287 288 289 290 291
static guint            widget_signals[LAST_SIGNAL] = { 0 };
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;
292

Tim Janik's avatar
Tim Janik committed
293 294
static GQuark		quark_property_parser = 0;
static GQuark		quark_aux_info = 0;
295 296
static GQuark		quark_accel_path = 0;
static GQuark		quark_accel_closures = 0;
Tim Janik's avatar
Tim Janik committed
297 298 299 300
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;
301
static GQuark		quark_input_shape_info = 0;
Tim Janik's avatar
Tim Janik committed
302 303 304 305
static GQuark		quark_colormap = 0;
static GQuark		quark_pango_context = 0;
static GQuark		quark_rc_style = 0;
static GQuark		quark_accessible_object = 0;
306
static GQuark		quark_mnemonic_labels = 0;
Kristian Rietveld's avatar
Kristian Rietveld committed
307 308 309
static GQuark		quark_tooltip_markup = 0;
static GQuark		quark_has_tooltip = 0;
static GQuark		quark_tooltip_window = 0;
Tim Janik's avatar
Tim Janik committed
310 311 312 313
GParamSpecPool         *_gtk_widget_child_property_pool = NULL;
GObjectNotifyContext   *_gtk_widget_child_property_notify_context = NULL;

/* --- functions --- */
314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341
GType
gtk_widget_get_type (void)
{
  static GType widget_type = 0;

  if (G_UNLIKELY (widget_type == 0))
    {
      const GTypeInfo widget_info =
      {
	sizeof (GtkWidgetClass),
	NULL,		/* base_init */
	(GBaseFinalizeFunc) gtk_widget_base_class_finalize,
	(GClassInitFunc) gtk_widget_class_init,
	NULL,		/* class_finalize */
	NULL,		/* class_init */
	sizeof (GtkWidget),
	0,		/* n_preallocs */
	(GInstanceInitFunc) gtk_widget_init,
	NULL,		/* value_table */
      };

      const GInterfaceInfo accessibility_info =
      {
	(GInterfaceInitFunc) gtk_widget_accessible_interface_init,
	(GInterfaceFinalizeFunc) NULL,
	NULL /* interface data */
      };

Johan Dahlin's avatar
Johan Dahlin committed
342 343 344 345 346 347 348
      const GInterfaceInfo buildable_info =
      {
	(GInterfaceInitFunc) gtk_widget_buildable_interface_init,
	(GInterfaceFinalizeFunc) NULL,
	NULL /* interface data */
      };

349 350 351 352 353
      widget_type = g_type_register_static (GTK_TYPE_OBJECT, "GtkWidget",
                                           &widget_info, G_TYPE_FLAG_ABSTRACT);

      g_type_add_interface_static (widget_type, ATK_TYPE_IMPLEMENTOR,
                                   &accessibility_info) ;
Johan Dahlin's avatar
Johan Dahlin committed
354 355
      g_type_add_interface_static (widget_type, GTK_TYPE_BUILDABLE,
                                   &buildable_info) ;
356 357 358 359 360

    }

  return widget_type;
}
Elliot Lee's avatar
Elliot Lee committed
361

Tim Janik's avatar
Tim Janik committed
362 363 364 365 366 367 368 369
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
370 371 372
static void
gtk_widget_class_init (GtkWidgetClass *klass)
{
Tim Janik's avatar
Tim Janik committed
373
  static GObjectNotifyContext cpn_context = { 0, NULL, NULL };
374 375
  GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
  GtkObjectClass *object_class = GTK_OBJECT_CLASS (klass);
Owen Taylor's avatar
Owen Taylor committed
376
  GtkBindingSet *binding_set;
377 378 379

  gtk_widget_parent_class = g_type_class_peek_parent (klass);

Tim Janik's avatar
Tim Janik committed
380 381
  quark_property_parser = g_quark_from_static_string ("gtk-rc-property-parser");
  quark_aux_info = g_quark_from_static_string ("gtk-aux-info");
382 383
  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
384 385 386 387
  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");
388
  quark_input_shape_info = g_quark_from_static_string ("gtk-input-shape-info");
Tim Janik's avatar
Tim Janik committed
389 390 391 392
  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");
393
  quark_mnemonic_labels = g_quark_from_static_string ("gtk-mnemonic-labels");
Kristian Rietveld's avatar
Kristian Rietveld committed
394 395 396
  quark_tooltip_markup = g_quark_from_static_string ("gtk-tooltip-markup");
  quark_has_tooltip = g_quark_from_static_string ("gtk-has-tooltip");
  quark_tooltip_window = g_quark_from_static_string ("gtk-tooltip-window");
Tim Janik's avatar
Tim Janik committed
397 398 399 400 401 402

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

Tim Janik's avatar
Tim Janik committed
404
  gobject_class->dispose = gtk_widget_dispose;
405
  gobject_class->finalize = gtk_widget_finalize;
Alexander Larsson's avatar
Alexander Larsson committed
406 407
  gobject_class->set_property = gtk_widget_set_property;
  gobject_class->get_property = gtk_widget_get_property;
408 409

  object_class->destroy = gtk_widget_real_destroy;
410
  
411 412
  klass->activate_signal = 0;
  klass->set_scroll_adjustments_signal = 0;
Tim Janik's avatar
Tim Janik committed
413
  klass->dispatch_child_properties_changed = gtk_widget_dispatch_child_properties_changed;
414 415 416 417 418 419 420 421 422 423 424 425
  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
426
  klass->hierarchy_changed = NULL;
427
  klass->style_set = gtk_widget_style_set;
428
  klass->direction_changed = gtk_widget_direction_changed;
Tim Janik's avatar
Tim Janik committed
429 430
  klass->grab_notify = NULL;
  klass->child_notify = NULL;
431
  klass->mnemonic_activate = gtk_widget_real_mnemonic_activate;
432
  klass->grab_focus = gtk_widget_real_grab_focus;
433
  klass->focus = gtk_widget_real_focus;
434 435 436 437 438 439 440 441 442 443 444 445
  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;
446 447
  klass->focus_in_event = gtk_widget_real_focus_in_event;
  klass->focus_out_event = gtk_widget_real_focus_out_event;
448 449
  klass->map_event = NULL;
  klass->unmap_event = NULL;
450
  klass->window_state_event = NULL;
451
  klass->property_notify_event = _gtk_selection_property_notify;
452
  klass->selection_clear_event = gtk_selection_clear;
453 454
  klass->selection_request_event = _gtk_selection_request;
  klass->selection_notify_event = _gtk_selection_notify;
455 456 457 458 459 460 461 462 463 464
  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
465
  klass->screen_changed = NULL;
466
  klass->can_activate_accel = gtk_widget_real_can_activate_accel;
467
  klass->grab_broken_event = NULL;
Kristian Rietveld's avatar
Kristian Rietveld committed
468
  klass->query_tooltip = gtk_widget_real_query_tooltip;
469 470 471 472 473 474

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

475 476
  klass->no_expose_event = NULL;

Alexander Larsson's avatar
Alexander Larsson committed
477 478 479
  g_object_class_install_property (gobject_class,
				   PROP_NAME,
				   g_param_spec_string ("name",
480 481
 							P_("Widget name"),
							P_("The name of the widget"),
Alexander Larsson's avatar
Alexander Larsson committed
482
							NULL,
483
							GTK_PARAM_READWRITE));
Alexander Larsson's avatar
Alexander Larsson committed
484 485 486
  g_object_class_install_property (gobject_class,
				   PROP_PARENT,
				   g_param_spec_object ("parent",
487 488
							P_("Parent widget"), 
							P_("The parent widget of this widget. Must be a Container widget"),
Alexander Larsson's avatar
Alexander Larsson committed
489
							GTK_TYPE_CONTAINER,
490
							GTK_PARAM_READWRITE));
Havoc Pennington's avatar
Havoc Pennington committed
491

Alexander Larsson's avatar
Alexander Larsson committed
492
  g_object_class_install_property (gobject_class,
Havoc Pennington's avatar
Havoc Pennington committed
493
				   PROP_WIDTH_REQUEST,
Matthias Clasen's avatar
x  
Matthias Clasen committed
494
				   g_param_spec_int ("width-request",
495 496
 						     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
497 498 499
 						     -1,
 						     G_MAXINT,
 						     -1,
500
 						     GTK_PARAM_READWRITE));
Alexander Larsson's avatar
Alexander Larsson committed
501
  g_object_class_install_property (gobject_class,
Havoc Pennington's avatar
Havoc Pennington committed
502
				   PROP_HEIGHT_REQUEST,
Matthias Clasen's avatar
x  
Matthias Clasen committed
503
				   g_param_spec_int ("height-request",
504 505
 						     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
506 507 508
 						     -1,
 						     G_MAXINT,
 						     -1,
509
 						     GTK_PARAM_READWRITE));
Alexander Larsson's avatar
Alexander Larsson committed
510 511 512
  g_object_class_install_property (gobject_class,
				   PROP_VISIBLE,
				   g_param_spec_boolean ("visible",
513 514
 							 P_("Visible"),
 							 P_("Whether the widget is visible"),
Alexander Larsson's avatar
Alexander Larsson committed
515
 							 FALSE,
516
 							 GTK_PARAM_READWRITE));
Alexander Larsson's avatar
Alexander Larsson committed
517 518 519
  g_object_class_install_property (gobject_class,
				   PROP_SENSITIVE,
				   g_param_spec_boolean ("sensitive",
520 521
 							 P_("Sensitive"),
 							 P_("Whether the widget responds to input"),
Alexander Larsson's avatar
Alexander Larsson committed
522
 							 TRUE,
523
 							 GTK_PARAM_READWRITE));
Alexander Larsson's avatar
Alexander Larsson committed
524 525
  g_object_class_install_property (gobject_class,
				   PROP_APP_PAINTABLE,
Matthias Clasen's avatar
x  
Matthias Clasen committed
526
				   g_param_spec_boolean ("app-paintable",
527 528
 							 P_("Application paintable"),
 							 P_("Whether the application will paint directly on the widget"),
Alexander Larsson's avatar
Alexander Larsson committed
529
 							 FALSE,
530
 							 GTK_PARAM_READWRITE));
Alexander Larsson's avatar
Alexander Larsson committed
531 532
  g_object_class_install_property (gobject_class,
				   PROP_CAN_FOCUS,
Matthias Clasen's avatar
x  
Matthias Clasen committed
533
				   g_param_spec_boolean ("can-focus",
534 535
 							 P_("Can focus"),
 							 P_("Whether the widget can accept the input focus"),
Alexander Larsson's avatar
Alexander Larsson committed
536
 							 FALSE,
537
 							 GTK_PARAM_READWRITE));
Alexander Larsson's avatar
Alexander Larsson committed
538 539
  g_object_class_install_property (gobject_class,
				   PROP_HAS_FOCUS,
Matthias Clasen's avatar
x  
Matthias Clasen committed
540
				   g_param_spec_boolean ("has-focus",
541 542
 							 P_("Has focus"),
 							 P_("Whether the widget has the input focus"),
Alexander Larsson's avatar
Alexander Larsson committed
543
 							 FALSE,
544
 							 GTK_PARAM_READWRITE));
545
  g_object_class_install_property (gobject_class,
546
				   PROP_IS_FOCUS,
Matthias Clasen's avatar
x  
Matthias Clasen committed
547
				   g_param_spec_boolean ("is-focus",
548 549
 							 P_("Is focus"),
 							 P_("Whether the widget is the focus widget within the toplevel"),
550
 							 FALSE,
551
 							 GTK_PARAM_READWRITE));
Alexander Larsson's avatar
Alexander Larsson committed
552 553
  g_object_class_install_property (gobject_class,
				   PROP_CAN_DEFAULT,
Matthias Clasen's avatar
x  
Matthias Clasen committed
554
				   g_param_spec_boolean ("can-default",
555 556
 							 P_("Can default"),
 							 P_("Whether the widget can be the default widget"),
Alexander Larsson's avatar
Alexander Larsson committed
557
 							 FALSE,
558
 							 GTK_PARAM_READWRITE));
Alexander Larsson's avatar
Alexander Larsson committed
559 560
  g_object_class_install_property (gobject_class,
				   PROP_HAS_DEFAULT,
Matthias Clasen's avatar
x  
Matthias Clasen committed
561
				   g_param_spec_boolean ("has-default",
562 563
 							 P_("Has default"),
 							 P_("Whether the widget is the default widget"),
Alexander Larsson's avatar
Alexander Larsson committed
564
 							 FALSE,
565
 							 GTK_PARAM_READWRITE));
Alexander Larsson's avatar
Alexander Larsson committed
566 567
  g_object_class_install_property (gobject_class,
				   PROP_RECEIVES_DEFAULT,
Matthias Clasen's avatar
x  
Matthias Clasen committed
568
				   g_param_spec_boolean ("receives-default",
569 570
 							 P_("Receives default"),
 							 P_("If TRUE, the widget will receive the default action when it is focused"),
Alexander Larsson's avatar
Alexander Larsson committed
571
 							 FALSE,
572
 							 GTK_PARAM_READWRITE));
Alexander Larsson's avatar
Alexander Larsson committed
573 574
  g_object_class_install_property (gobject_class,
				   PROP_COMPOSITE_CHILD,
Matthias Clasen's avatar
x  
Matthias Clasen committed
575
				   g_param_spec_boolean ("composite-child",
576 577
 							 P_("Composite child"),
 							 P_("Whether the widget is part of a composite widget"),
Alexander Larsson's avatar
Alexander Larsson committed
578
 							 FALSE,
579
 							 GTK_PARAM_READABLE));
Alexander Larsson's avatar
Alexander Larsson committed
580 581 582
  g_object_class_install_property (gobject_class,
				   PROP_STYLE,
				   g_param_spec_object ("style",
583 584
 							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
585
 							GTK_TYPE_STYLE,
586
 							GTK_PARAM_READWRITE));
Alexander Larsson's avatar
Alexander Larsson committed
587 588 589
  g_object_class_install_property (gobject_class,
				   PROP_EVENTS,
				   g_param_spec_flags ("events",
590 591
 						       P_("Events"),
 						       P_("The event mask that decides what kind of GdkEvents this widget gets"),
592
 						       GDK_TYPE_EVENT_MASK,
Alexander Larsson's avatar
Alexander Larsson committed
593
 						       GDK_STRUCTURE_MASK,
594
 						       GTK_PARAM_READWRITE));
Alexander Larsson's avatar
Alexander Larsson committed
595 596
  g_object_class_install_property (gobject_class,
				   PROP_EXTENSION_EVENTS,
Matthias Clasen's avatar
x  
Matthias Clasen committed
597
				   g_param_spec_enum ("extension-events",
598 599
 						      P_("Extension events"),
 						      P_("The mask that decides what kind of extension events this widget gets"),
600
 						      GDK_TYPE_EXTENSION_MODE,
Alexander Larsson's avatar
Alexander Larsson committed
601
 						      GDK_EXTENSION_EVENTS_NONE,
602
 						      GTK_PARAM_READWRITE));
603 604
  g_object_class_install_property (gobject_class,
				   PROP_NO_SHOW_ALL,
Matthias Clasen's avatar
x  
Matthias Clasen committed
605
				   g_param_spec_boolean ("no-show-all",
606 607
 							 P_("No show all"),
 							 P_("Whether gtk_widget_show_all() should not affect this widget"),
608
 							 FALSE,
609
 							 GTK_PARAM_READWRITE));
Kristian Rietveld's avatar
Kristian Rietveld committed
610 611 612 613

/**
 * GtkWidget:has-tooltip:
 *
614 615 616
 * Enables or disables the emission of #GtkWidget::query-tooltip on @widget.  
 * A value of %TRUE indicates that @widget can have a tooltip, in this case
 * the widget will be queried using #GtkWidget::query-tooltip to determine
Kristian Rietveld's avatar
Kristian Rietveld committed
617 618
 * whether it will provide a tooltip or not.
 *
619 620 621 622 623
 * Note that setting this property to %TRUE for the first time will change
 * the event masks of the GdkWindows of this widget to include leave-notify
 * and motion-notify events.  This cannot and will not be undone when the
 * property is set to %FALSE again.
 *
Kristian Rietveld's avatar
Kristian Rietveld committed
624 625 626 627 628 629 630 631 632
 * Since: 2.12
 */
  g_object_class_install_property (gobject_class,
				   PROP_HAS_TOOLTIP,
				   g_param_spec_boolean ("has-tooltip",
 							 P_("Has tooltip"),
 							 P_("Whether this widget has a tooltip"),
 							 FALSE,
 							 GTK_PARAM_READWRITE));
633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667
  /**
   * GtkWidget:tooltip-text:
   *
   * Sets the text of tooltip to be the given string.
   *
   * Also see gtk_tooltip_set_text().
   *
   * This is a convenience property which will take care of getting the
   * tooltip shown if the given string is not %NULL: #GtkWidget:has-tooltip
   * will automatically be set to %TRUE and there will be taken care of
   * #GtkWidget::query-tooltip in the default signal handler.
   *
   * Since: 2.12
   */
  g_object_class_install_property (gobject_class,
                                   PROP_TOOLTIP_TEXT,
                                   g_param_spec_string ("tooltip-text",
                                                        P_("Tooltip Text"),
                                                        P_("The contents of the tooltip for this widget"),
                                                        NULL,
                                                        GTK_PARAM_READWRITE));
  /**
   * GtkWidget:tooltip-markup:
   *
   * Sets the text of tooltip to be the given string, which is marked up
   * with the <link linkend="PangoMarkupFormat">Pango text markup language</link>.
   * Also see gtk_tooltip_set_markup().
   *
   * This is a convenience property which will take care of getting the
   * tooltip shown if the given string is not %NULL: #GtkWidget:has-tooltip
   * will automatically be set to %TRUE and there will be taken care of
   * #GtkWidget::query-tooltip in the default signal handler.
   *
   * Since: 2.12
   */
Kristian Rietveld's avatar
Kristian Rietveld committed
668 669 670 671 672 673 674 675
  g_object_class_install_property (gobject_class,
				   PROP_TOOLTIP_MARKUP,
				   g_param_spec_string ("tooltip-markup",
 							P_("Tooltip markup"),
							P_("The contents of the tooltip for this widget"),
							NULL,
							GTK_PARAM_READWRITE));

Elliot Lee's avatar
Elliot Lee committed
676
  widget_signals[SHOW] =
Matthias Clasen's avatar
Matthias Clasen committed
677
    g_signal_new (I_("show"),
Manish Singh's avatar
Manish Singh committed
678 679 680 681 682 683
		  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
684
  widget_signals[HIDE] =
Matthias Clasen's avatar
Matthias Clasen committed
685
    g_signal_new (I_("hide"),
Manish Singh's avatar
Manish Singh committed
686 687 688 689 690 691
		  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
692
  widget_signals[MAP] =
Matthias Clasen's avatar
Matthias Clasen committed
693
    g_signal_new (I_("map"),
Manish Singh's avatar
Manish Singh committed
694 695 696 697 698 699
		  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
700
  widget_signals[UNMAP] =
Matthias Clasen's avatar
Matthias Clasen committed
701
    g_signal_new (I_("unmap"),
Manish Singh's avatar
Manish Singh committed
702 703 704 705 706 707
		  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
708
  widget_signals[REALIZE] =
Matthias Clasen's avatar
Matthias Clasen committed
709
    g_signal_new (I_("realize"),
Manish Singh's avatar
Manish Singh committed
710 711 712 713 714 715
		  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
716
  widget_signals[UNREALIZE] =
Matthias Clasen's avatar
Matthias Clasen committed
717
    g_signal_new (I_("unrealize"),
Manish Singh's avatar
Manish Singh committed
718 719 720 721 722 723
		  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
724
  widget_signals[SIZE_REQUEST] =
Matthias Clasen's avatar
Matthias Clasen committed
725
    g_signal_new (I_("size_request"),
Manish Singh's avatar
Manish Singh committed
726 727 728 729 730 731 732
		  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);
733
  widget_signals[SIZE_ALLOCATE] = 
Matthias Clasen's avatar
Matthias Clasen committed
734
    g_signal_new (I_("size_allocate"),
Manish Singh's avatar
Manish Singh committed
735 736 737 738 739 740 741
		  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);
Matthias Clasen's avatar
Matthias Clasen committed
742

Elliot Lee's avatar
Elliot Lee committed
743
  widget_signals[STATE_CHANGED] =
Matthias Clasen's avatar
Matthias Clasen committed
744
    g_signal_new (I_("state_changed"),
Manish Singh's avatar
Manish Singh committed
745 746 747 748 749 750 751
		  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);
752 753 754 755 756 757 758

  /**
   * GtkWidget::parent-set:
   * @widget: the object on which the signal is emitted
   * @old_parent: the previous parent, or %NULL if the widget 
   *   just got its initial parent.
   *
759 760
   * The ::parent-set signal is emitted when a new parent 
   * has been set on a widget. 
761
   */
762
  widget_signals[PARENT_SET] =
Matthias Clasen's avatar
Matthias Clasen committed
763
    g_signal_new (I_("parent_set"),
Manish Singh's avatar
Manish Singh committed
764 765 766 767 768 769 770
		  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);
Matthias Clasen's avatar
Matthias Clasen committed
771 772 773 774 775 776 777 778

  /**
   * GtkWidget::hierarchy-changed:
   * @widget: the object on which the signal is emitted
   * @previous_toplevel: the previous toplevel ancestor, or %NULL
   *   if the widget was previously unanchored
   *
   * The ::hierarchy-changed signal is emitted when the
779 780 781 782
   * anchored state of a widget changes. A widget is
   * <firstterm>anchored</firstterm> when its toplevel
   * ancestor is a #GtkWindow. This signal is emitted when
   * a widget changes from un-anchored to anchored or vice-versa.
Matthias Clasen's avatar
Matthias Clasen committed
783
   */
Owen Taylor's avatar
Owen Taylor committed
784
  widget_signals[HIERARCHY_CHANGED] =
Matthias Clasen's avatar
Matthias Clasen committed
785
    g_signal_new (I_("hierarchy_changed"),
Manish Singh's avatar
Manish Singh committed
786 787 788 789 790 791 792
		  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);
Matthias Clasen's avatar
Matthias Clasen committed
793

794 795 796 797 798 799
  /**
   * GtkWidget::style-set:
   * @widget: the object on which the signal is emitted
   * @previous_style: the previous style, or %NULL if the widget 
   *   just got its initial style 
   *
800
   * The ::style-set signal is emitted when a new style has been set 
801 802 803
   * on a widget. Note that style-modifying functions like 
   * gtk_widget_modify_base() also cause this signal to be emitted.
   */
804
  widget_signals[STYLE_SET] =
Matthias Clasen's avatar
Matthias Clasen committed
805
    g_signal_new (I_("style_set"),
Manish Singh's avatar
Manish Singh committed
806 807 808 809 810 811 812
		  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);
Matthias Clasen's avatar
Matthias Clasen committed
813 814 815 816 817 818 819 820
/**
 * GtkWidget::direction-changed:
 * @widget: the object on which the signal is emitted
 * @previous_direction: the previous text direction of @widget
 *
 * The ::direction-changed signal is emitted when the text direction
 * of a widget changes.
 */
821
  widget_signals[DIRECTION_CHANGED] =
Matthias Clasen's avatar
Matthias Clasen committed
822
    g_signal_new (I_("direction_changed"),
Manish Singh's avatar
Manish Singh committed
823 824 825 826 827 828 829
		  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);
830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845

  /**
   * GtkWidget::grab-notify:
   * @widget: the object which received the signal
   * @was_grabbed: %FALSE if the widget becomes shadowed, %TRUE
   *               if it becomes unshadowed
   *
   * The ::grab-notify signal is emitted when a widget becomes
   * shadowed by a GTK+ grab (not a pointer or keyboard grab) on 
   * another widget, or when it becomes unshadowed due to a grab 
   * being removed.
   * 
   * A widget is shadowed by a gtk_grab_add() when the topmost 
   * grab widget in the grab stack of its window group is not 
   * its ancestor.
   */
846
  widget_signals[GRAB_NOTIFY] =
Matthias Clasen's avatar
Matthias Clasen committed
847
    g_signal_new (I_("grab_notify"),
Manish Singh's avatar
Manish Singh committed
848 849 850 851 852 853 854
		  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);
855 856 857

/**
 * GtkWidget::child-notify:
858 859
 * @widget: the object which received the signal
 * @pspec: the #GParamSpec of the changed child property
860
 *
861 862
 * The ::child-notify signal is emitted for each 
 * <link linkend="child-properties">child property</link>  that has
863 864
 * changed on an object. The signal's detail holds the property name. 
 */
Tim Janik's avatar
Tim Janik committed
865
  widget_signals[CHILD_NOTIFY] =
Matthias Clasen's avatar
Matthias Clasen committed
866
    g_signal_new (I_("child_notify"),
Manish Singh's avatar
Manish Singh committed
867
		   G_TYPE_FROM_CLASS (gobject_class),
Tim Janik's avatar
Tim Janik committed
868 869 870 871
		   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
872 873
		   G_TYPE_NONE, 1,
		   G_TYPE_PARAM);
874
  widget_signals[MNEMONIC_ACTIVATE] =
Matthias Clasen's avatar
Matthias Clasen committed
875
    g_signal_new (I_("mnemonic_activate"),
Manish Singh's avatar
Manish Singh committed
876 877 878 879 880 881 882
		  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);
883
  widget_signals[GRAB_FOCUS] =
Matthias Clasen's avatar
Matthias Clasen committed
884
    g_signal_new (I_("grab_focus"),
Manish Singh's avatar
Manish Singh committed
885 886 887 888 889 890
		  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);
891
  widget_signals[FOCUS] =
Matthias Clasen's avatar
Matthias Clasen committed
892
    g_signal_new (I_("focus"),
Manish Singh's avatar
Manish Singh committed
893 894 895 896 897 898 899
		  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);
900 901 902 903 904 905 906 907 908 909
  widget_signals[MOVE_FOCUS] =
    _gtk_binding_signal_new (I_("move_focus"),
                             G_TYPE_FROM_CLASS (object_class),
                             G_SIGNAL_RUN_LAST | G_SIGNAL_ACTION,
                             G_CALLBACK (gtk_widget_real_move_focus),
                             NULL, NULL,
                             _gtk_marshal_VOID__ENUM,
                             G_TYPE_NONE,
                             1,
                             GTK_TYPE_DIRECTION_TYPE);
910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926
  /**
   * GtkWidget::event:
   * @widget: the object which received the signal.
   * @event: the #GdkEvent which triggered this signal
   *
   * The GTK+ main loop will emit three signals for each GDK event delivered
   * to a widget: one generic ::event signal, another, more specific,
   * signal that matches the type of event delivered (e.g. 
   * #GtkWidget::key-press-event) and finally a generic 
   * #GtkWidget::event-after signal.
   *
   * Returns: %TRUE to stop other handlers from being invoked for the event 
   * and to cancel the emission of the second specific ::event signal.
   *   %FALSE to propagate the event further and to allow the emission of 
   *   the second signal. The ::event-after signal is emitted regardless of
   *   the return value.
   */
Elliot Lee's avatar
Elliot Lee committed
927
  widget_signals[EVENT] =
Matthias Clasen's avatar
Matthias Clasen committed
928
    g_signal_new (I_("event"),
Manish Singh's avatar
Manish Singh committed
929 930 931 932 933 934 935
		  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);
936 937 938 939 940 941 942 943 944 945 946

  /**
   * GtkWidget::event-after:
   * @widget: the object which received the signal.
   * @event: the #GdkEvent which triggered this signal
   *
   * After the emission of the #GtkWidget::event signal and (optionally) 
   * the second more specific signal, ::event-after will be emitted 
   * regardless of the previous two signals handlers return values.
   *
   */
947
  widget_signals[EVENT_AFTER] =
948
    g_signal_new (I_("event_after"),
Manish Singh's avatar
Manish Singh committed
949 950 951 952 953 954 955
		  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);
956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972

  /**
   * GtkWidget::button-press-event:
   * @widget: the object which received the signal.
   * @event: the #GdkEventButton which triggered this signal
   *
   * The ::button-press-event signal will be emitted when a button
   * (typically from a mouse) is pressed.
   *
   * To receive this signal, the #GdkWindow associated to the 
   * widget needs to enable the #GDK_BUTTON_PRESS_MASK mask.
   *
   * This signal will be sent to the grab widget if there is one.
   *
   * Returns: %TRUE to stop other handlers from being invoked for the event. 
   *   %FALSE to propagate the event further.
   */
Elliot Lee's avatar
Elliot Lee committed
973
  widget_signals[BUTTON_PRESS_EVENT] =
Matthias Clasen's avatar
Matthias Clasen committed
974
    g_signal_new (I_("button_press_event"),
Manish Singh's avatar
Manish Singh committed
975 976 977 978 979 980 981
		  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);
982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998

  /**
   * GtkWidget::button-release-event:
   * @widget: the object which received the signal.
   * @event: the #GdkEventButton which triggered this signal
   *
   * The ::button-release-event signal will be emitted when a button
   * (typically from a mouse) is released.
   *
   * To receive this signal, the #GdkWindow associated to the 
   * widget needs to enable the #GDK_BUTTON_RELEASE_MASK mask.
   *
   * This signal will be sent to the grab widget if there is one.
   *
   * Returns: %TRUE to stop other handlers from being invoked for the event. 
   *   %FALSE to propagate the event further.
   */
Elliot Lee's avatar
Elliot Lee committed
999
  widget_signals[BUTTON_RELEASE_EVENT] =
Matthias Clasen's avatar
Matthias Clasen committed
1000
    g_signal_new (I_("button_release_event"),
Manish Singh's avatar
Manish Singh committed
1001 1002 1003 1004 1005 1006 1007
		  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);
1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025

  /**
   * GtkWidget::scroll-event:
   * @widget: the object which received the signal.
   * @event: the #GdkEventScroll which triggered this signal
   *
   * The ::scroll-event signal is emitted when a button in the 4 to 7
   * range is pressed. Wheel mice are usually configured to generate 
   * button press events for buttons 4 and 5 when the wheel is turned.
   *
   * To receive this signal, the #GdkWindow associated to the widget needs
   * to enable the #GDK_BUTTON_PRESS_MASK mask.
   *
   * This signal will be sent to the grab widget if there is one.
   *
   * Returns: %TRUE to stop other handlers from being invoked for the event. 
   *   %FALSE to propagate the event further.
   */
1026
  widget_signals[SCROLL_EVENT] =
Matthias Clasen's avatar
Matthias Clasen committed
1027
    g_signal_new (I_("scroll_event"),
Manish Singh's avatar
Manish Singh committed
1028 1029 1030 1031 1032 1033 1034
		  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);
1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050
  /**
   * GtkWidget::motion-notify-event:
   * @widget: the object which received the signal.
   * @event: the #GdkEventMotion which triggered this signal
   *
   * The ::motion-notify-event signal is emitted when the pointer moves 
   * over the widget's #GdkWindow.
   *
   * To receive this signal, the #GdkWindow associated to the widget 
   * needs to enable the #GDK_POINTER_MOTION_MASK mask.
   *
   * This signal will be sent to the grab widget if there is one.
   *
   * Returns: %TRUE to stop other handlers from being invoked for the event. 
   *   %FALSE to propagate the event further.
   */
Elliot Lee's avatar
Elliot Lee committed
1051
  widget_signals[MOTION_NOTIFY_EVENT] =
Matthias Clasen's avatar
Matthias Clasen committed
1052
    g_signal_new (I_("motion_notify_event"),
Manish Singh's avatar
Manish Singh committed
1053 1054 1055 1056 1057 1058 1059
		  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);
Matthias Clasen's avatar
Matthias Clasen committed
1060 1061 1062 1063 1064 1065 1066 1067 1068

  /**
   * GtkWidget::composited-changed:
   * @widget: the object on which the signal is emitted
   *
   * The ::composited-changed signal is emitted when the composited
   * status of @widget<!-- -->s screen changes. 
   * See gdk_screen_is_composited().
   */
Søren Sandmann's avatar
Søren Sandmann committed
1069 1070 1071 1072 1073 1074 1075 1076
  widget_signals[COMPOSITED_CHANGED] =
    g_signal_new (I_("composited_changed"),
		  G_TYPE_FROM_CLASS (gobject_class),
		  G_SIGNAL_RUN_LAST | G_SIGNAL_ACTION,
		  G_STRUCT_OFFSET (GtkWidgetClass, composited_changed),
		  NULL, NULL,
		  _gtk_marshal_VOID__VOID,
		  G_TYPE_NONE, 0);
1077

1078 1079
  /**
   * GtkWidget::keynav-failed:
1080
   * @widget: the object which received the signal
1081 1082
   * @direction: the direction of movement
   *
1083
   * Gets emitted if keyboard navigation fails. 
1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101
   * See gtk_widget_keynav_failed() for details.
   *
   * Returns: %TRUE if stopping keyboard navigation is fine, %FALSE
   *          if the emitting widget should try to handle the keyboard
   *          navigation attempt in its parent container(s).
   *
   * Since: 2.12
   **/
  widget_signals[KEYNAV_FAILED] =
    _gtk_binding_signal_new (I_("keynav-failed"),
                             G_TYPE_FROM_CLASS (gobject_class),
                             G_SIGNAL_RUN_LAST,
                             G_CALLBACK (gtk_widget_real_keynav_failed),
                             _gtk_boolean_handled_accumulator, NULL,
                             _gtk_marshal_BOOLEAN__ENUM,
                             G_TYPE_BOOLEAN, 1,
                             GTK_TYPE_DIRECTION_TYPE);

Matthias Clasen's avatar
Matthias Clasen committed
1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115
  /**
   * GtkWidget::delete-event:
   * @widget: the object which received the signal
   * @event: the event which triggered this signal
   *
   * The ::delete-event signal is emitted if a user requests that
   * a toplevel window is closed. The default handler for this signal
   * destroys the window. Connecting gtk_widget_hide_on_delete() to
   * this signal will cause the window to be hidden instead, so that
   * it can later be shown again without reconstructing it.
   *
   * Returns: %TRUE to stop other handlers from being invoked for the event. 
   *   %FALSE to propagate the event further.
   */
Elliot Lee's avatar
Elliot Lee committed
1116
  widget_signals[DELETE_EVENT] =
Matthias Clasen's avatar
Matthias Clasen committed
1117
    g_signal_new (I_("delete_event"),
Manish Singh's avatar
Manish Singh committed
1118 1119 1120 1121 1122 1123 1124
		  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);
1125

Matthias Clasen's avatar
Matthias Clasen committed
1126 1127 1128 1129 1130 1131 1132 1133 1134 1135
  /**
   * GtkWidget::destroy-event:
   * @widget: the object which received the signal.
   * @event: the event which triggered this signal
   *
   * The ::destroy-event signal is emitted when a #GdkWindow is destroyed.
   * You rarely get this signal, because most widgets disconnect themselves 
   * from their window before they destroy it, so no widget owns the 
   * window at destroy time.
   * 
1136 1137 1138 1139
   * To receive this signal, the #GdkWindow associated to the widget needs
   * to enable the #GDK_STRUCTURE_MASK mask. GDK will enable this mask
   * automatically for all new windows.
   *
Matthias Clasen's avatar
Matthias Clasen committed
1140 1141 1142
   * Returns: %TRUE to stop other handlers from being invoked for the event. 
   *   %FALSE to propagate the event further.
   */
Elliot Lee's avatar
Elliot Lee committed
1143
  widget_signals[DESTROY_EVENT] =
Matthias Clasen's avatar
Matthias Clasen committed
1144
    g_signal_new (I_("destroy_event"),
Manish Singh's avatar
Manish Singh committed
1145 1146 1147 1148 1149 1150 1151
		  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);
1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168

  /**
   * GtkWidget::expose-event:
   * @widget: the object which received the signal.
   * @event: the #GdkEventExpose which triggered this signal
   *
   * The ::expose-event signal is emitted when an area of a previously
   * obscured #GdkWindow is made visible and needs to be redrawn.
   * #GTK_NO_WINDOW widgets will get a synthesized event from their parent 
   * widget.
   *
   * To receive this signal, the #GdkWindow associated to the widget needs
   * to enable the #GDK_EXPOSURE_MASK mask.
   * 
   * Returns: %TRUE to stop other handlers from being invoked for the event. 
   *   %FALSE to propagate the event further.
   */
Elliot Lee's avatar
Elliot Lee committed
1169
  widget_signals[EXPOSE_EVENT] =
Matthias Clasen's avatar
Matthias Clasen committed
1170
    g_signal_new (I_("expose_event"),
Manish Singh's avatar
Manish Singh committed
1171 1172 1173 1174 1175 1176 1177
		  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);
1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193

  /**
   * GtkWidget::key-press-event:
   * @widget: the object which received the signal
   * @event: the #GdkEventKey which triggered this signal
   *
   * The ::key-press-event signal is emitted when a key is pressed.
   *
   * To receive this signal, the #GdkWindow associated to the widget needs
   * to enable the #GDK_KEY_PRESS_MASK mask.
   *
   * This signal will be sent to the grab widget if there is one.
   *
   * Returns: %TRUE to stop other handlers from being invoked for the event. 
   *   %FALSE to propagate the event further.
   */
Elliot Lee's avatar
Elliot Lee committed
1194
  widget_signals[KEY_PRESS_EVENT] =
Matthias Clasen's avatar
Matthias Clasen committed
1195
    g_signal_new (I_("key_press_event"),
Manish Singh's avatar
Manish Singh committed
1196 1197 1198 1199 1200 1201 1202
		  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);
1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218

  /**
   * GtkWidget::key-release-event:
   * @widget: the object which received the signal
   * @event: the #GdkEventKey which triggered this signal
   *
   * The ::key-release-event signal is emitted when a key is pressed.
   *
   * To receive this signal, the #GdkWindow associated to the widget needs
   * to enable the #GDK_KEY_RELEASE_MASK mask.
   *
   * This signal will be sent to the grab widget if there is one.
   *
   * Returns: %TRUE to stop other handlers from being invoked for the event. 
   *   %FALSE to propagate the event further.
   */
Elliot Lee's avatar
Elliot Lee committed
1219
  widget_signals[KEY_RELEASE_EVENT] =
Matthias Clasen's avatar
Matthias Clasen committed
1220
    g_signal_new (I_("key_release_event"),
Manish Singh's avatar
Manish Singh committed
1221 1222 1223 1224 1225 1226 1227
		  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);
1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244

  /**
   * GtkWidget::enter-notify-event:
   * @widget: the object which received the signal
   * @event: the #GdkEventCrossing which triggered this signal
   *
   * The ::enter-notify-event will be emitted when the pointer enters
   * the @widget's window.
   *
   * To receive this signal, the #GdkWindow associated to the widget needs
   * to enable the #GDK_ENTER_NOTIFY_MASK mask.
   *
   * This signal will be sent to the grab widget if there is one.
   *
   * Returns: %TRUE to stop other handlers from being invoked for the event. 
   *   %FALSE to propagate the event further.
   */
Elliot Lee's avatar
Elliot Lee committed
1245
  widget_signals[ENTER_NOTIFY_EVENT] =
Matthias Clasen's avatar
Matthias Clasen committed
1246
    g_signal_new (I_("enter_notify_event"),
Manish Singh's avatar
Manish Singh committed
1247 1248 1249 1250 1251 1252 1253
		  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);
1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270

  /**
   * GtkWidget::leave-notify-event:
   * @widget: the object which received the signal
   * @event: the #GdkEventCrossing which triggered this signal
   *
   * The ::leave-notify-event will be emitted when the pointer leaves
   * the @widget's window.
   *
   * To receive this signal, the #GdkWindow associated to the widget needs
   * to enable the #GDK_LEAVE_NOTIFY_MASK mask.
   *
   * This signal will be sent to the grab widget if there is one.
   *
   * Returns: %TRUE to stop other handlers from being invoked for the event. 
   *   %FALSE to propagate the event further.
   */
Elliot Lee's avatar
Elliot Lee committed
1271
  widget_signals[LEAVE_NOTIFY_EVENT] =
Matthias Clasen's avatar
Matthias Clasen committed
1272
    g_signal_new (I_("leave_notify_event"),
Manish Singh's avatar
Manish Singh committed
1273 1274 1275 1276 1277 1278 1279
		  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);
1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295

  /**
   * GtkWidget::configure-event
   * @widget: the object which received the signal
   * @event: the #GdkEventConfigure which triggered this signal
   *
   * The ::configure-event signal will be emitted when the size, position or
   * stacking of the @widget's window has changed.
   *
   * To receive this signal, the #GdkWindow associated to the widget needs
   * to enable the #GDK_STRUCTURE_MASK mask. GDK will enable this mask
   * automatically for all new windows.
   *
   * Returns: %TRUE to stop other handlers from being invoked for the event. 
   *   %FALSE to propagate the event further.
   */
Elliot Lee's avatar
Elliot Lee committed
1296
  widget_signals[CONFIGURE_EVENT] =
Matthias Clasen's avatar
Matthias Clasen committed
1297
    g_signal_new (I_("configure_event"),
Manish Singh's avatar
Manish Singh committed
1298 1299 1300 1301 1302 1303 1304
		  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);
1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319

  /**
   * GtkWidget::focus-in-event
   * @widget: the object which received the signal
   * @event: the #GdkEventFocus which triggered this signal
   *
   * The ::focus-in-event signal will be emitted when the keyboard focus
   * enters the @widget's window.
   *
   * To receive this signal, the #GdkWindow associated to the widget needs
   * to enable the #GDK_FOCUS_CHANGE_MASK mask.
   *
   * Returns: %TRUE to stop other handlers from being invoked for the event. 
   *   %FALSE to propagate the event further.
   */
Elliot Lee's avatar
Elliot Lee committed
1320
  widget_signals[FOCUS_IN_EVENT] =
Matthias Clasen's avatar
Matthias Clasen committed
1321
    g_signal_new (I_("focus_in_event"),
Manish Singh's avatar
Manish Singh committed
1322 1323 1324 1325 1326 1327 1328
		  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);
1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343

  /**
   * GtkWidget::focus-out-event
   * @widget: the object which received the signal
   * @event: the #GdkEventFocus which triggered this signal
   *
   * The ::focus-out-event signal will be emitted when the keyboard focus
   * leaves the @widget's window.
   *
   * To receive this signal, the #GdkWindow associated to the widget needs
   * to enable the #GDK_FOCUS_CHANGE_MASK mask.
   *
   * Returns: %TRUE to stop other handlers from being invoked for the event. 
   *   %FALSE to propagate the event further.
   */
Elliot Lee's avatar
Elliot Lee committed
1344
  widget_signals[FOCUS_OUT_EVENT] =