]> 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 d8b0677f3c20be254f04794f9b33a328dc92cbcd..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,7 +219,9 @@ enum
   PROP_ROW_SPACING,
   PROP_COLUMN_SPACING,
   PROP_MARGIN,
-  PROP_REORDERABLE
+  PROP_REORDERABLE,
+  PROP_TOOLTIP_COLUMN,
+  PROP_ITEM_PADDING
 };
 
 /* GObject vfuncs */
@@ -393,6 +396,8 @@ static void                 gtk_icon_view_item_activate_cell             (GtkIco
                                                                          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,
@@ -444,8 +449,6 @@ static gboolean gtk_icon_view_maybe_begin_drag   (GtkIconView             *icon_
                                                  GdkEventMotion          *event);
 
 static void     remove_scroll_timeout            (GtkIconView *icon_view);
-static void     clear_dest_info                  (GtkIconView *icon_view);
-static void     clear_source_info                (GtkIconView *icon_view);
 
 static void     adjust_wrap_width                (GtkIconView     *icon_view,
                                                  GtkIconViewItem *item);
@@ -712,7 +715,6 @@ gtk_icon_view_class_init (GtkIconViewClass *klass)
                                                     0, G_MAXINT, 6,
                                                     GTK_PARAM_READWRITE));
 
-
   /**
    * GtkIconView:orientation:
    *
@@ -746,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",
@@ -763,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),
@@ -773,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),
@@ -783,6 +833,13 @@ 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_TYPE_FROM_CLASS (gobject_class),
@@ -792,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),
@@ -801,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),
@@ -810,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),
@@ -819,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),
@@ -828,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),
@@ -837,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),
@@ -850,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);
@@ -950,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);
   
@@ -967,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
@@ -1006,10 +1164,7 @@ gtk_icon_view_destroy (GtkObject *object)
       icon_view->priv->vadjustment = NULL;
     }
   
-  clear_dest_info (icon_view);
-  clear_source_info (icon_view);
-
-  (* GTK_OBJECT_CLASS (gtk_icon_view_parent_class)->destroy) (object);
+  GTK_OBJECT_CLASS (gtk_icon_view_parent_class)->destroy (object);
 }
 
 /* GObject methods */
@@ -1018,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);
 }
 
 
@@ -1074,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;
@@ -1131,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);
@@ -1203,9 +1373,7 @@ 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
@@ -1227,11 +1395,7 @@ static void
 gtk_icon_view_style_set (GtkWidget *widget,
                         GtkStyle *previous_style)
 {
-  GtkIconView *icon_view;
-
-  g_return_if_fail (GTK_IS_ICON_VIEW (widget));
-
-  icon_view = GTK_ICON_VIEW (widget);
+  GtkIconView *icon_view = GTK_ICON_VIEW (widget);
 
   if (GTK_WIDGET_REALIZED (widget))
     {
@@ -1246,11 +1410,9 @@ 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;
 
@@ -1281,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
        {
@@ -1383,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.);
 
@@ -1411,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;
@@ -1492,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;
 }
@@ -1646,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,
@@ -1737,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;
@@ -1751,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);
 
@@ -1809,11 +1992,11 @@ gtk_icon_view_stop_editing (GtkIconView *icon_view,
  * gtk_icon_view_set_cursor:
  * @icon_view: A #GtkIconView
  * @path: A #GtkTreePath
- * @cell: One of the cell renderers of @icon_view, 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.  
@@ -1932,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);
 
@@ -1946,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)
@@ -1990,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;
@@ -2016,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
        {
@@ -2036,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)
@@ -2096,7 +2288,7 @@ gtk_icon_view_key_press (GtkWidget      *widget,
       return TRUE;
     }
 
-  return (* GTK_WIDGET_CLASS (gtk_icon_view_parent_class)->key_press_event) (widget, event);
+  return GTK_WIDGET_CLASS (gtk_icon_view_parent_class)->key_press_event (widget, event);
 }
 
 static gboolean
@@ -2108,7 +2300,7 @@ gtk_icon_view_key_release (GtkWidget      *widget,
   if (icon_view->priv->doing_rubberband)
     return TRUE;
 
-  return (* GTK_WIDGET_CLASS (gtk_icon_view_parent_class)->key_press_event) (widget, event);
+  return GTK_WIDGET_CLASS (gtk_icon_view_parent_class)->key_press_event (widget, event);
 }
 
 static void
@@ -2261,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;
@@ -2296,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);
        }
     }
 
@@ -2339,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;
@@ -2350,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;
@@ -2444,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;
     }
@@ -2521,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); 
 
@@ -2545,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);
@@ -2682,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];
     }
@@ -2706,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];
 }
 
