]> Pileus Git - ~andy/gtk/blobdiff - gtk/gtkiconview.c
Deprecate flag macros for toplevel, state, no window and composite child
[~andy/gtk] / gtk / gtkiconview.c
index 6657c718531894f8a8674507f961aad391c0a438..9a47509f937514f1c91054b1a709f69fd3235e45 100644 (file)
@@ -17,7 +17,7 @@
  * Boston, MA 02111-1307, USA.
  */
 
-#include <config.h>
+#include "config.h"
 #include <string.h>
 
 #include <atk/atk.h>
@@ -33,7 +33,6 @@
 #include "gtkbindings.h"
 #include "gtkdnd.h"
 #include "gtkmain.h"
-#include "gtksignal.h"
 #include "gtkintl.h"
 #include "gtkaccessible.h"
 #include "gtkwindow.h"
@@ -150,6 +149,7 @@ struct _GtkIconViewPrivate
   gint row_spacing;
   gint column_spacing;
   gint margin;
+  gint item_padding;
 
   gint text_column;
   gint markup_column;
@@ -158,16 +158,15 @@ struct _GtkIconViewPrivate
   gint pixbuf_cell;
   gint text_cell;
 
+  gint tooltip_column;
+
   /* Drag-and-drop. */
   GdkModifierType start_button_mask;
   gint pressed_button;
   gint press_start_x;
   gint press_start_y;
 
-  GtkTargetList *source_targets;
   GdkDragAction source_actions;
-
-  GtkTargetList *dest_targets;
   GdkDragAction dest_actions;
 
   GtkTreeRowReference *dest_item;
@@ -185,7 +184,9 @@ struct _GtkIconViewPrivate
   guint empty_view_drop :1;
 
   guint ctrl_pressed : 1;
-  guint shift_pressed : 1;  
+  guint shift_pressed : 1;
+
+  guint draw_focus : 1;
 };
 
 /* Signals */
@@ -218,11 +219,12 @@ enum
   PROP_ROW_SPACING,
   PROP_COLUMN_SPACING,
   PROP_MARGIN,
-  PROP_REORDERABLE
+  PROP_REORDERABLE,
+  PROP_TOOLTIP_COLUMN,
+  PROP_ITEM_PADDING
 };
 
 /* GObject vfuncs */
