]> Pileus Git - ~andy/gtk/blobdiff - gtk/gtkwidget.c
Update the Cairo requirements (#345008)
[~andy/gtk] / gtk / gtkwidget.c
index 29ee934a9e7457c2b32f55e9f66f2517081cc43f..d9d3b53bd29482fd7b04d219969baac086e018bb 100644 (file)
@@ -28,7 +28,6 @@
 #include <stdarg.h>
 #include <string.h>
 #include <locale.h>
-#include "gtkalias.h"
 #include "gtkcontainer.h"
 #include "gtkaccelmap.h"
 #include "gtkclipboard.h"
@@ -53,6 +52,7 @@
 #include "gtkaccessible.h"
 #include "gtktooltips.h"
 #include "gtkinvisible.h"
+#include "gtkalias.h"
 
 #define WIDGET_CLASS(w)         GTK_WIDGET_GET_CLASS (w)
 #define        INIT_PATH_SIZE  (512)
@@ -120,6 +120,8 @@ enum {
   ACCEL_CLOSURES_CHANGED,
   SCREEN_CHANGED,
   CAN_ACTIVATE_ACCEL,
+  GRAB_BROKEN,
+  COMPOSITED_CHANGED,
   LAST_SIGNAL
 };
 
@@ -157,8 +159,9 @@ struct _GtkStateData
 
 
 /* --- prototypes --- */
-static void    gtk_widget_class_init            (GtkWidgetClass    *klass);
-static void    gtk_widget_init                  (GtkWidget         *widget);
+static void    gtk_widget_class_init           (GtkWidgetClass     *klass);
+static void    gtk_widget_base_class_finalize  (GtkWidgetClass     *klass);
+static void    gtk_widget_init                 (GtkWidget          *widget);
 static void    gtk_widget_set_property          (GObject           *object,
                                                  guint              prop_id,
                                                  const GValue      *value,
@@ -203,6 +206,7 @@ static gboolean             gtk_widget_real_focus_out_event         (GtkWidget        *widget,
 static gboolean                gtk_widget_real_focus                   (GtkWidget        *widget,
                                                                 GtkDirectionType  direction);
 static PangoContext*   gtk_widget_peek_pango_context           (GtkWidget        *widget);
+static void            gtk_widget_update_pango_context         (GtkWidget        *widget);
 static void            gtk_widget_propagate_state              (GtkWidget        *widget,
                                                                 GtkStateData     *data);
 static void             gtk_widget_reset_rc_style               (GtkWidget        *widget);
@@ -227,12 +231,13 @@ static gboolean         gtk_widget_real_can_activate_accel      (GtkWidget *widg
 static void gtk_widget_set_usize_internal (GtkWidget *widget,
                                           gint       width,
                                           gint       height);
+static void gtk_widget_get_draw_rectangle (GtkWidget    *widget,
+                                          GdkRectangle *rect);
 
 
 /* --- variables --- */
-static gpointer         parent_class = NULL;
+static gpointer         gtk_widget_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;
@@ -247,6 +252,7 @@ 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_input_shape_info = 0;
 static GQuark          quark_colormap = 0;
 static GQuark          quark_pango_context = 0;
 static GQuark          quark_rc_style = 0;
@@ -260,14 +266,14 @@ GType
 gtk_widget_get_type (void)
 {
   static GType widget_type = 0;
-  
-  if (!widget_type)
+
+  if (G_UNLIKELY (widget_type == 0))
     {
-      static const GTypeInfo widget_info =
+      const GTypeInfo widget_info =
       {
        sizeof (GtkWidgetClass),
        NULL,           /* base_init */
-       NULL,           /* base_finalize */
+       (GBaseFinalizeFunc) gtk_widget_base_class_finalize,
        (GClassInitFunc) gtk_widget_class_init,
        NULL,           /* class_finalize */
        NULL,           /* class_init */
@@ -276,22 +282,22 @@ gtk_widget_get_type (void)
        (GInstanceInitFunc) gtk_widget_init,
        NULL,           /* value_table */
       };
-      
-      static const GInterfaceInfo accessibility_info =
+
+      const GInterfaceInfo accessibility_info =
       {
-        (GInterfaceInitFunc) gtk_widget_accessible_interface_init,
-        (GInterfaceFinalizeFunc) NULL,
-        NULL /* interface data */
+       (GInterfaceInitFunc) gtk_widget_accessible_interface_init,
+       (GInterfaceFinalizeFunc) NULL,
+       NULL /* interface data */
       };
 
-      widget_type = g_type_register_static (GTK_TYPE_OBJECT, "GtkWidget", 
-                                           &widget_info, G_TYPE_FLAG_ABSTRACT);
+      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) ;
 
     }
-  
+
   return widget_type;
 }
 
@@ -310,8 +316,8 @@ gtk_widget_class_init (GtkWidgetClass *klass)
   GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
   GtkObjectClass *object_class = GTK_OBJECT_CLASS (klass);
   GtkBindingSet *binding_set;
-  
-  parent_class = g_type_class_peek_parent (klass);
+
+  gtk_widget_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");
@@ -321,6 +327,7 @@ gtk_widget_class_init (GtkWidgetClass *klass)
   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_input_shape_info = g_quark_from_static_string ("gtk-input-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");
@@ -396,6 +403,7 @@ gtk_widget_class_init (GtkWidgetClass *klass)
   klass->drag_data_received = NULL;
   klass->screen_changed = NULL;
   klass->can_activate_accel = gtk_widget_real_can_activate_accel;
+  klass->grab_broken_event = NULL;
 
   klass->show_help = gtk_widget_real_show_help;
   
@@ -410,110 +418,110 @@ gtk_widget_class_init (GtkWidgetClass *klass)
                                                        P_("Widget name"),
                                                        P_("The name of the widget"),
                                                        NULL,
-                                                       G_PARAM_READWRITE));
+                                                       GTK_PARAM_READWRITE));
   g_object_class_install_property (gobject_class,
                                   PROP_PARENT,
                                   g_param_spec_object ("parent",
                                                        P_("Parent widget"), 
                                                        P_("The parent widget of this widget. Must be a Container widget"),
                                                        GTK_TYPE_CONTAINER,
-                                                       G_PARAM_READWRITE));
+                                                       GTK_PARAM_READWRITE));
 
   g_object_class_install_property (gobject_class,
                                   PROP_WIDTH_REQUEST,
-                                  g_param_spec_int ("width_request",
+                                  g_param_spec_int ("width-request",
                                                     P_("Width request"),
                                                     P_("Override for width request of the widget, or -1 if natural request should be used"),
                                                     -1,
                                                     G_MAXINT,
                                                     -1,
-                                                    G_PARAM_READWRITE));
+                                                    GTK_PARAM_READWRITE));
   g_object_class_install_property (gobject_class,
                                   PROP_HEIGHT_REQUEST,
-                                  g_param_spec_int ("height_request",
+                                  g_param_spec_int ("height-request",
                                                     P_("Height request"),
                                                     P_("Override for height request of the widget, or -1 if natural request should be used"),
                                                     -1,
                                                     G_MAXINT,
                                                     -1,
-                                                    G_PARAM_READWRITE));
+                                                    GTK_PARAM_READWRITE));
   g_object_class_install_property (gobject_class,
                                   PROP_VISIBLE,
                                   g_param_spec_boolean ("visible",
                                                         P_("Visible"),
                                                         P_("Whether the widget is visible"),
                                                         FALSE,
-                                                        G_PARAM_READWRITE));
+                                                        GTK_PARAM_READWRITE));
   g_object_class_install_property (gobject_class,
                                   PROP_SENSITIVE,
                                   g_param_spec_boolean ("sensitive",
                                                         P_("Sensitive"),
                                                         P_("Whether the widget responds to input"),
                                                         TRUE,
-                                                        G_PARAM_READWRITE));
+                                                        GTK_PARAM_READWRITE));
   g_object_class_install_property (gobject_class,
                                   PROP_APP_PAINTABLE,
-                                  g_param_spec_boolean ("app_paintable",
+                                  g_param_spec_boolean ("app-paintable",
                                                         P_("Application paintable"),
                                                         P_("Whether the application will paint directly on the widget"),
                                                         FALSE,
-                                                        G_PARAM_READWRITE));
+                                                        GTK_PARAM_READWRITE));
   g_object_class_install_property (gobject_class,
                                   PROP_CAN_FOCUS,
-                                  g_param_spec_boolean ("can_focus",
+                                  g_param_spec_boolean ("can-focus",
                                                         P_("Can focus"),
                                                         P_("Whether the widget can accept the input focus"),
                                                         FALSE,
-                                                        G_PARAM_READWRITE));
+                                                        GTK_PARAM_READWRITE));
   g_object_class_install_property (gobject_class,
                                   PROP_HAS_FOCUS,
-                                  g_param_spec_boolean ("has_focus",
+                                  g_param_spec_boolean ("has-focus",
                                                         P_("Has focus"),
                                                         P_("Whether the widget has the input focus"),
                                                         FALSE,
-                                                        G_PARAM_READWRITE));
+                                                        GTK_PARAM_READWRITE));
   g_object_class_install_property (gobject_class,
                                   PROP_IS_FOCUS,
-                                  g_param_spec_boolean ("is_focus",
+                                  g_param_spec_boolean ("is-focus",
                                                         P_("Is focus"),
                                                         P_("Whether the widget is the focus widget within the toplevel"),
                                                         FALSE,
-                                                        G_PARAM_READWRITE));
+                                                        GTK_PARAM_READWRITE));
   g_object_class_install_property (gobject_class,
                                   PROP_CAN_DEFAULT,
-                                  g_param_spec_boolean ("can_default",
+                                  g_param_spec_boolean ("can-default",
                                                         P_("Can default"),
                                                         P_("Whether the widget can be the default widget"),
                                                         FALSE,
-                                                        G_PARAM_READWRITE));
+                                                        GTK_PARAM_READWRITE));
   g_object_class_install_property (gobject_class,
                                   PROP_HAS_DEFAULT,
-                                  g_param_spec_boolean ("has_default",
+                                  g_param_spec_boolean ("has-default",
                                                         P_("Has default"),
                                                         P_("Whether the widget is the default widget"),
                                                         FALSE,
-                                                        G_PARAM_READWRITE));
+                                                        GTK_PARAM_READWRITE));
   g_object_class_install_property (gobject_class,
                                   PROP_RECEIVES_DEFAULT,
-                                  g_param_spec_boolean ("receives_default",
+                                  g_param_spec_boolean ("receives-default",
                                                         P_("Receives default"),
                                                         P_("If TRUE, the widget will receive the default action when it is focused"),
                                                         FALSE,
-                                                        G_PARAM_READWRITE));
+                                                        GTK_PARAM_READWRITE));
   g_object_class_install_property (gobject_class,
                                   PROP_COMPOSITE_CHILD,
-                                  g_param_spec_boolean ("composite_child",
+                                  g_param_spec_boolean ("composite-child",
                                                         P_("Composite child"),
                                                         P_("Whether the widget is part of a composite widget"),
                                                         FALSE,
-                                                        G_PARAM_READABLE));
+                                                        GTK_PARAM_READABLE));
   g_object_class_install_property (gobject_class,
                                   PROP_STYLE,
                                   g_param_spec_object ("style",
                                                        P_("Style"),
                                                        P_("The style of the widget, which contains information about how it will look (colors etc)"),
                                                        GTK_TYPE_STYLE,
-                                                       G_PARAM_READWRITE));
+                                                       GTK_PARAM_READWRITE));
   g_object_class_install_property (gobject_class,
                                   PROP_EVENTS,
                                   g_param_spec_flags ("events",
@@ -521,24 +529,24 @@ gtk_widget_class_init (GtkWidgetClass *klass)
                                                       P_("The event mask that decides what kind of GdkEvents this widget gets"),
                                                       GDK_TYPE_EVENT_MASK,
                                                       GDK_STRUCTURE_MASK,
-                                                      G_PARAM_READWRITE));
+                                                      GTK_PARAM_READWRITE));
   g_object_class_install_property (gobject_class,
                                   PROP_EXTENSION_EVENTS,
-                                  g_param_spec_enum ("extension_events",
+                                  g_param_spec_enum ("extension-events",
                                                      P_("Extension events"),
                                                      P_("The mask that decides what kind of extension events this widget gets"),
                                                      GDK_TYPE_EXTENSION_MODE,
                                                      GDK_EXTENSION_EVENTS_NONE,
-                                                     G_PARAM_READWRITE));
+                                                     GTK_PARAM_READWRITE));
   g_object_class_install_property (gobject_class,
                                   PROP_NO_SHOW_ALL,
-                                  g_param_spec_boolean ("no_show_all",
+                                  g_param_spec_boolean ("no-show-all",
                                                         P_("No show all"),
                                                         P_("Whether gtk_widget_show_all() should not affect this widget"),
                                                         FALSE,
-                                                        G_PARAM_READWRITE));
+                                                        GTK_PARAM_READWRITE));
   widget_signals[SHOW] =