@@ -2741,17 +2946,16 @@ adjust_wrap_width (GtkIconView     *icon_view,
       else
        item_width = item->width;
 
-      if (item->width == -1)
-        {
-         if (item_width > 0)
-           wrap_width = item_width - pixbuf_width - icon_view->priv->spacing;
-         else
-           wrap_width = MAX (2 * pixbuf_width, 50);
-       }
-      else if (icon_view->priv->orientation == GTK_ORIENTATION_VERTICAL)
-       wrap_width = item_width;
-      else
-       wrap_width = item_width - pixbuf_width - icon_view->priv->spacing;
+      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);
@@ -2811,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
@@ -2839,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++)
@@ -2855,12 +3062,19 @@ gtk_icon_view_calculate_item_size2 (GtkIconView     *icon_view,
 
        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
          {
-           cell_area.width = item->width;
+            /* 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];
          }
        
@@ -2879,9 +3093,9 @@ gtk_icon_view_calculate_item_size2 (GtkIconView     *icon_view,
          }
        else
          {
-           if (item->box[info->position].width > item->width)
+           if (item->box[info->position].width > item->width - icon_view->priv->item_padding * 2)
              {
-               item->width = item->box[info->position].width;
+               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;
@@ -2897,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
@@ -2924,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;
@@ -2939,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; 
@@ -2967,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)
     {
@@ -3024,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
@@ -3184,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;
@@ -3199,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); 
     }
 }
@@ -3246,6 +3474,9 @@ 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;
@@ -3260,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  &&
@@ -3275,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;
@@ -3311,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);
 }
 
 
@@ -3333,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);
@@ -3559,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);
 
@@ -3572,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);
 }
@@ -3633,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;
 }
 
@@ -3671,7 +3903,6 @@ find_cell (GtkIconView     *icon_view,
 {
   gint n_focusable;
   gint *focusable;
-  gint first_text;
   gint current;
   gint i, k;
   GList *l;
@@ -3684,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++)
@@ -3696,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)
          {
@@ -3712,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)
     {
@@ -3830,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);
        }
     }
@@ -4453,8 +4684,8 @@ 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);
 
@@ -4520,6 +4751,7 @@ gtk_icon_view_new_with_model (GtkTreeModel *model)
 
 /**
  * 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
@@ -4649,6 +4881,7 @@ gtk_icon_view_get_item_at_pos (GtkIconView      *icon_view,
  * @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
@@ -4674,6 +4907,8 @@ gtk_icon_view_set_tooltip_item (GtkIconView     *icon_view,
  * 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
@@ -4685,6 +4920,7 @@ gtk_icon_view_set_tooltip_cell (GtkIconView     *icon_view,
   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));
@@ -4712,8 +4948,6 @@ gtk_icon_view_set_tooltip_cell (GtkIconView     *icon_view,
   
   if (icon_view->priv->bin_window)
     {
-      gint x, y;
-
       gdk_window_get_position (icon_view->priv->bin_window, &x, &y);
       rect.x += x;
       rect.y += y; 
@@ -4722,6 +4956,182 @@ gtk_icon_view_set_tooltip_cell (GtkIconView     *icon_view,
   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:
  * @icon_view: A #GtkIconView
@@ -4856,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.
  *
@@ -4948,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);
 
@@ -5121,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);
@@ -5385,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
  **/
@@ -5861,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,
@@ -5892,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,
@@ -6128,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;
 
@@ -6248,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;
@@ -6294,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);
@@ -6374,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);
@@ -6414,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);
@@ -6531,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))
@@ -6584,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)
@@ -6659,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
  **/
@@ -6673,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;
@@ -6692,8 +7126,9 @@ gtk_icon_view_enable_model_drag_source (GtkIconView              *icon_view,
  * @n_targets: the number of items in @targets
  * @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
  **/
@@ -6705,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);
-
-  clear_dest_info (icon_view);
+  gtk_drag_dest_set (GTK_WIDGET (icon_view), 0, targets, n_targets, actions);
 
-  icon_view->priv->dest_targets = gtk_target_list_new (targets, n_targets);
   icon_view->priv->dest_actions = actions;
 
   icon_view->priv->dest_set = TRUE;
@@ -6721,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
  **/
@@ -6733,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);
@@ -6743,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
  **/
@@ -6755,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);
@@ -6765,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
@@ -6796,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)
     {
@@ -7021,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
@@ -7252,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;
 }
@@ -8051,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;
@@ -8083,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;
@@ -8110,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;
@@ -8286,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);
 }
@@ -8328,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,
@@ -8637,12 +9077,45 @@ 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));
-  g_signal_emit_by_name (atk_obj, "visible_data_changed");
+  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;
 }
@@ -8687,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;
 }
@@ -8728,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;
@@ -8739,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);
     }
@@ -8771,20 +9241,29 @@ gtk_icon_view_accessible_model_rows_reordered (GtkTreeModel *tree_model,
   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);
   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);
 
@@ -8810,16 +9289,16 @@ gtk_icon_view_accessible_connect_model_signals (GtkIconView *icon_view)
   GObject *obj;
 
   obj = G_OBJECT (icon_view->priv->model);
-  g_signal_connect_data (obj, "row_changed",
+  g_signal_connect_data (obj, "row-changed",
                          (GCallback) gtk_icon_view_accessible_model_row_changed,
                          icon_view, NULL, 0);
-  g_signal_connect_data (obj, "row_inserted",
+  g_signal_connect_data (obj, "row-inserted",
                          (GCallback) gtk_icon_view_accessible_model_row_inserted, 
                          icon_view, NULL, G_CONNECT_AFTER);
-  g_signal_connect_data (obj, "row_deleted",
+  g_signal_connect_data (obj, "row-deleted",
                          (GCallback) gtk_icon_view_accessible_model_row_deleted, 
                          icon_view, NULL, G_CONNECT_AFTER);
-  g_signal_connect_data (obj, "rows_reordered",
+  g_signal_connect_data (obj, "rows-reordered",
                          (GCallback) gtk_icon_view_accessible_model_rows_reordered, 
                          icon_view, NULL, G_CONNECT_AFTER);
 }
@@ -8912,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,
@@ -9232,7 +9711,7 @@ gtk_icon_view_accessible_get_type (void)
 
   if (!type)
     {
-      static GTypeInfo tinfo =
+      GTypeInfo tinfo =
       {
         0, /* class size */
         (GBaseInitFunc) NULL, /* base init */
@@ -9245,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,
@@ -9375,7 +9854,7 @@ 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