-static void             gtk_icon_view_class_init                (GtkIconViewClass   *klass);
 static void             gtk_icon_view_cell_layout_init          (GtkCellLayoutIface *iface);
 static void             gtk_icon_view_finalize                  (GObject            *object);
 static void             gtk_icon_view_set_property              (GObject            *object,
@@ -240,6 +242,10 @@ static void             gtk_icon_view_destroy                   (GtkObject
 /* GtkWidget vfuncs */
 static void             gtk_icon_view_realize                   (GtkWidget          *widget);
 static void             gtk_icon_view_unrealize                 (GtkWidget          *widget);
+static void             gtk_icon_view_style_set                 (GtkWidget        *widget,
+                                                                GtkStyle         *previous_style);
+static void             gtk_icon_view_state_changed             (GtkWidget        *widget,
+                                                                GtkStateType      previous_state);
 static void             gtk_icon_view_size_request              (GtkWidget          *widget,
                                                                 GtkRequisition     *requisition);
 static void             gtk_icon_view_size_allocate             (GtkWidget          *widget,
@@ -252,6 +258,10 @@ static gboolean         gtk_icon_view_button_press              (GtkWidget
                                                                 GdkEventButton     *event);
 static gboolean         gtk_icon_view_button_release            (GtkWidget          *widget,
                                                                 GdkEventButton     *event);
+static gboolean         gtk_icon_view_key_press                 (GtkWidget          *widget,
+                                                                GdkEventKey        *event);
+static gboolean         gtk_icon_view_key_release               (GtkWidget          *widget,
+                                                                GdkEventKey        *event);
 static AtkObject       *gtk_icon_view_get_accessible            (GtkWidget          *widget);
 
 
@@ -380,10 +390,14 @@ static void                 gtk_icon_view_cell_layout_set_cell_data_func (GtkCel
 static void                 gtk_icon_view_cell_layout_reorder            (GtkCellLayout          *layout,
                                                                          GtkCellRenderer        *cell,
                                                                          gint                    position);
+static GList *              gtk_icon_view_cell_layout_get_cells          (GtkCellLayout          *layout);
+
 static void                 gtk_icon_view_item_activate_cell             (GtkIconView            *icon_view,
                                                                          GtkIconViewItem        *item,
                                                                          GtkIconViewCellInfo    *cell_info,
                                                                          GdkEvent               *event);
+static void                 gtk_icon_view_item_selected_changed          (GtkIconView            *icon_view,
+                                                                         GtkIconViewItem        *item);
 static void                 gtk_icon_view_put                            (GtkIconView            *icon_view,
                                                                          GtkWidget              *widget,
                                                                          GtkIconViewItem        *item,
@@ -436,12 +450,31 @@ static gboolean gtk_icon_view_maybe_begin_drag   (GtkIconView             *icon_
 
 static void     remove_scroll_timeout            (GtkIconView *icon_view);
 
+static void     adjust_wrap_width                (GtkIconView     *icon_view,
+                                                 GtkIconViewItem *item);
+
+/* GtkBuildable */
+static GtkBuildableIface *parent_buildable_iface;
+static void     gtk_icon_view_buildable_init             (GtkBuildableIface *iface);
+static gboolean gtk_icon_view_buildable_custom_tag_start (GtkBuildable  *buildable,
+                                                         GtkBuilder    *builder,
+                                                         GObject       *child,
+                                                         const gchar   *tagname,
+                                                         GMarkupParser *parser,
+                                                         gpointer      *data);
+static void     gtk_icon_view_buildable_custom_tag_end   (GtkBuildable  *buildable,
+                                                         GtkBuilder    *builder,
+                                                         GObject       *child,
+                                                         const gchar   *tagname,
+                                                         gpointer      *data);
 
 static guint icon_view_signals[LAST_SIGNAL] = { 0 };
 
 G_DEFINE_TYPE_WITH_CODE (GtkIconView, gtk_icon_view, GTK_TYPE_CONTAINER,
                         G_IMPLEMENT_INTERFACE (GTK_TYPE_CELL_LAYOUT,
-                                               gtk_icon_view_cell_layout_init));
+                                               gtk_icon_view_cell_layout_init)
+                        G_IMPLEMENT_INTERFACE (GTK_TYPE_BUILDABLE,
+                                               gtk_icon_view_buildable_init))
 
 static void
 gtk_icon_view_class_init (GtkIconViewClass *klass)
@@ -469,12 +502,16 @@ gtk_icon_view_class_init (GtkIconViewClass *klass)
   
   widget_class->realize = gtk_icon_view_realize;
   widget_class->unrealize = gtk_icon_view_unrealize;
+  widget_class->style_set = gtk_icon_view_style_set;
+  widget_class->get_accessible = gtk_icon_view_get_accessible;
   widget_class->size_request = gtk_icon_view_size_request;
   widget_class->size_allocate = gtk_icon_view_size_allocate;
   widget_class->expose_event = gtk_icon_view_expose;
   widget_class->motion_notify_event = gtk_icon_view_motion;
   widget_class->button_press_event = gtk_icon_view_button_press;
   widget_class->button_release_event = gtk_icon_view_button_release;
+  widget_class->key_press_event = gtk_icon_view_key_press;
+  widget_class->key_release_event = gtk_icon_view_key_release;
   widget_class->drag_begin = gtk_icon_view_drag_begin;
   widget_class->drag_end = gtk_icon_view_drag_end;
   widget_class->drag_data_get = gtk_icon_view_drag_data_get;
@@ -483,7 +520,7 @@ gtk_icon_view_class_init (GtkIconViewClass *klass)
   widget_class->drag_motion = gtk_icon_view_drag_motion;
   widget_class->drag_drop = gtk_icon_view_drag_drop;
   widget_class->drag_data_received = gtk_icon_view_drag_data_received;
-  widget_class->get_accessible = gtk_icon_view_get_accessible;
+  widget_class->state_changed = gtk_icon_view_state_changed;
 
   container_class->remove = gtk_icon_view_remove;
   container_class->forall = gtk_icon_view_forall;
@@ -598,7 +635,7 @@ gtk_icon_view_class_init (GtkIconViewClass *klass)
   
 
   /**
-   * GtkIconView::item-width:
+   * GtkIconView:item-width:
    *
    * The item-width property specifies the width to use for each item. 
    * If it is set to -1, the icon view will automatically determine a 
@@ -615,7 +652,7 @@ gtk_icon_view_class_init (GtkIconViewClass *klass)
                                                     GTK_PARAM_READWRITE));  
 
   /**
-   * GtkIconView::spacing:
+   * GtkIconView:spacing:
    *
    * The spacing property specifies the space which is inserted between
    * the cells (i.e. the icon and the text) of an item.
@@ -631,7 +668,7 @@ gtk_icon_view_class_init (GtkIconViewClass *klass)
                                                     GTK_PARAM_READWRITE));
 
   /**
-   * GtkIconView::row-spacing:
+   * GtkIconView:row-spacing:
    *
    * The row-spacing property specifies the space which is inserted between
    * the rows of the icon view.
@@ -647,7 +684,7 @@ gtk_icon_view_class_init (GtkIconViewClass *klass)
                                                     GTK_PARAM_READWRITE));
 
   /**
-   * GtkIconView::column-spacing:
+   * GtkIconView:column-spacing:
    *
    * The column-spacing property specifies the space which is inserted between
    * the columns of the icon view.
@@ -663,7 +700,7 @@ gtk_icon_view_class_init (GtkIconViewClass *klass)
                                                     GTK_PARAM_READWRITE));
 
   /**
-   * GtkIconView::margin:
+   * GtkIconView:margin:
    *
    * The margin property specifies the space which is inserted 
    * at the edges of the icon view.
@@ -678,9 +715,8 @@ gtk_icon_view_class_init (GtkIconViewClass *klass)
                                                     0, G_MAXINT, 6,
                                                     GTK_PARAM_READWRITE));
 
-
   /**
-   * GtkIconView::orientation:
+   * GtkIconView:orientation:
    *
    * The orientation property specifies how the cells (i.e. the icon and 
    * the text) of the item are positioned relative to each other.
@@ -712,6 +748,34 @@ gtk_icon_view_class_init (GtkIconViewClass *klass)
                                                         FALSE,
                                                         G_PARAM_READWRITE));
 
+    g_object_class_install_property (gobject_class,
+                                     PROP_TOOLTIP_COLUMN,
+                                     g_param_spec_int ("tooltip-column",
+                                                       P_("Tooltip Column"),
+                                                       P_("The column in the model containing the tooltip texts for the items"),
+                                                       -1,
+                                                       G_MAXINT,
+                                                       -1,
+                                                       GTK_PARAM_READWRITE));
+
+  /**
+   * GtkIconView:item-padding:
+   *
+   * The item-padding property specifies the padding around each
+   * of the icon view's item.
+   *
+   * Since: 2.18
+   */
+  g_object_class_install_property (gobject_class,
+                                   PROP_ITEM_PADDING,
+                                   g_param_spec_int ("item-padding",
+                                                    P_("Item Padding"),
+                                                    P_("Padding around icon view items"),
+                                                    0, G_MAXINT, 6,
+                                                    GTK_PARAM_READWRITE));
+
+
+
   /* Style properties */
   gtk_widget_class_install_style_property (widget_class,
                                            g_param_spec_boxed ("selection-box-color",
@@ -729,8 +793,17 @@ gtk_icon_view_class_init (GtkIconViewClass *klass)
                                                                GTK_PARAM_READABLE));
 
   /* Signals */
+  /**
+   * GtkIconView::set-scroll-adjustments
+   * @horizontal: the horizontal #GtkAdjustment
+   * @vertical: the vertical #GtkAdjustment
+   *
+   * Set the scroll adjustments for the icon view. Usually scrolled containers
+   * like #GtkScrolledWindow will emit this signal to connect two instances
+   * of #GtkScrollbar to the scroll directions of the #GtkIconView.
+   */
   widget_class->set_scroll_adjustments_signal =
-    g_signal_new (I_("set_scroll_adjustments"),
+    g_signal_new (I_("set-scroll-adjustments"),
                  G_TYPE_FROM_CLASS (gobject_class),
                  G_SIGNAL_RUN_LAST,
                  G_STRUCT_OFFSET (GtkIconViewClass, set_scroll_adjustments),
@@ -739,8 +812,19 @@ gtk_icon_view_class_init (GtkIconViewClass *klass)
                  G_TYPE_NONE, 2,
                  GTK_TYPE_ADJUSTMENT, GTK_TYPE_ADJUSTMENT);
 
+  /**
+   * GtkIconView::item-activated:
+   * @iconview: the object on which the signal is emitted
+   * @path: the #GtkTreePath for the activated item
+   *
+   * The ::item-activated signal is emitted when the method
+   * gtk_icon_view_item_activated() is called or the user double 
+   * clicks an item. It is also emitted when a non-editable item
+   * is selected and one of the keys: Space, Return or Enter is
+   * pressed.
+   */
   icon_view_signals[ITEM_ACTIVATED] =
-    g_signal_new (I_("item_activated"),
+    g_signal_new (I_("item-activated"),
                  G_TYPE_FROM_CLASS (gobject_class),
                  G_SIGNAL_RUN_LAST,
                  G_STRUCT_OFFSET (GtkIconViewClass, item_activated),
@@ -749,8 +833,15 @@ gtk_icon_view_class_init (GtkIconViewClass *klass)
                  G_TYPE_NONE, 1,
                  GTK_TYPE_TREE_PATH);
 
+  /**
+   * GtkIconView::selection-changed:
+   * @iconview: the object on which the signal is emitted
+   *
+   * The ::selection-changed signal is emitted when the selection
+   * (i.e. the set of selected items) changes.
+   */
   icon_view_signals[SELECTION_CHANGED] =
-    g_signal_new (I_("selection_changed"),
+    g_signal_new (I_("selection-changed"),
                  G_TYPE_FROM_CLASS (gobject_class),
                  G_SIGNAL_RUN_FIRST,
                  G_STRUCT_OFFSET (GtkIconViewClass, selection_changed),
@@ -758,8 +849,21 @@ gtk_icon_view_class_init (GtkIconViewClass *klass)
                  g_cclosure_marshal_VOID__VOID,
                  G_TYPE_NONE, 0);
   
+  /**
+   * GtkIconView::select-all:
+   * @iconview: the object on which the signal is emitted
+   *
+   * A <link linkend="keybinding-signals">keybinding signal</link>
+   * which gets emitted when the user selects all items.
+   *
+   * Applications should not connect to it, but may emit it with
+   * g_signal_emit_by_name() if they need to control selection
+   * programmatically.
+   * 
+   * The default binding for this signal is Ctrl-a.
+   */
   icon_view_signals[SELECT_ALL] =
-    g_signal_new (I_("select_all"),
+    g_signal_new (I_("select-all"),
                  G_TYPE_FROM_CLASS (gobject_class),
                  G_SIGNAL_RUN_LAST | G_SIGNAL_ACTION,
                  G_STRUCT_OFFSET (GtkIconViewClass, select_all),
@@ -767,8 +871,21 @@ gtk_icon_view_class_init (GtkIconViewClass *klass)
                  g_cclosure_marshal_VOID__VOID,
                  G_TYPE_NONE, 0);
   
+  /**
+   * GtkIconView::unselect-all:
+   * @iconview: the object on which the signal is emitted
+   *
+   * A <link linkend="keybinding-signals">keybinding signal</link>
+   * which gets emitted when the user unselects all items.
+   *
+   * Applications should not connect to it, but may emit it with
+   * g_signal_emit_by_name() if they need to control selection
+   * programmatically.
+   * 
+   * The default binding for this signal is Ctrl-Shift-a. 
+   */
   icon_view_signals[UNSELECT_ALL] =
-    g_signal_new (I_("unselect_all"),
+    g_signal_new (I_("unselect-all"),
                  G_TYPE_FROM_CLASS (gobject_class),
                  G_SIGNAL_RUN_LAST | G_SIGNAL_ACTION,
                  G_STRUCT_OFFSET (GtkIconViewClass, unselect_all),
@@ -776,8 +893,22 @@ gtk_icon_view_class_init (GtkIconViewClass *klass)
                  g_cclosure_marshal_VOID__VOID,
                  G_TYPE_NONE, 0);
 
+  /**
+   * GtkIconView::select-cursor-item:
+   * @iconview: the object on which the signal is emitted
+   *
+   * A <link linkend="keybinding-signals">keybinding signal</link>
+   * which gets emitted when the user selects the item that is currently
+   * focused.
+   *
+   * Applications should not connect to it, but may emit it with
+   * g_signal_emit_by_name() if they need to control selection
+   * programmatically.
+   * 
+   * There is no default binding for this signal.
+   */
   icon_view_signals[SELECT_CURSOR_ITEM] =
-    g_signal_new (I_("select_cursor_item"),
+    g_signal_new (I_("select-cursor-item"),
                  G_TYPE_FROM_CLASS (gobject_class),
                  G_SIGNAL_RUN_LAST | G_SIGNAL_ACTION,
                  G_STRUCT_OFFSET (GtkIconViewClass, select_cursor_item),
@@ -785,8 +916,23 @@ gtk_icon_view_class_init (GtkIconViewClass *klass)
                  g_cclosure_marshal_VOID__VOID,
                  G_TYPE_NONE, 0);
 
+  /**
+   * GtkIconView::toggle-cursor-item:
+   * @iconview: the object on which the signal is emitted
+   *
+   * A <link linkend="keybinding-signals">keybinding signal</link>
+   * which gets emitted when the user toggles whether the currently
+   * focused item is selected or not. The exact effect of this 
+   * depend on the selection mode.
+   *
+   * Applications should not connect to it, but may emit it with
+   * g_signal_emit_by_name() if they need to control selection
+   * programmatically.
+   * 
+   * There is no default binding for this signal is Ctrl-Space.
+   */
   icon_view_signals[TOGGLE_CURSOR_ITEM] =
-    g_signal_new (I_("toggle_cursor_item"),
+    g_signal_new (I_("toggle-cursor-item"),
                  G_TYPE_FROM_CLASS (gobject_class),
                  G_SIGNAL_RUN_LAST | G_SIGNAL_ACTION,
                  G_STRUCT_OFFSET (GtkIconViewClass, toggle_cursor_item),
@@ -794,8 +940,22 @@ gtk_icon_view_class_init (GtkIconViewClass *klass)
                  g_cclosure_marshal_VOID__VOID,
                  G_TYPE_NONE, 0);
 
+  /**
+   * GtkIconView::activate-cursor-item:
+   * @iconview: the object on which the signal is emitted
+   *
+   * A <link linkend="keybinding-signals">keybinding signal</link>
+   * which gets emitted when the user activates the currently 
+   * focused item. 
+   *
+   * Applications should not connect to it, but may emit it with
+   * g_signal_emit_by_name() if they need to control activation
+   * programmatically.
+   * 
+   * The default bindings for this signal are Space, Return and Enter.
+   */
   icon_view_signals[ACTIVATE_CURSOR_ITEM] =
-    g_signal_new (I_("activate_cursor_item"),
+    g_signal_new (I_("activate-cursor-item"),
                  G_TYPE_FROM_CLASS (gobject_class),
                  G_SIGNAL_RUN_LAST | G_SIGNAL_ACTION,
                  G_STRUCT_OFFSET (GtkIconViewClass, activate_cursor_item),
@@ -803,8 +963,32 @@ gtk_icon_view_class_init (GtkIconViewClass *klass)
                  _gtk_marshal_BOOLEAN__VOID,
                  G_TYPE_BOOLEAN, 0);
   
+  /**
+   * GtkIconView::move-cursor:
+   * @iconview: the object which received the signal
+   * @step: the granularity of the move, as a #GtkMovementStep
+   * @count: the number of @step units to move
+   *
+   * The ::move-cursor signal is a
+   * <link linkend="keybinding-signals">keybinding signal</link>
+   * which gets emitted when the user initiates a cursor movement.
+   *
+   * Applications should not connect to it, but may emit it with
+   * g_signal_emit_by_name() if they need to control the cursor
+   * programmatically.
+   *
+   * The default bindings for this signal include
+   * <itemizedlist>
+   * <listitem>Arrow keys which move by individual steps</listitem>
+   * <listitem>Home/End keys which move to the first/last item</listitem>
+   * <listitem>PageUp/PageDown which move by "pages"</listitem>
+   * </itemizedlist>
+   *
+   * All of these will extend the selection when combined with
+   * the Shift modifier.
+   */
   icon_view_signals[MOVE_CURSOR] =
-    g_signal_new (I_("move_cursor"),
+    g_signal_new (I_("move-cursor"),
                  G_TYPE_FROM_CLASS (gobject_class),
                  G_SIGNAL_RUN_LAST | G_SIGNAL_ACTION,
                  G_STRUCT_OFFSET (GtkIconViewClass, move_cursor),
@@ -816,20 +1000,24 @@ gtk_icon_view_class_init (GtkIconViewClass *klass)
 
   /* Key bindings */
   gtk_binding_entry_add_signal (binding_set, GDK_a, GDK_CONTROL_MASK, 
-                               "select_all", 0);
+                               "select-all", 0);
   gtk_binding_entry_add_signal (binding_set, GDK_a, GDK_CONTROL_MASK | GDK_SHIFT_MASK, 
-                               "unselect_all", 0);
+                               "unselect-all", 0);
   gtk_binding_entry_add_signal (binding_set, GDK_space, GDK_CONTROL_MASK, 
-                               "toggle_cursor_item", 0);
+                               "toggle-cursor-item", 0);
+  gtk_binding_entry_add_signal (binding_set, GDK_KP_Space, GDK_CONTROL_MASK,
+                               "toggle-cursor-item", 0);
 
   gtk_binding_entry_add_signal (binding_set, GDK_space, 0, 
-                               "activate_cursor_item", 0);
+                               "activate-cursor-item", 0);
+  gtk_binding_entry_add_signal (binding_set, GDK_KP_Space, 0,
+                               "activate-cursor-item", 0);
   gtk_binding_entry_add_signal (binding_set, GDK_Return, 0, 
-                               "activate_cursor_item", 0);
+                               "activate-cursor-item", 0);
   gtk_binding_entry_add_signal (binding_set, GDK_ISO_Enter, 0, 
-                               "activate_cursor_item", 0);
+                               "activate-cursor-item", 0);
   gtk_binding_entry_add_signal (binding_set, GDK_KP_Enter, 0, 
-                               "activate_cursor_item", 0);
+                               "activate-cursor-item", 0);
 
   gtk_icon_view_add_move_binding (binding_set, GDK_Up, 0,
                                  GTK_MOVEMENT_DISPLAY_LINES, -1);
@@ -878,6 +1066,15 @@ gtk_icon_view_class_init (GtkIconViewClass *klass)
                                  GTK_MOVEMENT_VISUAL_POSITIONS, -1);
 }
 
+static void
+gtk_icon_view_buildable_init (GtkBuildableIface *iface)
+{
+  parent_buildable_iface = g_type_interface_peek_parent (iface);
+  iface->add_child = _gtk_cell_layout_buildable_add_child;
+  iface->custom_tag_start = gtk_icon_view_buildable_custom_tag_start;
+  iface->custom_tag_end = gtk_icon_view_buildable_custom_tag_end;
+}
+
 static void
 gtk_icon_view_cell_layout_init (GtkCellLayoutIface *iface)
 {
@@ -888,6 +1085,7 @@ gtk_icon_view_cell_layout_init (GtkCellLayoutIface *iface)
   iface->set_cell_data_func = gtk_icon_view_cell_layout_set_cell_data_func;
   iface->clear_attributes = gtk_icon_view_cell_layout_clear_attributes;
   iface->reorder = gtk_icon_view_cell_layout_reorder;
+  iface->get_cells = gtk_icon_view_cell_layout_get_cells;
 }
 
 static void
@@ -906,6 +1104,7 @@ gtk_icon_view_init (GtkIconView *icon_view)
   icon_view->priv->pixbuf_column = -1;
   icon_view->priv->text_cell = -1;
   icon_view->priv->pixbuf_cell = -1;  
+  icon_view->priv->tooltip_column = -1;  
 
   GTK_WIDGET_SET_FLAGS (icon_view, GTK_CAN_FOCUS);
   
@@ -923,6 +1122,9 @@ gtk_icon_view_init (GtkIconView *icon_view)
   icon_view->priv->row_spacing = 6;
   icon_view->priv->column_spacing = 6;
   icon_view->priv->margin = 6;
+  icon_view->priv->item_padding = 6;
+
+  icon_view->priv->draw_focus = TRUE;
 }
 
 static void
@@ -949,8 +1151,20 @@ gtk_icon_view_destroy (GtkObject *object)
     }
 
   remove_scroll_timeout (icon_view);
+
+  if (icon_view->priv->hadjustment != NULL)
+    {
+      g_object_unref (icon_view->priv->hadjustment);
+      icon_view->priv->hadjustment = NULL;
+    }
+
+  if (icon_view->priv->vadjustment != NULL)
+    {
+      g_object_unref (icon_view->priv->vadjustment);
+      icon_view->priv->vadjustment = NULL;
+    }
   
-  (* GTK_OBJECT_CLASS (gtk_icon_view_parent_class)->destroy) (object);
+  GTK_OBJECT_CLASS (gtk_icon_view_parent_class)->destroy (object);
 }
 
 /* GObject methods */
@@ -959,7 +1173,7 @@ gtk_icon_view_finalize (GObject *object)
 {
   gtk_icon_view_cell_layout_clear (GTK_CELL_LAYOUT (object));
 
-  (* G_OBJECT_CLASS (gtk_icon_view_parent_class)->finalize) (object);
+  G_OBJECT_CLASS (gtk_icon_view_parent_class)->finalize (object);
 }
 
 
@@ -1015,6 +1229,14 @@ gtk_icon_view_set_property (GObject      *object,
       gtk_icon_view_set_reorderable (icon_view, g_value_get_boolean (value));
       break;
       
+    case PROP_TOOLTIP_COLUMN:
+      gtk_icon_view_set_tooltip_column (icon_view, g_value_get_int (value));
+      break;
+
+    case PROP_ITEM_PADDING:
+      gtk_icon_view_set_item_padding (icon_view, g_value_get_int (value));
+      break;
+
     default:
       G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
       break;
@@ -1072,6 +1294,13 @@ gtk_icon_view_get_property (GObject      *object,
     case PROP_REORDERABLE:
       g_value_set_boolean (value, icon_view->priv->reorderable);
       break;
+    case PROP_TOOLTIP_COLUMN:
+      g_value_set_int (value, icon_view->priv->tooltip_column);
+      break;
+
+    case PROP_ITEM_PADDING:
+      g_value_set_int (value, icon_view->priv->item_padding);
+      break;
 
     default:
       G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
@@ -1106,6 +1335,7 @@ gtk_icon_view_realize (GtkWidget *widget)
 
   widget->window = gdk_window_new (gtk_widget_get_parent_window (widget),
                                   &attributes, attributes_mask);
+  gdk_window_set_back_pixmap (widget->window, NULL, FALSE);
   gdk_window_set_user_data (widget->window, widget);
 
   /* Make the window for the icon view */
@@ -1128,7 +1358,6 @@ gtk_icon_view_realize (GtkWidget *widget)
 
   widget->style = gtk_style_attach (widget->style, widget->window);
   gdk_window_set_background (icon_view->priv->bin_window, &widget->style->base[widget->state]);
-  gdk_window_set_background (widget->window, &widget->style->base[widget->state]);
 
   gdk_window_show (icon_view->priv->bin_window);
 }
@@ -1144,20 +1373,46 @@ gtk_icon_view_unrealize (GtkWidget *widget)
   gdk_window_destroy (icon_view->priv->bin_window);
   icon_view->priv->bin_window = NULL;
 
-  /* GtkWidget::unrealize destroys children and widget->window */
-  if (GTK_WIDGET_CLASS (gtk_icon_view_parent_class)->unrealize)
-    (* GTK_WIDGET_CLASS (gtk_icon_view_parent_class)->unrealize) (widget);
+  GTK_WIDGET_CLASS (gtk_icon_view_parent_class)->unrealize (widget);
+}
+
+static void
+gtk_icon_view_state_changed (GtkWidget      *widget,
+                            GtkStateType    previous_state)
+{
+  GtkIconView *icon_view = GTK_ICON_VIEW (widget);
+
+  if (GTK_WIDGET_REALIZED (widget))
+    {
+      gdk_window_set_background (widget->window, &widget->style->base[widget->state]);
+      gdk_window_set_background (icon_view->priv->bin_window, &widget->style->base[widget->state]);
+    }
+
+  gtk_widget_queue_draw (widget);
+}
+
+static void
+gtk_icon_view_style_set (GtkWidget *widget,
+                        GtkStyle *previous_style)
+{
+  GtkIconView *icon_view = GTK_ICON_VIEW (widget);
+
+  if (GTK_WIDGET_REALIZED (widget))
+    {
+      gdk_window_set_background (widget->window, &widget->style->base[widget->state]);
+      gdk_window_set_background (icon_view->priv->bin_window, &widget->style->base[widget->state]);
+    }
+
+  gtk_widget_queue_resize (widget);
 }
 
 static void
 gtk_icon_view_size_request (GtkWidget      *widget,
                            GtkRequisition *requisition)
 {
-  GtkIconView *icon_view;
+  GtkIconView *icon_view = GTK_ICON_VIEW (widget);
   GList *tmp_list;
 
-  icon_view = GTK_ICON_VIEW (widget);
-
   requisition->width = icon_view->priv->width;
   requisition->height = icon_view->priv->height;
 
@@ -1188,10 +1443,10 @@ gtk_icon_view_allocate_children (GtkIconView *icon_view)
       /* totally ignore our child's requisition */
       if (child->cell < 0)
        {
-         allocation.x = child->item->x;
-         allocation.y = child->item->y;
-         allocation.width = child->item->width;
-         allocation.height = child->item->height;
+         allocation.x = child->item->x + icon_view->priv->item_padding;
+         allocation.y = child->item->y + icon_view->priv->item_padding;
+         allocation.width = child->item->width - icon_view->priv->item_padding * 2;
+         allocation.height = child->item->height - icon_view->priv->item_padding * 2;
        }
       else
        {
@@ -1290,6 +1545,11 @@ gtk_icon_view_expose (GtkWidget *widget,
   if (expose->window != icon_view->priv->bin_window)
     return FALSE;
 
+  /* If a layout has been scheduled, do it now so that all
+   * cell view items have valid sizes before we proceed. */
+  if (icon_view->priv->layout_idle_id != 0)
+    gtk_icon_view_layout (icon_view);
+
   cr = gdk_cairo_create (icon_view->priv->bin_window);
   cairo_set_line_width (cr, 1.);
 
@@ -1318,7 +1578,8 @@ gtk_icon_view_expose (GtkWidget *widget,
       
       gtk_icon_view_paint_item (icon_view, cr, item, &expose->area, 
                                icon_view->priv->bin_window,
-                               item->x, item->y, TRUE); 
+                               item->x, item->y,
+                               icon_view->priv->draw_focus); 
  
       if (dest_index == item->index)
        dest_item = item;
@@ -1399,7 +1660,7 @@ gtk_icon_view_expose (GtkWidget *widget,
 
   cairo_destroy (cr);
 
-  (* GTK_WIDGET_CLASS (gtk_icon_view_parent_class)->expose_event) (widget, expose);
+  GTK_WIDGET_CLASS (gtk_icon_view_parent_class)->expose_event (widget, expose);
 
   return TRUE;
 }
@@ -1410,8 +1671,6 @@ rubberband_scroll_timeout (gpointer data)
   GtkIconView *icon_view;
   gdouble value;
 
-  GDK_THREADS_ENTER ();
-  
   icon_view = data;
 
   value = MIN (icon_view->priv->vadjustment->value +
@@ -1423,8 +1682,6 @@ rubberband_scroll_timeout (gpointer data)
 
   gtk_icon_view_update_rubberband (icon_view);
   
-  GDK_THREADS_LEAVE ();
-
   return TRUE;
 }
 
@@ -1459,7 +1716,7 @@ gtk_icon_view_motion (GtkWidget      *widget,
          icon_view->priv->event_last_y = event->y;
 
          if (icon_view->priv->scroll_timeout_id == 0)
-           icon_view->priv->scroll_timeout_id = g_timeout_add (30, rubberband_scroll_timeout, 
+           icon_view->priv->scroll_timeout_id = gdk_threads_add_timeout (30, rubberband_scroll_timeout, 
                                                                icon_view);
        }
       else 
@@ -1557,6 +1814,25 @@ gtk_icon_view_item_activate_cell (GtkIconView         *icon_view,
     }
 }
 
+static void 
+gtk_icon_view_item_selected_changed (GtkIconView      *icon_view,
+                                     GtkIconViewItem  *item)
+{
+  AtkObject *obj;
+  AtkObject *item_obj;
+
+  obj = gtk_widget_get_accessible (GTK_WIDGET (icon_view));
+  if (obj != NULL)
+    {
+      item_obj = atk_object_ref_accessible_child (obj, item->index);
+      if (item_obj != NULL)
+        {
+          atk_object_notify_state_change (item_obj, ATK_STATE_SELECTED, item->selected);
+          g_object_unref (item_obj);
+        }
+    }
+}
+
 static void 
 gtk_icon_view_put (GtkIconView     *icon_view,
                   GtkWidget       *widget,
@@ -1648,10 +1924,6 @@ gtk_icon_view_start_editing (GtkIconView         *icon_view,
                                                  0);
       g_free (path_string);      
 
-      /* FIXME ugly special case */ 
-      if (GTK_IS_ENTRY (editable) || GTK_IS_COMBO_BOX (editable))
-       g_object_set (editable, "has_frame", TRUE, NULL);
-
       /* the rest corresponds to tree_view_real_start_editing... */
       icon_view->priv->edited_item = item;
       icon_view->priv->editable = editable;
@@ -1662,7 +1934,7 @@ gtk_icon_view_start_editing (GtkIconView         *icon_view,
       gtk_cell_editable_start_editing (GTK_CELL_EDITABLE (editable), 
                                       (GdkEvent *)event);
       gtk_widget_grab_focus (GTK_WIDGET (editable));
-      g_signal_connect (editable, "remove_widget",
+      g_signal_connect (editable, "remove-widget",
                        G_CALLBACK (gtk_icon_view_remove_widget), 
                        icon_view);
 
@@ -1720,11 +1992,11 @@ gtk_icon_view_stop_editing (GtkIconView *icon_view,
  * gtk_icon_view_set_cursor:
  * @icon_view: A #GtkIconView
  * @path: A #GtkTreePath
- * @cell: A #GtkCellRenderer or %NULL
+ * @cell: (allow-none): One of the cell renderers of @icon_view, or %NULL
  * @start_editing: %TRUE if the specified cell should start being edited.
  *
  * Sets the current keyboard focus to be at @path, and selects it.  This is
- * useful when you want to focus the user's attention on a particular item.  
+ * useful when you want to focus the user's attention on a particular item.
  * If @cell is not %NULL, then focus is given to the cell specified by 
  * it. Additionally, if @start_editing is %TRUE, then editing should be 
  * started in the specified cell.  
@@ -1758,29 +2030,27 @@ gtk_icon_view_set_cursor (GtkIconView     *icon_view,
   
   if (!item)
     return;
-  
+
   cell_pos = -1;
   for (l = icon_view->priv->cell_list, i = 0; l; l = l->next, i++)
     {
       info = l->data;
-
+      
       if (info->cell == cell)
        {
          cell_pos = i;
          break;
        }
-
+         
       info = NULL;
     }
+  
+  g_return_if_fail (cell == NULL || info != NULL);
 
   gtk_icon_view_set_cursor_item (icon_view, item, cell_pos);
-  if (FALSE && GTK_WIDGET_REALIZED (icon_view))
-    gtk_icon_view_scroll_to_item (icon_view, item);
-  else
-    gtk_icon_view_scroll_to_path (icon_view, path,
-                                 FALSE, 0.0, 0.0);
-
-  if (start_editing)
+  gtk_icon_view_scroll_to_path (icon_view, path, FALSE, 0.0, 0.0);
+  
+  if (info && start_editing)
     gtk_icon_view_start_editing (icon_view, item, info, NULL);
 }
 
@@ -1845,7 +2115,7 @@ gtk_icon_view_button_press (GtkWidget      *widget,
   GtkIconViewCellInfo *info = NULL;
   gboolean dirty = FALSE;
   GtkCellRendererMode mode;
-  gint cursor_cell;
+  gint cursor_cell = -1;
 
   icon_view = GTK_ICON_VIEW (widget);
 
@@ -1859,18 +2129,25 @@ gtk_icon_view_button_press (GtkWidget      *widget,
     {
       item = gtk_icon_view_get_item_at_coords (icon_view, 
                                               event->x, event->y,
-                                              TRUE,
-                                              &info);      
-      if (item != NULL)
+                                              FALSE,
+                                              &info);    
+
+      /*
+       * We consider only the the cells' area as the item area if the
+       * item is not selected, but if it *is* selected, the complete
+       * selection rectangle is considered to be part of the item.
+       */
+      if (item != NULL && (info != NULL || item->selected))
        {
-         g_object_get (info->cell, "mode", &mode, NULL);
-         
-         if (mode == GTK_CELL_RENDERER_MODE_ACTIVATABLE ||
-             mode == GTK_CELL_RENDERER_MODE_EDITABLE)
-           cursor_cell = g_list_index (icon_view->priv->cell_list, info);
-         else
-           cursor_cell = -1;
-         
+         if (info != NULL)
+           {
+             g_object_get (info->cell, "mode", &mode, NULL);
+
+             if (mode == GTK_CELL_RENDERER_MODE_ACTIVATABLE ||
+                 mode == GTK_CELL_RENDERER_MODE_EDITABLE)
+               cursor_cell = g_list_index (icon_view->priv->cell_list, info);
+           }
+
          gtk_icon_view_scroll_to_item (icon_view, item);
          
          if (icon_view->priv->selection_mode == GTK_SELECTION_NONE)
@@ -1903,14 +2180,11 @@ gtk_icon_view_button_press (GtkWidget      *widget,
                }
              else
                {
-                 if (!item->selected)
-                   {
-                     gtk_icon_view_unselect_all_internal (icon_view);
-                     
-                     item->selected = TRUE;
-                     gtk_icon_view_queue_draw_item (icon_view, item);
-                     dirty = TRUE;
-                   }
+                 gtk_icon_view_unselect_all_internal (icon_view);
+
+                 item->selected = TRUE;
+                 gtk_icon_view_queue_draw_item (icon_view, item);
+                 dirty = TRUE;
                }
              gtk_icon_view_set_cursor_item (icon_view, item, cursor_cell);
              icon_view->priv->anchor_item = item;
@@ -1929,13 +2203,16 @@ gtk_icon_view_button_press (GtkWidget      *widget,
 
          /* cancel the current editing, if it exists */
          gtk_icon_view_stop_editing (icon_view, TRUE);
-         
-         if (mode == GTK_CELL_RENDERER_MODE_ACTIVATABLE)
-           gtk_icon_view_item_activate_cell (icon_view, item, info, 
-                                             (GdkEvent *)event);
-         else if (mode == GTK_CELL_RENDERER_MODE_EDITABLE)
-           gtk_icon_view_start_editing (icon_view, item, info, 
-                                        (GdkEvent *)event);      
+
+         if (info != NULL)
+           {
+             if (mode == GTK_CELL_RENDERER_MODE_ACTIVATABLE)
+               gtk_icon_view_item_activate_cell (icon_view, item, info, 
+                                                 (GdkEvent *)event);
+             else if (mode == GTK_CELL_RENDERER_MODE_EDITABLE)
+               gtk_icon_view_start_editing (icon_view, item, info, 
+                                            (GdkEvent *)event);
+           }
        }
       else
        {
@@ -1949,13 +2226,15 @@ gtk_icon_view_button_press (GtkWidget      *widget,
            gtk_icon_view_start_rubberbanding (icon_view, event->x, event->y);
        }
 
+      /* don't draw keyboard focus around an clicked-on item */
+      icon_view->priv->draw_focus = FALSE;
     }
 
   if (event->button == 1 && event->type == GDK_2BUTTON_PRESS)
     {
       item = gtk_icon_view_get_item_at_coords (icon_view,
                                               event->x, event->y,
-                                              TRUE,
+                                              FALSE,
                                               NULL);
 
       if (item && item == icon_view->priv->last_single_clicked)
@@ -1968,6 +2247,7 @@ gtk_icon_view_button_press (GtkWidget      *widget,
        }
 
       icon_view->priv->last_single_clicked = NULL;
+      icon_view->priv->pressed_button = -1;
     }
   
   if (dirty)
@@ -1994,6 +2274,35 @@ gtk_icon_view_button_release (GtkWidget      *widget,
   return TRUE;
 }
 
+static gboolean
+gtk_icon_view_key_press (GtkWidget      *widget,
+                        GdkEventKey    *event)
+{
+  GtkIconView *icon_view = GTK_ICON_VIEW (widget);
+
+  if (icon_view->priv->doing_rubberband)
+    {
+      if (event->keyval == GDK_Escape)
+       gtk_icon_view_stop_rubberbanding (icon_view);
+
+      return TRUE;
+    }
+
+  return GTK_WIDGET_CLASS (gtk_icon_view_parent_class)->key_press_event (widget, event);
+}
+
+static gboolean
+gtk_icon_view_key_release (GtkWidget      *widget,
+                          GdkEventKey    *event)
+{
+  GtkIconView *icon_view = GTK_ICON_VIEW (widget);
+
+  if (icon_view->priv->doing_rubberband)
+    return TRUE;
+
+  return GTK_WIDGET_CLASS (gtk_icon_view_parent_class)->key_press_event (widget, event);
+}
+
 static void
 gtk_icon_view_update_rubberband (gpointer data)
 {
@@ -2144,6 +2453,10 @@ gtk_icon_view_item_hit_test (GtkIconView      *icon_view,
   GList *l;
   GdkRectangle box;
  
+  if (MIN (x + width, item->x + item->width) - MAX (x, item->x) <= 0 ||
+      MIN (y + height, item->y + item->height) - MAX (y, item->y) <= 0)
+    return FALSE;
+
   for (l = icon_view->priv->cell_list; l; l = l->next)
     {
       GtkIconViewCellInfo *info = (GtkIconViewCellInfo *)l->data;
@@ -2179,6 +2492,7 @@ gtk_icon_view_unselect_all_internal (GtkIconView  *icon_view)
          item->selected = FALSE;
          dirty = TRUE;
          gtk_icon_view_queue_draw_item (icon_view, item);
+         gtk_icon_view_item_selected_changed (icon_view, item);
        }
     }
 
@@ -2222,7 +2536,7 @@ gtk_icon_view_set_adjustments (GtkIconView   *icon_view,
       icon_view->priv->hadjustment = hadj;
       g_object_ref_sink (icon_view->priv->hadjustment);
 
-      g_signal_connect (icon_view->priv->hadjustment, "value_changed",
+      g_signal_connect (icon_view->priv->hadjustment, "value-changed",
                        G_CALLBACK (gtk_icon_view_adjustment_changed),
                        icon_view);
       need_adjust = TRUE;
@@ -2233,7 +2547,7 @@ gtk_icon_view_set_adjustments (GtkIconView   *icon_view,
       icon_view->priv->vadjustment = vadj;
       g_object_ref_sink (icon_view->priv->vadjustment);
 
-      g_signal_connect (icon_view->priv->vadjustment, "value_changed",
+      g_signal_connect (icon_view->priv->vadjustment, "value-changed",
                        G_CALLBACK (gtk_icon_view_adjustment_changed),
                        icon_view);
       need_adjust = TRUE;
@@ -2327,6 +2641,7 @@ gtk_icon_view_real_toggle_cursor_item (GtkIconView *icon_view)
       icon_view->priv->cursor_item->selected = !icon_view->priv->cursor_item->selected;
       g_signal_emit (icon_view, icon_view_signals[SELECTION_CHANGED], 0); 
       
+      gtk_icon_view_item_selected_changed (icon_view, icon_view->priv->cursor_item);      
       gtk_icon_view_queue_draw_item (icon_view, icon_view->priv->cursor_item);
       break;
     }
@@ -2404,7 +2719,7 @@ gtk_icon_view_layout_single_row (GtkIconView *icon_view,
       current_width += icon_view->priv->column_spacing + 2 * focus_width;
 
       item->y = *y + focus_width;
-      item->x = rtl ? GTK_WIDGET (icon_view)->allocation.width - item->width - x : x;
+      item->x = x;
 
       x = current_width - (icon_view->priv->margin + focus_width); 
 
@@ -2428,14 +2743,17 @@ gtk_icon_view_layout_single_row (GtkIconView *icon_view,
     {
       GtkIconViewItem *item = items->data;
 
+      if (rtl)
+       {
+         item->x = *maximum_width - item->width - item->x;
+         item->col = col - 1 - item->col;
+       }
+
       gtk_icon_view_calculate_item_size2 (icon_view, item, max_height);
 
       /* We may want to readjust the new y coordinate. */
       if (item->y + item->height + focus_width + icon_view->priv->row_spacing > *y)
        *y = item->y + item->height + focus_width + icon_view->priv->row_spacing;
-
-      if (rtl)
-       item->col = col - 1 - item->col;
     }
 
   g_free (max_height);
@@ -2476,6 +2794,12 @@ gtk_icon_view_layout (GtkIconView *icon_view)
   gint row;
   gint item_width;
 
+  if (icon_view->priv->layout_idle_id != 0)
+    {
+      g_source_remove (icon_view->priv->layout_idle_id);
+      icon_view->priv->layout_idle_id = 0;
+    }
+  
   if (icon_view->priv->model == NULL)
     return;
 
@@ -2493,9 +2817,16 @@ gtk_icon_view_layout (GtkIconView *icon_view)
        }
     }
 
+
   icons = icon_view->priv->items;
   y += icon_view->priv->margin;
   row = 0;
+
+  if (icons)
+    {
+      gtk_icon_view_set_cell_data (icon_view, icons->data);
+      adjust_wrap_width (icon_view, icons->data);
+    }
   
   do
     {
@@ -2507,33 +2838,43 @@ gtk_icon_view_layout (GtkIconView *icon_view)
   while (icons != NULL);
 
   if (maximum_width != icon_view->priv->width)
-    {
-      icon_view->priv->width = maximum_width;
-    }
+    icon_view->priv->width = maximum_width;
+
   y += icon_view->priv->margin;
   
   if (y != icon_view->priv->height)
-    {
-      icon_view->priv->height = y;
-    }
+    icon_view->priv->height = y;
 
-  gtk_icon_view_set_adjustment_upper (icon_view->priv->hadjustment, icon_view->priv->width);
-  gtk_icon_view_set_adjustment_upper (icon_view->priv->vadjustment, icon_view->priv->height);
+  gtk_icon_view_set_adjustment_upper (icon_view->priv->hadjustment, 
+                                     icon_view->priv->width);
+  gtk_icon_view_set_adjustment_upper (icon_view->priv->vadjustment, 
+                                     icon_view->priv->height);
+
+  if (icon_view->priv->width != widget->requisition.width ||
+      icon_view->priv->height != widget->requisition.height)
+    gtk_widget_queue_resize_no_redraw (widget);
 
   if (GTK_WIDGET_REALIZED (icon_view))
-    {
-      gdk_window_resize (icon_view->priv->bin_window,
-                        MAX (icon_view->priv->width, widget->allocation.width),
-                        MAX (icon_view->priv->height, widget->allocation.height));
-    }
+    gdk_window_resize (icon_view->priv->bin_window,
+                      MAX (icon_view->priv->width, widget->allocation.width),
+                      MAX (icon_view->priv->height, widget->allocation.height));
 
-  if (icon_view->priv->layout_idle_id != 0)
+  if (icon_view->priv->scroll_to_path)
     {
-      g_source_remove (icon_view->priv->layout_idle_id);
-      icon_view->priv->layout_idle_id = 0;
-    }
+      GtkTreePath *path;
 
-  gtk_widget_queue_draw (GTK_WIDGET (icon_view));
+      path = gtk_tree_row_reference_get_path (icon_view->priv->scroll_to_path);
+      gtk_tree_row_reference_free (icon_view->priv->scroll_to_path);
+      icon_view->priv->scroll_to_path = NULL;
+      
+      gtk_icon_view_scroll_to_path (icon_view, path,
+                                   icon_view->priv->scroll_to_use_align,
+                                   icon_view->priv->scroll_to_row_align,
+                                   icon_view->priv->scroll_to_col_align);
+      gtk_tree_path_free (path);
+    }
+  
+  gtk_widget_queue_draw (widget);
 }
 
 static void 
@@ -2542,19 +2883,21 @@ gtk_icon_view_get_cell_area (GtkIconView         *icon_view,
                             GtkIconViewCellInfo *info,
                             GdkRectangle        *cell_area)
 {
+  g_return_if_fail (info->position < item->n_cells);
+
   if (icon_view->priv->orientation == GTK_ORIENTATION_HORIZONTAL)
     {
       cell_area->x = item->box[info->position].x - item->before[info->position];
-      cell_area->y = item->y;
+      cell_area->y = item->y + icon_view->priv->item_padding;
       cell_area->width = item->box[info->position].width + 
        item->before[info->position] + item->after[info->position];
-      cell_area->height = item->height;
+      cell_area->height = item->height - icon_view->priv->item_padding * 2;
     }
   else
     {
-      cell_area->x = item->x;
+      cell_area->x = item->x + icon_view->priv->item_padding;
       cell_area->y = item->box[info->position].y - item->before[info->position];
-      cell_area->width = item->width;
+      cell_area->width = item->width - icon_view->priv->item_padding * 2;
       cell_area->height = item->box[info->position].height + 
        item->before[info->position] + item->after[info->position];
     }
@@ -2566,6 +2909,8 @@ gtk_icon_view_get_cell_box (GtkIconView         *icon_view,
                            GtkIconViewCellInfo *info,
                            GdkRectangle        *box)
 {
+  g_return_if_fail (info->position < item->n_cells);
+
   *box = item->box[info->position];
 }
 
@@ -2579,10 +2924,11 @@ adjust_wrap_width (GtkIconView     *icon_view,
   GtkIconViewCellInfo *pixbuf_info;
   gint pixbuf_width, wrap_width;
       
-  if (icon_view->priv->item_width < 0 &&
-      icon_view->priv->text_cell != -1 &&
+  if (icon_view->priv->text_cell != -1 &&
       icon_view->priv->pixbuf_cell != -1)
     {
+      gint item_width;
+
       text_info = g_list_nth_data (icon_view->priv->cell_list,
                                   icon_view->priv->text_cell);
       pixbuf_info = g_list_nth_data (icon_view->priv->cell_list,
@@ -2594,14 +2940,25 @@ adjust_wrap_width (GtkIconView     *icon_view,
                                  &pixbuf_width, 
                                  NULL);
          
-      if (item->width == -1)
-       wrap_width = pixbuf_width;
-      else if (icon_view->priv->orientation == GTK_ORIENTATION_VERTICAL)
-       wrap_width = item->width;
+
+      if (icon_view->priv->item_width > 0)
+       item_width = icon_view->priv->item_width;
       else
-       wrap_width = item->width - pixbuf_width - icon_view->priv->spacing;
+       item_width = item->width;
+
+      if (icon_view->priv->orientation == GTK_ORIENTATION_VERTICAL)
+        wrap_width = item_width;
+      else {
+        if (item->width == -1 && item_width <= 0)
+          wrap_width = MAX (2 * pixbuf_width, 50);
+        else
+          wrap_width = item_width - pixbuf_width - icon_view->priv->spacing;
+        }
+
+      wrap_width -= icon_view->priv->item_padding * 2;
 
       g_object_set (text_info->cell, "wrap-width", wrap_width, NULL);
+      g_object_set (text_info->cell, "width", wrap_width, NULL);
     }
 }
 
@@ -2645,7 +3002,7 @@ gtk_icon_view_calculate_item_size (GtkIconView     *icon_view,
                                  NULL, NULL, NULL,
                                  &item->box[info->position].width, 
                                  &item->box[info->position].height);
-      
+
       if (icon_view->priv->orientation == GTK_ORIENTATION_HORIZONTAL)
        {
          item->width += item->box[info->position].width 
@@ -2658,6 +3015,9 @@ gtk_icon_view_calculate_item_size (GtkIconView     *icon_view,
          item->height += item->box[info->position].height + (info->position > 0 ? spacing : 0);
        }
     }
+
+  item->width += icon_view->priv->item_padding * 2;
+  item->height += icon_view->priv->item_padding * 2;
 }
 
 static void
@@ -2686,8 +3046,8 @@ gtk_icon_view_calculate_item_size2 (GtkIconView     *icon_view,
        item->height += max_height[i] + (i > 0 ? spacing : 0);
     }
 
-  cell_area.x = item->x;
-  cell_area.y = item->y;
+  cell_area.x = item->x + icon_view->priv->item_padding;
+  cell_area.y = item->y + icon_view->priv->item_padding;
       
   for (k = 0; k < 2; k++)
     for (l = icon_view->priv->cell_list, i = 0; l; l = l->next, i++)
@@ -2698,45 +3058,52 @@ gtk_icon_view_calculate_item_size2 (GtkIconView     *icon_view,
          continue;
 
        if (!info->cell->visible)
-        continue;
-
-      if (icon_view->priv->orientation == GTK_ORIENTATION_HORIZONTAL)
-       {
-         cell_area.width = item->box[info->position].width;
-         cell_area.height = item->height;
-       }
-      else
-       {
-         cell_area.width = item->width;
-         cell_area.height = max_height[i];
-       }
-
-      gtk_cell_renderer_get_size (info->cell, GTK_WIDGET (icon_view), 
-                                 &cell_area,
-                                 &item->box[info->position].x, &item->box[info->position].y,
-                                 &item->box[info->position].width, &item->box[info->position].height);
-
-      item->box[info->position].x += cell_area.x;
-      item->box[info->position].y += cell_area.y;
-      if (icon_view->priv->orientation == GTK_ORIENTATION_HORIZONTAL)
-       {
-         item->before[info->position] = item->box[info->position].x - cell_area.x;
-         item->after[info->position] = cell_area.width - item->box[info->position].width - item->before[info->position];
-         cell_area.x += cell_area.width + spacing;
-       }
-      else
-       {
-         if (item->box[info->position].width > item->width)
-           {
-             item->width = item->box[info->position].width;
-             cell_area.width = item->width;
-           }
-         item->before[info->position] = item->box[info->position].y - cell_area.y;
-         item->after[info->position] = cell_area.height - item->box[info->position].height - item->before[info->position];
-         cell_area.y += cell_area.height + spacing;
-       }
-    }
+         continue;
 
+       if (icon_view->priv->orientation == GTK_ORIENTATION_HORIZONTAL)
+         {
+            /* We should not subtract icon_view->priv->item_padding from item->height,
+             * because item->height is recalculated above using
+             * max_height which does not contain item padding.
+             */
+           cell_area.width = item->box[info->position].width;
+           cell_area.height = item->height;
+         }
+       else
+         {
+            /* item->width is not recalculated and thus needs to be
+             * corrected for the padding.
+             */
+           cell_area.width = item->width - 2 * icon_view->priv->item_padding;
+           cell_area.height = max_height[i];
+         }
+       
+       gtk_cell_renderer_get_size (info->cell, GTK_WIDGET (icon_view), 
+                                   &cell_area,
+                                   &item->box[info->position].x, &item->box[info->position].y,
+                                   &item->box[info->position].width, &item->box[info->position].height);
+       
+       item->box[info->position].x += cell_area.x;
+       item->box[info->position].y += cell_area.y;
+       if (icon_view->priv->orientation == GTK_ORIENTATION_HORIZONTAL)
+         {
+           item->before[info->position] = item->box[info->position].x - cell_area.x;
+           item->after[info->position] = cell_area.width - item->box[info->position].width - item->before[info->position];
+           cell_area.x += cell_area.width + spacing;
+         }
+       else
+         {
+           if (item->box[info->position].width > item->width - icon_view->priv->item_padding * 2)
+             {
+               item->width = item->box[info->position].width + icon_view->priv->item_padding * 2;
+               cell_area.width = item->width;
+             }
+           item->before[info->position] = item->box[info->position].y - cell_area.y;
+           item->after[info->position] = cell_area.height - item->box[info->position].height - item->before[info->position];
+           cell_area.y += cell_area.height + spacing;
+         }
+      }
+  
   if (rtl && icon_view->priv->orientation == GTK_ORIENTATION_HORIZONTAL)
     {
       for (i = 0; i < icon_view->priv->n_cells; i++)
@@ -2744,7 +3111,9 @@ gtk_icon_view_calculate_item_size2 (GtkIconView     *icon_view,
          item->box[i].x = item->x + item->width - 
            (item->box[i].x + item->box[i].width - item->x);
        }      
-    }  
+    }
+
+  item->height += icon_view->priv->item_padding * 2;
 }
 
 static void
@@ -2771,7 +3140,7 @@ gtk_icon_view_paint_item (GtkIconView     *icon_view,
                          gint             y,
                          gboolean         draw_focus)
 {
-  gint focus_width, focus_pad;
+  gint focus_width;
   gint padding;
   GdkRectangle cell_area, box;
   GList *l;
@@ -2786,7 +3155,6 @@ gtk_icon_view_paint_item (GtkIconView     *icon_view,
 
   gtk_widget_style_get (GTK_WIDGET (icon_view),
                        "focus-line-width", &focus_width,
-                       "focus-padding", &focus_pad,
                        NULL);
   
   padding = focus_width; 
@@ -2814,28 +3182,17 @@ gtk_icon_view_paint_item (GtkIconView     *icon_view,
 #endif
 
   if (item->selected)
-    for (l = icon_view->priv->cell_list; l; l = l->next)
-      {
-       GtkIconViewCellInfo *info = (GtkIconViewCellInfo *)l->data;
-       
-       if (!info->cell->visible)
-         continue;
-       
-       gtk_icon_view_get_cell_box (icon_view, item, info, &box);
-
-       /* FIXME we hardwire background drawing behind text
-        * cell renderers here 
-        */
-       if (GTK_IS_CELL_RENDERER_TEXT (info->cell))
-         {
-           gdk_cairo_set_source_color (cr, &GTK_WIDGET (icon_view)->style->base[state]);
-           cairo_rectangle (cr,
-                            x - item->x + box.x, 
-                            y - item->y + box.y,
-                            box.width, box.height);
-           cairo_fill (cr);
-         }
-      }
+    {
+      gtk_paint_flat_box (GTK_WIDGET (icon_view)->style,
+                         (GdkWindow *) drawable,
+                         GTK_STATE_SELECTED,
+                         GTK_SHADOW_NONE,
+                         area,
+                         GTK_WIDGET (icon_view),
+                         "icon_view_item",
+                         x, y,
+                         item->width, item->height);
+    }
   
   for (l = icon_view->priv->cell_list; l; l = l->next)
     {
@@ -2871,42 +3228,57 @@ gtk_icon_view_paint_item (GtkIconView     *icon_view,
                                drawable,
                                GTK_WIDGET (icon_view),
                                &cell_area, &cell_area, area, flags);
-      
     }
 
-  /* FIXME where to draw the focus with generic cell renderers ? */
-  if (draw_focus && 
+  if (draw_focus &&
       GTK_WIDGET_HAS_FOCUS (icon_view) &&
       item == icon_view->priv->cursor_item)
-    for (l = icon_view->priv->cell_list, i = 0; l; l = l->next, i++)
-      {
-       GtkIconViewCellInfo *info = (GtkIconViewCellInfo *)l->data;
-       
-       if (!info->cell->visible)
-         continue;
-       
-       if (icon_view->priv->cursor_cell < 0 &&
-           (info->cell->mode != GTK_CELL_RENDERER_MODE_INERT ||
-            GTK_IS_CELL_RENDERER_TEXT (info->cell)))
-         icon_view->priv->cursor_cell = i;
-       
-       if (i == icon_view->priv->cursor_cell)
-         {
-           gtk_icon_view_get_cell_box (icon_view, item, info, &box);
-
-           gtk_paint_focus (GTK_WIDGET (icon_view)->style,
-                            drawable,
-                            GTK_STATE_NORMAL,
-                            area,
-                            GTK_WIDGET (icon_view),
-                            "icon_view",
-                            x - item->x + box.x - padding,
-                            y - item->y + box.y - padding,
-                            box.width + 2 * padding,
-                            box.height + 2 * padding);
-           break;
-         }
-      }
+    {
+      for (l = icon_view->priv->cell_list, i = 0; l; l = l->next, i++)
+        {
+          GtkIconViewCellInfo *info = (GtkIconViewCellInfo *)l->data;
+
+          if (!info->cell->visible)
+            continue;
+
+          /* If found a editable/activatable cell, draw focus on it. */
+          if (icon_view->priv->cursor_cell < 0 &&
+              info->cell->mode != GTK_CELL_RENDERER_MODE_INERT)
+            icon_view->priv->cursor_cell = i;
+
+          gtk_icon_view_get_cell_box (icon_view, item, info, &box);
+
+          if (i == icon_view->priv->cursor_cell)
+            {
+              gtk_paint_focus (GTK_WIDGET (icon_view)->style,
+                               drawable,
+                               GTK_STATE_NORMAL,
+                               area,
+                               GTK_WIDGET (icon_view),
+                               "icon_view",
+                               x - item->x + box.x - padding,
+                               y - item->y + box.y - padding,
+                               box.width + 2 * padding,
+                               box.height + 2 * padding);
+              break;
+            }
+        }
+
+      /* If there are no editable/activatable cells, draw focus 
+       * around the whole item.
+       */
+      if (icon_view->priv->cursor_cell < 0)
+        gtk_paint_focus (GTK_WIDGET (icon_view)->style,
+                         drawable,
+                         GTK_STATE_NORMAL,
+                         area,
+                         GTK_WIDGET (icon_view),
+                         "icon_view",
+                         x - padding,
+                         y - padding,
+                         item->width + 2 * padding,
+                         item->height + 2 * padding);
+    }
 }
 
 static void
@@ -3006,16 +3378,12 @@ layout_callback (gpointer user_data)
 {
   GtkIconView *icon_view;
 
-  GDK_THREADS_ENTER ();
-
   icon_view = GTK_ICON_VIEW (user_data);
   
   icon_view->priv->layout_idle_id = 0;
 
   gtk_icon_view_layout (icon_view);
   
-  GDK_THREADS_LEAVE();
-
   return FALSE;
 }
 
@@ -3025,7 +3393,7 @@ gtk_icon_view_queue_layout (GtkIconView *icon_view)
   if (icon_view->priv->layout_idle_id != 0)
     return;
 
-  icon_view->priv->layout_idle_id = g_idle_add (layout_callback, icon_view);
+  icon_view->priv->layout_idle_id = gdk_threads_add_idle (layout_callback, icon_view);
 }
 
 static void
@@ -3035,14 +3403,23 @@ gtk_icon_view_set_cursor_item (GtkIconView     *icon_view,
 {
   AtkObject *obj;
   AtkObject *item_obj;
+  AtkObject *cursor_item_obj;
 
   if (icon_view->priv->cursor_item == item &&
       (cursor_cell < 0 || cursor_cell == icon_view->priv->cursor_cell))
     return;
 
+  obj = gtk_widget_get_accessible (GTK_WIDGET (icon_view));
   if (icon_view->priv->cursor_item != NULL)
-    gtk_icon_view_queue_draw_item (icon_view, icon_view->priv->cursor_item);
-  
+    {
+      gtk_icon_view_queue_draw_item (icon_view, icon_view->priv->cursor_item);
+      if (obj != NULL)
+        {
+          cursor_item_obj = atk_object_ref_accessible_child (obj, icon_view->priv->cursor_item->index);
+          if (cursor_item_obj != NULL)
+            atk_object_notify_state_change (cursor_item_obj, ATK_STATE_FOCUSED, FALSE);
+        }
+    }
   icon_view->priv->cursor_item = item;
   if (cursor_cell >= 0)
     icon_view->priv->cursor_cell = cursor_cell;
@@ -3050,12 +3427,12 @@ gtk_icon_view_set_cursor_item (GtkIconView     *icon_view,
   gtk_icon_view_queue_draw_item (icon_view, item);
   
   /* Notify that accessible focus object has changed */
-  obj = gtk_widget_get_accessible (GTK_WIDGET (icon_view));
   item_obj = atk_object_ref_accessible_child (obj, item->index);
 
   if (item_obj != NULL)
     {
       atk_focus_tracker_notify (item_obj);
+      atk_object_notify_state_change (item_obj, ATK_STATE_FOCUSED, TRUE);
       g_object_unref (item_obj); 
     }
 }
@@ -3097,12 +3474,15 @@ gtk_icon_view_get_item_at_coords (GtkIconView          *icon_view,
   GList *items, *l;
   GdkRectangle box;
 
+  if (cell_at_pos)
+    *cell_at_pos = NULL;
+
   for (items = icon_view->priv->items; items; items = items->next)
     {
       GtkIconViewItem *item = items->data;
 
-      if (x >= item->x - icon_view->priv->row_spacing/2 && x <= item->x + item->width + icon_view->priv->row_spacing/2 &&
-         y >= item->y - icon_view->priv->column_spacing/2 && y <= item->y + item->height + icon_view->priv->column_spacing/2)
+      if (x >= item->x - icon_view->priv->column_spacing/2 && x <= item->x + item->width + icon_view->priv->column_spacing/2 &&
+         y >= item->y - icon_view->priv->row_spacing/2 && y <= item->y + item->height + icon_view->priv->row_spacing/2)
        {
          if (only_in_cell || cell_at_pos)
            {
@@ -3111,12 +3491,12 @@ gtk_icon_view_get_item_at_coords (GtkIconView          *icon_view,
              for (l = icon_view->priv->cell_list; l; l = l->next)
                {
                  GtkIconViewCellInfo *info = (GtkIconViewCellInfo *)l->data;
-                 
+
                  if (!info->cell->visible)
                    continue;
-                 
+
                  gtk_icon_view_get_cell_box (icon_view, item, info, &box);
-                 
+
                  if ((x >= box.x && x <= box.x + box.width &&
                       y >= box.y && y <= box.y + box.height) ||
                      (x >= box.x  &&
@@ -3126,16 +3506,13 @@ gtk_icon_view_get_item_at_coords (GtkIconView          *icon_view,
                    {
                      if (cell_at_pos)
                        *cell_at_pos = info;
-                     
+
                      return item;
                    }
                }
 
              if (only_in_cell)
                return NULL;
-             
-             if (cell_at_pos)
-               *cell_at_pos = NULL;
            }
 
          return item;
@@ -3162,9 +3539,10 @@ gtk_icon_view_select_item (GtkIconView      *icon_view,
 
   item->selected = TRUE;
 
-  gtk_icon_view_queue_draw_item (icon_view, item);
-
+  gtk_icon_view_item_selected_changed (icon_view, item);
   g_signal_emit (icon_view, icon_view_signals[SELECTION_CHANGED], 0);
+
+  gtk_icon_view_queue_draw_item (icon_view, item);
 }
 
 
@@ -3184,6 +3562,7 @@ gtk_icon_view_unselect_item (GtkIconView      *icon_view,
   
   item->selected = FALSE;
 
+  gtk_icon_view_item_selected_changed (icon_view, item);
   g_signal_emit (icon_view, icon_view_signals[SELECTION_CHANGED], 0);
 
   gtk_icon_view_queue_draw_item (icon_view, item);
@@ -3271,6 +3650,8 @@ gtk_icon_view_row_inserted (GtkTreeModel *model,
     }
     
   verify_items (icon_view);
+
+  gtk_icon_view_queue_layout (icon_view);
 }
 
 static void
@@ -3313,10 +3694,10 @@ gtk_icon_view_row_deleted (GtkTreeModel *model,
   
   icon_view->priv->items = g_list_delete_link (icon_view->priv->items, list);
 
-  gtk_icon_view_queue_layout (icon_view);
-
   verify_items (icon_view);  
   
+  gtk_icon_view_queue_layout (icon_view);
+
   if (emit)
     g_signal_emit (icon_view, icon_view_signals[SELECTION_CHANGED], 0);
 }
@@ -3408,12 +3789,12 @@ gtk_icon_view_add_move_binding (GtkBindingSet  *binding_set,
 {
   
   gtk_binding_entry_add_signal (binding_set, keyval, modmask,
-                                I_("move_cursor"), 2,
+                                I_("move-cursor"), 2,
                                 G_TYPE_ENUM, step,
                                 G_TYPE_INT, count);
 
   gtk_binding_entry_add_signal (binding_set, keyval, GDK_SHIFT_MASK,
-                                "move_cursor", 2,
+                                "move-cursor", 2,
                                 G_TYPE_ENUM, step,
                                 G_TYPE_INT, count);
 
@@ -3421,12 +3802,12 @@ gtk_icon_view_add_move_binding (GtkBindingSet  *binding_set,
    return;
 
   gtk_binding_entry_add_signal (binding_set, keyval, GDK_CONTROL_MASK | GDK_SHIFT_MASK,
-                                "move_cursor", 2,
+                                "move-cursor", 2,
                                 G_TYPE_ENUM, step,
                                 G_TYPE_INT, count);
 
   gtk_binding_entry_add_signal (binding_set, keyval, GDK_CONTROL_MASK,
-                                "move_cursor", 2,
+                                "move-cursor", 2,
                                 G_TYPE_ENUM, step,
                                 G_TYPE_INT, count);
 }
@@ -3482,6 +3863,8 @@ gtk_icon_view_real_move_cursor (GtkIconView     *icon_view,
   icon_view->priv->ctrl_pressed = FALSE;
   icon_view->priv->shift_pressed = FALSE;
 
+  icon_view->priv->draw_focus = TRUE;
+
   return TRUE;
 }
 
@@ -3520,7 +3903,6 @@ find_cell (GtkIconView     *icon_view,
 {
   gint n_focusable;
   gint *focusable;
-  gint first_text;
   gint current;
   gint i, k;
   GList *l;
@@ -3533,7 +3915,6 @@ find_cell (GtkIconView     *icon_view,
   focusable = g_new0 (gint, icon_view->priv->n_cells);
   n_focusable = 0;
 
-  first_text = 0;
   current = 0;
   for (k = 0; k < 2; k++)
     for (l = icon_view->priv->cell_list, i = 0; l; l = l->next, i++)
@@ -3545,9 +3926,6 @@ find_cell (GtkIconView     *icon_view,
        
        if (!info->cell->visible)
          continue;
-       
-       if (GTK_IS_CELL_RENDERER_TEXT (info->cell))
-         first_text = i;
 
        if (info->cell->mode != GTK_CELL_RENDERER_MODE_INERT)
          {
@@ -3561,7 +3939,10 @@ find_cell (GtkIconView     *icon_view,
       }
   
   if (n_focusable == 0)
-    focusable[n_focusable++] = first_text;
+    {
+      g_free (focusable);
+      return -1;
+    }
 
   if (cell < 0)
     {
@@ -3679,10 +4060,11 @@ gtk_icon_view_select_all_between (GtkIconView     *icon_view,
          col1 <= item->col && item->col <= col2)
        {
          if (!item->selected)
-           dirty = TRUE;
-
-         item->selected = TRUE;
-         
+           {
+             dirty = TRUE;
+             item->selected = TRUE;
+             gtk_icon_view_item_selected_changed (icon_view, item);
+           }
          gtk_icon_view_queue_draw_item (icon_view, item);
        }
     }
@@ -3733,7 +4115,10 @@ gtk_icon_view_move_cursor_up_down (GtkIconView *icon_view,
     }
 
   if (!item)
-    return;
+    {
+      gtk_widget_error_bell (GTK_WIDGET (icon_view));
+      return;
+    }
 
   if (icon_view->priv->ctrl_pressed ||
       !icon_view->priv->shift_pressed ||
@@ -3784,6 +4169,9 @@ gtk_icon_view_move_cursor_page_up_down (GtkIconView *icon_view,
                                   icon_view->priv->cursor_item,
                                   count);
 
+  if (item == icon_view->priv->cursor_item)
+    gtk_widget_error_bell (GTK_WIDGET (icon_view));
+
   if (!item)
     return;
 
@@ -3852,7 +4240,10 @@ gtk_icon_view_move_cursor_left_right (GtkIconView *icon_view,
     }
 
   if (!item)
-    return;
+    {
+      gtk_widget_error_bell (GTK_WIDGET (icon_view));
+      return;
+    }
 
   if (icon_view->priv->ctrl_pressed ||
       !icon_view->priv->shift_pressed ||
@@ -3895,6 +4286,9 @@ gtk_icon_view_move_cursor_start_end (GtkIconView *icon_view,
   
   item = list ? list->data : NULL;
 
+  if (item == icon_view->priv->cursor_item)
+    gtk_widget_error_bell (GTK_WIDGET (icon_view));
+
   if (!item)
     return;
 
@@ -3930,18 +4324,19 @@ gtk_icon_view_move_cursor_start_end (GtkIconView *icon_view,
  * @col_align: The horizontal alignment of the item specified by @path.
  *
  * Moves the alignments of @icon_view to the position specified by @path.  
- * @row_align determines where the row is placed, and @col_align determines where 
- * @column is placed.  Both are expected to be between 0.0 and 1.0. 
- * 0.0 means left/top alignment, 1.0 means right/bottom alignment, 0.5 means center.
+ * @row_align determines where the row is placed, and @col_align determines 
+ * where @column is placed.  Both are expected to be between 0.0 and 1.0. 
+ * 0.0 means left/top alignment, 1.0 means right/bottom alignment, 0.5 means 
+ * center.
  *
  * If @use_align is %FALSE, then the alignment arguments are ignored, and the
  * tree does the minimum amount of work to scroll the item onto the screen.
  * This means that the item will be scrolled to the edge closest to its current
  * position.  If the item is currently visible on the screen, nothing is done.
  *
- * This function only works if the model is set, and @path is a valid row on the
- * model.  If the model changes before the @icon_view is realized, the centered
- * path will be modified to reflect this change.
+ * This function only works if the model is set, and @path is a valid row on 
+ * the model. If the model changes before the @icon_view is realized, the 
+ * centered path will be modified to reflect this change.
  *
  * Since: 2.8
  **/
@@ -3959,7 +4354,11 @@ gtk_icon_view_scroll_to_path (GtkIconView *icon_view,
   g_return_if_fail (row_align >= 0.0 && row_align <= 1.0);
   g_return_if_fail (col_align >= 0.0 && col_align <= 1.0);
 
-  if (! GTK_WIDGET_REALIZED (icon_view))
+  if (gtk_tree_path_get_depth (path) > 0)
+    item = g_list_nth_data (icon_view->priv->items,
+                           gtk_tree_path_get_indices(path)[0]);
+  
+  if (!GTK_WIDGET_REALIZED (icon_view) || !item || item->width < 0)
     {
       if (icon_view->priv->scroll_to_path)
        gtk_tree_row_reference_free (icon_view->priv->scroll_to_path);
@@ -3976,13 +4375,6 @@ gtk_icon_view_scroll_to_path (GtkIconView *icon_view,
       return;
     }
 
-  if (gtk_tree_path_get_depth (path) > 0)
-    item = g_list_nth_data (icon_view->priv->items,
-                           gtk_tree_path_get_indices(path)[0]);
-  
-  if (!item)
-    return;
-
   if (use_align)
     {
       gint x, y;
@@ -4031,7 +4423,7 @@ gtk_icon_view_scroll_to_item (GtkIconView     *icon_view,
   gdk_drawable_get_size (GDK_DRAWABLE (icon_view->priv->bin_window), 
                         &width, &height);
   gdk_window_get_position (icon_view->priv->bin_window, &x, &y);
-
+  
   if (y + item->y - focus_width < 0)
     gtk_adjustment_set_value (icon_view->priv->vadjustment, 
                              icon_view->priv->vadjustment->value + y + item->y - focus_width);
@@ -4085,7 +4477,8 @@ gtk_icon_view_set_cell_data (GtkIconView     *icon_view,
       GtkTreePath *path;
 
       path = gtk_tree_path_new_from_indices (item->index, -1);
-      gtk_tree_model_get_iter (icon_view->priv->model, &iter, path);
+      if (!gtk_tree_model_get_iter (icon_view->priv->model, &iter, path))
+        return;
       gtk_tree_path_free (path);
     }
   else
@@ -4120,8 +4513,6 @@ gtk_icon_view_set_cell_data (GtkIconView     *icon_view,
       
       g_object_thaw_notify (G_OBJECT (info->cell));
     }  
-  
-  adjust_wrap_width (icon_view, item);
 }
 
 static void 
@@ -4293,19 +4684,35 @@ gtk_icon_view_cell_layout_reorder (GtkCellLayout   *layout,
 
   g_return_if_fail (link != NULL);
 
-  icon_view->priv->cell_list = g_list_remove_link (icon_view->priv->cell_list,
-                                                  link);
+  icon_view->priv->cell_list = g_list_delete_link (icon_view->priv->cell_list,
+                                                   link);
   icon_view->priv->cell_list = g_list_insert (icon_view->priv->cell_list,
                                              info, position);
 
   for (l = icon_view->priv->cell_list, i = 0; l; l = l->next, i++)
     {
-      info = l->data;
+      info = l->data;
+
+      info->position = i;
+    }
+
+  gtk_widget_queue_draw (GTK_WIDGET (icon_view));
+}
+
+static GList *
+gtk_icon_view_cell_layout_get_cells (GtkCellLayout *layout)
+{
+  GtkIconView *icon_view = (GtkIconView *)layout;
+  GList *retval = NULL, *l;
+
+  for (l = icon_view->priv->cell_list; l; l = l->next)
+    {
+      GtkIconViewCellInfo *info = (GtkIconViewCellInfo *)l->data;
 
-      info->position = i;
+      retval = g_list_prepend (retval, info->cell);
     }
 
-  gtk_widget_queue_draw (GTK_WIDGET (icon_view));
+  return g_list_reverse (retval);
 }
 
 /* Public API */
@@ -4342,6 +4749,40 @@ gtk_icon_view_new_with_model (GtkTreeModel *model)
   return g_object_new (GTK_TYPE_ICON_VIEW, "model", model, NULL);
 }
 
+/**
+ * gtk_icon_view_convert_widget_to_bin_window_coords:
+ * @icon_view: a #GtkIconView 
+ * @wx: X coordinate relative to the widget
+ * @wy: Y coordinate relative to the widget
+ * @bx: return location for bin_window X coordinate
+ * @by: return location for bin_window Y coordinate
+ * 
+ * Converts widget coordinates to coordinates for the bin_window,
+ * as expected by e.g. gtk_icon_view_get_path_at_pos(). 
+ *
+ * Since: 2.12
+ */
+void
+gtk_icon_view_convert_widget_to_bin_window_coords (GtkIconView *icon_view,
+                                                   gint         wx,
+                                                   gint         wy, 
+                                                   gint        *bx,
+                                                   gint        *by)
+{
+  gint x, y;
+
+  g_return_if_fail (GTK_IS_ICON_VIEW (icon_view));
+
+  if (icon_view->priv->bin_window) 
+    gdk_window_get_position (icon_view->priv->bin_window, &x, &y);
+  else
+    x = y = 0;
+  if (bx)
+    *bx = wx - x;
+  if (by)
+    *by = wy - y;
+}
 
 /**
  * gtk_icon_view_get_path_at_pos:
@@ -4349,9 +4790,11 @@ gtk_icon_view_new_with_model (GtkTreeModel *model)
  * @x: The x position to be identified
  * @y: The y position to be identified
  * 
- * Finds the path at the point (@x, @y), relative to widget coordinates.
+ * Finds the path at the point (@x, @y), relative to bin_window coordinates.
  * See gtk_icon_view_get_item_at_pos(), if you are also interested in
- * the cell at the specified position.
+ * the cell at the specified position. 
+ * See gtk_icon_view_convert_widget_to_bin_window_coords() for converting
+ * widget coordinates to bin_window coordinates.
  * 
  * Return value: The #GtkTreePath corresponding to the icon or %NULL
  * if no icon exists at that position.
@@ -4387,10 +4830,12 @@ gtk_icon_view_get_path_at_pos (GtkIconView *icon_view,
  * @cell: Return location for the renderer responsible for the cell
  *   at (@x, @y), or %NULL
  * 
- * Finds the path at the point (@x, @y), relative to widget coordinates.
+ * Finds the path at the point (@x, @y), relative to bin_window coordinates.
  * In contrast to gtk_icon_view_get_path_at_pos(), this function also 
  * obtains the cell at the specified position. The returned path should
  * be freed with gtk_tree_path_free().
+ * See gtk_icon_view_convert_widget_to_bin_window_coords() for converting
+ * widget coordinates to bin_window coordinates.
  * 
  * Return value: %TRUE if an item exists at the specified position
  *
@@ -4429,6 +4874,263 @@ gtk_icon_view_get_item_at_pos (GtkIconView      *icon_view,
   return (item != NULL);
 }
 
+/**
+ * gtk_icon_view_set_tooltip_item:
+ * @icon_view: a #GtkIconView
+ * @tooltip: a #GtkTooltip
+ * @path: a #GtkTreePath
+ * 
+ * Sets the tip area of @tooltip to be the area covered by the item at @path.
+ * See also gtk_icon_view_set_tooltip_column() for a simpler alternative.
+ * See also gtk_tooltip_set_tip_area().
+ * 
+ * Since: 2.12
+ */
+void 
+gtk_icon_view_set_tooltip_item (GtkIconView     *icon_view,
+                                GtkTooltip      *tooltip,
+                                GtkTreePath     *path)
+{
+  g_return_if_fail (GTK_IS_ICON_VIEW (icon_view));
+  g_return_if_fail (GTK_IS_TOOLTIP (tooltip));
+
+  gtk_icon_view_set_tooltip_cell (icon_view, tooltip, path, NULL);
+}
+
+/**
+ * gtk_icon_view_set_tooltip_cell:
+ * @icon_view: a #GtkIconView
+ * @tooltip: a #GtkTooltip
+ * @path: a #GtkTreePath
+ * @cell: a #GtkCellRenderer or %NULL
+ *
+ * Sets the tip area of @tooltip to the area which @cell occupies in
+ * the item pointed to by @path. See also gtk_tooltip_set_tip_area().
+ *
+ * See also gtk_icon_view_set_tooltip_column() for a simpler alternative.
+ *
+ * Since: 2.12
+ */
+void
+gtk_icon_view_set_tooltip_cell (GtkIconView     *icon_view,
+                                GtkTooltip      *tooltip,
+                                GtkTreePath     *path,
+                                GtkCellRenderer *cell)
+{
+  GdkRectangle rect;
+  GtkIconViewItem *item = NULL;
+  GtkIconViewCellInfo *info = NULL;
+  gint x, y;
+  g_return_if_fail (GTK_IS_ICON_VIEW (icon_view));
+  g_return_if_fail (GTK_IS_TOOLTIP (tooltip));
+  g_return_if_fail (cell == NULL || GTK_IS_CELL_RENDERER (cell));
+
+  if (gtk_tree_path_get_depth (path) > 0)
+    item = g_list_nth_data (icon_view->priv->items,
+                            gtk_tree_path_get_indices(path)[0]);
+  if (!item)
+    return;
+
+  if (cell)
+    {
+      info = gtk_icon_view_get_cell_info (icon_view, cell);
+      gtk_icon_view_get_cell_area (icon_view, item, info, &rect);
+    }
+  else
+    {
+      rect.x = item->x;
+      rect.y = item->y;
+      rect.width = item->width;
+      rect.height = item->height;
+    }
+  
+  if (icon_view->priv->bin_window)
+    {
+      gdk_window_get_position (icon_view->priv->bin_window, &x, &y);
+      rect.x += x;
+      rect.y += y; 
+    }
+
+  gtk_tooltip_set_tip_area (tooltip, &rect); 
+}
+
+
+/**
+ * gtk_icon_view_get_tooltip_context:
+ * @icon_view: an #GtkIconView
+ * @x: the x coordinate (relative to widget coordinates)
+ * @y: the y coordinate (relative to widget coordinates)
+ * @keyboard_tip: whether this is a keyboard tooltip or not
+ * @model: a pointer to receive a #GtkTreeModel or %NULL
+ * @path: a pointer to receive a #GtkTreePath or %NULL
+ * @iter: a pointer to receive a #GtkTreeIter or %NULL
+ *
+ * This function is supposed to be used in a #GtkWidget::query-tooltip
+ * signal handler for #GtkIconView.  The @x, @y and @keyboard_tip values
+ * which are received in the signal handler, should be passed to this
+ * function without modification.
+ *
+ * The return value indicates whether there is an icon view item at the given
+ * coordinates (%TRUE) or not (%FALSE) for mouse tooltips. For keyboard
+ * tooltips the item returned will be the cursor item. When %TRUE, then any of
+ * @model, @path and @iter which have been provided will be set to point to
+ * that row and the corresponding model. @x and @y will always be converted
+ * to be relative to @icon_view's bin_window if @keyboard_tooltip is %FALSE.
+ *
+ * Return value: whether or not the given tooltip context points to a item
+ *
+ * Since: 2.12
+ */
+gboolean
+gtk_icon_view_get_tooltip_context (GtkIconView   *icon_view,
+                                   gint          *x,
+                                   gint          *y,
+                                   gboolean       keyboard_tip,
+                                   GtkTreeModel **model,
+                                   GtkTreePath  **path,
+                                   GtkTreeIter   *iter)
+{
+  GtkTreePath *tmppath = NULL;
+
+  g_return_val_if_fail (GTK_IS_ICON_VIEW (icon_view), FALSE);
+  g_return_val_if_fail (x != NULL, FALSE);
+  g_return_val_if_fail (y != NULL, FALSE);
+
+  if (keyboard_tip)
+    {
+      gtk_icon_view_get_cursor (icon_view, &tmppath, NULL);
+
+      if (!tmppath)
+        return FALSE;
+    }
+  else
+    {
+      gtk_icon_view_convert_widget_to_bin_window_coords (icon_view, *x, *y,
+                                                         x, y);
+
+      if (!gtk_icon_view_get_item_at_pos (icon_view, *x, *y, &tmppath, NULL))
+        return FALSE;
+    }
+
+  if (model)
+    *model = gtk_icon_view_get_model (icon_view);
+
+  if (iter)
+    gtk_tree_model_get_iter (gtk_icon_view_get_model (icon_view),
+                             iter, tmppath);
+
+  if (path)
+    *path = tmppath;
+  else
+    gtk_tree_path_free (tmppath);
+
+  return TRUE;
+}
+
+static gboolean
+gtk_icon_view_set_tooltip_query_cb (GtkWidget  *widget,
+                                    gint        x,
+                                    gint        y,
+                                    gboolean    keyboard_tip,
+                                    GtkTooltip *tooltip,
+                                    gpointer    data)
+{
+  gchar *str;
+  GtkTreeIter iter;
+  GtkTreePath *path;
+  GtkTreeModel *model;
+  GtkIconView *icon_view = GTK_ICON_VIEW (widget);
+
+  if (!gtk_icon_view_get_tooltip_context (GTK_ICON_VIEW (widget),
+                                          &x, &y,
+                                          keyboard_tip,
+                                          &model, &path, &iter))
+    return FALSE;
+
+  gtk_tree_model_get (model, &iter, icon_view->priv->tooltip_column, &str, -1);
+
+  if (!str)
+    {
+      gtk_tree_path_free (path);
+      return FALSE;
+    }
+
+  gtk_tooltip_set_markup (tooltip, str);
+  gtk_icon_view_set_tooltip_item (icon_view, tooltip, path);
+
+  gtk_tree_path_free (path);
+  g_free (str);
+
+  return TRUE;
+}
+
+
+/**
+ * gtk_icon_view_set_tooltip_column:
+ * @icon_view: a #GtkIconView
+ * @column: an integer, which is a valid column number for @icon_view's model
+ *
+ * If you only plan to have simple (text-only) tooltips on full items, you
+ * can use this function to have #GtkIconView handle these automatically
+ * for you. @column should be set to the column in @icon_view's model
+ * containing the tooltip texts, or -1 to disable this feature.
+ *
+ * When enabled, #GtkWidget::has-tooltip will be set to %TRUE and
+ * @icon_view will connect a #GtkWidget::query-tooltip signal handler.
+ *
+ * Since: 2.12
+ */
+void
+gtk_icon_view_set_tooltip_column (GtkIconView *icon_view,
+                                  gint         column)
+{
+  g_return_if_fail (GTK_IS_ICON_VIEW (icon_view));
+
+  if (column == icon_view->priv->tooltip_column)
+    return;
+
+  if (column == -1)
+    {
+      g_signal_handlers_disconnect_by_func (icon_view,
+                                            gtk_icon_view_set_tooltip_query_cb,
+                                            NULL);
+      gtk_widget_set_has_tooltip (GTK_WIDGET (icon_view), FALSE);
+    }
+  else
+    {
+      if (icon_view->priv->tooltip_column == -1)
+        {
+          g_signal_connect (icon_view, "query-tooltip",
+                            G_CALLBACK (gtk_icon_view_set_tooltip_query_cb), NULL);
+          gtk_widget_set_has_tooltip (GTK_WIDGET (icon_view), TRUE);
+        }
+    }
+
+  icon_view->priv->tooltip_column = column;
+  g_object_notify (G_OBJECT (icon_view), "tooltip-column");
+}
+
+/** 
+ * gtk_icon_view_get_tooltip_column:
+ * @icon_view: a #GtkIconView
+ *
+ * Returns the column of @icon_view's model which is being used for
+ * displaying tooltips on @icon_view's rows.
+ *
+ * Return value: the index of the tooltip column that is currently being
+ * used, or -1 if this is disabled.
+ *
+ * Since: 2.12
+ */
+gint
+gtk_icon_view_get_tooltip_column (GtkIconView *icon_view)
+{
+  g_return_val_if_fail (GTK_IS_ICON_VIEW (icon_view), 0);
+
+  return icon_view->priv->tooltip_column;
+}
 
 /**
  * gtk_icon_view_get_visible_range:
@@ -4564,10 +5266,10 @@ gtk_icon_view_get_selection_mode (GtkIconView *icon_view)
 /**
  * gtk_icon_view_set_model:
  * @icon_view: A #GtkIconView.
- * @model: The model.
+ * @model: (allow-none): The model.
  *
- * Sets the model for a #GtkIconView.  
- * If the @icon_view already has a model set, it will remove 
+ * Sets the model for a #GtkIconView.
+ * If the @icon_view already has a model set, it will remove
  * it before setting the new model.  If @model is %NULL, then
  * it will unset the old model.
  *
@@ -4656,19 +5358,19 @@ gtk_icon_view_set_model (GtkIconView *icon_view,
     {
       g_object_ref (icon_view->priv->model);
       g_signal_connect (icon_view->priv->model,
-                       "row_changed",
+                       "row-changed",
                        G_CALLBACK (gtk_icon_view_row_changed),
                        icon_view);
       g_signal_connect (icon_view->priv->model,
-                       "row_inserted",
+                       "row-inserted",
                        G_CALLBACK (gtk_icon_view_row_inserted),
                        icon_view);
       g_signal_connect (icon_view->priv->model,
-                       "row_deleted",
+                       "row-deleted",
                        G_CALLBACK (gtk_icon_view_row_deleted),
                        icon_view);
       g_signal_connect (icon_view->priv->model,
-                       "rows_reordered",
+                       "rows-reordered",
                        G_CALLBACK (gtk_icon_view_rows_reordered),
                        icon_view);
 
@@ -4714,10 +5416,13 @@ update_text_cell (GtkIconView *icon_view)
     {
       if (icon_view->priv->text_cell != -1)
        {
+         if (icon_view->priv->pixbuf_cell > icon_view->priv->text_cell)
+           icon_view->priv->pixbuf_cell--;
+
          info = g_list_nth_data (icon_view->priv->cell_list, 
                                  icon_view->priv->text_cell);
          
-         g_list_remove (icon_view->priv->cell_list, info);
+         icon_view->priv->cell_list = g_list_remove (icon_view->priv->cell_list, info);
          
          free_cell_info (info);
          
@@ -4758,15 +5463,15 @@ update_text_cell (GtkIconView *icon_view)
 
       if (icon_view->priv->orientation == GTK_ORIENTATION_VERTICAL)
        g_object_set (info->cell,
-                     "wrap_mode", PANGO_WRAP_CHAR,
-                     "wrap_width", icon_view->priv->item_width,
-                     "xalign", 0.5,
+                      "alignment", PANGO_ALIGN_CENTER,
+                     "wrap-mode", PANGO_WRAP_WORD_CHAR,
+                     "xalign", 0.0,
                      "yalign", 0.0,
                      NULL);
       else
        g_object_set (info->cell,
-                     "wrap_mode", PANGO_WRAP_CHAR,
-                     "wrap_width", icon_view->priv->item_width,
+                      "alignment", PANGO_ALIGN_LEFT,
+                     "wrap-mode", PANGO_WRAP_WORD_CHAR,
                      "xalign", 0.0,
                      "yalign", 0.0,
                      NULL);
@@ -4784,10 +5489,13 @@ update_pixbuf_cell (GtkIconView *icon_view)
     {
       if (icon_view->priv->pixbuf_cell != -1)
        {
+         if (icon_view->priv->text_cell > icon_view->priv->pixbuf_cell)
+           icon_view->priv->text_cell--;
+
          info = g_list_nth_data (icon_view->priv->cell_list, 
                                  icon_view->priv->pixbuf_cell);
          
-         g_list_remove (icon_view->priv->cell_list, info);
+         icon_view->priv->cell_list = g_list_remove (icon_view->priv->cell_list, info);
          
          free_cell_info (info);
          
@@ -4823,13 +5531,11 @@ update_pixbuf_cell (GtkIconView *icon_view)
 
        if (icon_view->priv->orientation == GTK_ORIENTATION_VERTICAL)
          g_object_set (info->cell,
-                       "follow_state", TRUE, 
                        "xalign", 0.5,
                        "yalign", 1.0,
                        NULL);
        else
          g_object_set (info->cell,
-                       "follow_state", TRUE, 
                        "xalign", 0.0,
                        "yalign", 0.0,
                        NULL);
@@ -4839,7 +5545,7 @@ update_pixbuf_cell (GtkIconView *icon_view)
 /**
  * gtk_icon_view_set_text_column:
  * @icon_view: A #GtkIconView.
- * @column: A column in the currently used model.
+ * @column: A column in the currently used model, or -1 to display no text
  * 
  * Sets the column with text for @icon_view to be @column. The text
  * column must be of type #G_TYPE_STRING.
@@ -4900,7 +5606,7 @@ gtk_icon_view_get_text_column (GtkIconView  *icon_view)
 /**
  * gtk_icon_view_set_markup_column:
  * @icon_view: A #GtkIconView.
- * @column: A column in the currently used model.
+ * @column: A column in the currently used model, or -1 to display no text
  * 
  * Sets the column with markup information for @icon_view to be
  * @column. The markup column must be of type #G_TYPE_STRING.
@@ -4963,7 +5669,7 @@ gtk_icon_view_get_markup_column (GtkIconView  *icon_view)
 /**
  * gtk_icon_view_set_pixbuf_column:
  * @icon_view: A #GtkIconView.
- * @column: A column in the currently used model.
+ * @column: A column in the currently used model, or -1 to disable
  * 
  * Sets the column with pixbufs for @icon_view to be @column. The pixbuf
  * column must be of type #GDK_TYPE_PIXBUF
@@ -5087,12 +5793,12 @@ gtk_icon_view_unselect_path (GtkIconView *icon_view,
  * To do this, you can use gtk_tree_row_reference_new().
  *
  * To free the return value, use:
- * <informalexample><programlisting>
- * g_list_foreach (list, gtk_tree_path_free, NULL);
+ * |[
+ * g_list_foreach (list, (GFunc)gtk_tree_path_free, NULL);
  * g_list_free (list);
- * </programlisting></informalexample>
+ * ]|
  *
- * Return value: A #GList containing a #GtkTreePath for each selected row.
+ * Return value: (element-type GtkTreePath) (transfer full): A #GList containing a #GtkTreePath for each selected row.
  *
  * Since: 2.6
  **/
@@ -5185,7 +5891,7 @@ gtk_icon_view_unselect_all (GtkIconView *icon_view)
  * @path: A #GtkTreePath to check selection on.
  * 
  * Returns %TRUE if the icon pointed to by @path is currently
- * selected. If @icon does not point to a valid location, %FALSE is returned.
+ * selected. If @path does not point to a valid location, %FALSE is returned.
  * 
  * Return value: %TRUE if @path is selected.
  *
@@ -5563,6 +6269,51 @@ gtk_icon_view_get_margin (GtkIconView *icon_view)
   return icon_view->priv->margin;
 }
 
+/**
+ * gtk_icon_view_set_item_padding:
+ * @icon_view: a #GtkIconView
+ * @item_padding: the item padding
+ *
+ * Sets the #GtkIconView:item-padding property which specifies the padding
+ * around each of the icon view's items.
+ *
+ * Since: 2.18
+ */
+void
+gtk_icon_view_set_item_padding (GtkIconView *icon_view,
+                               gint         item_padding)
+{
+  g_return_if_fail (GTK_IS_ICON_VIEW (icon_view));
+  
+  if (icon_view->priv->item_padding != item_padding)
+    {
+      icon_view->priv->item_padding = item_padding;
+
+      gtk_icon_view_stop_editing (icon_view, TRUE);
+      gtk_icon_view_invalidate_sizes (icon_view);
+      gtk_icon_view_queue_layout (icon_view);
+      
+      g_object_notify (G_OBJECT (icon_view), "item-padding");
+    }  
+}
+
+/**
+ * gtk_icon_view_get_item_padding:
+ * @icon_view: a #GtkIconView
+ * 
+ * Returns the value of the ::item-padding property.
+ * 
+ * Return value: the padding around items
+ *
+ * Since: 2.18
+ */
+gint
+gtk_icon_view_get_item_padding (GtkIconView *icon_view)
+{
+  g_return_val_if_fail (GTK_IS_ICON_VIEW (icon_view), -1);
+
+  return icon_view->priv->item_padding;
+}
 
 /* Get/set whether drag_motion requested the drag data and
  * drag_data_received should thus not actually insert the data,
@@ -5594,26 +6345,6 @@ unset_reorderable (GtkIconView *icon_view)
     }
 }
 
-static void
-clear_source_info (GtkIconView *icon_view)
-{
-  if (icon_view->priv->source_targets)
-    gtk_target_list_unref (icon_view->priv->source_targets);
-  icon_view->priv->source_targets = NULL;
-
-  icon_view->priv->source_set = FALSE;
-}
-
-static void
-clear_dest_info (GtkIconView *icon_view)
-{
-  if (icon_view->priv->dest_targets)
-    gtk_target_list_unref (icon_view->priv->dest_targets);
-  icon_view->priv->dest_targets = NULL;
-
-  icon_view->priv->dest_set = FALSE;
-}
-
 static void
 set_source_row (GdkDragContext *context,
                 GtkTreeModel   *model,
@@ -5789,12 +6520,8 @@ drag_scroll_timeout (gpointer data)
 {
   GtkIconView *icon_view = GTK_ICON_VIEW (data);
 
-  GDK_THREADS_ENTER ();
-
   gtk_icon_view_autoscroll (icon_view);
 
-  GDK_THREADS_LEAVE ();
-
   return TRUE;
 }
 
@@ -5834,7 +6561,8 @@ set_destination (GtkIconView    *icon_view,
       return FALSE; /* no longer a drop site */
     }
 
-  *target = gtk_drag_dest_find_target (widget, context, icon_view->priv->dest_targets);
+  *target = gtk_drag_dest_find_target (widget, context,
+                                       gtk_drag_dest_get_target_list (widget));
   if (*target == GDK_NONE)
     return FALSE;
 
@@ -5954,6 +6682,7 @@ static gboolean
 gtk_icon_view_maybe_begin_drag (GtkIconView    *icon_view,
                                GdkEventMotion *event)
 {
+  GtkWidget *widget = GTK_WIDGET (icon_view);
   GdkDragContext *context;
   GtkTreePath *path = NULL;
   gint button;
@@ -6000,8 +6729,8 @@ gtk_icon_view_maybe_begin_drag (GtkIconView    *icon_view,
   
   retval = TRUE;
 
-  context = gtk_drag_begin (GTK_WIDGET (icon_view),
-                            icon_view->priv->source_targets,
+  context = gtk_drag_begin (widget,
+                            gtk_drag_source_get_target_list (widget),
                             icon_view->priv->source_actions,
                             button,
                             (GdkEvent*)event);
@@ -6080,7 +6809,7 @@ gtk_icon_view_drag_data_get (GtkWidget        *widget,
   if (model == NULL)
     return;
 
-  if (!icon_view->priv->dest_set)
+  if (!icon_view->priv->source_set)
     return;
 
   source_row = get_source_row (context);
@@ -6120,10 +6849,10 @@ gtk_icon_view_drag_data_delete (GtkWidget      *widget,
   icon_view = GTK_ICON_VIEW (widget);
   model = gtk_icon_view_get_model (icon_view);
 
-  if (!check_model_dnd (model, GTK_TYPE_TREE_DRAG_SOURCE, "drag_data_delete"))
+  if (!check_model_dnd (model, GTK_TYPE_TREE_DRAG_SOURCE, "drag-data-delete"))
     return;
 
-  if (!icon_view->priv->dest_set)
+  if (!icon_view->priv->source_set)
     return;
 
   source_row = get_source_row (context);
@@ -6191,7 +6920,7 @@ gtk_icon_view_drag_motion (GtkWidget      *widget,
       if (icon_view->priv->scroll_timeout_id == 0)
        {
          icon_view->priv->scroll_timeout_id =
-           g_timeout_add (50, drag_scroll_timeout, icon_view);
+           gdk_threads_add_timeout (50, drag_scroll_timeout, icon_view);
        }
 
       if (target == gdk_atom_intern_static_string ("GTK_TREE_MODEL_ROW"))
@@ -6237,7 +6966,7 @@ gtk_icon_view_drag_drop (GtkWidget      *widget,
   if (!icon_view->priv->dest_set)
     return FALSE;
 
-  if (!check_model_dnd (model, GTK_TYPE_TREE_DRAG_DEST, "drag_drop"))
+  if (!check_model_dnd (model, GTK_TYPE_TREE_DRAG_DEST, "drag-drop"))
     return FALSE;
 
   if (!set_destination (icon_view, context, x, y, &suggested_action, &target))
@@ -6290,7 +7019,7 @@ gtk_icon_view_drag_data_received (GtkWidget        *widget,
   icon_view = GTK_ICON_VIEW (widget);  
   model = gtk_icon_view_get_model (icon_view);
 
-  if (!check_model_dnd (model, GTK_TYPE_TREE_DRAG_DEST, "drag_data_received"))
+  if (!check_model_dnd (model, GTK_TYPE_TREE_DRAG_DEST, "drag-data-received"))
     return;
 
   if (!icon_view->priv->dest_set)
@@ -6365,8 +7094,9 @@ gtk_icon_view_drag_data_received (GtkWidget        *widget,
  * @n_targets: the number of items in @targets
  * @actions: the bitmask of possible actions for a drag from this
  *    widget
- * 
- * Turns @icon_view into a drag source for automatic DND.
+ *
+ * Turns @icon_view into a drag source for automatic DND. Calling this
+ * method sets #GtkIconView:reorderable to %FALSE.
  *
  * Since: 2.8
  **/
@@ -6379,11 +7109,9 @@ gtk_icon_view_enable_model_drag_source (GtkIconView              *icon_view,
 {
   g_return_if_fail (GTK_IS_ICON_VIEW (icon_view));
 
-  gtk_drag_source_set (GTK_WIDGET (icon_view), 0, NULL, 0, actions);
+  gtk_drag_source_set (GTK_WIDGET (icon_view), 0, targets, n_targets, actions);
 
-  clear_source_info (icon_view);
   icon_view->priv->start_button_mask = start_button_mask;
-  icon_view->priv->source_targets = gtk_target_list_new (targets, n_targets);
   icon_view->priv->source_actions = actions;
 
   icon_view->priv->source_set = TRUE;
@@ -6396,10 +7124,11 @@ gtk_icon_view_enable_model_drag_source (GtkIconView              *icon_view,
  * @icon_view: a #GtkIconView
  * @targets: the table of targets that the drag will support
  * @n_targets: the number of items in @targets
- * @actions: the bitmask of possible actions for a drag from this
+ * @actions: the bitmask of possible actions for a drag to this
  *    widget
- * 
- * Turns @icon_view into a drop destination for automatic DND.
+ *
+ * Turns @icon_view into a drop destination for automatic DND. Calling this
+ * method sets #GtkIconView:reorderable to %FALSE.
  *
  * Since: 2.8
  **/
@@ -6411,11 +7140,8 @@ gtk_icon_view_enable_model_drag_dest (GtkIconView          *icon_view,
 {
   g_return_if_fail (GTK_IS_ICON_VIEW (icon_view));
 
-  gtk_drag_dest_set (GTK_WIDGET (icon_view), 0, NULL, 0, actions);
+  gtk_drag_dest_set (GTK_WIDGET (icon_view), 0, targets, n_targets, actions);
 
-  clear_dest_info (icon_view);
-
-  icon_view->priv->dest_targets = gtk_target_list_new (targets, n_targets);
   icon_view->priv->dest_actions = actions;
 
   icon_view->priv->dest_set = TRUE;
@@ -6427,7 +7153,8 @@ gtk_icon_view_enable_model_drag_dest (GtkIconView          *icon_view,
  * gtk_icon_view_unset_model_drag_source:
  * @icon_view: a #GtkIconView
  * 
- * Undoes the effect of gtk_icon_view_enable_model_drag_source().
+ * Undoes the effect of gtk_icon_view_enable_model_drag_source(). Calling this
+ * method sets #GtkIconView:reorderable to %FALSE.
  *
  * Since: 2.8
  **/
@@ -6439,7 +7166,7 @@ gtk_icon_view_unset_model_drag_source (GtkIconView *icon_view)
   if (icon_view->priv->source_set)
     {
       gtk_drag_source_unset (GTK_WIDGET (icon_view));
-      clear_source_info (icon_view);
+      icon_view->priv->source_set = FALSE;
     }
 
   unset_reorderable (icon_view);
@@ -6449,7 +7176,8 @@ gtk_icon_view_unset_model_drag_source (GtkIconView *icon_view)
  * gtk_icon_view_unset_model_drag_dest:
  * @icon_view: a #GtkIconView
  * 
- * Undoes the effect of gtk_icon_view_enable_model_drag_dest().
+ * Undoes the effect of gtk_icon_view_enable_model_drag_dest(). Calling this
+ * method sets #GtkIconView:reorderable to %FALSE.
  *
  * Since: 2.8
  **/
@@ -6461,7 +7189,7 @@ gtk_icon_view_unset_model_drag_dest (GtkIconView *icon_view)
   if (icon_view->priv->dest_set)
     {
       gtk_drag_dest_unset (GTK_WIDGET (icon_view));
-      clear_dest_info (icon_view);
+      icon_view->priv->dest_set = FALSE;
     }
 
   unset_reorderable (icon_view);
@@ -6471,9 +7199,9 @@ gtk_icon_view_unset_model_drag_dest (GtkIconView *icon_view)
 /**
  * gtk_icon_view_set_drag_dest_item:
  * @icon_view: a #GtkIconView
- * @path: The path of the item to highlight, or %NULL.
+ * @path: (allow-none): The path of the item to highlight, or %NULL.
  * @pos: Specifies where to drop, relative to the item
- * 
+ *
  * Sets the item that is highlighted for feedback.
  *
  * Since: 2.8
@@ -6502,7 +7230,7 @@ gtk_icon_view_set_drag_dest_item (GtkIconView              *icon_view,
   
   /* special case a drop on an empty model */
   icon_view->priv->empty_view_drop = FALSE;
-  if (pos == GTK_TREE_VIEW_DROP_BEFORE && path
+  if (pos == GTK_ICON_VIEW_DROP_ABOVE && path
       && gtk_tree_path_get_depth (path) == 1
       && gtk_tree_path_get_indices (path)[0] == 0)
     {
@@ -6727,7 +7455,9 @@ static const GtkTargetEntry item_targets[] = {
  * #GtkTreeStore and #GtkListStore support these.  If @reorderable is %TRUE, then
  * the user can reorder the model by dragging and dropping rows.  The
  * developer can listen to these changes by connecting to the model's
- * row_inserted and row_deleted signals.
+ * row_inserted and row_deleted signals. The reordering is implemented by setting up
+ * the icon view as a drag source and destination. Therefore, drag and
+ * drop can not be used in a reorderable view for any other purpose.
  *
  * This function does not give you any degree of control over the order -- any
  * reordering is allowed.  If more control is needed, you should probably
@@ -6832,8 +7562,6 @@ gtk_icon_view_item_accessible_idle_do_action (gpointer data)
   GtkIconView *icon_view;
   GtkTreePath *path;
 
-  GDK_THREADS_ENTER ();
-
   item = GTK_ICON_VIEW_ITEM_ACCESSIBLE (data);
   item->action_idle_handler = 0;
 
@@ -6845,8 +7573,6 @@ gtk_icon_view_item_accessible_idle_do_action (gpointer data)
       gtk_tree_path_free (path);
     }
 
-  GDK_THREADS_LEAVE ();
-
   return FALSE;
 }
 
@@ -6871,7 +7597,7 @@ gtk_icon_view_item_accessible_action_do_action (AtkAction *action,
     {
     case ACTION_ACTIVATE:
       if (!item->action_idle_handler)
-        item->action_idle_handler = g_idle_add (gtk_icon_view_item_accessible_idle_do_action, item);
+        item->action_idle_handler = gdk_threads_add_idle (gtk_icon_view_item_accessible_idle_do_action, item);
       break;
     default:
       g_assert_not_reached ();
@@ -6926,8 +7652,7 @@ gtk_icon_view_item_accessible_action_set_description (AtkAction   *action,
 
   item = GTK_ICON_VIEW_ITEM_ACCESSIBLE (action);
 
-  if (item->action_descriptions[i])
-    g_free (item->action_descriptions[i]);
+  g_free (item->action_descriptions[i]);
 
   item->action_descriptions[i] = g_strdup (description);
 
@@ -6963,7 +7688,7 @@ gtk_icon_view_item_accessible_image_set_image_description (AtkImage    *image,
   item = GTK_ICON_VIEW_ITEM_ACCESSIBLE (image);
 
   g_free (item->image_description);
-  item->image_description = g_strdup (item->image_description);
+  item->image_description = g_strdup (description);
 
   return TRUE;
 }
@@ -7153,7 +7878,7 @@ get_pango_text_offsets (PangoLayout     *layout,
   iter = pango_layout_get_iter (layout);
   do
     {
-      line = pango_layout_iter_get_line (iter);
+      line = pango_layout_iter_get_line_readonly (iter);
       start_index = line->start_index;
       end_index = start_index + line->length;
 
@@ -7194,7 +7919,7 @@ get_pango_text_offsets (PangoLayout     *layout,
                 {
                 case ATK_TEXT_BOUNDARY_LINE_START:
                   if (pango_layout_iter_next_line (iter))
-                    end_index = pango_layout_iter_get_line (iter)->start_index;
+                    end_index = pango_layout_iter_get_line_readonly (iter)->start_index;
                   break;
                 case ATK_TEXT_BOUNDARY_LINE_END:
                   if (prev_line)
@@ -7211,13 +7936,13 @@ get_pango_text_offsets (PangoLayout     *layout,
                 */
               if (pango_layout_iter_next_line (iter))
                 {
-                  line = pango_layout_iter_get_line (iter);
+                  line = pango_layout_iter_get_line_readonly (iter);
                   switch (boundary_type)
                     {
                     case ATK_TEXT_BOUNDARY_LINE_START:
                       start_index = line->start_index;
                       if (pango_layout_iter_next_line (iter))
-                        end_index = pango_layout_iter_get_line (iter)->start_index;
+                        end_index = pango_layout_iter_get_line_readonly (iter)->start_index;
                       else
                         end_index = start_index + line->length;
                       break;
@@ -7762,7 +8487,7 @@ gtk_icon_view_item_accessible_grab_focus (AtkComponent *component)
   gtk_widget_grab_focus (item->widget);
   gtk_icon_view_set_cursor_item (GTK_ICON_VIEW (item->widget), item->item, -1);
   toplevel = gtk_widget_get_toplevel (GTK_WIDGET (item->widget));
-  if (GTK_WIDGET_TOPLEVEL (toplevel))
+  if (gtk_widget_is_toplevel (toplevel))
     gtk_window_present (GTK_WINDOW (toplevel));
 
   return TRUE;
@@ -7794,7 +8519,7 @@ gtk_icon_view_item_accessible_add_state (GtkIconViewItemAccessible *item,
       atk_object_notify_state_change (ATK_OBJECT (item), state_type, TRUE);
       /* If state_type is ATK_STATE_VISIBLE, additional notification */
       if (state_type == ATK_STATE_VISIBLE)
-        g_signal_emit_by_name (item, "visible_data_changed");
+        g_signal_emit_by_name (item, "visible-data-changed");
     }
 
   return rc;
@@ -7821,7 +8546,7 @@ gtk_icon_view_item_accessible_remove_state (GtkIconViewItemAccessible *item,
           atk_object_notify_state_change (ATK_OBJECT (item), state_type, FALSE);
           /* If state_type is ATK_STATE_VISIBLE, additional notification */
           if (state_type == ATK_STATE_VISIBLE)
-            g_signal_emit_by_name (item, "visible_data_changed");
+            g_signal_emit_by_name (item, "visible-data-changed");
         }
 
       return rc;
@@ -7997,6 +8722,10 @@ gtk_icon_view_item_accessible_ref_state_set (AtkObject *obj)
     atk_state_set_add_state (item->state_set, ATK_STATE_FOCUSED);
   else
     atk_state_set_remove_state (item->state_set, ATK_STATE_FOCUSED);
+  if (item->item->selected)
+    atk_state_set_add_state (item->state_set, ATK_STATE_SELECTED);
+  else
+    atk_state_set_remove_state (item->state_set, ATK_STATE_SELECTED);
 
   return g_object_ref (item->state_set);
 }
@@ -8025,7 +8754,7 @@ gtk_icon_view_item_accessible_get_type (void)
 
   if (!type)
     {
-      static const GTypeInfo tinfo =
+      const GTypeInfo tinfo =
       {
         sizeof (GtkIconViewItemAccessibleClass),
         (GBaseInitFunc) NULL, /* base init */
@@ -8039,25 +8768,25 @@ gtk_icon_view_item_accessible_get_type (void)
         NULL /* value table */
       };
 
-      static const GInterfaceInfo atk_component_info =
+      const GInterfaceInfo atk_component_info =
       {
         (GInterfaceInitFunc) atk_component_item_interface_init,
         (GInterfaceFinalizeFunc) NULL,
         NULL
       };
-      static const GInterfaceInfo atk_action_info =
+      const GInterfaceInfo atk_action_info =
       {
         (GInterfaceInitFunc) atk_action_item_interface_init,
         (GInterfaceFinalizeFunc) NULL,
         NULL
       };
-      static const GInterfaceInfo atk_image_info =
+      const GInterfaceInfo atk_image_info =
       {
         (GInterfaceInitFunc) atk_image_item_interface_init,
         (GInterfaceFinalizeFunc) NULL,
         NULL
       };
-      static const GInterfaceInfo atk_text_info =
+      const GInterfaceInfo atk_text_info =
       {
         (GInterfaceInitFunc) atk_text_item_interface_init,
         (GInterfaceFinalizeFunc) NULL,
@@ -8203,6 +8932,8 @@ gtk_icon_view_accessible_ref_child (AtkObject *accessible,
       obj = gtk_icon_view_accessible_find_child (accessible, index);
       if (!obj)
         {
+          gchar *text;
+
           obj = g_object_new (gtk_icon_view_item_accessible_get_type (), NULL);
           gtk_icon_view_item_accessible_info_new (accessible,
                                                   obj,
@@ -8214,8 +8945,12 @@ gtk_icon_view_accessible_ref_child (AtkObject *accessible,
           a11y_item->text_buffer = gtk_text_buffer_new (NULL);
 
          gtk_icon_view_set_cell_data (icon_view, item);
-          gtk_text_buffer_set_text (a11y_item->text_buffer, 
-                                   get_text (icon_view, item), -1);
+          text = get_text (icon_view, item);
+          if (text)
+            {
+              gtk_text_buffer_set_text (a11y_item->text_buffer, text, -1);
+              g_free (text);
+            } 
 
           gtk_icon_view_item_accessible_set_visibility (a11y_item, FALSE);
           g_object_add_weak_pointer (G_OBJECT (widget), (gpointer) &(a11y_item->widget));
@@ -8342,11 +9077,44 @@ static void
 gtk_icon_view_accessible_model_row_changed (GtkTreeModel *tree_model,
                                             GtkTreePath  *path,
                                             GtkTreeIter  *iter,
-                                            gpointer     user_data)
+                                            gpointer      user_data)
 {
   AtkObject *atk_obj;
+  gint index;
+  GtkWidget *widget;
+  GtkIconView *icon_view;
+  GtkIconViewItem *item;
+  GtkIconViewAccessible *a11y_view;
+  GtkIconViewItemAccessible *a11y_item;
+  const gchar *name;
+  gchar *text;
 
   atk_obj = gtk_widget_get_accessible (GTK_WIDGET (user_data));
+  a11y_view = GTK_ICON_VIEW_ACCESSIBLE (atk_obj);
+  index = gtk_tree_path_get_indices(path)[0];
+  a11y_item = GTK_ICON_VIEW_ITEM_ACCESSIBLE (
+      gtk_icon_view_accessible_find_child (atk_obj, index));
+
+  if (a11y_item)
+    {
+      widget = GTK_ACCESSIBLE (atk_obj)->widget;
+      icon_view = GTK_ICON_VIEW (widget);
+      item = a11y_item->item;
+
+      name = gtk_icon_view_item_accessible_get_name (ATK_OBJECT (a11y_item));
+
+      if (!name || strcmp (name, "") == 0)
+        {
+          gtk_icon_view_set_cell_data (icon_view, item);
+          text = get_text (icon_view, item);
+          if (text)
+            {
+              gtk_text_buffer_set_text (a11y_item->text_buffer, text, -1);
+              g_free (text);
+            }
+        }
+    }
+
   g_signal_emit_by_name (atk_obj, "visible-data-changed");
 
   return;
@@ -8392,7 +9160,7 @@ gtk_icon_view_accessible_model_row_inserted (GtkTreeModel *tree_model,
       items = items->next;
     }
   gtk_icon_view_accessible_traverse_items (view, tmp_list);
-  g_signal_emit_by_name (atk_obj, "children_changed::add",
+  g_signal_emit_by_name (atk_obj, "children-changed::add",
                          index, NULL, NULL);
   return;
 }
@@ -8433,8 +9201,8 @@ gtk_icon_view_accessible_model_row_deleted (GtkTreeModel *tree_model,
         {
           if (tmp_list == NULL)
             tmp_list = items;
-          else    
-            info->index = item->item->index;
+            
+          info->index = item->item->index;
         }
 
       items = items->next;
@@ -8444,11 +9212,8 @@ gtk_icon_view_accessible_model_row_deleted (GtkTreeModel *tree_model,
     {
       info = deleted_item->data;
       gtk_icon_view_item_accessible_add_state (GTK_ICON_VIEW_ITEM_ACCESSIBLE (info->item), ATK_STATE_DEFUNCT, TRUE);
-    }
-  g_signal_emit_by_name (atk_obj, "children_changed::remove",
-                         index, NULL, NULL);
-  if (deleted_item)
-    {
+      g_signal_emit_by_name (atk_obj, "children-changed::remove",
+                             index, NULL, NULL);
       priv->items = g_list_remove_link (priv->items, deleted_item);
       g_free (info);
     }
@@ -8472,26 +9237,33 @@ gtk_icon_view_accessible_model_rows_reordered (GtkTreeModel *tree_model,
 {
   GtkIconViewAccessiblePrivate *priv;
   GtkIconViewItemAccessibleInfo *info;
-  GtkIconViewAccessible *view;
   GtkIconView *icon_view;
   GtkIconViewItemAccessible *item;
   GList *items;
   AtkObject *atk_obj;
+  gint *order;
+  gint length, i;
 
   atk_obj = gtk_widget_get_accessible (GTK_WIDGET (user_data));
   icon_view = GTK_ICON_VIEW (user_data);
-  view = GTK_ICON_VIEW_ACCESSIBLE (atk_obj);
   priv = gtk_icon_view_accessible_get_priv (atk_obj);
 
+  length = gtk_tree_model_iter_n_children (tree_model, NULL);
+
+  order = g_new (gint, length);
+  for (i = 0; i < length; i++)
+    order [new_order[i]] = i;
+
   items = priv->items;
   while (items)
     {
       info = items->data;
       item = GTK_ICON_VIEW_ITEM_ACCESSIBLE (info->item);
-      info->index = new_order[info->index];
+      info->index = order[info->index];
       item->item = g_list_nth_data (icon_view->priv->items, info->index);
       items = items->next;
     }
+  g_free (order);
   priv->items = g_list_sort (priv->items, 
                              (GCompareFunc)gtk_icon_view_accessible_item_compare);
 
@@ -8619,7 +9391,7 @@ gtk_icon_view_accessible_initialize (AtkObject *accessible,
                         icon_view);
     }
   g_signal_connect_after (data,
-                          "set_scroll_adjustments",
+                          "set-scroll-adjustments",
                           G_CALLBACK (gtk_icon_view_accessible_set_scroll_adjustments),
                           NULL);
   g_signal_connect (data,
@@ -8791,10 +9563,10 @@ static AtkObject*
 gtk_icon_view_accessible_ref_selection (AtkSelection *selection,
                                         gint          i)
 {
+  GList *l;
   GtkWidget *widget;
   GtkIconView *icon_view;
   GtkIconViewItem *item;
-  GList *l;
 
   widget = GTK_ACCESSIBLE (selection)->widget;
   if (widget == NULL)
@@ -8856,7 +9628,6 @@ gtk_icon_view_accessible_is_child_selected (AtkSelection *selection,
   GtkWidget *widget;
   GtkIconView *icon_view;
   GtkIconViewItem *item;
-  GList *l;
 
   widget = GTK_ACCESSIBLE (selection)->widget;
   if (widget == NULL)
@@ -8940,7 +9711,7 @@ gtk_icon_view_accessible_get_type (void)
 
   if (!type)
     {
-      static GTypeInfo tinfo =
+      GTypeInfo tinfo =
       {
         0, /* class size */
         (GBaseInitFunc) NULL, /* base init */
@@ -8953,13 +9724,13 @@ gtk_icon_view_accessible_get_type (void)
         (GInstanceInitFunc) NULL, /* instance init */
         NULL /* value table */
       };
-      static const GInterfaceInfo atk_component_info =
+      const GInterfaceInfo atk_component_info =
       {
         (GInterfaceInitFunc) atk_component_interface_init,
         (GInterfaceFinalizeFunc) NULL,
         NULL
       };
-      static const GInterfaceInfo atk_selection_info = 
+      const GInterfaceInfo atk_selection_info =
       {
         (GInterfaceInitFunc) gtk_icon_view_accessible_selection_interface_init,
         (GInterfaceFinalizeFunc) NULL,
@@ -8984,7 +9755,7 @@ gtk_icon_view_accessible_get_type (void)
       tinfo.instance_size = query.instance_size;
  
       type = g_type_register_static (derived_atk_type, 
-                                     "GtkIconViewAccessible"
+                                     I_("GtkIconViewAccessible")
                                      &tinfo, 0);
       g_type_add_interface_static (type, ATK_TYPE_COMPONENT,
                                    &atk_component_info);
@@ -9033,7 +9804,7 @@ gtk_icon_view_accessible_factory_get_type (void)
 
   if (!type)
     {
-      static const GTypeInfo tinfo =
+      const GTypeInfo tinfo =
       {
         sizeof (AtkObjectFactoryClass),
         NULL,           /* base_init */
@@ -9047,7 +9818,7 @@ gtk_icon_view_accessible_factory_get_type (void)
       };
 
       type = g_type_register_static (ATK_TYPE_OBJECT_FACTORY, 
-                                    "GtkIconViewAccessibleFactory",
+                                    I_("GtkIconViewAccessibleFactory"),
                                     &tinfo, 0);
     }
   return type;
@@ -9083,8 +9854,41 @@ gtk_icon_view_get_accessible (GtkWidget *widget)
                                       gtk_icon_view_accessible_factory_get_type ());
       first_time = FALSE;
     } 
-  return (* GTK_WIDGET_CLASS (gtk_icon_view_parent_class)->get_accessible) (widget);
+  return GTK_WIDGET_CLASS (gtk_icon_view_parent_class)->get_accessible (widget);
+}
+
+static gboolean
+gtk_icon_view_buildable_custom_tag_start (GtkBuildable  *buildable,
+                                         GtkBuilder    *builder,
+                                         GObject       *child,
+                                         const gchar   *tagname,
+                                         GMarkupParser *parser,
+                                         gpointer      *data)
+{
+  if (parent_buildable_iface->custom_tag_start (buildable, builder, child,
+                                               tagname, parser, data))
+    return TRUE;
+
+  return _gtk_cell_layout_buildable_custom_tag_start (buildable, builder, child,
+                                                     tagname, parser, data);
+}
+
+static void
+gtk_icon_view_buildable_custom_tag_end (GtkBuildable *buildable,
+                                       GtkBuilder   *builder,
+                                       GObject      *child,
+                                       const gchar  *tagname,
+                                       gpointer     *data)
+{
+  if (strcmp (tagname, "attributes") == 0)
+    _gtk_cell_layout_buildable_custom_tag_end (buildable, builder, child, tagname,
+                                              data);
+  else
+    parent_buildable_iface->custom_tag_end (buildable, builder, child, tagname,
+                                           data);
 }
 
+
+
 #define __GTK_ICON_VIEW_C__
 #include "gtkaliasdef.c"