-    g_signal_new ("show",
+    g_signal_new (I_("show"),
                  G_TYPE_FROM_CLASS (gobject_class),
                  G_SIGNAL_RUN_FIRST,
                  G_STRUCT_OFFSET (GtkWidgetClass, show),
@@ -546,7 +554,7 @@ gtk_widget_class_init (GtkWidgetClass *klass)
                  _gtk_marshal_VOID__VOID,
                  G_TYPE_NONE, 0);
   widget_signals[HIDE] =
-    g_signal_new ("hide",
+    g_signal_new (I_("hide"),
                  G_TYPE_FROM_CLASS (gobject_class),
                  G_SIGNAL_RUN_FIRST,
                  G_STRUCT_OFFSET (GtkWidgetClass, hide),
@@ -554,7 +562,7 @@ gtk_widget_class_init (GtkWidgetClass *klass)
                  _gtk_marshal_VOID__VOID,
                  G_TYPE_NONE, 0);
   widget_signals[MAP] =
-    g_signal_new ("map",
+    g_signal_new (I_("map"),
                  G_TYPE_FROM_CLASS (gobject_class),
                  G_SIGNAL_RUN_FIRST,
                  G_STRUCT_OFFSET (GtkWidgetClass, map),
@@ -562,7 +570,7 @@ gtk_widget_class_init (GtkWidgetClass *klass)
                  _gtk_marshal_VOID__VOID,
                  G_TYPE_NONE, 0);
   widget_signals[UNMAP] =
-    g_signal_new ("unmap",
+    g_signal_new (I_("unmap"),
                  G_TYPE_FROM_CLASS (gobject_class),
                  G_SIGNAL_RUN_FIRST,
                  G_STRUCT_OFFSET (GtkWidgetClass, unmap),
@@ -570,7 +578,7 @@ gtk_widget_class_init (GtkWidgetClass *klass)
                  _gtk_marshal_VOID__VOID,
                  G_TYPE_NONE, 0);
   widget_signals[REALIZE] =
-    g_signal_new ("realize",
+    g_signal_new (I_("realize"),
                  G_TYPE_FROM_CLASS (gobject_class),
                  G_SIGNAL_RUN_FIRST,
                  G_STRUCT_OFFSET (GtkWidgetClass, realize),
@@ -578,7 +586,7 @@ gtk_widget_class_init (GtkWidgetClass *klass)
                  _gtk_marshal_VOID__VOID,
                  G_TYPE_NONE, 0);
   widget_signals[UNREALIZE] =
-    g_signal_new ("unrealize",
+    g_signal_new (I_("unrealize"),
                  G_TYPE_FROM_CLASS (gobject_class),
                  G_SIGNAL_RUN_LAST,
                  G_STRUCT_OFFSET (GtkWidgetClass, unrealize),
@@ -586,7 +594,7 @@ gtk_widget_class_init (GtkWidgetClass *klass)
                  _gtk_marshal_VOID__VOID,
                  G_TYPE_NONE, 0);
   widget_signals[SIZE_REQUEST] =
-    g_signal_new ("size_request",
+    g_signal_new (I_("size_request"),
                  G_TYPE_FROM_CLASS (gobject_class),
                  G_SIGNAL_RUN_FIRST,
                  G_STRUCT_OFFSET (GtkWidgetClass, size_request),
@@ -595,7 +603,7 @@ gtk_widget_class_init (GtkWidgetClass *klass)
                  G_TYPE_NONE, 1,
                  GTK_TYPE_REQUISITION | G_SIGNAL_TYPE_STATIC_SCOPE);
   widget_signals[SIZE_ALLOCATE] = 
-    g_signal_new ("size_allocate",
+    g_signal_new (I_("size_allocate"),
                  G_TYPE_FROM_CLASS (gobject_class),
                  G_SIGNAL_RUN_FIRST,
                  G_STRUCT_OFFSET (GtkWidgetClass, size_allocate),
@@ -604,7 +612,7 @@ gtk_widget_class_init (GtkWidgetClass *klass)
                  G_TYPE_NONE, 1,
                  GDK_TYPE_RECTANGLE | G_SIGNAL_TYPE_STATIC_SCOPE);
   widget_signals[STATE_CHANGED] =
-    g_signal_new ("state_changed",
+    g_signal_new (I_("state_changed"),
                  G_TYPE_FROM_CLASS (gobject_class),
                  G_SIGNAL_RUN_FIRST,
                  G_STRUCT_OFFSET (GtkWidgetClass, state_changed),
@@ -613,7 +621,7 @@ gtk_widget_class_init (GtkWidgetClass *klass)
                  G_TYPE_NONE, 1,
                  GTK_TYPE_STATE_TYPE);
   widget_signals[PARENT_SET] =
-    g_signal_new ("parent_set",
+    g_signal_new (I_("parent_set"),
                  G_TYPE_FROM_CLASS (gobject_class),
                  G_SIGNAL_RUN_FIRST,
                  G_STRUCT_OFFSET (GtkWidgetClass, parent_set),
@@ -622,7 +630,7 @@ gtk_widget_class_init (GtkWidgetClass *klass)
                  G_TYPE_NONE, 1,
                  GTK_TYPE_WIDGET);
   widget_signals[HIERARCHY_CHANGED] =
-    g_signal_new ("hierarchy_changed",
+    g_signal_new (I_("hierarchy_changed"),
                  G_TYPE_FROM_CLASS (gobject_class),
                  G_SIGNAL_RUN_LAST,
                  G_STRUCT_OFFSET (GtkWidgetClass, hierarchy_changed),
@@ -641,7 +649,7 @@ gtk_widget_class_init (GtkWidgetClass *klass)
    * gtk_widget_modify_base() also cause this signal to be emitted.
    */
   widget_signals[STYLE_SET] =
-    g_signal_new ("style_set",
+    g_signal_new (I_("style_set"),
                  G_TYPE_FROM_CLASS (gobject_class),
                  G_SIGNAL_RUN_FIRST,
                  G_STRUCT_OFFSET (GtkWidgetClass, style_set),
@@ -650,7 +658,7 @@ gtk_widget_class_init (GtkWidgetClass *klass)
                  G_TYPE_NONE, 1,
                  GTK_TYPE_STYLE);
   widget_signals[DIRECTION_CHANGED] =
-    g_signal_new ("direction_changed",
+    g_signal_new (I_("direction_changed"),
                  G_TYPE_FROM_CLASS (gobject_class),
                  G_SIGNAL_RUN_FIRST,
                  G_STRUCT_OFFSET (GtkWidgetClass, direction_changed),
@@ -658,8 +666,24 @@ gtk_widget_class_init (GtkWidgetClass *klass)
                  _gtk_marshal_VOID__ENUM,
                  G_TYPE_NONE, 1,
                  GTK_TYPE_TEXT_DIRECTION);
+
+  /**
+   * 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.
+   */
   widget_signals[GRAB_NOTIFY] =
-    g_signal_new ("grab_notify",
+    g_signal_new (I_("grab_notify"),
                  G_TYPE_FROM_CLASS (gobject_class),
                  G_SIGNAL_RUN_FIRST,
                   G_STRUCT_OFFSET (GtkWidgetClass, grab_notify),
@@ -677,7 +701,7 @@ gtk_widget_class_init (GtkWidgetClass *klass)
  * changed on an object. The signal's detail holds the property name. 
  */
   widget_signals[CHILD_NOTIFY] =
-    g_signal_new ("child_notify",
+    g_signal_new (I_("child_notify"),
                   G_TYPE_FROM_CLASS (gobject_class),
                   G_SIGNAL_RUN_FIRST | G_SIGNAL_NO_RECURSE | G_SIGNAL_DETAILED | G_SIGNAL_NO_HOOKS,
                   G_STRUCT_OFFSET (GtkWidgetClass, child_notify),
@@ -686,7 +710,7 @@ gtk_widget_class_init (GtkWidgetClass *klass)
                   G_TYPE_NONE, 1,
                   G_TYPE_PARAM);
   widget_signals[MNEMONIC_ACTIVATE] =
-    g_signal_new ("mnemonic_activate",
+    g_signal_new (I_("mnemonic_activate"),
                  G_TYPE_FROM_CLASS (gobject_class),
                  G_SIGNAL_RUN_LAST,
                  G_STRUCT_OFFSET (GtkWidgetClass, mnemonic_activate),
@@ -695,7 +719,7 @@ gtk_widget_class_init (GtkWidgetClass *klass)
                  G_TYPE_BOOLEAN, 1,
                  G_TYPE_BOOLEAN);
   widget_signals[GRAB_FOCUS] =
-    g_signal_new ("grab_focus",
+    g_signal_new (I_("grab_focus"),
                  G_TYPE_FROM_CLASS (gobject_class),
                  G_SIGNAL_RUN_LAST | G_SIGNAL_ACTION,
                  G_STRUCT_OFFSET (GtkWidgetClass, grab_focus),
@@ -703,7 +727,7 @@ gtk_widget_class_init (GtkWidgetClass *klass)
                  _gtk_marshal_VOID__VOID,
                  G_TYPE_NONE, 0);
   widget_signals[FOCUS] =
-    g_signal_new ("focus",
+    g_signal_new (I_("focus"),
                  G_TYPE_FROM_CLASS (object_class),
                  G_SIGNAL_RUN_LAST,
                  G_STRUCT_OFFSET (GtkWidgetClass, focus),
@@ -712,7 +736,7 @@ gtk_widget_class_init (GtkWidgetClass *klass)
                  G_TYPE_BOOLEAN, 1,
                  GTK_TYPE_DIRECTION_TYPE);
   widget_signals[EVENT] =
-    g_signal_new ("event",
+    g_signal_new (I_("event"),
                  G_TYPE_FROM_CLASS (gobject_class),
                  G_SIGNAL_RUN_LAST,
                  G_STRUCT_OFFSET (GtkWidgetClass, event),
@@ -721,7 +745,7 @@ gtk_widget_class_init (GtkWidgetClass *klass)
                  G_TYPE_BOOLEAN, 1,
                  GDK_TYPE_EVENT | G_SIGNAL_TYPE_STATIC_SCOPE);
   widget_signals[EVENT_AFTER] =
-    g_signal_new ("event-after",
+    g_signal_new (I_("event-after"),
                  G_TYPE_FROM_CLASS (gobject_class),
                  0,
                  0,
@@ -730,7 +754,7 @@ gtk_widget_class_init (GtkWidgetClass *klass)
                  G_TYPE_NONE, 1,
                  GDK_TYPE_EVENT | G_SIGNAL_TYPE_STATIC_SCOPE);
   widget_signals[BUTTON_PRESS_EVENT] =
-    g_signal_new ("button_press_event",
+    g_signal_new (I_("button_press_event"),
                  G_TYPE_FROM_CLASS (gobject_class),
                  G_SIGNAL_RUN_LAST,
                  G_STRUCT_OFFSET (GtkWidgetClass, button_press_event),
@@ -739,7 +763,7 @@ gtk_widget_class_init (GtkWidgetClass *klass)
                  G_TYPE_BOOLEAN, 1,
                  GDK_TYPE_EVENT | G_SIGNAL_TYPE_STATIC_SCOPE);
   widget_signals[BUTTON_RELEASE_EVENT] =
-    g_signal_new ("button_release_event",
+    g_signal_new (I_("button_release_event"),
                  G_TYPE_FROM_CLASS (gobject_class),
                  G_SIGNAL_RUN_LAST,
                  G_STRUCT_OFFSET (GtkWidgetClass, button_release_event),
@@ -748,7 +772,7 @@ gtk_widget_class_init (GtkWidgetClass *klass)
                  G_TYPE_BOOLEAN, 1,
                  GDK_TYPE_EVENT | G_SIGNAL_TYPE_STATIC_SCOPE);
   widget_signals[SCROLL_EVENT] =
-    g_signal_new ("scroll_event",
+    g_signal_new (I_("scroll_event"),
                  G_TYPE_FROM_CLASS (gobject_class),
                  G_SIGNAL_RUN_LAST,
                  G_STRUCT_OFFSET (GtkWidgetClass, scroll_event),
@@ -757,7 +781,7 @@ gtk_widget_class_init (GtkWidgetClass *klass)
                  G_TYPE_BOOLEAN, 1,
                  GDK_TYPE_EVENT | G_SIGNAL_TYPE_STATIC_SCOPE);
   widget_signals[MOTION_NOTIFY_EVENT] =
-    g_signal_new ("motion_notify_event",
+    g_signal_new (I_("motion_notify_event"),
                  G_TYPE_FROM_CLASS (gobject_class),
                  G_SIGNAL_RUN_LAST,
                  G_STRUCT_OFFSET (GtkWidgetClass, motion_notify_event),
@@ -765,6 +789,14 @@ gtk_widget_class_init (GtkWidgetClass *klass)
                  _gtk_marshal_BOOLEAN__BOXED,
                  G_TYPE_BOOLEAN, 1,
                  GDK_TYPE_EVENT | G_SIGNAL_TYPE_STATIC_SCOPE);
+  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);
 
 /**
  * GtkWidget::delete-event:
@@ -781,7 +813,7 @@ gtk_widget_class_init (GtkWidgetClass *klass)
  *   %FALSE to propagate the event further.
  */
   widget_signals[DELETE_EVENT] =
-    g_signal_new ("delete_event",
+    g_signal_new (I_("delete_event"),
                  G_TYPE_FROM_CLASS (gobject_class),
                  G_SIGNAL_RUN_LAST,
                  G_STRUCT_OFFSET (GtkWidgetClass, delete_event),
@@ -804,7 +836,7 @@ gtk_widget_class_init (GtkWidgetClass *klass)
  *   %FALSE to propagate the event further.
  */
   widget_signals[DESTROY_EVENT] =
-    g_signal_new ("destroy_event",
+    g_signal_new (I_("destroy_event"),
                  G_TYPE_FROM_CLASS (gobject_class),
                  G_SIGNAL_RUN_LAST,
                  G_STRUCT_OFFSET (GtkWidgetClass, destroy_event),
@@ -813,7 +845,7 @@ gtk_widget_class_init (GtkWidgetClass *klass)
                  G_TYPE_BOOLEAN, 1,
                  GDK_TYPE_EVENT | G_SIGNAL_TYPE_STATIC_SCOPE);
   widget_signals[EXPOSE_EVENT] =
-    g_signal_new ("expose_event",
+    g_signal_new (I_("expose_event"),
                  G_TYPE_FROM_CLASS (gobject_class),
                  G_SIGNAL_RUN_LAST,
                  G_STRUCT_OFFSET (GtkWidgetClass, expose_event),
@@ -822,7 +854,7 @@ gtk_widget_class_init (GtkWidgetClass *klass)
                  G_TYPE_BOOLEAN, 1,
                  GDK_TYPE_EVENT | G_SIGNAL_TYPE_STATIC_SCOPE);
   widget_signals[KEY_PRESS_EVENT] =
-    g_signal_new ("key_press_event",
+    g_signal_new (I_("key_press_event"),
                  G_TYPE_FROM_CLASS (gobject_class),
                  G_SIGNAL_RUN_LAST,
                  G_STRUCT_OFFSET (GtkWidgetClass, key_press_event),
@@ -831,7 +863,7 @@ gtk_widget_class_init (GtkWidgetClass *klass)
                  G_TYPE_BOOLEAN, 1,
                  GDK_TYPE_EVENT | G_SIGNAL_TYPE_STATIC_SCOPE);
   widget_signals[KEY_RELEASE_EVENT] =
-    g_signal_new ("key_release_event",
+    g_signal_new (I_("key_release_event"),
                  G_TYPE_FROM_CLASS (gobject_class),
                  G_SIGNAL_RUN_LAST,
                  G_STRUCT_OFFSET (GtkWidgetClass, key_release_event),
@@ -840,7 +872,7 @@ gtk_widget_class_init (GtkWidgetClass *klass)
                  G_TYPE_BOOLEAN, 1,
                  GDK_TYPE_EVENT | G_SIGNAL_TYPE_STATIC_SCOPE);
   widget_signals[ENTER_NOTIFY_EVENT] =
-    g_signal_new ("enter_notify_event",
+    g_signal_new (I_("enter_notify_event"),
                  G_TYPE_FROM_CLASS (gobject_class),
                  G_SIGNAL_RUN_LAST,
                  G_STRUCT_OFFSET (GtkWidgetClass, enter_notify_event),
@@ -849,7 +881,7 @@ gtk_widget_class_init (GtkWidgetClass *klass)
                  G_TYPE_BOOLEAN, 1,
                  GDK_TYPE_EVENT | G_SIGNAL_TYPE_STATIC_SCOPE);
   widget_signals[LEAVE_NOTIFY_EVENT] =
-    g_signal_new ("leave_notify_event",
+    g_signal_new (I_("leave_notify_event"),
                  G_TYPE_FROM_CLASS (gobject_class),
                  G_SIGNAL_RUN_LAST,
                  G_STRUCT_OFFSET (GtkWidgetClass, leave_notify_event),
@@ -858,7 +890,7 @@ gtk_widget_class_init (GtkWidgetClass *klass)
                  G_TYPE_BOOLEAN, 1,
                  GDK_TYPE_EVENT | G_SIGNAL_TYPE_STATIC_SCOPE);
   widget_signals[CONFIGURE_EVENT] =
-    g_signal_new ("configure_event",
+    g_signal_new (I_("configure_event"),
                  G_TYPE_FROM_CLASS (gobject_class),
                  G_SIGNAL_RUN_LAST,
                  G_STRUCT_OFFSET (GtkWidgetClass, configure_event),
@@ -867,7 +899,7 @@ gtk_widget_class_init (GtkWidgetClass *klass)
                  G_TYPE_BOOLEAN, 1,
                  GDK_TYPE_EVENT | G_SIGNAL_TYPE_STATIC_SCOPE);
   widget_signals[FOCUS_IN_EVENT] =
-    g_signal_new ("focus_in_event",
+    g_signal_new (I_("focus_in_event"),
                  G_TYPE_FROM_CLASS (gobject_class),
                  G_SIGNAL_RUN_LAST,
                  G_STRUCT_OFFSET (GtkWidgetClass, focus_in_event),
@@ -876,7 +908,7 @@ gtk_widget_class_init (GtkWidgetClass *klass)
                  G_TYPE_BOOLEAN, 1,
                  GDK_TYPE_EVENT | G_SIGNAL_TYPE_STATIC_SCOPE);
   widget_signals[FOCUS_OUT_EVENT] =
-    g_signal_new ("focus_out_event",
+    g_signal_new (I_("focus_out_event"),
                  G_TYPE_FROM_CLASS (gobject_class),
                  G_SIGNAL_RUN_LAST,
                  G_STRUCT_OFFSET (GtkWidgetClass, focus_out_event),
@@ -885,7 +917,7 @@ gtk_widget_class_init (GtkWidgetClass *klass)
                  G_TYPE_BOOLEAN, 1,
                  GDK_TYPE_EVENT | G_SIGNAL_TYPE_STATIC_SCOPE);
   widget_signals[MAP_EVENT] =
-    g_signal_new ("map_event",
+    g_signal_new (I_("map_event"),
                  G_TYPE_FROM_CLASS (gobject_class),
                  G_SIGNAL_RUN_LAST,
                  G_STRUCT_OFFSET (GtkWidgetClass, map_event),
@@ -894,7 +926,7 @@ gtk_widget_class_init (GtkWidgetClass *klass)
                  G_TYPE_BOOLEAN, 1,
                  GDK_TYPE_EVENT | G_SIGNAL_TYPE_STATIC_SCOPE);
   widget_signals[UNMAP_EVENT] =
-    g_signal_new ("unmap_event",
+    g_signal_new (I_("unmap_event"),
                  G_TYPE_FROM_CLASS (gobject_class),
                  G_SIGNAL_RUN_LAST,
                  G_STRUCT_OFFSET (GtkWidgetClass, unmap_event),
@@ -903,7 +935,7 @@ gtk_widget_class_init (GtkWidgetClass *klass)
                  G_TYPE_BOOLEAN, 1,
                  GDK_TYPE_EVENT | G_SIGNAL_TYPE_STATIC_SCOPE);
   widget_signals[PROPERTY_NOTIFY_EVENT] =
-    g_signal_new ("property_notify_event",
+    g_signal_new (I_("property_notify_event"),
                  G_TYPE_FROM_CLASS (gobject_class),
                  G_SIGNAL_RUN_LAST,
                  G_STRUCT_OFFSET (GtkWidgetClass, property_notify_event),
@@ -912,7 +944,7 @@ gtk_widget_class_init (GtkWidgetClass *klass)
                  G_TYPE_BOOLEAN, 1,
                  GDK_TYPE_EVENT | G_SIGNAL_TYPE_STATIC_SCOPE);
   widget_signals[SELECTION_CLEAR_EVENT] =
-    g_signal_new ("selection_clear_event",
+    g_signal_new (I_("selection_clear_event"),
                  G_TYPE_FROM_CLASS (gobject_class),
                  G_SIGNAL_RUN_LAST,
                  G_STRUCT_OFFSET (GtkWidgetClass, selection_clear_event),
@@ -921,7 +953,7 @@ gtk_widget_class_init (GtkWidgetClass *klass)
                  G_TYPE_BOOLEAN, 1,
                  GDK_TYPE_EVENT | G_SIGNAL_TYPE_STATIC_SCOPE);
   widget_signals[SELECTION_REQUEST_EVENT] =
-    g_signal_new ("selection_request_event",
+    g_signal_new (I_("selection_request_event"),
                  G_TYPE_FROM_CLASS (gobject_class),
                  G_SIGNAL_RUN_LAST,
                  G_STRUCT_OFFSET (GtkWidgetClass, selection_request_event),
@@ -930,7 +962,7 @@ gtk_widget_class_init (GtkWidgetClass *klass)
                  G_TYPE_BOOLEAN, 1,
                  GDK_TYPE_EVENT | G_SIGNAL_TYPE_STATIC_SCOPE);
   widget_signals[SELECTION_NOTIFY_EVENT] =
-    g_signal_new ("selection_notify_event",
+    g_signal_new (I_("selection_notify_event"),
                  G_TYPE_FROM_CLASS (gobject_class),
                  G_SIGNAL_RUN_LAST,
                  G_STRUCT_OFFSET (GtkWidgetClass, selection_notify_event),
@@ -939,7 +971,7 @@ gtk_widget_class_init (GtkWidgetClass *klass)
                  G_TYPE_BOOLEAN, 1,
                  GDK_TYPE_EVENT | G_SIGNAL_TYPE_STATIC_SCOPE);
   widget_signals[SELECTION_RECEIVED] =
-    g_signal_new ("selection_received",
+    g_signal_new (I_("selection_received"),
                  G_TYPE_FROM_CLASS (gobject_class),
                  G_SIGNAL_RUN_LAST,
                  G_STRUCT_OFFSET (GtkWidgetClass, selection_received),
@@ -949,7 +981,7 @@ gtk_widget_class_init (GtkWidgetClass *klass)
                  GTK_TYPE_SELECTION_DATA | G_SIGNAL_TYPE_STATIC_SCOPE,
                  G_TYPE_UINT);
   widget_signals[SELECTION_GET] =
-    g_signal_new ("selection_get",
+    g_signal_new (I_("selection_get"),
                  G_TYPE_FROM_CLASS (gobject_class),
                  G_SIGNAL_RUN_LAST,
                  G_STRUCT_OFFSET (GtkWidgetClass, selection_get),
@@ -960,7 +992,7 @@ gtk_widget_class_init (GtkWidgetClass *klass)
                  G_TYPE_UINT,
                  G_TYPE_UINT);
   widget_signals[PROXIMITY_IN_EVENT] =
-    g_signal_new ("proximity_in_event",
+    g_signal_new (I_("proximity_in_event"),
                  G_TYPE_FROM_CLASS (gobject_class),
                  G_SIGNAL_RUN_LAST,
                  G_STRUCT_OFFSET (GtkWidgetClass, proximity_in_event),
@@ -969,7 +1001,7 @@ gtk_widget_class_init (GtkWidgetClass *klass)
                  G_TYPE_BOOLEAN, 1,
                  GDK_TYPE_EVENT | G_SIGNAL_TYPE_STATIC_SCOPE);
   widget_signals[PROXIMITY_OUT_EVENT] =
-    g_signal_new ("proximity_out_event",
+    g_signal_new (I_("proximity_out_event"),
                  G_TYPE_FROM_CLASS (gobject_class),
                  G_SIGNAL_RUN_LAST,
                  G_STRUCT_OFFSET (GtkWidgetClass, proximity_out_event),
@@ -984,12 +1016,13 @@ gtk_widget_class_init (GtkWidgetClass *klass)
    * @drag_context: the drag context
    * @time: the timestamp of the motion event
    *
-   * The ::drag-leave signal is emitted on the drop site when the cursor leaves the widget.
-   * A typical reason to connect to this signal is to undo things done in ::drag-motion, e.g.
-   * undo highlighting with gtk_drag_unhighlight()
+   * The ::drag-leave signal is emitted on the drop site when the cursor 
+   * leaves the widget. A typical reason to connect to this signal is to 
+   * undo things done in ::drag-motion, e.g. undo highlighting with 
+   * gtk_drag_unhighlight()
    */
   widget_signals[DRAG_LEAVE] =
-    g_signal_new ("drag_leave",
+    g_signal_new (I_("drag_leave"),
                  G_TYPE_FROM_CLASS (gobject_class),
                  G_SIGNAL_RUN_LAST,
                  G_STRUCT_OFFSET (GtkWidgetClass, drag_leave),
@@ -1009,7 +1042,7 @@ gtk_widget_class_init (GtkWidgetClass *klass)
    * gtk_drag_source_set_icon().
    */
   widget_signals[DRAG_BEGIN] =
-    g_signal_new ("drag_begin",
+    g_signal_new (I_("drag_begin"),
                  G_TYPE_FROM_CLASS (gobject_class),
                  G_SIGNAL_RUN_LAST,
                  G_STRUCT_OFFSET (GtkWidgetClass, drag_begin),
@@ -1027,7 +1060,7 @@ gtk_widget_class_init (GtkWidgetClass *klass)
    * A typical reason to connect to this signal is to undo things done in ::drag-begin.
    */
   widget_signals[DRAG_END] =
-    g_signal_new ("drag_end",
+    g_signal_new (I_("drag_end"),
                  G_TYPE_FROM_CLASS (gobject_class),
                  G_SIGNAL_RUN_LAST,
                  G_STRUCT_OFFSET (GtkWidgetClass, drag_end),
@@ -1041,13 +1074,13 @@ gtk_widget_class_init (GtkWidgetClass *klass)
    * @widget: the object which received the signal.
    * @drag_context: the drag context
    *
-   * The ::drag-data-delete signal is emitted on the drag source when a drag with the action
-   * %GDK_ACTION_MOVE is successfully completed. The signal handler is responsible for deleting
-   * the data that has been dropped. What "delete" means, depends on the context of the drag
-   * operation. 
+   * The ::drag-data-delete signal is emitted on the drag source when a drag 
+   * with the action %GDK_ACTION_MOVE is successfully completed. The signal 
+   * handler is responsible for deleting the data that has been dropped. What 
+   * "delete" means, depends on the context of the drag operation. 
    */
   widget_signals[DRAG_DATA_DELETE] =
-    g_signal_new ("drag_data_delete",
+    g_signal_new (I_("drag_data_delete"),
                  G_TYPE_FROM_CLASS (gobject_class),
                  G_SIGNAL_RUN_LAST,
                  G_STRUCT_OFFSET (GtkWidgetClass, drag_data_delete),
@@ -1065,20 +1098,23 @@ gtk_widget_class_init (GtkWidgetClass *klass)
    * @time: the timestamp of the motion event
    * @returns: whether the cursor position is in a drop zone
    *
-   * The ::drag-motion signal is emitted on the drop site when the user moves the cursor over
-   * the widget during a drag. The signal handler must determine whether the cursor position is in 
-   * a drop zone or not. If it is not in a drop zone, it returns %FALSE and no further processing is
-   * necessary. Otherwise, the handler returns %TRUE. In this case, the handler is responsible for
-   * providing the necessary information for displaying feedback to the user, by calling
-   * gdk_drag_status(). If the decision whether the drop will be accepted or rejected can't be made
-   * based solely on the cursor position and the type of the data, the handler may inspect the dragged 
-   * data by calling gtk_drag_get_data() and defer the gdk_drag_status() call to the ::drag-data-received 
-   * handler. 
+   * The ::drag-motion signal is emitted on the drop site when the user 
+   * moves the cursor over the widget during a drag. The signal handler 
+   * must determine whether the cursor position is in a drop zone or not. 
+   * If it is not in a drop zone, it returns %FALSE and no further processing 
+   * is necessary. Otherwise, the handler returns %TRUE. In this case, the 
+   * handler is responsible for providing the necessary information for 
+   * displaying feedback to the user, by calling gdk_drag_status(). If the 
+   * decision whether the drop will be accepted or rejected can't be made
+   * based solely on the cursor position and the type of the data, the handler 
+   * may inspect the dragged data by calling gtk_drag_get_data() and defer the 
+   * gdk_drag_status() call to the ::drag-data-received handler. 
    *
-   * Note that there is no ::drag-enter signal. The drag receiver has to keep track of whether
-   * he has received any ::drag-motion signals since the last ::drag-leave and if not, treat the
-   * ::drag-motion signal as an "enter" signal. Upon an "enter", the handler will typically highlight 
-   * the drop site with gtk_drag_highlight().
+   * Note that there is no ::drag-enter signal. The drag receiver has to keep 
+   * track of whether he has received any ::drag-motion signals since the last 
+   * ::drag-leave and if not, treat the ::drag-motion signal as an "enter" signal. 
+   * Upon an "enter", the handler will typically highlight the drop site with 
+   * gtk_drag_highlight().
    *
    * <informalexample><programlisting> 
    * static void
@@ -1127,7 +1163,8 @@ gtk_widget_class_init (GtkWidgetClass *klass)
    *      
    *     /<!-- -->* We are getting this data due to a request in drag_motion,
    *      * rather than due to a request in drag_drop, so we are just
-   *      * supposed to call gdk_drag_status(<!-- -->), not actually paste in the data.
+   *      * supposed to call gdk_drag_status(<!-- -->), not actually paste in 
+   *      * the data.
    *      *<!-- -->/
    *      str = gtk_selection_data_get_text (selection_data);
    *      if (!data_is_acceptable (str)) 
@@ -1143,7 +1180,7 @@ gtk_widget_class_init (GtkWidgetClass *klass)
    * </programlisting></informalexample>
    */
   widget_signals[DRAG_MOTION] =
-    g_signal_new ("drag_motion",
+    g_signal_new (I_("drag_motion"),
                  G_TYPE_FROM_CLASS (gobject_class),
                  G_SIGNAL_RUN_LAST,
                  G_STRUCT_OFFSET (GtkWidgetClass, drag_motion),
@@ -1164,17 +1201,18 @@ gtk_widget_class_init (GtkWidgetClass *klass)
    * @time: the timestamp of the motion event
    * @returns: whether the cursor position is in a drop zone
    *
-   * The ::drag-drop signal is emitted on the drop site when the user drops the data
-   * onto the widget. The signal handler must determine whether the cursor position is in 
-   * a drop zone or not. If it is not in a drop zone, it returns %FALSE and no further 
-   * processing is necessary. Otherwise, the handler returns %TRUE. In this case, the handler 
-   * must ensure that gtk_drag_finish() is called to let the source know that the drop is done.
-   * The call to gtk_drag_finish() can be done either directly or in a ::drag-data-received handler
-   * which gets triggered by calling gtk_drop_get_data() to receive the data for one or more of the 
-   * supported targets.
+   * The ::drag-drop signal is emitted on the drop site when the user drops the 
+   * data onto the widget. The signal handler must determine whether the cursor 
+   * position is in a drop zone or not. If it is not in a drop zone, it returns 
+   * %FALSE and no further processing is necessary. Otherwise, the handler returns 
+   * %TRUE. In this case, the handler must ensure that gtk_drag_finish() is called 
+   * to let the source know that the drop is done. The call to gtk_drag_finish() 
+   * can be done either directly or in a ::drag-data-received handler which gets 
+   * triggered by calling gtk_drop_get_data() to receive the data for one or more 
+   * of the supported targets.
    */
   widget_signals[DRAG_DROP] =
-    g_signal_new ("drag_drop",
+    g_signal_new (I_("drag_drop"),
                  G_TYPE_FROM_CLASS (gobject_class),
                  G_SIGNAL_RUN_LAST,
                  G_STRUCT_OFFSET (GtkWidgetClass, drag_drop),
@@ -1194,13 +1232,13 @@ gtk_widget_class_init (GtkWidgetClass *klass)
    * @info: the info that has been registered with the target in the #GtkTargetList.
    * @time: the timestamp at which the data was requested
    *
-   * The ::drag-data-get signal is emitted on the drag source when the drop site requests
-   * the data which is dragged. It is the responsibility of the signal handler to fill @data
-   * with the data in the format which is indicated by @info. See gtk_selection_data_set() and 
-   * gtk_selection_data_set_text().
+   * The ::drag-data-get signal is emitted on the drag source when the drop site 
+   * requests the data which is dragged. It is the responsibility of the signal 
+   * handler to fill @data with the data in the format which is indicated by @info. 
+   * See gtk_selection_data_set() and gtk_selection_data_set_text().
    */
   widget_signals[DRAG_DATA_GET] =
-    g_signal_new ("drag_data_get",
+    g_signal_new (I_("drag_data_get"),
                  G_TYPE_FROM_CLASS (gobject_class),
                  G_SIGNAL_RUN_LAST,
                  G_STRUCT_OFFSET (GtkWidgetClass, drag_data_get),
@@ -1222,16 +1260,18 @@ gtk_widget_class_init (GtkWidgetClass *klass)
  * @info: the info that has been registered with the target in the #GtkTargetList.
  * @time: the timestamp at which the data was received
  *
- * The ::drag-data-received signal is emitted on the drop site when the dragged data has been 
- * received. If the data was received in order to determine whether the drop will be accepted, 
- * the handler is expected to call gdk_drag_status() and <emphasis>not</emphasis> finish the drag. 
- * If the data was received in response to a ::drag-drop signal (and this is the last target to be 
- * received), the handler for this signal is expected to process the received data and then call 
- * gtk_drag_finish(), setting the @success parameter depending on whether the data was processed 
- * successfully. 
- * 
- * The handler may inspect and modify @drag_context->action before calling gtk_drag_finish(), 
- * e.g. to implement %GDK_ACTION_ASK as shown in the following example:
+ * The ::drag-data-received signal is emitted on the drop site when the dragged 
+ * data has been received. If the data was received in order to determine whether 
+ * the drop will be accepted, the handler is expected to call gdk_drag_status() 
+ * and <emphasis>not</emphasis> finish the drag. If the data was received in 
+ * response to a ::drag-drop signal (and this is the last target to be received), 
+ * the handler for this signal is expected to process the received data and then 
+ * call gtk_drag_finish(), setting the @success parameter depending on whether 
+ * the data was processed successfully. 
+ * 
+ * The handler may inspect and modify @drag_context->action before calling 
+ * gtk_drag_finish(), e.g. to implement %GDK_ACTION_ASK as shown in the following 
+ * example:
  * <informalexample><programlisting>
  * void  
  * drag_data_received (GtkWidget          *widget,
@@ -1273,7 +1313,7 @@ gtk_widget_class_init (GtkWidgetClass *klass)
  * </programlisting></informalexample>
  */
   widget_signals[DRAG_DATA_RECEIVED] =
-    g_signal_new ("drag_data_received",
+    g_signal_new (I_("drag_data_received"),
                  G_TYPE_FROM_CLASS (gobject_class),
                  G_SIGNAL_RUN_LAST,
                  G_STRUCT_OFFSET (GtkWidgetClass, drag_data_received),
@@ -1287,7 +1327,7 @@ gtk_widget_class_init (GtkWidgetClass *klass)
                  G_TYPE_UINT,
                  G_TYPE_UINT);
   widget_signals[VISIBILITY_NOTIFY_EVENT] =
-    g_signal_new ("visibility_notify_event",
+    g_signal_new (I_("visibility_notify_event"),
                  G_TYPE_FROM_CLASS (gobject_class),
                  G_SIGNAL_RUN_LAST,
                  G_STRUCT_OFFSET (GtkWidgetClass, visibility_notify_event),
@@ -1296,7 +1336,7 @@ gtk_widget_class_init (GtkWidgetClass *klass)
                  G_TYPE_BOOLEAN, 1,
                  GDK_TYPE_EVENT | G_SIGNAL_TYPE_STATIC_SCOPE);
   widget_signals[CLIENT_EVENT] =
-    g_signal_new ("client_event",
+    g_signal_new (I_("client_event"),
                  G_TYPE_FROM_CLASS (gobject_class),
                  G_SIGNAL_RUN_LAST,
                  G_STRUCT_OFFSET (GtkWidgetClass, client_event),
@@ -1305,7 +1345,7 @@ gtk_widget_class_init (GtkWidgetClass *klass)
                  G_TYPE_BOOLEAN, 1,
                  GDK_TYPE_EVENT | G_SIGNAL_TYPE_STATIC_SCOPE);
   widget_signals[NO_EXPOSE_EVENT] =
-    g_signal_new ("no_expose_event",
+    g_signal_new (I_("no_expose_event"),
                  G_TYPE_FROM_CLASS (gobject_class),
                  G_SIGNAL_RUN_LAST,
                  G_STRUCT_OFFSET (GtkWidgetClass, no_expose_event),
@@ -1314,7 +1354,7 @@ gtk_widget_class_init (GtkWidgetClass *klass)
                  G_TYPE_BOOLEAN, 1,
                  GDK_TYPE_EVENT | G_SIGNAL_TYPE_STATIC_SCOPE);
   widget_signals[WINDOW_STATE_EVENT] =
-    g_signal_new ("window_state_event",
+    g_signal_new (I_("window_state_event"),
                  G_TYPE_FROM_CLASS (gobject_class),
                  G_SIGNAL_RUN_LAST,
                  G_STRUCT_OFFSET (GtkWidgetClass, window_state_event),
@@ -1322,6 +1362,32 @@ gtk_widget_class_init (GtkWidgetClass *klass)
                  _gtk_marshal_BOOLEAN__BOXED,
                  G_TYPE_BOOLEAN, 1,
                  GDK_TYPE_EVENT | G_SIGNAL_TYPE_STATIC_SCOPE);
+  /**
+   * GtkWidget::grab-broken-event:
+   * @widget: the object which received the signal
+   * @event: the #GdkEventGrabBroken event
+   *
+   * Emitted when a pointer or keyboard grab on a window belonging 
+   * to @widget gets broken. 
+   * 
+   * On X11, this happens when the grab window becomes unviewable 
+   * (i.e. it or one of its ancestors is unmapped), or if the same 
+   * application grabs the pointer or keyboard again.
+   *
+   * Returns: %TRUE to stop other handlers from being invoked for the event. 
+   *   %FALSE to propagate the event further.
+   *
+   * Since: 2.8
+   */
+  widget_signals[GRAB_BROKEN] =
+    g_signal_new (I_("grab_broken_event"),
+                 G_TYPE_FROM_CLASS (gobject_class),
+                 G_SIGNAL_RUN_LAST,
+                 G_STRUCT_OFFSET (GtkWidgetClass, grab_broken_event),
+                 _gtk_boolean_handled_accumulator, NULL,
+                 _gtk_marshal_BOOLEAN__BOXED,
+                 G_TYPE_BOOLEAN, 1,
+                 GDK_TYPE_EVENT | G_SIGNAL_TYPE_STATIC_SCOPE);
 /**
  * GtkWidget::popup-menu
  * @widget: the object which received the signal
@@ -1335,7 +1401,7 @@ gtk_widget_class_init (GtkWidgetClass *klass)
  * example of how to use this signal.
  */
   widget_signals[POPUP_MENU] =
-    g_signal_new ("popup_menu",
+    g_signal_new (I_("popup_menu"),
                  G_TYPE_FROM_CLASS (gobject_class),
                  G_SIGNAL_RUN_LAST | G_SIGNAL_ACTION,
                  G_STRUCT_OFFSET (GtkWidgetClass, popup_menu),
@@ -1343,7 +1409,7 @@ gtk_widget_class_init (GtkWidgetClass *klass)
                  _gtk_marshal_BOOLEAN__VOID,
                  G_TYPE_BOOLEAN, 0);
   widget_signals[SHOW_HELP] =
-    g_signal_new ("show_help",
+    g_signal_new (I_("show_help"),
                  G_TYPE_FROM_CLASS (gobject_class),
                  G_SIGNAL_RUN_LAST | G_SIGNAL_ACTION,
                  G_STRUCT_OFFSET (GtkWidgetClass, show_help),
@@ -1352,7 +1418,7 @@ gtk_widget_class_init (GtkWidgetClass *klass)
                  G_TYPE_BOOLEAN, 1,
                  GTK_TYPE_WIDGET_HELP_TYPE);
   widget_signals[ACCEL_CLOSURES_CHANGED] =
-    g_signal_new ("accel_closures_changed",
+    g_signal_new (I_("accel_closures_changed"),
                  G_TYPE_FROM_CLASS (gobject_class),
                  0,
                  0,
@@ -1360,7 +1426,7 @@ gtk_widget_class_init (GtkWidgetClass *klass)
                  _gtk_marshal_NONE__NONE,
                  G_TYPE_NONE, 0);
   widget_signals[SCREEN_CHANGED] =
-    g_signal_new ("screen_changed",
+    g_signal_new (I_("screen_changed"),
                  G_TYPE_FROM_CLASS (gobject_class),
                  G_SIGNAL_RUN_LAST,
                  G_STRUCT_OFFSET (GtkWidgetClass, screen_changed),
@@ -1381,7 +1447,7 @@ gtk_widget_class_init (GtkWidgetClass *klass)
  * for determining whether an accelerator can be activated.
  */
   widget_signals[CAN_ACTIVATE_ACCEL] =
-    g_signal_new ("can_activate_accel",
+     g_signal_new (I_("can_activate_accel"),
                  G_TYPE_FROM_CLASS (gobject_class),
                  G_SIGNAL_RUN_LAST,
                  G_STRUCT_OFFSET (GtkWidgetClass, can_activate_accel),
@@ -1413,49 +1479,183 @@ gtk_widget_class_init (GtkWidgetClass *klass)
                                 GTK_WIDGET_HELP_WHATS_THIS);
 
   gtk_widget_class_install_style_property (klass,
-                                          g_param_spec_boolean ("interior_focus",
+                                          g_param_spec_boolean ("interior-focus",
                                                                 P_("Interior Focus"),
                                                                 P_("Whether to draw the focus indicator inside widgets"),
                                                                 TRUE,
-                                                                G_PARAM_READABLE));
+                                                                GTK_PARAM_READABLE));
 
   gtk_widget_class_install_style_property (klass,
                                           g_param_spec_int ("focus-line-width",
                                                             P_("Focus linewidth"),
                                                             P_("Width, in pixels, of the focus indicator line"),
                                                             0, G_MAXINT, 1,
-                                                            G_PARAM_READABLE));
+                                                            GTK_PARAM_READABLE));
 
   gtk_widget_class_install_style_property (klass,
                                           g_param_spec_string ("focus-line-pattern",
                                                                P_("Focus line dash pattern"),
                                                                P_("Dash pattern used to draw the focus indicator"),
                                                                "\1\1",
-                                                               G_PARAM_READABLE));
+                                                               GTK_PARAM_READABLE));
   gtk_widget_class_install_style_property (klass,
                                           g_param_spec_int ("focus-padding",
                                                             P_("Focus padding"),
                                                             P_("Width, in pixels, between focus indicator and the widget 'box'"),
                                                             0, G_MAXINT, 1,
-                                                            G_PARAM_READABLE));
+                                                            GTK_PARAM_READABLE));
   gtk_widget_class_install_style_property (klass,
                                           g_param_spec_boxed ("cursor-color",
                                                               P_("Cursor color"),
                                                               P_("Color with which to draw insertion cursor"),
                                                               GDK_TYPE_COLOR,
-                                                              G_PARAM_READABLE));
+                                                              GTK_PARAM_READABLE));
   gtk_widget_class_install_style_property (klass,
                                           g_param_spec_boxed ("secondary-cursor-color",
                                                               P_("Secondary cursor color"),
                                                               P_("Color with which to draw the secondary insertion cursor when editing mixed right-to-left and left-to-right text"),
                                                               GDK_TYPE_COLOR,
-                                                              G_PARAM_READABLE));
+                                                              GTK_PARAM_READABLE));
   gtk_widget_class_install_style_property (klass,
                                           g_param_spec_float ("cursor-aspect-ratio",
                                                               P_("Cursor line aspect ratio"),
                                                               P_("Aspect ratio with which to draw insertion cursor"),
                                                               0.0, 1.0, 0.04,
-                                                              G_PARAM_READABLE));
+                                                              GTK_PARAM_READABLE));
+
+/**
+ * GtkWidget:draw-border:
+ *
+ * The "draw-border" property defines the size of areas outside 
+ * the widget's allocation to draw.
+ *
+ * Since: 2.8
+ */
+  gtk_widget_class_install_style_property (klass,
+                                          g_param_spec_boxed ("draw-border",
+                                                              P_("Draw Border"),
+                                                              P_("Size of areas outside the widget's allocation to draw"),
+                                                              GTK_TYPE_BORDER,
+                                                              GTK_PARAM_READABLE));
+
+/**
+ * GtkWidget:link-color:
+ *
+ * The "link-color" property defines the color of unvisited links.
+ *
+ * Since: 2.10
+ */
+  gtk_widget_class_install_style_property (klass,
+                                          g_param_spec_boxed ("link-color",
+                                                              P_("Unvisited Link Color"),
+                                                              P_("Color of unvisited links"),
+                                                              GDK_TYPE_COLOR,
+                                                              GTK_PARAM_READABLE));
+
+/**
+ * GtkWidget:visited-link-color:
+ *
+ * The "visited-link-color" property defines the color of visited links.
+ *
+ * Since: 2.10
+ */
+  gtk_widget_class_install_style_property (klass,
+                                          g_param_spec_boxed ("visited-link-color",
+                                                              P_("Visited Link Color"),
+                                                              P_("Color of visited links"),
+                                                              GDK_TYPE_COLOR,
+                                                              GTK_PARAM_READABLE));
+
+/**
+ * GtkWidget:wide-separators:
+ *
+ * The "wide-separators" property defines whether separators have 
+ * configurable width and should be drawn using a box instead of a line.
+ *
+ * Since: 2.10
+ */
+  gtk_widget_class_install_style_property (klass,
+                                           g_param_spec_boolean ("wide-separators",
+                                                                 P_("Wide Separators"),
+                                                                 P_("Whether separators have configurable width and should be drawn using a box instead of a line"),
+                                                                 FALSE,
+                                                                 GTK_PARAM_READABLE));
+
+/**
+ * GtkWidget:separator-width:
+ *
+ * The "separator-width" property defines the width of separators.
+ * This property only takes effect if "wide-separators" is %TRUE.
+ *
+ * Since: 2.10
+ */
+  gtk_widget_class_install_style_property (klass,
+                                           g_param_spec_int ("separator-width",
+                                                             P_("Separator Width"),
+                                                             P_("The width of separators if wide-separators is TRUE"),
+                                                             0, G_MAXINT, 0,
+                                                             GTK_PARAM_READABLE));
+
+/**
+ * GtkWidget:separator-height:
+ *
+ * The "separator-height" property defines the height of separators.
+ * This property only takes effect if "wide-separators" is %TRUE.
+ *
+ * Since: 2.10
+ */
+  gtk_widget_class_install_style_property (klass,
+                                           g_param_spec_int ("separator-height",
+                                                             P_("Separator Height"),
+                                                             P_("The height of separators if \"wide-separators\" is TRUE"),
+                                                             0, G_MAXINT, 0,
+                                                             GTK_PARAM_READABLE));
+
+/**
+ * GtkWidget:scroll-arrow-hlength:
+ *
+ * The "scroll-arrow-hlength" property defines the length of 
+ * horizontal scroll arrows.
+ *
+ * Since: 2.10
+ */
+  gtk_widget_class_install_style_property (klass,
+                                           g_param_spec_int ("scroll-arrow-hlength",
+                                                             P_("Horizontal Scroll Arrow Length"),
+                                                             P_("The length of horizontal scroll arrows"),
+                                                             1, G_MAXINT, 16,
+                                                             GTK_PARAM_READABLE));
+
+/**
+ * GtkWidget:scroll-arrow-vlength:
+ *
+ * The "scroll-arrow-vlength" property defines the length of 
+ * vertical scroll arrows.
+ *
+ * Since: 2.10
+ */
+  gtk_widget_class_install_style_property (klass,
+                                           g_param_spec_int ("scroll-arrow-vlength",
+                                                             P_("Vertical Scroll Arrow Length"),
+                                                             P_("The length of vertical scroll arrows"),
+                                                             1, G_MAXINT, 16,
+                                                             GTK_PARAM_READABLE));
+}
+
+static void
+gtk_widget_base_class_finalize (GtkWidgetClass *klass)
+{
+  GList *list, *node;
+
+  list = g_param_spec_pool_list_owned (style_property_spec_pool, G_OBJECT_CLASS_TYPE (klass));
+  for (node = list; node; node = node->next)
+    {
+      GParamSpec *pspec = node->data;
+
+      g_param_spec_pool_remove (style_property_spec_pool, pspec);
+      g_param_spec_unref (pspec);
+    }
+  g_list_free (list);
 }
 
 static void
@@ -2294,6 +2494,13 @@ gtk_widget_realize (GtkWidget *widget)
                                         shape_info->offset_y);
        }
       
+      shape_info = g_object_get_qdata (G_OBJECT (widget), quark_input_shape_info);
+      if (shape_info)
+       gdk_window_input_shape_combine_mask (widget->window,
+                                            shape_info->shape_mask,
+                                            shape_info->offset_x,
+                                            shape_info->offset_y);
+
       if (!GTK_WIDGET_NO_WINDOW (widget))
        {
          mode = gtk_widget_get_extension_events (widget);
@@ -2322,7 +2529,10 @@ gtk_widget_unrealize (GtkWidget *widget)
   g_return_if_fail (GTK_IS_WIDGET (widget));
 
   if (GTK_WIDGET_HAS_SHAPE_MASK (widget))
-    gtk_widget_shape_combine_mask (widget, NULL, -1, -1);
+    gtk_widget_shape_combine_mask (widget, NULL, 0, 0);
+
+  if (g_object_get_qdata (G_OBJECT (widget), quark_input_shape_info))
+    gtk_widget_input_shape_combine_mask (widget, NULL, 0, 0);
 
   if (GTK_WIDGET_REALIZED (widget))
     {
@@ -2430,6 +2640,55 @@ gtk_widget_queue_draw_area (GtkWidget *widget,
   gdk_window_invalidate_rect (widget->window, &invalid_rect, TRUE);
 }
 
+static void
+widget_add_child_draw_rectangle (GtkWidget    *widget,
+                                GdkRectangle *rect)
+{
+  GdkRectangle child_rect;
+  
+  if (!GTK_WIDGET_MAPPED (widget) ||
+      widget->window != widget->parent->window)
+    return;
+
+  gtk_widget_get_draw_rectangle (widget, &child_rect);
+  gdk_rectangle_union (rect, &child_rect, rect);
+}
+
+static void
+gtk_widget_get_draw_rectangle (GtkWidget    *widget,
+                              GdkRectangle *rect)
+{
+  if (GTK_WIDGET_NO_WINDOW (widget))
+    {
+      GtkBorder *draw_border = NULL;
+
+      *rect = widget->allocation;
+
+      gtk_widget_style_get (widget, 
+                           "draw-border", &draw_border,
+                           NULL);
+      if (draw_border)
+       {
+         rect->x -= draw_border->top;
+         rect->y -= draw_border->left;
+         rect->width += draw_border->left + draw_border->right;
+         rect->height += draw_border->top + draw_border->bottom;
+       }
+
+      if (GTK_IS_CONTAINER (widget))
+       gtk_container_forall (GTK_CONTAINER (widget),
+                             (GtkCallback)widget_add_child_draw_rectangle,
+                             rect);
+    }
+  else
+    {
+      rect->x = 0;
+      rect->y = 0;
+      rect->width = widget->allocation.width;
+      rect->height = widget->allocation.height;
+    }
+}
+
 /**
  * gtk_widget_queue_draw:
  * @widget: a #GtkWidget
@@ -2441,20 +2700,15 @@ gtk_widget_queue_draw_area (GtkWidget *widget,
 void      
 gtk_widget_queue_draw (GtkWidget *widget)
 {
+  GdkRectangle rect;
+  
   g_return_if_fail (GTK_IS_WIDGET (widget));
 
-  if (widget->allocation.width || widget->allocation.height)
-    {
-      if (GTK_WIDGET_NO_WINDOW (widget))
-       gtk_widget_queue_draw_area (widget, widget->allocation.x,
-                                   widget->allocation.y,
-                                   widget->allocation.width, 
-                                   widget->allocation.height);
-      else
-       gtk_widget_queue_draw_area (widget, 0, 0, 
-                                   widget->allocation.width, 
-                                   widget->allocation.height);
-    }
+  gtk_widget_get_draw_rectangle (widget, &rect);
+
+  gtk_widget_queue_draw_area (widget,
+                             rect.x, rect.y,
+                             rect.width, rect.height);
 }
 
 /* Invalidates the given area (allocation-relative-coordinates)
@@ -2687,11 +2941,29 @@ gtk_widget_invalidate_widget_windows (GtkWidget *widget,
 static void
 gtk_widget_queue_shallow_draw (GtkWidget *widget)
 {
+  GdkRectangle rect;
   GdkRegion *region;
   
-  g_return_if_fail (GTK_IS_WIDGET (widget));
+  if (!GTK_WIDGET_REALIZED (widget))
+    return;
+
+  gtk_widget_get_draw_rectangle (widget, &rect);
+
+  /* get_draw_rectangle() gives us window coordinates, we
+   * need to convert to the coordinates that widget->allocation
+   * is in.
+   */
+  if (!GTK_WIDGET_NO_WINDOW (widget) && widget->parent)
+    {
+      int wx, wy;
+      
+      gdk_window_get_position (widget->window, &wx, &wy);
+      
+      rect.x += wx;
+      rect.y += wy;
+    }
   
-  region = gdk_region_rectangle (&widget->allocation);
+  region = gdk_region_rectangle (&rect);
   gtk_widget_invalidate_widget_windows (widget, region);
   gdk_region_destroy (region);
 }
@@ -3240,7 +3512,6 @@ gtk_widget_list_accel_closures (GtkWidget *widget)
 
 typedef struct {
   GQuark         path_quark;
-  GtkWidget     *widget;
   GtkAccelGroup *accel_group;
   GClosure      *closure;
 } AccelPath;
@@ -3255,7 +3526,7 @@ destroy_accel_path (gpointer data)
   /* closures_destroy takes care of unrefing the closure */
   g_object_unref (apath->accel_group);
   
-  g_free (apath);
+  g_slice_free (AccelPath, apath);
 }
 
 
@@ -3299,11 +3570,10 @@ gtk_widget_set_accel_path (GtkWidget     *widget,
       g_return_if_fail (_gtk_accel_path_is_valid (accel_path));
 
       gtk_accel_map_add_entry (accel_path, 0, 0);
-      apath = g_new (AccelPath, 1);
-      apath->widget = widget;
+      apath = g_slice_new (AccelPath);
       apath->accel_group = g_object_ref (accel_group);
       apath->path_quark = g_quark_from_string (accel_path);
-      apath->closure = widget_new_accel_closure (apath->widget, GTK_WIDGET_GET_CLASS (apath->widget)->activate_signal);
+      apath->closure = widget_new_accel_closure (widget, GTK_WIDGET_GET_CLASS (widget)->activate_signal);
     }
   else
     apath = NULL;
@@ -3465,9 +3735,6 @@ gtk_widget_send_expose (GtkWidget *widget,
   g_return_val_if_fail (event != NULL, TRUE);
   g_return_val_if_fail (event->type == GDK_EXPOSE, TRUE);
 
-  if (event->type != GDK_EXPOSE)
-    return TRUE;
-  
   return gtk_widget_event_internal (widget, event);
 }
 
@@ -3622,6 +3889,9 @@ gtk_widget_event_internal (GtkWidget *widget,
        case GDK_VISIBILITY_NOTIFY:
          signal_num = VISIBILITY_NOTIFY_EVENT;
          break;
+       case GDK_GRAB_BROKEN:
+         signal_num = GRAB_BROKEN;
+         break;
        default:
          g_warning ("gtk_widget_event(): unhandled event type: %d", event->type);
          signal_num = -1;
@@ -3735,7 +4005,9 @@ gtk_widget_reparent_subwindows (GtkWidget *widget,
 
      parent = gdk_window_get_parent (widget->window);
 
-     if (parent)
+     if (parent == NULL)
+       gdk_window_reparent (widget->window, new_window, 0, 0);
+     else
        {
         children = gdk_window_get_children (parent);
         
@@ -3758,7 +4030,7 @@ static void
 gtk_widget_reparent_fixup_child (GtkWidget *widget,
                                 gpointer   client_data)
 {
-  g_return_if_fail (client_data != NULL);
+  g_assert (client_data != NULL);
   
   if (GTK_WIDGET_NO_WINDOW (widget))
     {
@@ -3881,12 +4153,15 @@ GdkRegion *
 gtk_widget_region_intersect (GtkWidget *widget,
                             GdkRegion *region)
 {
+  GdkRectangle rect;
   GdkRegion *dest;
   
   g_return_val_if_fail (GTK_IS_WIDGET (widget), NULL);
   g_return_val_if_fail (region != NULL, NULL);
+
+  gtk_widget_get_draw_rectangle (widget, &rect);
   
-  dest = gdk_region_rectangle (&widget->allocation);
+  dest = gdk_region_rectangle (&rect);
  
   gdk_region_intersect (dest, region);
 
@@ -3929,7 +4204,7 @@ gtk_widget_grab_focus (GtkWidget *widget)
   
   g_object_ref (widget);
   g_signal_emit (widget, widget_signals[GRAB_FOCUS], 0);
-  g_object_notify (G_OBJECT (widget), "has_focus");
+  g_object_notify (G_OBJECT (widget), "has-focus");
   g_object_unref (widget);
 }
 
@@ -4161,11 +4436,20 @@ void
 gtk_widget_set_state (GtkWidget           *widget,
                      GtkStateType         state)
 {
+  gboolean touchscreen;
+
   g_return_if_fail (GTK_IS_WIDGET (widget));
 
   if (state == GTK_WIDGET_STATE (widget))
     return;
 
+  g_object_get (gtk_widget_get_settings (widget),
+                "gtk-touchscreen-mode", &touchscreen,
+                NULL);
+  
+  if (touchscreen && state == GTK_STATE_PRELIGHT)
+    state = GTK_STATE_NORMAL;
+
   if (state == GTK_STATE_INSENSITIVE)
     gtk_widget_set_sensitive (widget, FALSE);
   else
@@ -4187,6 +4471,31 @@ gtk_widget_set_state (GtkWidget           *widget,
     }
 }
 
+
+/**
+ * gtk_widget_set_app_paintable:
+ * @widget: a #GtkWidget
+ * @app_paintable: %TRUE if the application will paint on the widget
+ *
+ * Sets whether the application intends to draw on the widget in
+ * an ::expose-event handler. 
+ *
+ * This is a hint to the widget and does not affect the behavior of 
+ * the GTK+ core; many widgets ignore this flag entirely. For widgets 
+ * that do pay attention to the flag, such as #GtkEventBox and #GtkWindow, 
+ * the effect is to suppress default themed drawing of the widget's 
+ * background. (Children of the widget will still be drawn.) The application 
+ * is then entirely responsible for drawing the widget background.
+ *
+ * Note that the background is still drawn when the widget is mapped.
+ * If this is not suitable (e.g. because you want to make a transparent
+ * window using an RGBA visual), you can work around this by doing:
+ * <informalexample><programlisting>
+ *  gtk_widget_realize (window);
+ *  gdk_window_set_back_pixmap (window->window, NULL, FALSE);
+ *  gtk_widget_show (window);
+ * </programlisting></informalexample> 
+ **/
 void
 gtk_widget_set_app_paintable (GtkWidget *widget,
                              gboolean   app_paintable)
@@ -4205,7 +4514,7 @@ gtk_widget_set_app_paintable (GtkWidget *widget,
       if (GTK_WIDGET_DRAWABLE (widget))
        gtk_widget_queue_draw (widget);
 
-      g_object_notify (G_OBJECT (widget), "app_paintable");
+      g_object_notify (G_OBJECT (widget), "app-paintable");
     }
 }
 
@@ -4228,6 +4537,11 @@ gtk_widget_set_app_paintable (GtkWidget *widget,
  * so you would only use this function to turn off double buffering
  * if you had special needs and really knew what you were doing.
  * 
+ * Note: if you turn off double-buffering, you have to handle
+ * expose events, since even the clearing to the background color or 
+ * pixmap will not happen automatically (as it is done in 
+ * gdk_window_begin_paint()).
+ * 
  **/
 void
 gtk_widget_set_double_buffered (GtkWidget *widget,
@@ -4248,8 +4562,8 @@ gtk_widget_set_double_buffered (GtkWidget *widget,
  *   when it is allocated to a new size. Otherwise, only the
  *   new portion of the widget will be redrawn.
  *
- * Sets whether a when a widgets size allocation changes, the entire
- * widget is queued for drawing. By default, this setting is %TRUE and
+ * Sets whether the entire widget is queued for drawing when its size 
+ * allocation changes. By default, this setting is %TRUE and
  * the entire widget is redrawn on every size change. If your widget
  * leaves the upper left unchanged when made bigger, turning this
  * setting on will improve performance.
@@ -4359,8 +4673,7 @@ gtk_widget_set_parent (GtkWidget *widget,
   /* keep this function in sync with gtk_menu_attach_to_widget()
    */
 
-  g_object_ref (widget);
-  gtk_object_sink (GTK_OBJECT (widget));
+  g_object_ref_sink (widget);
   widget->parent = parent;
 
   if (GTK_WIDGET_STATE (parent) != GTK_STATE_NORMAL)
@@ -4482,8 +4795,6 @@ gtk_widget_reset_rc_style (GtkWidget *widget)
   GtkStyle *new_style = NULL;
   gboolean initial_emission;
   
-  g_return_if_fail (GTK_IS_WIDGET (widget));
-
   initial_emission = !GTK_WIDGET_RC_STYLE (widget) && !GTK_WIDGET_USER_STYLE (widget);
 
   GTK_PRIVATE_UNSET_FLAG (widget, GTK_USER_STYLE);
@@ -4541,13 +4852,9 @@ void
 gtk_widget_modify_style (GtkWidget      *widget,
                         GtkRcStyle     *style)
 {
-  GtkRcStyle *old_style;
-
   g_return_if_fail (GTK_IS_WIDGET (widget));
   g_return_if_fail (GTK_IS_RC_STYLE (style));
   
-  old_style = g_object_get_qdata (G_OBJECT (widget), quark_rc_style);
-
   g_object_set_qdata_full (G_OBJECT (widget),
                           quark_rc_style,
                           gtk_rc_style_copy (style),
@@ -4672,7 +4979,14 @@ gtk_widget_modify_fg (GtkWidget      *widget,
  * 
  * Sets the background color for a widget in a particular state.  All
  * other style values are left untouched. See also
- * gtk_widget_modify_style().
+ * gtk_widget_modify_style(). 
+ *
+ * Note that "no window" widgets (which have the %GTK_NO_WINDOW flag set)
+ * draw on their parent container's window and thus may not draw any background
+ * themselves. This is the case for e.g. #GtkLabel. To modify the background
+ * of such widgets, you have to set the background color on their parent; if you want 
+ * to set the background of a rectangular area around a label, try placing the 
+ * label in a #GtkEventBox widget and setting the background color on that.
  **/
 void
 gtk_widget_modify_bg (GtkWidget      *widget,
@@ -4723,6 +5037,13 @@ gtk_widget_modify_text (GtkWidget      *widget,
  * is the background color used along with the text color
  * (see gtk_widget_modify_text()) for widgets such as #GtkEntry
  * and #GtkTextView. See also gtk_widget_modify_style().
+ *
+ * Note that "no window" widgets (which have the %GTK_NO_WINDOW flag set)
+ * draw on their parent container's window and thus may not draw any background
+ * themselves. This is the case for e.g. #GtkLabel. To modify the background
+ * of such widgets, you have to set the base color on their parent; if you want 
+ * to set the background of a rectangular area around a label, try placing the 
+ * label in a #GtkEventBox widget and setting the base color on that.
  **/
 void
 gtk_widget_modify_base (GtkWidget      *widget,
@@ -4789,13 +5110,6 @@ gtk_widget_set_style_internal (GtkWidget *widget,
   g_object_ref (widget);
   g_object_freeze_notify (G_OBJECT (widget));
 
-  if (widget->style != style || initial_emission)
-    {
-      PangoContext *context = gtk_widget_peek_pango_context (widget);
-      if (context)
-       pango_context_set_font_description (context, style->font_desc);
-    }
-  
   if (widget->style != style)
     {
       GtkStyle *previous_style;
@@ -4813,6 +5127,7 @@ gtk_widget_set_style_internal (GtkWidget *widget,
       if (GTK_WIDGET_REALIZED (widget))
        widget->style = gtk_style_attach (widget->style, widget->window);
 
+      gtk_widget_update_pango_context (widget);
       g_signal_emit (widget,
                     widget_signals[STYLE_SET],
                     0,
@@ -4823,10 +5138,13 @@ gtk_widget_set_style_internal (GtkWidget *widget,
        gtk_widget_queue_resize (widget);
     }
   else if (initial_emission)
-    g_signal_emit (widget,
-                  widget_signals[STYLE_SET],
-                  0,
-                  NULL);
+    {
+      gtk_widget_update_pango_context (widget);
+      g_signal_emit (widget,
+                    widget_signals[STYLE_SET],
+                    0,
+                    NULL);
+    }
   g_object_notify (G_OBJECT (widget), "style");
   g_object_thaw_notify (G_OBJECT (widget));
   g_object_unref (widget);
@@ -4942,6 +5260,51 @@ gtk_widget_propagate_screen_changed_recurse (GtkWidget *widget,
   g_object_unref (widget);
 }
 
+/**
+ * gtk_widget_is_composited:
+ * @widget: 
+ * 
+ * Whether @widget can rely on having its alpha channel
+ * drawn correctly. On X11 this function returns whether a
+ * compositing manager is running for @widget's screen
+ * 
+ * Return value: #TRUE if the widget can rely on its alpha
+ * channel being drawn correctly.
+ * 
+ * Since: 2.10
+ **/
+gboolean
+gtk_widget_is_composited (GtkWidget *widget)
+{
+  GdkScreen *screen;
+
+  g_return_val_if_fail (GTK_IS_WIDGET (widget), FALSE);
+  
+  screen = gtk_widget_get_screen (widget);
+  
+  return gdk_screen_is_composited (screen);
+}
+
+static void
+propagate_composited_changed (GtkWidget *widget,
+                             gpointer dummy)
+{
+  if (GTK_IS_CONTAINER (widget))
+    {
+      gtk_container_forall (GTK_CONTAINER (widget),
+                           propagate_composited_changed,
+                           NULL);
+    }
+  
+  g_signal_emit (widget, widget_signals[COMPOSITED_CHANGED], 0);
+}
+
+void
+_gtk_widget_propagate_composited_changed (GtkWidget *widget)
+{
+  propagate_composited_changed (widget, NULL);
+}
+
 /**
  * _gtk_widget_propagate_screen_changed:
  * @widget: a #GtkWidget
@@ -5018,7 +5381,7 @@ gtk_widget_peek_pango_context (GtkWidget *widget)
  * gtk_widget_get_pango_context:
  * @widget: a #GtkWidget
  * 
- * Gets a #PangoContext with the appropriate colormap, font description
+ * Gets a #PangoContext with the appropriate font map, font description,
  * and base direction for this widget. Unlike the context returned
  * by gtk_widget_create_pango_context(), this context is owned by
  * the widget (it can be used until the screen for the widget changes
@@ -5052,11 +5415,43 @@ gtk_widget_get_pango_context (GtkWidget *widget)
   return context;
 }
 
+static void
+update_pango_context (GtkWidget    *widget,
+                     PangoContext *context)
+{
+  pango_context_set_font_description (context, widget->style->font_desc);
+  pango_context_set_base_dir (context,
+                             gtk_widget_get_direction (widget) == GTK_TEXT_DIR_LTR ?
+                             PANGO_DIRECTION_LTR : PANGO_DIRECTION_RTL);
+}
+
+static void
+gtk_widget_update_pango_context (GtkWidget *widget)
+{
+  PangoContext *context = gtk_widget_peek_pango_context (widget);
+  
+  if (context)
+    {
+      GdkScreen *screen;
+
+      update_pango_context (widget, context);
+
+      screen = gtk_widget_get_screen_unchecked (widget);
+      if (screen)
+       {
+         pango_cairo_context_set_resolution (context,
+                                             gdk_screen_get_resolution (screen));
+         pango_cairo_context_set_font_options (context,
+                                               gdk_screen_get_font_options (screen));
+       }
+    }
+}
+
 /**
  * gtk_widget_create_pango_context:
  * @widget: a #GtkWidget
  * 
- * Creates a new #PangoContext with the appropriate colormap,
+ * Creates a new #PangoContext with the appropriate font map,
  * font description, and base direction for drawing text for
  * this widget. See also gtk_widget_get_pango_context().
  * 
@@ -5081,10 +5476,7 @@ gtk_widget_create_pango_context (GtkWidget *widget)
 
   context = gdk_pango_context_get_for_screen (screen);
 
-  pango_context_set_base_dir (context,
-                             gtk_widget_get_direction (widget) == GTK_TEXT_DIR_LTR ?
-                               PANGO_DIRECTION_LTR : PANGO_DIRECTION_RTL);
-  pango_context_set_font_description (context, widget->style->font_desc);
+  update_pango_context (widget, context);
   pango_context_set_language (context, gtk_get_default_language ());
 
   return context;
@@ -5095,11 +5487,11 @@ gtk_widget_create_pango_context (GtkWidget *widget)
  * @widget: a #GtkWidget
  * @text:   text to set on the layout (can be %NULL)
  * 
- * Creates a new #PangoLayout with the appropriate colormap,
+ * Creates a new #PangoLayout with the appropriate font map,
  * font description, and base direction for drawing text for
  * this widget.
  *
- * If you keep a #PangoLayout created in this way around, in order
+ * If you keep a #PangoLayout created in this way around, in order to
  * notify the layout of changes to the base direction or font of this
  * widget, you must call pango_layout_context_changed() in response to
  * the ::style-set and ::direction-changed signals for the widget.
@@ -5430,11 +5822,11 @@ gtk_widget_get_parent_window   (GtkWidget           *widget)
   GdkWindow *parent_window;
 
   g_return_val_if_fail (GTK_IS_WIDGET (widget), NULL);
-  g_return_val_if_fail (widget->parent != NULL, NULL);
   
   parent_window = g_object_get_qdata (G_OBJECT (widget), quark_parent_window);
 
-  return (parent_window != NULL) ? parent_window : widget->parent->window;
+  return (parent_window != NULL) ? parent_window : 
+        (widget->parent != NULL) ? widget->parent->window : NULL;
 }
 
 /**
@@ -5576,21 +5968,19 @@ gtk_widget_set_usize_internal (GtkWidget *widget,
   GtkWidgetAuxInfo *aux_info;
   gboolean changed = FALSE;
   
-  g_return_if_fail (GTK_IS_WIDGET (widget));
-  
   g_object_freeze_notify (G_OBJECT (widget));
 
   aux_info = _gtk_widget_get_aux_info (widget, TRUE);
   
   if (width > -2 && aux_info->width != width)
     {
-      g_object_notify (G_OBJECT (widget), "width_request");
+      g_object_notify (G_OBJECT (widget), "width-request");
       aux_info->width = width;
       changed = TRUE;
     }
   if (height > -2 && aux_info->height != height)
     {
-      g_object_notify (G_OBJECT (widget), "height_request");  
+      g_object_notify (G_OBJECT (widget), "height-request");  
       aux_info->height = height;
       changed = TRUE;
     }
@@ -5704,9 +6094,7 @@ gtk_widget_set_size_request (GtkWidget *widget,
  * gtk_widget_set_size_request(). To get the size a widget will
  * actually use, call gtk_widget_size_request() instead of
  * this function.
- * 
  **/
 void
 gtk_widget_get_size_request (GtkWidget *widget,
                              gint      *width,
@@ -5740,7 +6128,6 @@ gtk_widget_get_size_request (GtkWidget *widget,
  * mask. This function can't be used with #GTK_NO_WINDOW widgets;
  * to get events on those widgets, place them inside a #GtkEventBox
  * and receive events on the event box.
- * 
  **/
 void
 gtk_widget_set_events (GtkWidget *widget,
@@ -5756,20 +6143,46 @@ gtk_widget_set_events (GtkWidget *widget,
   if (events)
     {
       if (!eventp)
-       eventp = g_new (gint, 1);
+       eventp = g_slice_new (gint);
       
       *eventp = events;
       g_object_set_qdata (G_OBJECT (widget), quark_event_mask, eventp);
     }
   else if (eventp)
     {
-      g_free (eventp);
+      g_slice_free (gint, eventp);
       g_object_set_qdata (G_OBJECT (widget), quark_event_mask, NULL);
     }
 
   g_object_notify (G_OBJECT (widget), "events");
 }
 
+static void
+gtk_widget_add_events_internal (GtkWidget *widget,
+                               gint       events,
+                               GList     *window_list)
+{
+  GList *l;
+
+  for (l = window_list; l != NULL; l = l->next)
+    {
+      GdkWindow *window = l->data;
+      gpointer user_data;
+
+      gdk_window_get_user_data (window, &user_data);
+      if (user_data == widget)
+       {
+         GList *children;
+
+         gdk_window_set_events (window, gdk_window_get_events (window) | events);
+
+         children = gdk_window_get_children (window);
+         gtk_widget_add_events_internal (widget, events, children);
+         g_list_free (children);
+       }
+    }
+}
+
 /**
  * gtk_widget_add_events:
  * @widget: a #GtkWidget
@@ -5793,7 +6206,7 @@ gtk_widget_add_events (GtkWidget *widget,
     {
       if (!eventp)
        {
-         eventp = g_new (gint, 1);
+         eventp = g_slice_new (gint);
          *eventp = 0;
        }
       
@@ -5802,34 +6215,22 @@ gtk_widget_add_events (GtkWidget *widget,
     }
   else if (eventp)
     {
-      g_free (eventp);
+      g_slice_free (gint, eventp);
       g_object_set_qdata (G_OBJECT (widget), quark_event_mask, NULL);
     }
 
   if (GTK_WIDGET_REALIZED (widget))
     {
-      if (GTK_WIDGET_NO_WINDOW (widget))
-       {
-         GList *children = gdk_window_get_children (widget->window);
-         GList *tmp_list = children;
+      GList *window_list;
 
-         while (tmp_list)
-           {
-             GdkWindow *window = tmp_list->data;
-             gpointer user_data;
+      if (GTK_WIDGET_NO_WINDOW (widget))
+       window_list = gdk_window_get_children (widget->window);
+      else
+       window_list = g_list_prepend (NULL, widget->window);
 
-             gdk_window_get_user_data (window, &user_data);
-             if (user_data == widget)
-               gdk_window_set_events (window, gdk_window_get_events (window) | events);
-             tmp_list = tmp_list->next;
-           }
+      gtk_widget_add_events_internal (widget, events, window_list);
 
-         g_list_free (children);
-       }
-      else
-       {
-         gdk_window_set_events (widget->window, gdk_window_get_events (widget->window) | events);
-       }
+      g_list_free (window_list);
     }
 
   g_object_notify (G_OBJECT (widget), "events");
@@ -5855,11 +6256,11 @@ gtk_widget_set_extension_events (GtkWidget *widget,
   modep = g_object_get_qdata (G_OBJECT (widget), quark_extension_event_mode);
   
   if (!modep)
-    modep = g_new (GdkExtensionMode, 1);
+    modep = g_slice_new (GdkExtensionMode);
   
   *modep = mode;
   g_object_set_qdata (G_OBJECT (widget), quark_extension_event_mode, modep);
-  g_object_notify (G_OBJECT (widget), "extension_events");
+  g_object_notify (G_OBJECT (widget), "extension-events");
 }
 
 /**
@@ -6319,12 +6720,7 @@ static void
 gtk_widget_emit_direction_changed (GtkWidget        *widget,
                                   GtkTextDirection  old_dir)
 {
-  PangoContext *context = gtk_widget_peek_pango_context (widget);
-
-  if (context)
-    pango_context_set_base_dir (context,
-                               gtk_widget_get_direction (widget) == GTK_TEXT_DIR_LTR ?
-                                 PANGO_DIRECTION_LTR : PANGO_DIRECTION_RTL);
+  gtk_widget_update_pango_context (widget);
   
   g_signal_emit (widget, widget_signals[DIRECTION_CHANGED], 0, old_dir);
 }
@@ -6474,7 +6870,7 @@ gtk_widget_dispose (GObject *object)
   if (GTK_WIDGET_REALIZED (widget))
     gtk_widget_unrealize (widget);
   
-  G_OBJECT_CLASS (parent_class)->dispose (object);
+  G_OBJECT_CLASS (gtk_widget_parent_class)->dispose (object);
 }
 
 static void
@@ -6496,7 +6892,7 @@ gtk_widget_real_destroy (GtkObject *object)
   widget->style = gtk_widget_get_default_style ();
   g_object_ref (widget->style);
 
-  GTK_OBJECT_CLASS (parent_class)->destroy (object);
+  GTK_OBJECT_CLASS (gtk_widget_parent_class)->destroy (object);
 }
 
 static void
@@ -6522,17 +6918,17 @@ gtk_widget_finalize (GObject *object)
   
   events = g_object_get_qdata (G_OBJECT (widget), quark_event_mask);
   if (events)
-    g_free (events);
+    g_slice_free (gint, events);
   
   mode = g_object_get_qdata (G_OBJECT (widget), quark_extension_event_mode);
   if (mode)
-    g_free (mode);
+    g_slice_free (GdkExtensionMode, mode);
 
   accessible = g_object_get_qdata (G_OBJECT (widget), quark_accessible_object);
   if (accessible)
     g_object_unref (accessible);
 
-  G_OBJECT_CLASS (parent_class)->finalize (object);
+  G_OBJECT_CLASS (gtk_widget_parent_class)->finalize (object);
 }
 
 /*****************************************
@@ -6546,7 +6942,7 @@ gtk_widget_finalize (GObject *object)
 static void
 gtk_widget_real_map (GtkWidget *widget)
 {
-  g_return_if_fail (GTK_WIDGET_REALIZED (widget) == TRUE);
+  g_assert (GTK_WIDGET_REALIZED (widget));
   
   if (!GTK_WIDGET_MAPPED (widget))
     {
@@ -6588,7 +6984,7 @@ gtk_widget_real_unmap (GtkWidget *widget)
 static void
 gtk_widget_real_realize (GtkWidget *widget)
 {
-  g_return_if_fail (GTK_WIDGET_NO_WINDOW (widget));
+  g_assert (GTK_WIDGET_NO_WINDOW (widget));
   
   GTK_WIDGET_SET_FLAGS (widget, GTK_REALIZED);
   if (widget->parent)
@@ -6768,11 +7164,7 @@ _gtk_widget_get_aux_info (GtkWidget *widget,
   aux_info = g_object_get_qdata (G_OBJECT (widget), quark_aux_info);
   if (!aux_info && create)
     {
-      if (!aux_info_mem_chunk)
-       aux_info_mem_chunk = g_mem_chunk_new ("widget aux info mem chunk",
-                                             sizeof (GtkWidgetAuxInfo),
-                                             1024, G_ALLOC_AND_FREE);
-      aux_info = g_chunk_new (GtkWidgetAuxInfo, aux_info_mem_chunk);
+      aux_info = g_slice_new (GtkWidgetAuxInfo);
 
       aux_info->width = -1;
       aux_info->height = -1;
@@ -6797,14 +7189,14 @@ _gtk_widget_get_aux_info (GtkWidget *widget,
 static void
 gtk_widget_aux_info_destroy (GtkWidgetAuxInfo *aux_info)
 {
-  g_mem_chunk_free (aux_info_mem_chunk, aux_info);
+  g_slice_free (GtkWidgetAuxInfo, aux_info);
 }
 
 static void
 gtk_widget_shape_info_destroy (GtkWidgetShapeInfo *info)
 {
   g_object_unref (info->shape_mask);
-  g_free (info);
+  g_slice_free (GtkWidgetShapeInfo, info);
 }
 
 /**
@@ -6843,7 +7235,7 @@ gtk_widget_shape_combine_mask (GtkWidget *widget,
     {
       GTK_PRIVATE_SET_FLAG (widget, GTK_HAS_SHAPE_MASK);
       
-      shape_info = g_new (GtkWidgetShapeInfo, 1);
+      shape_info = g_slice_new (GtkWidgetShapeInfo);
       g_object_set_qdata_full (G_OBJECT (widget), quark_shape_info, shape_info,
                               (GDestroyNotify) gtk_widget_shape_info_destroy);
       
@@ -6851,8 +7243,8 @@ gtk_widget_shape_combine_mask (GtkWidget *widget,
       shape_info->offset_x = offset_x;
       shape_info->offset_y = offset_y;
       
-      /* set shape if widget has a gdk window allready.
-       * otherwise the shape is scheduled to be set by gtk_widget_realize.
+      /* set shape if widget has a gdk window already.
+       * otherwise the shape is scheduled to be set by gtk_widget_realize().
        */
       if (widget->window)
        gdk_window_shape_combine_mask (widget->window, shape_mask,
@@ -6860,6 +7252,59 @@ gtk_widget_shape_combine_mask (GtkWidget *widget,
     }
 }
 
+/**
+ * gtk_widget_input_shape_combine_mask: 
+ * @widget: a #GtkWidget.
+ * @shape_mask: shape to be added, or %NULL to remove an existing shape. 
+ * @offset_x: X position of shape mask with respect to @window.
+ * @offset_y: Y position of shape mask with respect to @window.
+ * 
+ * Sets an input shape for this widget's GDK window. This allows for
+ * windows which react to mouse click in a nonrectangular region, see 
+ * gdk_window_input_shape_combine_mask() for more information.
+ *
+ * Since: 2.10
+ **/
+void
+gtk_widget_input_shape_combine_mask (GtkWidget *widget,
+                                    GdkBitmap *shape_mask,
+                                    gint       offset_x,
+                                    gint       offset_y)
+{
+  GtkWidgetShapeInfo* shape_info;
+  
+  g_return_if_fail (GTK_IS_WIDGET (widget));
+  /*  set_shape doesn't work on widgets without gdk window */
+  g_return_if_fail (!GTK_WIDGET_NO_WINDOW (widget));
+
+  if (!shape_mask)
+    {
+      if (widget->window)
+       gdk_window_input_shape_combine_mask (widget->window, NULL, 0, 0);
+      
+      g_object_set_qdata (G_OBJECT (widget), quark_input_shape_info, NULL);
+    }
+  else
+    {
+      shape_info = g_slice_new (GtkWidgetShapeInfo);
+      g_object_set_qdata_full (G_OBJECT (widget), quark_input_shape_info, 
+                              shape_info,
+                              (GDestroyNotify) gtk_widget_shape_info_destroy);
+      
+      shape_info->shape_mask = g_object_ref (shape_mask);
+      shape_info->offset_x = offset_x;
+      shape_info->offset_y = offset_y;
+      
+      /* set shape if widget has a gdk window already.
+       * otherwise the shape is scheduled to be set by gtk_widget_realize().
+       */
+      if (widget->window)
+       gdk_window_input_shape_combine_mask (widget->window, shape_mask,
+                                            offset_x, offset_y);
+    }
+}
+
+
 static void
 gtk_reset_shapes_recurse (GtkWidget *widget,
                          GdkWindow *window)
@@ -6956,8 +7401,7 @@ gtk_widget_class_install_style_property_parser (GtkWidgetClass     *klass,
       return;
     }
 
-  g_param_spec_ref (pspec);
-  g_param_spec_sink (pspec);
+  g_param_spec_ref_sink (pspec);
   g_param_spec_set_qdata (pspec, quark_property_parser, (gpointer) parser);
   g_param_spec_pool_insert (style_property_spec_pool, pspec, G_OBJECT_CLASS_TYPE (klass));
 }
@@ -7340,7 +7784,7 @@ gtk_requisition_get_type (void)
   static GType our_type = 0;
   
   if (our_type == 0)
-    our_type = g_boxed_type_register_static ("GtkRequisition",
+    our_type = g_boxed_type_register_static (I_("GtkRequisition"),
                                             (GBoxedCopyFunc) gtk_requisition_copy,
                                             (GBoxedFreeFunc) gtk_requisition_free);
 
@@ -7500,7 +7944,7 @@ gtk_widget_list_mnemonic_labels (GtkWidget *widget)
  * this widget. (See gtk_widget_list_mnemonic_labels()). Note the
  * list of mnemonic labels for the widget is cleared when the
  * widget is destroyed, so the caller must make sure to update
- * it's internal state at this point as well, by using a connection
+ * its internal state at this point as well, by using a connection
  * to the ::destroy signal or a weak notifier.
  *
  * Since: 2.4
@@ -7600,5 +8044,8 @@ gtk_widget_set_no_show_all (GtkWidget *widget,
   else
     GTK_WIDGET_UNSET_FLAGS (widget, GTK_NO_SHOW_ALL);
   
-  g_object_notify (G_OBJECT (widget), "no_show_all");
+  g_object_notify (G_OBJECT (widget), "no-show-all");
 }
+
+#define __GTK_WIDGET_C__
+#include "gtkaliasdef.c"