icon_view->priv->pixbuf_cell = -1;
icon_view->priv->tooltip_column = -1;
- GTK_WIDGET_SET_FLAGS (icon_view, GTK_CAN_FOCUS);
+ gtk_widget_set_can_focus (GTK_WIDGET (icon_view), TRUE);
gtk_icon_view_set_adjustments (icon_view, NULL, NULL);
icon_view = GTK_ICON_VIEW (widget);
- GTK_WIDGET_SET_FLAGS (widget, GTK_REALIZED);
+ gtk_widget_set_realized (widget, TRUE);
/* Make the main, clipping window */
attributes.window_type = GDK_WINDOW_CHILD;
{
GtkIconView *icon_view = GTK_ICON_VIEW (widget);
- if (GTK_WIDGET_REALIZED (widget))
+ if (gtk_widget_get_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]);
{
GtkIconView *icon_view = GTK_ICON_VIEW (widget);
- if (GTK_WIDGET_REALIZED (widget))
+ if (gtk_widget_get_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]);
tmp_list = tmp_list->next;
- if (GTK_WIDGET_VISIBLE (child->widget))
+ if (gtk_widget_get_visible (child->widget))
gtk_widget_size_request (child->widget, &child_requisition);
}
}
widget->allocation = *allocation;
- if (GTK_WIDGET_REALIZED (widget))
+ if (gtk_widget_get_realized (widget))
{
gdk_window_move_resize (widget->window,
allocation->x, allocation->y,
if (vadjustment->value > vadjustment->upper - vadjustment->page_size)
gtk_adjustment_set_value (vadjustment, MAX (0, vadjustment->upper - vadjustment->page_size));
- if (GTK_WIDGET_REALIZED (widget) &&
+ if (gtk_widget_get_realized (widget) &&
icon_view->priv->scroll_to_path)
{
GtkTreePath *path;
case GTK_ICON_VIEW_DROP_INTO:
gtk_paint_focus (widget->style,
icon_view->priv->bin_window,
- GTK_WIDGET_STATE (widget),
+ gtk_widget_get_state (widget),
NULL,
widget,
"iconview-drop-indicator",
case GTK_ICON_VIEW_DROP_ABOVE:
gtk_paint_focus (widget->style,
icon_view->priv->bin_window,
- GTK_WIDGET_STATE (widget),
+ gtk_widget_get_state (widget),
NULL,
widget,
"iconview-drop-indicator",
case GTK_ICON_VIEW_DROP_LEFT:
gtk_paint_focus (widget->style,
icon_view->priv->bin_window,
- GTK_WIDGET_STATE (widget),
+ gtk_widget_get_state (widget),
NULL,
widget,
"iconview-drop-indicator",
case GTK_ICON_VIEW_DROP_BELOW:
gtk_paint_focus (widget->style,
icon_view->priv->bin_window,
- GTK_WIDGET_STATE (widget),
+ gtk_widget_get_state (widget),
NULL,
widget,
"iconview-drop-indicator",
case GTK_ICON_VIEW_DROP_RIGHT:
gtk_paint_focus (widget->style,
icon_view->priv->bin_window,
- GTK_WIDGET_STATE (widget),
+ gtk_widget_get_state (widget),
NULL,
widget,
"iconview-drop-indicator",
icon_view->priv->children = g_list_append (icon_view->priv->children, child);
- if (GTK_WIDGET_REALIZED (icon_view))
+ if (gtk_widget_get_realized (GTK_WIDGET (icon_view)))
gtk_widget_set_parent_window (child->widget, icon_view->priv->bin_window);
gtk_widget_set_parent (widget, GTK_WIDGET (icon_view));
info->editing = FALSE;
}
- if (GTK_WIDGET_HAS_FOCUS (editable))
+ if (gtk_widget_has_focus (GTK_WIDGET (editable)))
gtk_widget_grab_focus (GTK_WIDGET (icon_view));
g_signal_handlers_disconnect_by_func (editable,
* 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.
/**
* gtk_icon_view_get_cursor:
* @icon_view: A #GtkIconView
- * @path: Return location for the current cursor path, or %NULL
- * @cell: Return location the current focus cell, or %NULL
+ * @path: (allow-none): Return location for the current cursor path, or %NULL
+ * @cell: (allow-none): Return location the current focus cell, or %NULL
*
* Fills in @path and @cell with the current cursor path and cell.
* If the cursor isn't currently set, then *@path will be %NULL.
if (event->window != icon_view->priv->bin_window)
return FALSE;
- if (!GTK_WIDGET_HAS_FOCUS (widget))
+ if (!gtk_widget_has_focus (widget))
gtk_widget_grab_focus (widget);
if (event->button == 1 && event->type == GDK_BUTTON_PRESS)
gtk_icon_view_adjustment_changed (GtkAdjustment *adjustment,
GtkIconView *icon_view)
{
- if (GTK_WIDGET_REALIZED (icon_view))
+ if (gtk_widget_get_realized (GTK_WIDGET (icon_view)))
{
gdk_window_move (icon_view->priv->bin_window,
- icon_view->priv->hadjustment->value,
icon_view->priv->height != widget->requisition.height)
gtk_widget_queue_resize_no_redraw (widget);
- if (GTK_WIDGET_REALIZED (icon_view))
+ if (gtk_widget_get_realized (GTK_WIDGET (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));
if (item->selected)
{
flags = GTK_CELL_RENDERER_SELECTED;
- if (GTK_WIDGET_HAS_FOCUS (icon_view))
+ if (gtk_widget_has_focus (GTK_WIDGET (icon_view)))
state = GTK_STATE_SELECTED;
else
state = GTK_STATE_ACTIVE;
}
if (draw_focus &&
- GTK_WIDGET_HAS_FOCUS (icon_view) &&
+ gtk_widget_has_focus (GTK_WIDGET (icon_view)) &&
item == icon_view->priv->cursor_item)
{
for (l = icon_view->priv->cell_list, i = 0; l; l = l->next, i++)
step == GTK_MOVEMENT_PAGES ||
step == GTK_MOVEMENT_BUFFER_ENDS, FALSE);
- if (!GTK_WIDGET_HAS_FOCUS (GTK_WIDGET (icon_view)))
+ if (!gtk_widget_has_focus (GTK_WIDGET (icon_view)))
return FALSE;
gtk_icon_view_stop_editing (icon_view, FALSE);
gboolean dirty = FALSE;
gint step;
- if (!GTK_WIDGET_HAS_FOCUS (icon_view))
+ if (!gtk_widget_has_focus (GTK_WIDGET (icon_view)))
return;
if (!icon_view->priv->cursor_item)
GtkIconViewItem *item;
gboolean dirty = FALSE;
- if (!GTK_WIDGET_HAS_FOCUS (icon_view))
+ if (!gtk_widget_has_focus (GTK_WIDGET (icon_view)))
return;
if (!icon_view->priv->cursor_item)
gboolean dirty = FALSE;
gint step;
- if (!GTK_WIDGET_HAS_FOCUS (icon_view))
+ if (!gtk_widget_has_focus (GTK_WIDGET (icon_view)))
return;
if (!icon_view->priv->cursor_item)
GList *list;
gboolean dirty = FALSE;
- if (!GTK_WIDGET_HAS_FOCUS (icon_view))
+ if (!gtk_widget_has_focus (GTK_WIDGET (icon_view)))
return;
if (count < 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 (!item || item->width < 0 ||
+ !gtk_widget_get_realized (GTK_WIDGET (icon_view)))
{
if (icon_view->priv->scroll_to_path)
gtk_tree_row_reference_free (icon_view->priv->scroll_to_path);
* @icon_view: A #GtkIconView.
* @x: The x position to be identified
* @y: The y position to be identified
- * @path: Return location for the path, or %NULL
+ * @path: (allow-none): Return location for the path, or %NULL
* @cell: Return location for the renderer responsible for the cell
* at (@x, @y), or %NULL
*
* @icon_view: a #GtkIconView
* @tooltip: a #GtkTooltip
* @path: a #GtkTreePath
- * @cell: a #GtkCellRenderer or %NULL
+ * @cell: (allow-none): 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().
* @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
+ * @model: (allow-none): a pointer to receive a #GtkTreeModel or %NULL
+ * @path: (allow-none): a pointer to receive a #GtkTreePath or %NULL
+ * @iter: (allow-none): 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
/**
* gtk_icon_view_get_visible_range:
* @icon_view: A #GtkIconView
- * @start_path: Return location for start of region, or %NULL
- * @end_path: Return location for end of region, or %NULL
+ * @start_path: (allow-none): Return location for start of region, or %NULL
+ * @end_path: (allow-none): Return location for end of region, or %NULL
*
* Sets @start_path and @end_path to be the first and last visible path.
* Note that there may be invisible paths in between.
/**
* 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.
*
g_object_notify (G_OBJECT (icon_view), "model");
- if (GTK_WIDGET_REALIZED (icon_view))
+ if (gtk_widget_get_realized (GTK_WIDGET (icon_view)))
gtk_widget_queue_resize (GTK_WIDGET (icon_view));
}
*
* 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_icon_view_get_drag_dest_item:
* @icon_view: a #GtkIconView
- * @path: Return location for the path of the highlighted item, or %NULL.
- * @pos: Return location for the drop position, or %NULL
+ * @path: (allow-none): Return location for the path of the highlighted item, or %NULL.
+ * @pos: (allow-none): Return location for the drop position, or %NULL
*
* Gets information about the item that is highlighted for feedback.
*
* @icon_view: a #GtkIconView
* @drag_x: the position to determine the destination item for
* @drag_y: the position to determine the destination item for
- * @path: Return location for the path of the item, or %NULL.
- * @pos: Return location for the drop position, or %NULL
+ * @path: (allow-none): Return location for the path of the item, or %NULL.
+ * @pos: (allow-none): Return location for the drop position, or %NULL
*
* Determines the destination item for a given position.
*
widget = GTK_WIDGET (icon_view);
- if (!GTK_WIDGET_REALIZED (widget))
+ if (!gtk_widget_get_realized (widget))
return NULL;
index = gtk_tree_path_get_indices (path)[0];
cairo_set_line_width (cr, 1.);
gdk_cairo_set_source_color
- (cr, &widget->style->base[GTK_WIDGET_STATE (widget)]);
+ (cr, &widget->style->base[gtk_widget_get_state (widget)]);
cairo_rectangle (cr, 0, 0, item->width + 2, item->height + 2);
cairo_fill (cr);
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;