gint tooltip_column;
- guint draw_focus : 1;
-
/* Drag-and-drop. */
GdkModifierType start_button_mask;
gint pressed_button;
guint empty_view_drop :1;
guint ctrl_pressed : 1;
- guint shift_pressed : 1;
+ guint shift_pressed : 1;
+
+ guint draw_focus : 1;
};
/* Signals */
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.);
* 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.
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;
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 &&
{
if (cell_at_pos)
*cell_at_pos = info;
-
+
return item;
}
}
- if (cell_at_pos)
- *cell_at_pos = NULL;
-
if (only_in_cell)
return NULL;
}
/**
* 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.
*
*
* To free the return value, use:
* |[
- * g_list_foreach (list, gtk_tree_path_free, NULL);
+ * g_list_foreach (list, (GFunc)gtk_tree_path_free, NULL);
* g_list_free (list);
* ]|
*
- * 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
**/
/**
* gtk_icon_view_set_item_padding:
* @icon_view: a #GtkIconView
- * @column_spacing: the item padding
- *
- * Sets the ::item-padding property which specifies the padding
+ * @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
+void
gtk_icon_view_set_item_padding (GtkIconView *icon_view,
gint item_padding)
{
/**
* 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
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;
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,
if (!type)
{
- static GTypeInfo tinfo =
+ GTypeInfo tinfo =
{
0, /* class size */
(GBaseInitFunc) NULL, /* base init */
(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,