2004-07-13 05:15:49 +00:00
|
|
|
/* gtkiconview.c
|
2004-07-04 15:56:55 +00:00
|
|
|
* Copyright (C) 2002, 2004 Anders Carlsson <andersca@gnu.org>
|
2002-04-30 17:08:52 +00:00
|
|
|
*
|
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Library General Public
|
|
|
|
* License as published by the Free Software Foundation; either
|
|
|
|
* version 2 of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This library is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* Library General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Library General Public
|
|
|
|
* License along with this library; if not, write to the
|
|
|
|
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
|
|
|
* Boston, MA 02111-1307, USA.
|
|
|
|
*/
|
|
|
|
|
2008-06-22 14:28:52 +00:00
|
|
|
#include "config.h"
|
2011-01-04 17:21:41 +00:00
|
|
|
|
2002-04-30 17:08:52 +00:00
|
|
|
#include <string.h>
|
|
|
|
|
2004-08-12 05:37:10 +00:00
|
|
|
#include <atk/atk.h>
|
|
|
|
|
2011-02-17 06:30:33 +00:00
|
|
|
#include "gtkaccessibleprivate.h"
|
2004-07-04 15:56:55 +00:00
|
|
|
#include "gtkiconview.h"
|
2005-05-02 20:28:37 +00:00
|
|
|
#include "gtkcelllayout.h"
|
|
|
|
#include "gtkcellrenderer.h"
|
2010-12-10 08:15:39 +00:00
|
|
|
#include "gtkcellareabox.h"
|
2010-12-12 07:29:41 +00:00
|
|
|
#include "gtkcellareacontext.h"
|
2005-05-02 20:28:37 +00:00
|
|
|
#include "gtkcellrenderertext.h"
|
|
|
|
#include "gtkcellrendererpixbuf.h"
|
2010-12-12 07:29:41 +00:00
|
|
|
#include "gtkorientable.h"
|
2004-07-04 15:56:55 +00:00
|
|
|
#include "gtkmarshalers.h"
|
|
|
|
#include "gtkbindings.h"
|
|
|
|
#include "gtkdnd.h"
|
|
|
|
#include "gtkmain.h"
|
|
|
|
#include "gtkintl.h"
|
2004-08-12 05:37:10 +00:00
|
|
|
#include "gtkaccessible.h"
|
|
|
|
#include "gtkwindow.h"
|
2005-05-02 20:28:37 +00:00
|
|
|
#include "gtkentry.h"
|
|
|
|
#include "gtkcombobox.h"
|
2004-08-12 05:37:10 +00:00
|
|
|
#include "gtktextbuffer.h"
|
2010-10-18 04:21:39 +00:00
|
|
|
#include "gtkscrollable.h"
|
2010-09-07 22:25:47 +00:00
|
|
|
#include "gtksizerequest.h"
|
2005-05-06 04:14:32 +00:00
|
|
|
#include "gtktreednd.h"
|
2011-01-04 19:51:19 +00:00
|
|
|
#include "gtktypebuiltins.h"
|
2005-03-22 02:14:55 +00:00
|
|
|
#include "gtkprivate.h"
|
2002-04-30 17:08:52 +00:00
|
|
|
|
2010-06-08 23:44:56 +00:00
|
|
|
/**
|
|
|
|
* SECTION:gtkiconview
|
|
|
|
* @title: GtkIconView
|
|
|
|
* @short_description: A widget which displays a list of icons in a grid
|
|
|
|
*
|
2010-10-21 10:54:08 +00:00
|
|
|
* #GtkIconView provides an alternative view on a #GtkTreeModel.
|
2010-06-08 23:44:56 +00:00
|
|
|
* It displays the model as a grid of icons with labels. Like
|
|
|
|
* #GtkTreeView, it allows to select one or multiple items
|
|
|
|
* (depending on the selection mode, see gtk_icon_view_set_selection_mode()).
|
|
|
|
* In addition to selection with the arrow keys, #GtkIconView supports
|
|
|
|
* rubberband selection, which is controlled by dragging the pointer.
|
2010-10-21 10:54:08 +00:00
|
|
|
*
|
|
|
|
* Note that if the tree model is backed by an actual tree store (as
|
|
|
|
* opposed to a flat list where the mapping to icons is obvious),
|
|
|
|
* #GtkIconView will only display the first level of the tree and
|
|
|
|
* ignore the tree's branches.
|
2010-06-08 23:44:56 +00:00
|
|
|
*/
|
|
|
|
|
2005-05-06 04:14:32 +00:00
|
|
|
#define SCROLL_EDGE_SIZE 15
|
|
|
|
|
2010-10-17 08:27:41 +00:00
|
|
|
#define GTK_ICON_VIEW_PRIORITY_LAYOUT (GDK_PRIORITY_REDRAW + 5)
|
|
|
|
|
2005-05-02 20:28:37 +00:00
|
|
|
typedef struct _GtkIconViewItem GtkIconViewItem;
|
|
|
|
struct _GtkIconViewItem
|
2002-04-30 17:08:52 +00:00
|
|
|
{
|
2010-12-13 08:41:50 +00:00
|
|
|
/* First member is always the rectangle so it
|
|
|
|
* can be cast to a rectangle. */
|
|
|
|
GdkRectangle cell_area;
|
|
|
|
|
Update icon list to use the tree model instead.
2004-07-02 Anders Carlsson <andersca@gnome.org>
* libegg/iconlist/eggiconlist.c: (egg_icon_list_class_init),
(egg_icon_list_init), (egg_icon_list_destroy),
(egg_icon_list_finalize), (egg_icon_list_set_property),
(egg_icon_list_get_property), (egg_icon_list_button_press),
(egg_icon_list_select_first_matching_item),
(egg_icon_list_maybe_begin_dragging_items),
(egg_icon_list_real_toggle_cursor_item),
(egg_icon_list_calculate_item_size),
(egg_icon_list_invalidate_sizes), (egg_icon_list_paint_item),
(egg_icon_list_item_new), (egg_icon_list_item_unref),
(egg_icon_list_get_item_text), (egg_icon_list_get_item_icon),
(egg_icon_list_get_item_at_pos), (egg_icon_list_get_path_at_pos),
(egg_icon_list_selected_foreach), (egg_icon_list_select_path),
(egg_icon_list_unselect_path), (egg_icon_list_path_is_selected),
(egg_icon_list_item_activated), (egg_icon_list_get_items),
(egg_icon_list_row_changed), (egg_icon_list_row_inserted),
(egg_icon_list_row_deleted), (egg_icon_list_rows_reordered),
(egg_icon_list_build_items), (egg_icon_list_set_model),
(egg_icon_list_get_model), (egg_icon_list_set_text_column),
(egg_icon_list_set_pixbuf_column):
* libegg/iconlist/eggiconlist.h:
* libegg/iconlist/testiconlist.c: (fill_model), (create_model),
(foreach_selected_print), (item_removed), (remove_selected),
(item_cb), (do_popup_menu), (main):
* libegg/util/eggmarshalers.list:
Update icon list to use the tree model instead.
2004-07-02 12:04:49 +00:00
|
|
|
GtkTreeIter iter;
|
2005-05-02 20:28:37 +00:00
|
|
|
gint index;
|
2002-04-30 17:08:52 +00:00
|
|
|
|
2004-06-18 05:17:01 +00:00
|
|
|
gint row, col;
|
|
|
|
|
2002-04-30 17:08:52 +00:00
|
|
|
guint selected : 1;
|
|
|
|
guint selected_before_rubberbanding : 1;
|
2005-08-20 20:16:34 +00:00
|
|
|
|
2005-05-02 20:28:37 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
typedef struct _GtkIconViewChild GtkIconViewChild;
|
|
|
|
struct _GtkIconViewChild
|
|
|
|
{
|
2010-12-12 07:29:41 +00:00
|
|
|
GtkWidget *widget;
|
|
|
|
GdkRectangle area;
|
2005-05-02 20:28:37 +00:00
|
|
|
};
|
2002-04-30 17:08:52 +00:00
|
|
|
|
2004-07-04 15:56:55 +00:00
|
|
|
struct _GtkIconViewPrivate
|
2002-04-30 17:08:52 +00:00
|
|
|
{
|
2010-12-10 08:15:39 +00:00
|
|
|
GtkCellArea *cell_area;
|
|
|
|
GtkCellAreaContext *cell_area_context;
|
|
|
|
|
2010-12-12 10:59:41 +00:00
|
|
|
gulong add_editable_id;
|
|
|
|
gulong remove_editable_id;
|
|
|
|
gulong context_changed_id;
|
|
|
|
|
2010-12-12 15:24:26 +00:00
|
|
|
GPtrArray *row_contexts;
|
|
|
|
|
2002-04-30 17:08:52 +00:00
|
|
|
gint width, height;
|
|
|
|
|
|
|
|
GtkSelectionMode selection_mode;
|
|
|
|
|
2011-04-12 16:33:24 +00:00
|
|
|
guint layout_idle_id;
|
|
|
|
|
2002-04-30 17:08:52 +00:00
|
|
|
GdkWindow *bin_window;
|
|
|
|
|
2005-05-02 20:28:37 +00:00
|
|
|
GList *children;
|
|
|
|
|
Update icon list to use the tree model instead.
2004-07-02 Anders Carlsson <andersca@gnome.org>
* libegg/iconlist/eggiconlist.c: (egg_icon_list_class_init),
(egg_icon_list_init), (egg_icon_list_destroy),
(egg_icon_list_finalize), (egg_icon_list_set_property),
(egg_icon_list_get_property), (egg_icon_list_button_press),
(egg_icon_list_select_first_matching_item),
(egg_icon_list_maybe_begin_dragging_items),
(egg_icon_list_real_toggle_cursor_item),
(egg_icon_list_calculate_item_size),
(egg_icon_list_invalidate_sizes), (egg_icon_list_paint_item),
(egg_icon_list_item_new), (egg_icon_list_item_unref),
(egg_icon_list_get_item_text), (egg_icon_list_get_item_icon),
(egg_icon_list_get_item_at_pos), (egg_icon_list_get_path_at_pos),
(egg_icon_list_selected_foreach), (egg_icon_list_select_path),
(egg_icon_list_unselect_path), (egg_icon_list_path_is_selected),
(egg_icon_list_item_activated), (egg_icon_list_get_items),
(egg_icon_list_row_changed), (egg_icon_list_row_inserted),
(egg_icon_list_row_deleted), (egg_icon_list_rows_reordered),
(egg_icon_list_build_items), (egg_icon_list_set_model),
(egg_icon_list_get_model), (egg_icon_list_set_text_column),
(egg_icon_list_set_pixbuf_column):
* libegg/iconlist/eggiconlist.h:
* libegg/iconlist/testiconlist.c: (fill_model), (create_model),
(foreach_selected_print), (item_removed), (remove_selected),
(item_cb), (do_popup_menu), (main):
* libegg/util/eggmarshalers.list:
Update icon list to use the tree model instead.
2004-07-02 12:04:49 +00:00
|
|
|
GtkTreeModel *model;
|
2011-04-12 16:33:24 +00:00
|
|
|
|
2002-04-30 17:08:52 +00:00
|
|
|
GList *items;
|
2011-04-12 16:33:24 +00:00
|
|
|
|
2002-04-30 17:08:52 +00:00
|
|
|
GtkAdjustment *hadjustment;
|
|
|
|
GtkAdjustment *vadjustment;
|
|
|
|
|
|
|
|
gint rubberband_x1, rubberband_y1;
|
|
|
|
gint rubberband_x2, rubberband_y2;
|
2010-05-25 22:38:44 +00:00
|
|
|
GdkDevice *rubberband_device;
|
2004-05-31 19:44:01 +00:00
|
|
|
|
|
|
|
guint scroll_timeout_id;
|
|
|
|
gint scroll_value_diff;
|
|
|
|
gint event_last_x, event_last_y;
|
|
|
|
|
2004-07-04 15:56:55 +00:00
|
|
|
GtkIconViewItem *anchor_item;
|
|
|
|
GtkIconViewItem *cursor_item;
|
2004-06-18 05:17:01 +00:00
|
|
|
|
2004-07-04 15:56:55 +00:00
|
|
|
GtkIconViewItem *last_single_clicked;
|
2004-07-03 20:36:01 +00:00
|
|
|
|
2010-09-02 03:03:48 +00:00
|
|
|
GtkOrientation item_orientation;
|
2004-12-14 06:39:45 +00:00
|
|
|
|
|
|
|
gint columns;
|
|
|
|
gint item_width;
|
|
|
|
gint spacing;
|
|
|
|
gint row_spacing;
|
|
|
|
gint column_spacing;
|
|
|
|
gint margin;
|
2009-08-07 03:56:30 +00:00
|
|
|
gint item_padding;
|
2005-05-02 20:28:37 +00:00
|
|
|
|
|
|
|
gint text_column;
|
|
|
|
gint markup_column;
|
|
|
|
gint pixbuf_column;
|
2011-04-12 16:33:24 +00:00
|
|
|
gint tooltip_column;
|
2005-05-02 20:28:37 +00:00
|
|
|
|
2010-12-12 10:59:41 +00:00
|
|
|
GtkCellRenderer *pixbuf_cell;
|
|
|
|
GtkCellRenderer *text_cell;
|
2005-05-06 04:14:32 +00:00
|
|
|
|
|
|
|
/* Drag-and-drop. */
|
|
|
|
GdkModifierType start_button_mask;
|
|
|
|
gint pressed_button;
|
|
|
|
gint press_start_x;
|
|
|
|
gint press_start_y;
|
|
|
|
|
|
|
|
GdkDragAction source_actions;
|
|
|
|
GdkDragAction dest_actions;
|
|
|
|
|
|
|
|
GtkTreeRowReference *dest_item;
|
|
|
|
GtkIconViewDropPosition dest_pos;
|
|
|
|
|
2005-08-20 20:16:34 +00:00
|
|
|
/* scroll to */
|
|
|
|
GtkTreeRowReference *scroll_to_path;
|
|
|
|
gfloat scroll_to_row_align;
|
|
|
|
gfloat scroll_to_col_align;
|
|
|
|
guint scroll_to_use_align : 1;
|
|
|
|
|
2005-05-06 04:14:32 +00:00
|
|
|
guint source_set : 1;
|
|
|
|
guint dest_set : 1;
|
|
|
|
guint reorderable : 1;
|
|
|
|
guint empty_view_drop :1;
|
|
|
|
|
|
|
|
guint ctrl_pressed : 1;
|
2009-09-16 05:53:22 +00:00
|
|
|
guint shift_pressed : 1;
|
|
|
|
|
|
|
|
guint draw_focus : 1;
|
2010-10-26 00:59:02 +00:00
|
|
|
|
|
|
|
/* GtkScrollablePolicy needs to be checked when
|
|
|
|
* driving the scrollable adjustment values */
|
|
|
|
guint hscroll_policy : 1;
|
|
|
|
guint vscroll_policy : 1;
|
2010-12-12 10:59:41 +00:00
|
|
|
|
|
|
|
guint doing_rubberband : 1;
|
|
|
|
|
2002-04-30 17:08:52 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
/* Signals */
|
|
|
|
enum
|
|
|
|
{
|
|
|
|
ITEM_ACTIVATED,
|
|
|
|
SELECTION_CHANGED,
|
|
|
|
SELECT_ALL,
|
|
|
|
UNSELECT_ALL,
|
|
|
|
SELECT_CURSOR_ITEM,
|
|
|
|
TOGGLE_CURSOR_ITEM,
|
|
|
|
MOVE_CURSOR,
|
2004-07-04 23:19:46 +00:00
|
|
|
ACTIVATE_CURSOR_ITEM,
|
2002-04-30 17:08:52 +00:00
|
|
|
LAST_SIGNAL
|
|
|
|
};
|
|
|
|
|
|
|
|
/* Properties */
|
|
|
|
enum
|
|
|
|
{
|
|
|
|
PROP_0,
|
Update icon list to use the tree model instead.
2004-07-02 Anders Carlsson <andersca@gnome.org>
* libegg/iconlist/eggiconlist.c: (egg_icon_list_class_init),
(egg_icon_list_init), (egg_icon_list_destroy),
(egg_icon_list_finalize), (egg_icon_list_set_property),
(egg_icon_list_get_property), (egg_icon_list_button_press),
(egg_icon_list_select_first_matching_item),
(egg_icon_list_maybe_begin_dragging_items),
(egg_icon_list_real_toggle_cursor_item),
(egg_icon_list_calculate_item_size),
(egg_icon_list_invalidate_sizes), (egg_icon_list_paint_item),
(egg_icon_list_item_new), (egg_icon_list_item_unref),
(egg_icon_list_get_item_text), (egg_icon_list_get_item_icon),
(egg_icon_list_get_item_at_pos), (egg_icon_list_get_path_at_pos),
(egg_icon_list_selected_foreach), (egg_icon_list_select_path),
(egg_icon_list_unselect_path), (egg_icon_list_path_is_selected),
(egg_icon_list_item_activated), (egg_icon_list_get_items),
(egg_icon_list_row_changed), (egg_icon_list_row_inserted),
(egg_icon_list_row_deleted), (egg_icon_list_rows_reordered),
(egg_icon_list_build_items), (egg_icon_list_set_model),
(egg_icon_list_get_model), (egg_icon_list_set_text_column),
(egg_icon_list_set_pixbuf_column):
* libegg/iconlist/eggiconlist.h:
* libegg/iconlist/testiconlist.c: (fill_model), (create_model),
(foreach_selected_print), (item_removed), (remove_selected),
(item_cb), (do_popup_menu), (main):
* libegg/util/eggmarshalers.list:
Update icon list to use the tree model instead.
2004-07-02 12:04:49 +00:00
|
|
|
PROP_PIXBUF_COLUMN,
|
|
|
|
PROP_TEXT_COLUMN,
|
2010-09-02 03:03:48 +00:00
|
|
|
PROP_MARKUP_COLUMN,
|
2002-04-30 17:08:52 +00:00
|
|
|
PROP_SELECTION_MODE,
|
2010-09-02 03:03:48 +00:00
|
|
|
PROP_ITEM_ORIENTATION,
|
Update icon list to use the tree model instead.
2004-07-02 Anders Carlsson <andersca@gnome.org>
* libegg/iconlist/eggiconlist.c: (egg_icon_list_class_init),
(egg_icon_list_init), (egg_icon_list_destroy),
(egg_icon_list_finalize), (egg_icon_list_set_property),
(egg_icon_list_get_property), (egg_icon_list_button_press),
(egg_icon_list_select_first_matching_item),
(egg_icon_list_maybe_begin_dragging_items),
(egg_icon_list_real_toggle_cursor_item),
(egg_icon_list_calculate_item_size),
(egg_icon_list_invalidate_sizes), (egg_icon_list_paint_item),
(egg_icon_list_item_new), (egg_icon_list_item_unref),
(egg_icon_list_get_item_text), (egg_icon_list_get_item_icon),
(egg_icon_list_get_item_at_pos), (egg_icon_list_get_path_at_pos),
(egg_icon_list_selected_foreach), (egg_icon_list_select_path),
(egg_icon_list_unselect_path), (egg_icon_list_path_is_selected),
(egg_icon_list_item_activated), (egg_icon_list_get_items),
(egg_icon_list_row_changed), (egg_icon_list_row_inserted),
(egg_icon_list_row_deleted), (egg_icon_list_rows_reordered),
(egg_icon_list_build_items), (egg_icon_list_set_model),
(egg_icon_list_get_model), (egg_icon_list_set_text_column),
(egg_icon_list_set_pixbuf_column):
* libegg/iconlist/eggiconlist.h:
* libegg/iconlist/testiconlist.c: (fill_model), (create_model),
(foreach_selected_print), (item_removed), (remove_selected),
(item_cb), (do_popup_menu), (main):
* libegg/util/eggmarshalers.list:
Update icon list to use the tree model instead.
2004-07-02 12:04:49 +00:00
|
|
|
PROP_MODEL,
|
2004-12-14 06:39:45 +00:00
|
|
|
PROP_COLUMNS,
|
|
|
|
PROP_ITEM_WIDTH,
|
|
|
|
PROP_SPACING,
|
|
|
|
PROP_ROW_SPACING,
|
|
|
|
PROP_COLUMN_SPACING,
|
2005-05-06 04:14:32 +00:00
|
|
|
PROP_MARGIN,
|
2007-07-19 14:59:44 +00:00
|
|
|
PROP_REORDERABLE,
|
2009-08-07 03:56:30 +00:00
|
|
|
PROP_TOOLTIP_COLUMN,
|
2010-10-18 04:21:39 +00:00
|
|
|
PROP_ITEM_PADDING,
|
2010-12-10 08:15:39 +00:00
|
|
|
PROP_CELL_AREA,
|
2010-10-18 04:21:39 +00:00
|
|
|
|
|
|
|
/* For scrollable interface */
|
|
|
|
PROP_HADJUSTMENT,
|
2010-10-26 00:59:02 +00:00
|
|
|
PROP_VADJUSTMENT,
|
|
|
|
PROP_HSCROLL_POLICY,
|
|
|
|
PROP_VSCROLL_POLICY
|
2002-04-30 17:08:52 +00:00
|
|
|
};
|
|
|
|
|
2005-05-02 20:28:37 +00:00
|
|
|
/* GObject vfuncs */
|
|
|
|
static void gtk_icon_view_cell_layout_init (GtkCellLayoutIface *iface);
|
2010-12-10 08:15:39 +00:00
|
|
|
static void gtk_icon_view_dispose (GObject *object);
|
|
|
|
static GObject *gtk_icon_view_constructor (GType type,
|
|
|
|
guint n_construct_properties,
|
|
|
|
GObjectConstructParam *construct_properties);
|
2005-05-02 20:28:37 +00:00
|
|
|
static void gtk_icon_view_set_property (GObject *object,
|
|
|
|
guint prop_id,
|
|
|
|
const GValue *value,
|
|
|
|
GParamSpec *pspec);
|
|
|
|
static void gtk_icon_view_get_property (GObject *object,
|
|
|
|
guint prop_id,
|
|
|
|
GValue *value,
|
|
|
|
GParamSpec *pspec);
|
|
|
|
/* GtkWidget vfuncs */
|
2010-09-18 23:55:42 +00:00
|
|
|
static void gtk_icon_view_destroy (GtkWidget *widget);
|
2005-05-02 20:28:37 +00:00
|
|
|
static void gtk_icon_view_realize (GtkWidget *widget);
|
|
|
|
static void gtk_icon_view_unrealize (GtkWidget *widget);
|
2011-01-12 20:26:25 +00:00
|
|
|
static void gtk_icon_view_style_updated (GtkWidget *widget);
|
|
|
|
static void gtk_icon_view_state_flags_changed (GtkWidget *widget,
|
|
|
|
GtkStateFlags previous_state);
|
2010-10-27 05:11:36 +00:00
|
|
|
static void gtk_icon_view_get_preferred_width (GtkWidget *widget,
|
|
|
|
gint *minimum,
|
|
|
|
gint *natural);
|
|
|
|
static void gtk_icon_view_get_preferred_height (GtkWidget *widget,
|
|
|
|
gint *minimum,
|
|
|
|
gint *natural);
|
2005-05-02 20:28:37 +00:00
|
|
|
static void gtk_icon_view_size_allocate (GtkWidget *widget,
|
|
|
|
GtkAllocation *allocation);
|
2010-09-06 16:54:04 +00:00
|
|
|
static gboolean gtk_icon_view_draw (GtkWidget *widget,
|
|
|
|
cairo_t *cr);
|
2005-05-02 20:28:37 +00:00
|
|
|
static gboolean gtk_icon_view_motion (GtkWidget *widget,
|
|
|
|
GdkEventMotion *event);
|
|
|
|
static gboolean gtk_icon_view_button_press (GtkWidget *widget,
|
|
|
|
GdkEventButton *event);
|
|
|
|
static gboolean gtk_icon_view_button_release (GtkWidget *widget,
|
|
|
|
GdkEventButton *event);
|
2007-05-09 14:06:02 +00:00
|
|
|
static gboolean gtk_icon_view_key_press (GtkWidget *widget,
|
|
|
|
GdkEventKey *event);
|
|
|
|
static gboolean gtk_icon_view_key_release (GtkWidget *widget,
|
|
|
|
GdkEventKey *event);
|
2005-05-02 20:28:37 +00:00
|
|
|
static AtkObject *gtk_icon_view_get_accessible (GtkWidget *widget);
|
|
|
|
|
|
|
|
|
|
|
|
/* GtkContainer vfuncs */
|
|
|
|
static void gtk_icon_view_remove (GtkContainer *container,
|
|
|
|
GtkWidget *widget);
|
|
|
|
static void gtk_icon_view_forall (GtkContainer *container,
|
|
|
|
gboolean include_internals,
|
|
|
|
GtkCallback callback,
|
|
|
|
gpointer callback_data);
|
|
|
|
|
|
|
|
/* GtkIconView vfuncs */
|
|
|
|
static void gtk_icon_view_real_select_all (GtkIconView *icon_view);
|
|
|
|
static void gtk_icon_view_real_unselect_all (GtkIconView *icon_view);
|
|
|
|
static void gtk_icon_view_real_select_cursor_item (GtkIconView *icon_view);
|
|
|
|
static void gtk_icon_view_real_toggle_cursor_item (GtkIconView *icon_view);
|
|
|
|
static gboolean gtk_icon_view_real_activate_cursor_item (GtkIconView *icon_view);
|
|
|
|
|
|
|
|
/* Internal functions */
|
2010-10-18 04:21:39 +00:00
|
|
|
static void gtk_icon_view_set_hadjustment_values (GtkIconView *icon_view);
|
|
|
|
static void gtk_icon_view_set_vadjustment_values (GtkIconView *icon_view);
|
|
|
|
static void gtk_icon_view_set_hadjustment (GtkIconView *icon_view,
|
|
|
|
GtkAdjustment *adjustment);
|
|
|
|
static void gtk_icon_view_set_vadjustment (GtkIconView *icon_view,
|
|
|
|
GtkAdjustment *adjustment);
|
2010-11-28 01:56:09 +00:00
|
|
|
static void gtk_icon_view_accessible_set_adjustment (AtkObject *accessible,
|
2010-10-18 04:21:39 +00:00
|
|
|
GtkOrientation orientation,
|
|
|
|
GtkAdjustment *adjustment);
|
2005-05-02 20:28:37 +00:00
|
|
|
static void gtk_icon_view_adjustment_changed (GtkAdjustment *adjustment,
|
|
|
|
GtkIconView *icon_view);
|
|
|
|
static void gtk_icon_view_layout (GtkIconView *icon_view);
|
|
|
|
static void gtk_icon_view_paint_item (GtkIconView *icon_view,
|
2010-08-22 02:32:52 +00:00
|
|
|
cairo_t *cr,
|
2005-05-02 20:28:37 +00:00
|
|
|
GtkIconViewItem *item,
|
2010-08-22 02:32:52 +00:00
|
|
|
gint x,
|
|
|
|
gint y,
|
|
|
|
gboolean draw_focus);
|
2005-05-02 20:28:37 +00:00
|
|
|
static void gtk_icon_view_paint_rubberband (GtkIconView *icon_view,
|
2010-09-06 15:46:37 +00:00
|
|
|
cairo_t *cr);
|
2005-05-06 04:14:32 +00:00
|
|
|
static void gtk_icon_view_queue_draw_path (GtkIconView *icon_view,
|
|
|
|
GtkTreePath *path);
|
2005-05-02 20:28:37 +00:00
|
|
|
static void gtk_icon_view_queue_draw_item (GtkIconView *icon_view,
|
|
|
|
GtkIconViewItem *item);
|
|
|
|
static void gtk_icon_view_queue_layout (GtkIconView *icon_view);
|
|
|
|
static void gtk_icon_view_set_cursor_item (GtkIconView *icon_view,
|
|
|
|
GtkIconViewItem *item,
|
2010-12-12 07:29:41 +00:00
|
|
|
GtkCellRenderer *cursor_cell);
|
2005-05-02 20:28:37 +00:00
|
|
|
static void gtk_icon_view_start_rubberbanding (GtkIconView *icon_view,
|
2010-05-25 22:38:44 +00:00
|
|
|
GdkDevice *device,
|
2005-05-02 20:28:37 +00:00
|
|
|
gint x,
|
|
|
|
gint y);
|
|
|
|
static void gtk_icon_view_stop_rubberbanding (GtkIconView *icon_view);
|
|
|
|
static void gtk_icon_view_update_rubberband_selection (GtkIconView *icon_view);
|
|
|
|
static gboolean gtk_icon_view_item_hit_test (GtkIconView *icon_view,
|
|
|
|
GtkIconViewItem *item,
|
|
|
|
gint x,
|
|
|
|
gint y,
|
|
|
|
gint width,
|
|
|
|
gint height);
|
|
|
|
static gboolean gtk_icon_view_unselect_all_internal (GtkIconView *icon_view);
|
2010-12-12 07:29:41 +00:00
|
|
|
static void gtk_icon_view_cache_widths (GtkIconView *icon_view);
|
2005-05-02 20:28:37 +00:00
|
|
|
static void gtk_icon_view_update_rubberband (gpointer data);
|
|
|
|
static void gtk_icon_view_item_invalidate_size (GtkIconViewItem *item);
|
|
|
|
static void gtk_icon_view_invalidate_sizes (GtkIconView *icon_view);
|
|
|
|
static void gtk_icon_view_add_move_binding (GtkBindingSet *binding_set,
|
|
|
|
guint keyval,
|
|
|
|
guint modmask,
|
|
|
|
GtkMovementStep step,
|
|
|
|
gint count);
|
|
|
|
static gboolean gtk_icon_view_real_move_cursor (GtkIconView *icon_view,
|
|
|
|
GtkMovementStep step,
|
|
|
|
gint count);
|
|
|
|
static void gtk_icon_view_move_cursor_up_down (GtkIconView *icon_view,
|
|
|
|
gint count);
|
|
|
|
static void gtk_icon_view_move_cursor_page_up_down (GtkIconView *icon_view,
|
|
|
|
gint count);
|
|
|
|
static void gtk_icon_view_move_cursor_left_right (GtkIconView *icon_view,
|
|
|
|
gint count);
|
|
|
|
static void gtk_icon_view_move_cursor_start_end (GtkIconView *icon_view,
|
|
|
|
gint count);
|
|
|
|
static void gtk_icon_view_scroll_to_item (GtkIconView *icon_view,
|
|
|
|
GtkIconViewItem *item);
|
|
|
|
static void gtk_icon_view_select_item (GtkIconView *icon_view,
|
|
|
|
GtkIconViewItem *item);
|
|
|
|
static void gtk_icon_view_unselect_item (GtkIconView *icon_view,
|
|
|
|
GtkIconViewItem *item);
|
|
|
|
static gboolean gtk_icon_view_select_all_between (GtkIconView *icon_view,
|
|
|
|
GtkIconViewItem *anchor,
|
|
|
|
GtkIconViewItem *cursor);
|
|
|
|
static GtkIconViewItem * gtk_icon_view_get_item_at_coords (GtkIconView *icon_view,
|
|
|
|
gint x,
|
|
|
|
gint y,
|
2005-05-06 04:14:32 +00:00
|
|
|
gboolean only_in_cell,
|
2010-12-12 07:29:41 +00:00
|
|
|
GtkCellRenderer **cell_at_pos);
|
2005-05-02 20:28:37 +00:00
|
|
|
static void gtk_icon_view_set_cell_data (GtkIconView *icon_view,
|
|
|
|
GtkIconViewItem *item);
|
2010-12-12 07:29:41 +00:00
|
|
|
|
2011-01-31 22:34:37 +00:00
|
|
|
static void gtk_icon_view_ensure_cell_area (GtkIconView *icon_view,
|
|
|
|
GtkCellArea *cell_area);
|
|
|
|
|
2010-12-12 07:29:41 +00:00
|
|
|
static GtkCellArea *gtk_icon_view_cell_layout_get_area (GtkCellLayout *layout);
|
|
|
|
|
2008-02-12 16:43:04 +00:00
|
|
|
static void gtk_icon_view_item_selected_changed (GtkIconView *icon_view,
|
|
|
|
GtkIconViewItem *item);
|
2010-12-12 10:59:41 +00:00
|
|
|
|
|
|
|
static void gtk_icon_view_add_editable (GtkCellArea *area,
|
|
|
|
GtkCellRenderer *renderer,
|
|
|
|
GtkCellEditable *editable,
|
|
|
|
GdkRectangle *cell_area,
|
|
|
|
const gchar *path,
|
|
|
|
GtkIconView *icon_view);
|
|
|
|
static void gtk_icon_view_remove_editable (GtkCellArea *area,
|
|
|
|
GtkCellRenderer *renderer,
|
|
|
|
GtkCellEditable *editable,
|
|
|
|
GtkIconView *icon_view);
|
2010-12-13 09:08:37 +00:00
|
|
|
static void gtk_icon_view_context_changed (GtkCellAreaContext *context,
|
|
|
|
GParamSpec *pspec,
|
|
|
|
GtkIconView *icon_view);
|
2011-02-23 11:50:50 +00:00
|
|
|
static void update_text_cell (GtkIconView *icon_view);
|
|
|
|
static void update_pixbuf_cell (GtkIconView *icon_view);
|
Update icon list to use the tree model instead.
2004-07-02 Anders Carlsson <andersca@gnome.org>
* libegg/iconlist/eggiconlist.c: (egg_icon_list_class_init),
(egg_icon_list_init), (egg_icon_list_destroy),
(egg_icon_list_finalize), (egg_icon_list_set_property),
(egg_icon_list_get_property), (egg_icon_list_button_press),
(egg_icon_list_select_first_matching_item),
(egg_icon_list_maybe_begin_dragging_items),
(egg_icon_list_real_toggle_cursor_item),
(egg_icon_list_calculate_item_size),
(egg_icon_list_invalidate_sizes), (egg_icon_list_paint_item),
(egg_icon_list_item_new), (egg_icon_list_item_unref),
(egg_icon_list_get_item_text), (egg_icon_list_get_item_icon),
(egg_icon_list_get_item_at_pos), (egg_icon_list_get_path_at_pos),
(egg_icon_list_selected_foreach), (egg_icon_list_select_path),
(egg_icon_list_unselect_path), (egg_icon_list_path_is_selected),
(egg_icon_list_item_activated), (egg_icon_list_get_items),
(egg_icon_list_row_changed), (egg_icon_list_row_inserted),
(egg_icon_list_row_deleted), (egg_icon_list_rows_reordered),
(egg_icon_list_build_items), (egg_icon_list_set_model),
(egg_icon_list_get_model), (egg_icon_list_set_text_column),
(egg_icon_list_set_pixbuf_column):
* libegg/iconlist/eggiconlist.h:
* libegg/iconlist/testiconlist.c: (fill_model), (create_model),
(foreach_selected_print), (item_removed), (remove_selected),
(item_cb), (do_popup_menu), (main):
* libegg/util/eggmarshalers.list:
Update icon list to use the tree model instead.
2004-07-02 12:04:49 +00:00
|
|
|
|
2005-05-06 04:14:32 +00:00
|
|
|
/* Source side drag signals */
|
|
|
|
static void gtk_icon_view_drag_begin (GtkWidget *widget,
|
|
|
|
GdkDragContext *context);
|
|
|
|
static void gtk_icon_view_drag_end (GtkWidget *widget,
|
|
|
|
GdkDragContext *context);
|
|
|
|
static void gtk_icon_view_drag_data_get (GtkWidget *widget,
|
|
|
|
GdkDragContext *context,
|
|
|
|
GtkSelectionData *selection_data,
|
|
|
|
guint info,
|
|
|
|
guint time);
|
|
|
|
static void gtk_icon_view_drag_data_delete (GtkWidget *widget,
|
|
|
|
GdkDragContext *context);
|
|
|
|
|
|
|
|
/* Target side drag signals */
|
|
|
|
static void gtk_icon_view_drag_leave (GtkWidget *widget,
|
|
|
|
GdkDragContext *context,
|
|
|
|
guint time);
|
|
|
|
static gboolean gtk_icon_view_drag_motion (GtkWidget *widget,
|
|
|
|
GdkDragContext *context,
|
|
|
|
gint x,
|
|
|
|
gint y,
|
|
|
|
guint time);
|
|
|
|
static gboolean gtk_icon_view_drag_drop (GtkWidget *widget,
|
|
|
|
GdkDragContext *context,
|
|
|
|
gint x,
|
|
|
|
gint y,
|
|
|
|
guint time);
|
|
|
|
static void gtk_icon_view_drag_data_received (GtkWidget *widget,
|
|
|
|
GdkDragContext *context,
|
|
|
|
gint x,
|
|
|
|
gint y,
|
|
|
|
GtkSelectionData *selection_data,
|
|
|
|
guint info,
|
|
|
|
guint time);
|
|
|
|
static gboolean gtk_icon_view_maybe_begin_drag (GtkIconView *icon_view,
|
|
|
|
GdkEventMotion *event);
|
|
|
|
|
|
|
|
static void remove_scroll_timeout (GtkIconView *icon_view);
|
|
|
|
|
Add GtkBuilder, fixes #172535
2007-06-15 Johan Dahlin <jdahlin@async.com.br>
* demos/gtk-demo/Makefile.am:
* demos/gtk-demo/builder.c: (quit_activate), (about_activate),
(do_builder):
* demos/gtk-demo/demo.ui:
* docs/reference/gtk/gtk-docs.sgml:
* docs/reference/gtk/gtk-sections.txt:
* docs/reference/gtk/gtk.types:
* docs/reference/gtk/tmpl/gtkbuildable.sgml:
* docs/reference/gtk/tmpl/gtkbuilder.sgml:
* gtk/Makefile.am:
* gtk/gtk.h:
* gtk/gtk.symbols:
* gtk/gtkaction.c: (gtk_action_buildable_init),
(gtk_action_buildable_set_name), (gtk_action_buildable_get_name):
* gtk/gtkactiongroup.c: (gtk_action_group_get_type),
(gtk_action_group_buildable_init),
(gtk_action_group_buildable_add),
(gtk_action_group_buildable_set_name),
(gtk_action_group_buildable_get_name):
* gtk/gtkbuildable.c: (gtk_buildable_get_type),
(gtk_buildable_set_name), (gtk_buildable_get_name),
(gtk_buildable_add), (gtk_buildable_set_property),
(gtk_buildable_parser_finished), (gtk_buildable_construct_child),
(gtk_buildable_custom_tag_start), (gtk_buildable_custom_tag_end),
(gtk_buildable_custom_finished),
(gtk_buildable_get_internal_child):
* gtk/gtkbuildable.h:
* gtk/gtkbuilder.c: (gtk_builder_class_init), (gtk_builder_init),
(gtk_builder_finalize), (gtk_builder_set_property),
(gtk_builder_get_property), (_gtk_builder_resolve_type_lazily),
(gtk_builder_real_get_type_from_name),
(gtk_builder_get_parameters), (gtk_builder_get_internal_child),
(_gtk_builder_construct), (_gtk_builder_add),
(apply_delayed_properties), (_gtk_builder_finish),
(gtk_builder_new), (gtk_builder_add_from_file),
(gtk_builder_add_from_string), (gtk_builder_get_object),
(object_add_to_list), (gtk_builder_get_objects),
(gtk_builder_set_translation_domain),
(gtk_builder_get_translation_domain),
(gtk_builder_connect_signals_default),
(gtk_builder_connect_signals), (gtk_builder_connect_signals_full),
(gtk_builder_value_from_string),
(gtk_builder_value_from_string_type),
(_gtk_builder_enum_from_string), (_gtk_builder_flags_from_string),
(gtk_builder_get_type_from_name), (gtk_builder_error_quark):
* gtk/gtkbuilder.h:
* gtk/gtkbuilderparser.c: (state_push), (state_peek), (state_pop),
(error_missing_attribute), (error_invalid_attribute),
(error_invalid_tag), (builder_construct), (parse_object),
(free_object_info), (_get_type_by_symbol), (parse_child),
(free_child_info), (parse_property), (free_property_info),
(parse_signal), (_free_signal_info), (parse_interface),
(create_subparser), (free_subparser), (subparser_start),
(subparser_end), (parse_custom), (start_element), (end_element),
(text), (_gtk_builder_parser_parse_buffer):
* gtk/gtkbuilderprivate.h:
* gtk/gtkcelllayout.c: (attributes_start_element),
(attributes_text_element),
(_gtk_cell_layout_buildable_custom_tag_start),
(_gtk_cell_layout_buildable_custom_tag_end),
(_gtk_cell_layout_buildable_add):
* gtk/gtkcelllayout.h:
* gtk/gtkcellview.c: (gtk_cell_view_buildable_init),
(gtk_cell_view_buildable_custom_tag_start),
(gtk_cell_view_buildable_custom_tag_end):
* gtk/gtkcolorseldialog.c:
(gtk_color_selection_dialog_buildable_interface_init),
(gtk_color_selection_dialog_buildable_get_internal_child):
* gtk/gtkcombobox.c: (gtk_combo_box_buildable_init),
(gtk_combo_box_buildable_custom_tag_start),
(gtk_combo_box_buildable_custom_tag_end):
* gtk/gtkcomboboxentry.c:
(gtk_combo_box_entry_buildable_interface_init),
(gtk_combo_box_entry_buildable_get_internal_child):
* gtk/gtkcontainer.c: (gtk_container_get_type),
(gtk_container_buildable_init), (gtk_container_buildable_add),
(gtk_container_buildable_set_child_property),
(attributes_start_element), (attributes_text_element),
(gtk_container_buildable_custom_tag_start),
(gtk_container_buildable_custom_tag_end):
* gtk/gtkdebug.h:
* gtk/gtkdialog.c: (gtk_dialog_buildable_interface_init),
(gtk_dialog_buildable_get_internal_child),
(attributes_start_element), (attributes_text_element),
(gtk_dialog_buildable_custom_tag_start),
(gtk_dialog_buildable_custom_finished):
* gtk/gtkentrycompletion.c: (gtk_entry_completion_buildable_init):
* gtk/gtkexpander.c: (gtk_expander_buildable_add),
(gtk_expander_buildable_init):
* gtk/gtkfontsel.c:
(gtk_font_selection_dialog_buildable_interface_init),
(gtk_font_selection_dialog_buildable_get_internal_child):
* gtk/gtkframe.c: (gtk_frame_buildable_init),
(gtk_frame_buildable_add):
* gtk/gtkiconview.c: (gtk_icon_view_buildable_init),
(gtk_icon_view_buildable_custom_tag_start),
(gtk_icon_view_buildable_custom_tag_end):
* gtk/gtkliststore.c: (gtk_list_store_buildable_init),
(list_store_start_element), (list_store_end_element),
(list_store_text), (gtk_list_store_buildable_custom_tag_start),
(gtk_list_store_buildable_custom_tag_end):
* gtk/gtkmain.c:
* gtk/gtknotebook.c: (gtk_notebook_buildable_init),
(gtk_notebook_buildable_add):
* gtk/gtksizegroup.c: (gtk_size_group_buildable_init),
(size_group_start_element),
(gtk_size_group_buildable_custom_tag_start),
(gtk_size_group_buildable_custom_finished):
* gtk/gtktreestore.c: (gtk_tree_store_buildable_init),
(tree_model_start_element),
(gtk_tree_store_buildable_custom_tag_start),
(gtk_tree_store_buildable_custom_finished):
* gtk/gtktreeview.c: (gtk_tree_view_buildable_init),
(gtk_tree_view_buildable_add):
* gtk/gtktreeviewcolumn.c: (gtk_tree_view_column_buildable_init):
* gtk/gtkuimanager.c: (gtk_ui_manager_buildable_init),
(gtk_ui_manager_buildable_add),
(gtk_ui_manager_buildable_construct_child),
(gtk_ui_manager_buildable_custom_tag_start),
(gtk_ui_manager_buildable_custom_tag_end):
* gtk/gtkwidget.c: (gtk_widget_get_type),
(gtk_widget_buildable_interface_init),
(gtk_widget_buildable_set_name), (gtk_widget_buildable_get_name),
(gtk_widget_buildable_set_property),
(gtk_widget_buildable_parser_finshed), (accel_group_start_element),
(gtk_widget_buildable_custom_tag_start),
(gtk_widget_buildable_custom_finshed):
* gtk/gtkwindow.c: (gtk_window_buildable_interface_init),
(gtk_window_buildable_set_property),
(gtk_window_buildable_parser_finished):
* tests/Makefile.am:
* tests/buildertest.c: (builder_new_from_string), (test_parser),
(signal_normal), (signal_after), (signal_object),
(signal_object_after), (signal_first), (signal_second),
(signal_extra), (signal_extra2), (test_connect_signals),
(test_uimanager_simple), (test_domain), (test_translation),
(test_sizegroup), (test_list_store), (test_tree_store),
(test_types), (test_spin_button), (test_notebook),
(test_construct_only_property), (test_children),
(test_child_properties), (test_treeview_column), (test_icon_view),
(test_combo_box), (test_combo_box_entry), (test_cell_view),
(test_dialog), (test_accelerators), (test_widget), (main):
Add GtkBuilder, fixes #172535
svn path=/trunk/; revision=18141
2007-06-15 17:53:46 +00:00
|
|
|
/* GtkBuildable */
|
|
|
|
static GtkBuildableIface *parent_buildable_iface;
|
|
|
|
static void gtk_icon_view_buildable_init (GtkBuildableIface *iface);
|
|
|
|
static gboolean gtk_icon_view_buildable_custom_tag_start (GtkBuildable *buildable,
|
|
|
|
GtkBuilder *builder,
|
|
|
|
GObject *child,
|
|
|
|
const gchar *tagname,
|
|
|
|
GMarkupParser *parser,
|
|
|
|
gpointer *data);
|
|
|
|
static void gtk_icon_view_buildable_custom_tag_end (GtkBuildable *buildable,
|
|
|
|
GtkBuilder *builder,
|
|
|
|
GObject *child,
|
|
|
|
const gchar *tagname,
|
|
|
|
gpointer *data);
|
|
|
|
|
2004-07-04 15:56:55 +00:00
|
|
|
static guint icon_view_signals[LAST_SIGNAL] = { 0 };
|
2002-04-30 17:08:52 +00:00
|
|
|
|
2005-05-02 20:28:37 +00:00
|
|
|
G_DEFINE_TYPE_WITH_CODE (GtkIconView, gtk_icon_view, GTK_TYPE_CONTAINER,
|
|
|
|
G_IMPLEMENT_INTERFACE (GTK_TYPE_CELL_LAYOUT,
|
Add GtkBuilder, fixes #172535
2007-06-15 Johan Dahlin <jdahlin@async.com.br>
* demos/gtk-demo/Makefile.am:
* demos/gtk-demo/builder.c: (quit_activate), (about_activate),
(do_builder):
* demos/gtk-demo/demo.ui:
* docs/reference/gtk/gtk-docs.sgml:
* docs/reference/gtk/gtk-sections.txt:
* docs/reference/gtk/gtk.types:
* docs/reference/gtk/tmpl/gtkbuildable.sgml:
* docs/reference/gtk/tmpl/gtkbuilder.sgml:
* gtk/Makefile.am:
* gtk/gtk.h:
* gtk/gtk.symbols:
* gtk/gtkaction.c: (gtk_action_buildable_init),
(gtk_action_buildable_set_name), (gtk_action_buildable_get_name):
* gtk/gtkactiongroup.c: (gtk_action_group_get_type),
(gtk_action_group_buildable_init),
(gtk_action_group_buildable_add),
(gtk_action_group_buildable_set_name),
(gtk_action_group_buildable_get_name):
* gtk/gtkbuildable.c: (gtk_buildable_get_type),
(gtk_buildable_set_name), (gtk_buildable_get_name),
(gtk_buildable_add), (gtk_buildable_set_property),
(gtk_buildable_parser_finished), (gtk_buildable_construct_child),
(gtk_buildable_custom_tag_start), (gtk_buildable_custom_tag_end),
(gtk_buildable_custom_finished),
(gtk_buildable_get_internal_child):
* gtk/gtkbuildable.h:
* gtk/gtkbuilder.c: (gtk_builder_class_init), (gtk_builder_init),
(gtk_builder_finalize), (gtk_builder_set_property),
(gtk_builder_get_property), (_gtk_builder_resolve_type_lazily),
(gtk_builder_real_get_type_from_name),
(gtk_builder_get_parameters), (gtk_builder_get_internal_child),
(_gtk_builder_construct), (_gtk_builder_add),
(apply_delayed_properties), (_gtk_builder_finish),
(gtk_builder_new), (gtk_builder_add_from_file),
(gtk_builder_add_from_string), (gtk_builder_get_object),
(object_add_to_list), (gtk_builder_get_objects),
(gtk_builder_set_translation_domain),
(gtk_builder_get_translation_domain),
(gtk_builder_connect_signals_default),
(gtk_builder_connect_signals), (gtk_builder_connect_signals_full),
(gtk_builder_value_from_string),
(gtk_builder_value_from_string_type),
(_gtk_builder_enum_from_string), (_gtk_builder_flags_from_string),
(gtk_builder_get_type_from_name), (gtk_builder_error_quark):
* gtk/gtkbuilder.h:
* gtk/gtkbuilderparser.c: (state_push), (state_peek), (state_pop),
(error_missing_attribute), (error_invalid_attribute),
(error_invalid_tag), (builder_construct), (parse_object),
(free_object_info), (_get_type_by_symbol), (parse_child),
(free_child_info), (parse_property), (free_property_info),
(parse_signal), (_free_signal_info), (parse_interface),
(create_subparser), (free_subparser), (subparser_start),
(subparser_end), (parse_custom), (start_element), (end_element),
(text), (_gtk_builder_parser_parse_buffer):
* gtk/gtkbuilderprivate.h:
* gtk/gtkcelllayout.c: (attributes_start_element),
(attributes_text_element),
(_gtk_cell_layout_buildable_custom_tag_start),
(_gtk_cell_layout_buildable_custom_tag_end),
(_gtk_cell_layout_buildable_add):
* gtk/gtkcelllayout.h:
* gtk/gtkcellview.c: (gtk_cell_view_buildable_init),
(gtk_cell_view_buildable_custom_tag_start),
(gtk_cell_view_buildable_custom_tag_end):
* gtk/gtkcolorseldialog.c:
(gtk_color_selection_dialog_buildable_interface_init),
(gtk_color_selection_dialog_buildable_get_internal_child):
* gtk/gtkcombobox.c: (gtk_combo_box_buildable_init),
(gtk_combo_box_buildable_custom_tag_start),
(gtk_combo_box_buildable_custom_tag_end):
* gtk/gtkcomboboxentry.c:
(gtk_combo_box_entry_buildable_interface_init),
(gtk_combo_box_entry_buildable_get_internal_child):
* gtk/gtkcontainer.c: (gtk_container_get_type),
(gtk_container_buildable_init), (gtk_container_buildable_add),
(gtk_container_buildable_set_child_property),
(attributes_start_element), (attributes_text_element),
(gtk_container_buildable_custom_tag_start),
(gtk_container_buildable_custom_tag_end):
* gtk/gtkdebug.h:
* gtk/gtkdialog.c: (gtk_dialog_buildable_interface_init),
(gtk_dialog_buildable_get_internal_child),
(attributes_start_element), (attributes_text_element),
(gtk_dialog_buildable_custom_tag_start),
(gtk_dialog_buildable_custom_finished):
* gtk/gtkentrycompletion.c: (gtk_entry_completion_buildable_init):
* gtk/gtkexpander.c: (gtk_expander_buildable_add),
(gtk_expander_buildable_init):
* gtk/gtkfontsel.c:
(gtk_font_selection_dialog_buildable_interface_init),
(gtk_font_selection_dialog_buildable_get_internal_child):
* gtk/gtkframe.c: (gtk_frame_buildable_init),
(gtk_frame_buildable_add):
* gtk/gtkiconview.c: (gtk_icon_view_buildable_init),
(gtk_icon_view_buildable_custom_tag_start),
(gtk_icon_view_buildable_custom_tag_end):
* gtk/gtkliststore.c: (gtk_list_store_buildable_init),
(list_store_start_element), (list_store_end_element),
(list_store_text), (gtk_list_store_buildable_custom_tag_start),
(gtk_list_store_buildable_custom_tag_end):
* gtk/gtkmain.c:
* gtk/gtknotebook.c: (gtk_notebook_buildable_init),
(gtk_notebook_buildable_add):
* gtk/gtksizegroup.c: (gtk_size_group_buildable_init),
(size_group_start_element),
(gtk_size_group_buildable_custom_tag_start),
(gtk_size_group_buildable_custom_finished):
* gtk/gtktreestore.c: (gtk_tree_store_buildable_init),
(tree_model_start_element),
(gtk_tree_store_buildable_custom_tag_start),
(gtk_tree_store_buildable_custom_finished):
* gtk/gtktreeview.c: (gtk_tree_view_buildable_init),
(gtk_tree_view_buildable_add):
* gtk/gtktreeviewcolumn.c: (gtk_tree_view_column_buildable_init):
* gtk/gtkuimanager.c: (gtk_ui_manager_buildable_init),
(gtk_ui_manager_buildable_add),
(gtk_ui_manager_buildable_construct_child),
(gtk_ui_manager_buildable_custom_tag_start),
(gtk_ui_manager_buildable_custom_tag_end):
* gtk/gtkwidget.c: (gtk_widget_get_type),
(gtk_widget_buildable_interface_init),
(gtk_widget_buildable_set_name), (gtk_widget_buildable_get_name),
(gtk_widget_buildable_set_property),
(gtk_widget_buildable_parser_finshed), (accel_group_start_element),
(gtk_widget_buildable_custom_tag_start),
(gtk_widget_buildable_custom_finshed):
* gtk/gtkwindow.c: (gtk_window_buildable_interface_init),
(gtk_window_buildable_set_property),
(gtk_window_buildable_parser_finished):
* tests/Makefile.am:
* tests/buildertest.c: (builder_new_from_string), (test_parser),
(signal_normal), (signal_after), (signal_object),
(signal_object_after), (signal_first), (signal_second),
(signal_extra), (signal_extra2), (test_connect_signals),
(test_uimanager_simple), (test_domain), (test_translation),
(test_sizegroup), (test_list_store), (test_tree_store),
(test_types), (test_spin_button), (test_notebook),
(test_construct_only_property), (test_children),
(test_child_properties), (test_treeview_column), (test_icon_view),
(test_combo_box), (test_combo_box_entry), (test_cell_view),
(test_dialog), (test_accelerators), (test_widget), (main):
Add GtkBuilder, fixes #172535
svn path=/trunk/; revision=18141
2007-06-15 17:53:46 +00:00
|
|
|
gtk_icon_view_cell_layout_init)
|
|
|
|
G_IMPLEMENT_INTERFACE (GTK_TYPE_BUILDABLE,
|
2010-10-18 04:21:39 +00:00
|
|
|
gtk_icon_view_buildable_init)
|
|
|
|
G_IMPLEMENT_INTERFACE (GTK_TYPE_SCROLLABLE, NULL))
|
2002-04-30 17:08:52 +00:00
|
|
|
|
|
|
|
static void
|
2004-07-04 15:56:55 +00:00
|
|
|
gtk_icon_view_class_init (GtkIconViewClass *klass)
|
2002-04-30 17:08:52 +00:00
|
|
|
{
|
|
|
|
GObjectClass *gobject_class;
|
|
|
|
GtkWidgetClass *widget_class;
|
2005-05-02 20:28:37 +00:00
|
|
|
GtkContainerClass *container_class;
|
2002-04-30 17:08:52 +00:00
|
|
|
GtkBindingSet *binding_set;
|
|
|
|
|
|
|
|
binding_set = gtk_binding_set_by_class (klass);
|
Update icon list to use the tree model instead.
2004-07-02 Anders Carlsson <andersca@gnome.org>
* libegg/iconlist/eggiconlist.c: (egg_icon_list_class_init),
(egg_icon_list_init), (egg_icon_list_destroy),
(egg_icon_list_finalize), (egg_icon_list_set_property),
(egg_icon_list_get_property), (egg_icon_list_button_press),
(egg_icon_list_select_first_matching_item),
(egg_icon_list_maybe_begin_dragging_items),
(egg_icon_list_real_toggle_cursor_item),
(egg_icon_list_calculate_item_size),
(egg_icon_list_invalidate_sizes), (egg_icon_list_paint_item),
(egg_icon_list_item_new), (egg_icon_list_item_unref),
(egg_icon_list_get_item_text), (egg_icon_list_get_item_icon),
(egg_icon_list_get_item_at_pos), (egg_icon_list_get_path_at_pos),
(egg_icon_list_selected_foreach), (egg_icon_list_select_path),
(egg_icon_list_unselect_path), (egg_icon_list_path_is_selected),
(egg_icon_list_item_activated), (egg_icon_list_get_items),
(egg_icon_list_row_changed), (egg_icon_list_row_inserted),
(egg_icon_list_row_deleted), (egg_icon_list_rows_reordered),
(egg_icon_list_build_items), (egg_icon_list_set_model),
(egg_icon_list_get_model), (egg_icon_list_set_text_column),
(egg_icon_list_set_pixbuf_column):
* libegg/iconlist/eggiconlist.h:
* libegg/iconlist/testiconlist.c: (fill_model), (create_model),
(foreach_selected_print), (item_removed), (remove_selected),
(item_cb), (do_popup_menu), (main):
* libegg/util/eggmarshalers.list:
Update icon list to use the tree model instead.
2004-07-02 12:04:49 +00:00
|
|
|
|
2004-07-04 15:56:55 +00:00
|
|
|
g_type_class_add_private (klass, sizeof (GtkIconViewPrivate));
|
Update icon list to use the tree model instead.
2004-07-02 Anders Carlsson <andersca@gnome.org>
* libegg/iconlist/eggiconlist.c: (egg_icon_list_class_init),
(egg_icon_list_init), (egg_icon_list_destroy),
(egg_icon_list_finalize), (egg_icon_list_set_property),
(egg_icon_list_get_property), (egg_icon_list_button_press),
(egg_icon_list_select_first_matching_item),
(egg_icon_list_maybe_begin_dragging_items),
(egg_icon_list_real_toggle_cursor_item),
(egg_icon_list_calculate_item_size),
(egg_icon_list_invalidate_sizes), (egg_icon_list_paint_item),
(egg_icon_list_item_new), (egg_icon_list_item_unref),
(egg_icon_list_get_item_text), (egg_icon_list_get_item_icon),
(egg_icon_list_get_item_at_pos), (egg_icon_list_get_path_at_pos),
(egg_icon_list_selected_foreach), (egg_icon_list_select_path),
(egg_icon_list_unselect_path), (egg_icon_list_path_is_selected),
(egg_icon_list_item_activated), (egg_icon_list_get_items),
(egg_icon_list_row_changed), (egg_icon_list_row_inserted),
(egg_icon_list_row_deleted), (egg_icon_list_rows_reordered),
(egg_icon_list_build_items), (egg_icon_list_set_model),
(egg_icon_list_get_model), (egg_icon_list_set_text_column),
(egg_icon_list_set_pixbuf_column):
* libegg/iconlist/eggiconlist.h:
* libegg/iconlist/testiconlist.c: (fill_model), (create_model),
(foreach_selected_print), (item_removed), (remove_selected),
(item_cb), (do_popup_menu), (main):
* libegg/util/eggmarshalers.list:
Update icon list to use the tree model instead.
2004-07-02 12:04:49 +00:00
|
|
|
|
2002-04-30 17:08:52 +00:00
|
|
|
gobject_class = (GObjectClass *) klass;
|
|
|
|
widget_class = (GtkWidgetClass *) klass;
|
2005-05-02 20:28:37 +00:00
|
|
|
container_class = (GtkContainerClass *) klass;
|
2002-04-30 17:08:52 +00:00
|
|
|
|
2010-12-10 08:15:39 +00:00
|
|
|
gobject_class->constructor = gtk_icon_view_constructor;
|
|
|
|
gobject_class->dispose = gtk_icon_view_dispose;
|
2004-07-04 15:56:55 +00:00
|
|
|
gobject_class->set_property = gtk_icon_view_set_property;
|
|
|
|
gobject_class->get_property = gtk_icon_view_get_property;
|
|
|
|
|
2010-09-18 23:55:42 +00:00
|
|
|
widget_class->destroy = gtk_icon_view_destroy;
|
2004-07-04 15:56:55 +00:00
|
|
|
widget_class->realize = gtk_icon_view_realize;
|
|
|
|
widget_class->unrealize = gtk_icon_view_unrealize;
|
2011-01-12 20:26:25 +00:00
|
|
|
widget_class->style_updated = gtk_icon_view_style_updated;
|
2006-08-16 20:42:15 +00:00
|
|
|
widget_class->get_accessible = gtk_icon_view_get_accessible;
|
2010-10-27 05:11:36 +00:00
|
|
|
widget_class->get_preferred_width = gtk_icon_view_get_preferred_width;
|
|
|
|
widget_class->get_preferred_height = gtk_icon_view_get_preferred_height;
|
2004-07-04 15:56:55 +00:00
|
|
|
widget_class->size_allocate = gtk_icon_view_size_allocate;
|
2010-09-06 16:54:04 +00:00
|
|
|
widget_class->draw = gtk_icon_view_draw;
|
2004-07-04 15:56:55 +00:00
|
|
|
widget_class->motion_notify_event = gtk_icon_view_motion;
|
|
|
|
widget_class->button_press_event = gtk_icon_view_button_press;
|
|
|
|
widget_class->button_release_event = gtk_icon_view_button_release;
|
2007-05-09 14:06:02 +00:00
|
|
|
widget_class->key_press_event = gtk_icon_view_key_press;
|
|
|
|
widget_class->key_release_event = gtk_icon_view_key_release;
|
2005-05-06 04:14:32 +00:00
|
|
|
widget_class->drag_begin = gtk_icon_view_drag_begin;
|
|
|
|
widget_class->drag_end = gtk_icon_view_drag_end;
|
|
|
|
widget_class->drag_data_get = gtk_icon_view_drag_data_get;
|
|
|
|
widget_class->drag_data_delete = gtk_icon_view_drag_data_delete;
|
|
|
|
widget_class->drag_leave = gtk_icon_view_drag_leave;
|
|
|
|
widget_class->drag_motion = gtk_icon_view_drag_motion;
|
|
|
|
widget_class->drag_drop = gtk_icon_view_drag_drop;
|
|
|
|
widget_class->drag_data_received = gtk_icon_view_drag_data_received;
|
2011-01-12 20:26:25 +00:00
|
|
|
widget_class->state_flags_changed = gtk_icon_view_state_flags_changed;
|
2004-07-27 21:58:09 +00:00
|
|
|
|
2005-05-02 20:28:37 +00:00
|
|
|
container_class->remove = gtk_icon_view_remove;
|
|
|
|
container_class->forall = gtk_icon_view_forall;
|
|
|
|
|
2004-07-04 15:56:55 +00:00
|
|
|
klass->select_all = gtk_icon_view_real_select_all;
|
|
|
|
klass->unselect_all = gtk_icon_view_real_unselect_all;
|
|
|
|
klass->select_cursor_item = gtk_icon_view_real_select_cursor_item;
|
|
|
|
klass->toggle_cursor_item = gtk_icon_view_real_toggle_cursor_item;
|
2004-07-04 23:19:46 +00:00
|
|
|
klass->activate_cursor_item = gtk_icon_view_real_activate_cursor_item;
|
2004-07-04 15:56:55 +00:00
|
|
|
klass->move_cursor = gtk_icon_view_real_move_cursor;
|
2002-04-30 17:08:52 +00:00
|
|
|
|
|
|
|
/* Properties */
|
2004-07-13 05:15:49 +00:00
|
|
|
/**
|
|
|
|
* GtkIconView:selection-mode:
|
|
|
|
*
|
|
|
|
* The ::selection-mode property specifies the selection mode of
|
|
|
|
* icon view. If the mode is #GTK_SELECTION_MULTIPLE, rubberband selection
|
|
|
|
* is enabled, for the other modes, only keyboard selection is possible.
|
|
|
|
*
|
|
|
|
* Since: 2.6
|
|
|
|
*/
|
2002-04-30 17:08:52 +00:00
|
|
|
g_object_class_install_property (gobject_class,
|
|
|
|
PROP_SELECTION_MODE,
|
2005-03-09 06:15:13 +00:00
|
|
|
g_param_spec_enum ("selection-mode",
|
2004-07-04 15:56:55 +00:00
|
|
|
P_("Selection mode"),
|
|
|
|
P_("The selection mode"),
|
2002-04-30 17:08:52 +00:00
|
|
|
GTK_TYPE_SELECTION_MODE,
|
|
|
|
GTK_SELECTION_SINGLE,
|
2005-03-22 02:14:55 +00:00
|
|
|
GTK_PARAM_READWRITE));
|
2002-04-30 17:08:52 +00:00
|
|
|
|
2004-07-13 05:15:49 +00:00
|
|
|
/**
|
|
|
|
* GtkIconView:pixbuf-column:
|
|
|
|
*
|
|
|
|
* The ::pixbuf-column property contains the number of the model column
|
|
|
|
* containing the pixbufs which are displayed. The pixbuf column must be
|
|
|
|
* of type #GDK_TYPE_PIXBUF. Setting this property to -1 turns off the
|
|
|
|
* display of pixbufs.
|
|
|
|
*
|
|
|
|
* Since: 2.6
|
|
|
|
*/
|
2002-04-30 17:08:52 +00:00
|
|
|
g_object_class_install_property (gobject_class,
|
Update icon list to use the tree model instead.
2004-07-02 Anders Carlsson <andersca@gnome.org>
* libegg/iconlist/eggiconlist.c: (egg_icon_list_class_init),
(egg_icon_list_init), (egg_icon_list_destroy),
(egg_icon_list_finalize), (egg_icon_list_set_property),
(egg_icon_list_get_property), (egg_icon_list_button_press),
(egg_icon_list_select_first_matching_item),
(egg_icon_list_maybe_begin_dragging_items),
(egg_icon_list_real_toggle_cursor_item),
(egg_icon_list_calculate_item_size),
(egg_icon_list_invalidate_sizes), (egg_icon_list_paint_item),
(egg_icon_list_item_new), (egg_icon_list_item_unref),
(egg_icon_list_get_item_text), (egg_icon_list_get_item_icon),
(egg_icon_list_get_item_at_pos), (egg_icon_list_get_path_at_pos),
(egg_icon_list_selected_foreach), (egg_icon_list_select_path),
(egg_icon_list_unselect_path), (egg_icon_list_path_is_selected),
(egg_icon_list_item_activated), (egg_icon_list_get_items),
(egg_icon_list_row_changed), (egg_icon_list_row_inserted),
(egg_icon_list_row_deleted), (egg_icon_list_rows_reordered),
(egg_icon_list_build_items), (egg_icon_list_set_model),
(egg_icon_list_get_model), (egg_icon_list_set_text_column),
(egg_icon_list_set_pixbuf_column):
* libegg/iconlist/eggiconlist.h:
* libegg/iconlist/testiconlist.c: (fill_model), (create_model),
(foreach_selected_print), (item_removed), (remove_selected),
(item_cb), (do_popup_menu), (main):
* libegg/util/eggmarshalers.list:
Update icon list to use the tree model instead.
2004-07-02 12:04:49 +00:00
|
|
|
PROP_PIXBUF_COLUMN,
|
2005-03-09 06:15:13 +00:00
|
|
|
g_param_spec_int ("pixbuf-column",
|
2004-07-04 15:56:55 +00:00
|
|
|
P_("Pixbuf column"),
|
|
|
|
P_("Model column used to retrieve the icon pixbuf from"),
|
Update icon list to use the tree model instead.
2004-07-02 Anders Carlsson <andersca@gnome.org>
* libegg/iconlist/eggiconlist.c: (egg_icon_list_class_init),
(egg_icon_list_init), (egg_icon_list_destroy),
(egg_icon_list_finalize), (egg_icon_list_set_property),
(egg_icon_list_get_property), (egg_icon_list_button_press),
(egg_icon_list_select_first_matching_item),
(egg_icon_list_maybe_begin_dragging_items),
(egg_icon_list_real_toggle_cursor_item),
(egg_icon_list_calculate_item_size),
(egg_icon_list_invalidate_sizes), (egg_icon_list_paint_item),
(egg_icon_list_item_new), (egg_icon_list_item_unref),
(egg_icon_list_get_item_text), (egg_icon_list_get_item_icon),
(egg_icon_list_get_item_at_pos), (egg_icon_list_get_path_at_pos),
(egg_icon_list_selected_foreach), (egg_icon_list_select_path),
(egg_icon_list_unselect_path), (egg_icon_list_path_is_selected),
(egg_icon_list_item_activated), (egg_icon_list_get_items),
(egg_icon_list_row_changed), (egg_icon_list_row_inserted),
(egg_icon_list_row_deleted), (egg_icon_list_rows_reordered),
(egg_icon_list_build_items), (egg_icon_list_set_model),
(egg_icon_list_get_model), (egg_icon_list_set_text_column),
(egg_icon_list_set_pixbuf_column):
* libegg/iconlist/eggiconlist.h:
* libegg/iconlist/testiconlist.c: (fill_model), (create_model),
(foreach_selected_print), (item_removed), (remove_selected),
(item_cb), (do_popup_menu), (main):
* libegg/util/eggmarshalers.list:
Update icon list to use the tree model instead.
2004-07-02 12:04:49 +00:00
|
|
|
-1, G_MAXINT, -1,
|
2005-03-22 02:14:55 +00:00
|
|
|
GTK_PARAM_READWRITE));
|
Update icon list to use the tree model instead.
2004-07-02 Anders Carlsson <andersca@gnome.org>
* libegg/iconlist/eggiconlist.c: (egg_icon_list_class_init),
(egg_icon_list_init), (egg_icon_list_destroy),
(egg_icon_list_finalize), (egg_icon_list_set_property),
(egg_icon_list_get_property), (egg_icon_list_button_press),
(egg_icon_list_select_first_matching_item),
(egg_icon_list_maybe_begin_dragging_items),
(egg_icon_list_real_toggle_cursor_item),
(egg_icon_list_calculate_item_size),
(egg_icon_list_invalidate_sizes), (egg_icon_list_paint_item),
(egg_icon_list_item_new), (egg_icon_list_item_unref),
(egg_icon_list_get_item_text), (egg_icon_list_get_item_icon),
(egg_icon_list_get_item_at_pos), (egg_icon_list_get_path_at_pos),
(egg_icon_list_selected_foreach), (egg_icon_list_select_path),
(egg_icon_list_unselect_path), (egg_icon_list_path_is_selected),
(egg_icon_list_item_activated), (egg_icon_list_get_items),
(egg_icon_list_row_changed), (egg_icon_list_row_inserted),
(egg_icon_list_row_deleted), (egg_icon_list_rows_reordered),
(egg_icon_list_build_items), (egg_icon_list_set_model),
(egg_icon_list_get_model), (egg_icon_list_set_text_column),
(egg_icon_list_set_pixbuf_column):
* libegg/iconlist/eggiconlist.h:
* libegg/iconlist/testiconlist.c: (fill_model), (create_model),
(foreach_selected_print), (item_removed), (remove_selected),
(item_cb), (do_popup_menu), (main):
* libegg/util/eggmarshalers.list:
Update icon list to use the tree model instead.
2004-07-02 12:04:49 +00:00
|
|
|
|
2004-07-13 05:15:49 +00:00
|
|
|
/**
|
|
|
|
* GtkIconView:text-column:
|
|
|
|
*
|
|
|
|
* The ::text-column property contains the number of the model column
|
|
|
|
* containing the texts which are displayed. The text column must be
|
|
|
|
* of type #G_TYPE_STRING. If this property and the :markup-column
|
|
|
|
* property are both set to -1, no texts are displayed.
|
|
|
|
*
|
|
|
|
* Since: 2.6
|
|
|
|
*/
|
2002-04-30 17:08:52 +00:00
|
|
|
g_object_class_install_property (gobject_class,
|
Update icon list to use the tree model instead.
2004-07-02 Anders Carlsson <andersca@gnome.org>
* libegg/iconlist/eggiconlist.c: (egg_icon_list_class_init),
(egg_icon_list_init), (egg_icon_list_destroy),
(egg_icon_list_finalize), (egg_icon_list_set_property),
(egg_icon_list_get_property), (egg_icon_list_button_press),
(egg_icon_list_select_first_matching_item),
(egg_icon_list_maybe_begin_dragging_items),
(egg_icon_list_real_toggle_cursor_item),
(egg_icon_list_calculate_item_size),
(egg_icon_list_invalidate_sizes), (egg_icon_list_paint_item),
(egg_icon_list_item_new), (egg_icon_list_item_unref),
(egg_icon_list_get_item_text), (egg_icon_list_get_item_icon),
(egg_icon_list_get_item_at_pos), (egg_icon_list_get_path_at_pos),
(egg_icon_list_selected_foreach), (egg_icon_list_select_path),
(egg_icon_list_unselect_path), (egg_icon_list_path_is_selected),
(egg_icon_list_item_activated), (egg_icon_list_get_items),
(egg_icon_list_row_changed), (egg_icon_list_row_inserted),
(egg_icon_list_row_deleted), (egg_icon_list_rows_reordered),
(egg_icon_list_build_items), (egg_icon_list_set_model),
(egg_icon_list_get_model), (egg_icon_list_set_text_column),
(egg_icon_list_set_pixbuf_column):
* libegg/iconlist/eggiconlist.h:
* libegg/iconlist/testiconlist.c: (fill_model), (create_model),
(foreach_selected_print), (item_removed), (remove_selected),
(item_cb), (do_popup_menu), (main):
* libegg/util/eggmarshalers.list:
Update icon list to use the tree model instead.
2004-07-02 12:04:49 +00:00
|
|
|
PROP_TEXT_COLUMN,
|
2005-03-09 06:15:13 +00:00
|
|
|
g_param_spec_int ("text-column",
|
2004-07-04 15:56:55 +00:00
|
|
|
P_("Text column"),
|
|
|
|
P_("Model column used to retrieve the text from"),
|
Update icon list to use the tree model instead.
2004-07-02 Anders Carlsson <andersca@gnome.org>
* libegg/iconlist/eggiconlist.c: (egg_icon_list_class_init),
(egg_icon_list_init), (egg_icon_list_destroy),
(egg_icon_list_finalize), (egg_icon_list_set_property),
(egg_icon_list_get_property), (egg_icon_list_button_press),
(egg_icon_list_select_first_matching_item),
(egg_icon_list_maybe_begin_dragging_items),
(egg_icon_list_real_toggle_cursor_item),
(egg_icon_list_calculate_item_size),
(egg_icon_list_invalidate_sizes), (egg_icon_list_paint_item),
(egg_icon_list_item_new), (egg_icon_list_item_unref),
(egg_icon_list_get_item_text), (egg_icon_list_get_item_icon),
(egg_icon_list_get_item_at_pos), (egg_icon_list_get_path_at_pos),
(egg_icon_list_selected_foreach), (egg_icon_list_select_path),
(egg_icon_list_unselect_path), (egg_icon_list_path_is_selected),
(egg_icon_list_item_activated), (egg_icon_list_get_items),
(egg_icon_list_row_changed), (egg_icon_list_row_inserted),
(egg_icon_list_row_deleted), (egg_icon_list_rows_reordered),
(egg_icon_list_build_items), (egg_icon_list_set_model),
(egg_icon_list_get_model), (egg_icon_list_set_text_column),
(egg_icon_list_set_pixbuf_column):
* libegg/iconlist/eggiconlist.h:
* libegg/iconlist/testiconlist.c: (fill_model), (create_model),
(foreach_selected_print), (item_removed), (remove_selected),
(item_cb), (do_popup_menu), (main):
* libegg/util/eggmarshalers.list:
Update icon list to use the tree model instead.
2004-07-02 12:04:49 +00:00
|
|
|
-1, G_MAXINT, -1,
|
2005-03-22 02:14:55 +00:00
|
|
|
GTK_PARAM_READWRITE));
|
2002-04-30 17:08:52 +00:00
|
|
|
|
2004-07-13 05:15:49 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* GtkIconView:markup-column:
|
|
|
|
*
|
|
|
|
* The ::markup-column property contains the number of the model column
|
|
|
|
* containing markup information to be displayed. The markup column must be
|
|
|
|
* of type #G_TYPE_STRING. If this property and the :text-column property
|
|
|
|
* are both set to column numbers, it overrides the text column.
|
|
|
|
* If both are set to -1, no texts are displayed.
|
|
|
|
*
|
|
|
|
* Since: 2.6
|
|
|
|
*/
|
Add markup column support.
2004-07-02 Anders Carlsson <andersca@gnome.org>
* libegg/iconlist/eggiconlist.c: (egg_icon_list_class_init),
(egg_icon_list_init), (egg_icon_list_set_property),
(egg_icon_list_get_property), (egg_icon_list_calculate_item_size),
(egg_icon_list_paint_item), (egg_icon_list_update_item_text),
(egg_icon_list_get_text_column), (egg_icon_list_set_markup_column),
(egg_icon_list_get_markup_column),
(egg_icon_list_set_pixbuf_column),
(egg_icon_list_get_pixbuf_column):
* libegg/iconlist/eggiconlist.h:
* libegg/iconlist/testiconlist.c: (fill_model), (create_model):
Add markup column support.
2004-07-02 13:20:16 +00:00
|
|
|
g_object_class_install_property (gobject_class,
|
|
|
|
PROP_MARKUP_COLUMN,
|
2005-03-09 06:15:13 +00:00
|
|
|
g_param_spec_int ("markup-column",
|
2004-07-04 15:56:55 +00:00
|
|
|
P_("Markup column"),
|
2004-07-13 05:15:49 +00:00
|
|
|
P_("Model column used to retrieve the text if using Pango markup"),
|
Add markup column support.
2004-07-02 Anders Carlsson <andersca@gnome.org>
* libegg/iconlist/eggiconlist.c: (egg_icon_list_class_init),
(egg_icon_list_init), (egg_icon_list_set_property),
(egg_icon_list_get_property), (egg_icon_list_calculate_item_size),
(egg_icon_list_paint_item), (egg_icon_list_update_item_text),
(egg_icon_list_get_text_column), (egg_icon_list_set_markup_column),
(egg_icon_list_get_markup_column),
(egg_icon_list_set_pixbuf_column),
(egg_icon_list_get_pixbuf_column):
* libegg/iconlist/eggiconlist.h:
* libegg/iconlist/testiconlist.c: (fill_model), (create_model):
Add markup column support.
2004-07-02 13:20:16 +00:00
|
|
|
-1, G_MAXINT, -1,
|
2005-03-22 02:14:55 +00:00
|
|
|
GTK_PARAM_READWRITE));
|
Add markup column support.
2004-07-02 Anders Carlsson <andersca@gnome.org>
* libegg/iconlist/eggiconlist.c: (egg_icon_list_class_init),
(egg_icon_list_init), (egg_icon_list_set_property),
(egg_icon_list_get_property), (egg_icon_list_calculate_item_size),
(egg_icon_list_paint_item), (egg_icon_list_update_item_text),
(egg_icon_list_get_text_column), (egg_icon_list_set_markup_column),
(egg_icon_list_get_markup_column),
(egg_icon_list_set_pixbuf_column),
(egg_icon_list_get_pixbuf_column):
* libegg/iconlist/eggiconlist.h:
* libegg/iconlist/testiconlist.c: (fill_model), (create_model):
Add markup column support.
2004-07-02 13:20:16 +00:00
|
|
|
|
Update icon list to use the tree model instead.
2004-07-02 Anders Carlsson <andersca@gnome.org>
* libegg/iconlist/eggiconlist.c: (egg_icon_list_class_init),
(egg_icon_list_init), (egg_icon_list_destroy),
(egg_icon_list_finalize), (egg_icon_list_set_property),
(egg_icon_list_get_property), (egg_icon_list_button_press),
(egg_icon_list_select_first_matching_item),
(egg_icon_list_maybe_begin_dragging_items),
(egg_icon_list_real_toggle_cursor_item),
(egg_icon_list_calculate_item_size),
(egg_icon_list_invalidate_sizes), (egg_icon_list_paint_item),
(egg_icon_list_item_new), (egg_icon_list_item_unref),
(egg_icon_list_get_item_text), (egg_icon_list_get_item_icon),
(egg_icon_list_get_item_at_pos), (egg_icon_list_get_path_at_pos),
(egg_icon_list_selected_foreach), (egg_icon_list_select_path),
(egg_icon_list_unselect_path), (egg_icon_list_path_is_selected),
(egg_icon_list_item_activated), (egg_icon_list_get_items),
(egg_icon_list_row_changed), (egg_icon_list_row_inserted),
(egg_icon_list_row_deleted), (egg_icon_list_rows_reordered),
(egg_icon_list_build_items), (egg_icon_list_set_model),
(egg_icon_list_get_model), (egg_icon_list_set_text_column),
(egg_icon_list_set_pixbuf_column):
* libegg/iconlist/eggiconlist.h:
* libegg/iconlist/testiconlist.c: (fill_model), (create_model),
(foreach_selected_print), (item_removed), (remove_selected),
(item_cb), (do_popup_menu), (main):
* libegg/util/eggmarshalers.list:
Update icon list to use the tree model instead.
2004-07-02 12:04:49 +00:00
|
|
|
g_object_class_install_property (gobject_class,
|
|
|
|
PROP_MODEL,
|
|
|
|
g_param_spec_object ("model",
|
2004-07-13 05:15:49 +00:00
|
|
|
P_("Icon View Model"),
|
|
|
|
P_("The model for the icon view"),
|
Update icon list to use the tree model instead.
2004-07-02 Anders Carlsson <andersca@gnome.org>
* libegg/iconlist/eggiconlist.c: (egg_icon_list_class_init),
(egg_icon_list_init), (egg_icon_list_destroy),
(egg_icon_list_finalize), (egg_icon_list_set_property),
(egg_icon_list_get_property), (egg_icon_list_button_press),
(egg_icon_list_select_first_matching_item),
(egg_icon_list_maybe_begin_dragging_items),
(egg_icon_list_real_toggle_cursor_item),
(egg_icon_list_calculate_item_size),
(egg_icon_list_invalidate_sizes), (egg_icon_list_paint_item),
(egg_icon_list_item_new), (egg_icon_list_item_unref),
(egg_icon_list_get_item_text), (egg_icon_list_get_item_icon),
(egg_icon_list_get_item_at_pos), (egg_icon_list_get_path_at_pos),
(egg_icon_list_selected_foreach), (egg_icon_list_select_path),
(egg_icon_list_unselect_path), (egg_icon_list_path_is_selected),
(egg_icon_list_item_activated), (egg_icon_list_get_items),
(egg_icon_list_row_changed), (egg_icon_list_row_inserted),
(egg_icon_list_row_deleted), (egg_icon_list_rows_reordered),
(egg_icon_list_build_items), (egg_icon_list_set_model),
(egg_icon_list_get_model), (egg_icon_list_set_text_column),
(egg_icon_list_set_pixbuf_column):
* libegg/iconlist/eggiconlist.h:
* libegg/iconlist/testiconlist.c: (fill_model), (create_model),
(foreach_selected_print), (item_removed), (remove_selected),
(item_cb), (do_popup_menu), (main):
* libegg/util/eggmarshalers.list:
Update icon list to use the tree model instead.
2004-07-02 12:04:49 +00:00
|
|
|
GTK_TYPE_TREE_MODEL,
|
2005-03-22 02:14:55 +00:00
|
|
|
GTK_PARAM_READWRITE));
|
Update icon list to use the tree model instead.
2004-07-02 Anders Carlsson <andersca@gnome.org>
* libegg/iconlist/eggiconlist.c: (egg_icon_list_class_init),
(egg_icon_list_init), (egg_icon_list_destroy),
(egg_icon_list_finalize), (egg_icon_list_set_property),
(egg_icon_list_get_property), (egg_icon_list_button_press),
(egg_icon_list_select_first_matching_item),
(egg_icon_list_maybe_begin_dragging_items),
(egg_icon_list_real_toggle_cursor_item),
(egg_icon_list_calculate_item_size),
(egg_icon_list_invalidate_sizes), (egg_icon_list_paint_item),
(egg_icon_list_item_new), (egg_icon_list_item_unref),
(egg_icon_list_get_item_text), (egg_icon_list_get_item_icon),
(egg_icon_list_get_item_at_pos), (egg_icon_list_get_path_at_pos),
(egg_icon_list_selected_foreach), (egg_icon_list_select_path),
(egg_icon_list_unselect_path), (egg_icon_list_path_is_selected),
(egg_icon_list_item_activated), (egg_icon_list_get_items),
(egg_icon_list_row_changed), (egg_icon_list_row_inserted),
(egg_icon_list_row_deleted), (egg_icon_list_rows_reordered),
(egg_icon_list_build_items), (egg_icon_list_set_model),
(egg_icon_list_get_model), (egg_icon_list_set_text_column),
(egg_icon_list_set_pixbuf_column):
* libegg/iconlist/eggiconlist.h:
* libegg/iconlist/testiconlist.c: (fill_model), (create_model),
(foreach_selected_print), (item_removed), (remove_selected),
(item_cb), (do_popup_menu), (main):
* libegg/util/eggmarshalers.list:
Update icon list to use the tree model instead.
2004-07-02 12:04:49 +00:00
|
|
|
|
2004-12-14 06:39:45 +00:00
|
|
|
/**
|
|
|
|
* GtkIconView:columns:
|
|
|
|
*
|
|
|
|
* The columns property contains the number of the columns in which the
|
|
|
|
* items should be displayed. If it is -1, the number of columns will
|
|
|
|
* be chosen automatically to fill the available area.
|
|
|
|
*
|
|
|
|
* Since: 2.6
|
|
|
|
*/
|
|
|
|
g_object_class_install_property (gobject_class,
|
|
|
|
PROP_COLUMNS,
|
|
|
|
g_param_spec_int ("columns",
|
|
|
|
P_("Number of columns"),
|
|
|
|
P_("Number of columns to display"),
|
|
|
|
-1, G_MAXINT, -1,
|
2005-03-22 02:14:55 +00:00
|
|
|
GTK_PARAM_READWRITE));
|
2004-12-14 06:39:45 +00:00
|
|
|
|
|
|
|
|
|
|
|
/**
|
2006-07-10 16:59:43 +00:00
|
|
|
* GtkIconView:item-width:
|
2004-12-14 06:39:45 +00:00
|
|
|
*
|
|
|
|
* The item-width property specifies the width to use for each item.
|
|
|
|
* If it is set to -1, the icon view will automatically determine a
|
|
|
|
* suitable item size.
|
|
|
|
*
|
|
|
|
* Since: 2.6
|
|
|
|
*/
|
|
|
|
g_object_class_install_property (gobject_class,
|
|
|
|
PROP_ITEM_WIDTH,
|
2005-03-09 06:15:13 +00:00
|
|
|
g_param_spec_int ("item-width",
|
2004-12-14 06:39:45 +00:00
|
|
|
P_("Width for each item"),
|
|
|
|
P_("The width used for each item"),
|
|
|
|
-1, G_MAXINT, -1,
|
2005-03-22 02:14:55 +00:00
|
|
|
GTK_PARAM_READWRITE));
|
2004-12-14 06:39:45 +00:00
|
|
|
|
|
|
|
/**
|
2006-07-10 16:59:43 +00:00
|
|
|
* GtkIconView:spacing:
|
2004-12-14 06:39:45 +00:00
|
|
|
*
|
|
|
|
* The spacing property specifies the space which is inserted between
|
|
|
|
* the cells (i.e. the icon and the text) of an item.
|
|
|
|
*
|
|
|
|
* Since: 2.6
|
|
|
|
*/
|
|
|
|
g_object_class_install_property (gobject_class,
|
|
|
|
PROP_SPACING,
|
|
|
|
g_param_spec_int ("spacing",
|
|
|
|
P_("Spacing"),
|
|
|
|
P_("Space which is inserted between cells of an item"),
|
|
|
|
0, G_MAXINT, 0,
|
2005-03-22 02:14:55 +00:00
|
|
|
GTK_PARAM_READWRITE));
|
2004-12-14 06:39:45 +00:00
|
|
|
|
|
|
|
/**
|
2006-07-10 16:59:43 +00:00
|
|
|
* GtkIconView:row-spacing:
|
2004-12-14 06:39:45 +00:00
|
|
|
*
|
|
|
|
* The row-spacing property specifies the space which is inserted between
|
|
|
|
* the rows of the icon view.
|
|
|
|
*
|
|
|
|
* Since: 2.6
|
|
|
|
*/
|
|
|
|
g_object_class_install_property (gobject_class,
|
|
|
|
PROP_ROW_SPACING,
|
2005-03-09 06:15:13 +00:00
|
|
|
g_param_spec_int ("row-spacing",
|
2004-12-14 06:39:45 +00:00
|
|
|
P_("Row Spacing"),
|
|
|
|
P_("Space which is inserted between grid rows"),
|
|
|
|
0, G_MAXINT, 6,
|
2005-03-22 02:14:55 +00:00
|
|
|
GTK_PARAM_READWRITE));
|
2004-12-14 06:39:45 +00:00
|
|
|
|
|
|
|
/**
|
2006-07-10 16:59:43 +00:00
|
|
|
* GtkIconView:column-spacing:
|
2004-12-14 06:39:45 +00:00
|
|
|
*
|
|
|
|
* The column-spacing property specifies the space which is inserted between
|
|
|
|
* the columns of the icon view.
|
|
|
|
*
|
|
|
|
* Since: 2.6
|
|
|
|
*/
|
|
|
|
g_object_class_install_property (gobject_class,
|
|
|
|
PROP_COLUMN_SPACING,
|
2005-03-09 06:15:13 +00:00
|
|
|
g_param_spec_int ("column-spacing",
|
2004-12-14 06:39:45 +00:00
|
|
|
P_("Column Spacing"),
|
2005-09-09 16:21:15 +00:00
|
|
|
P_("Space which is inserted between grid columns"),
|
2004-12-14 06:39:45 +00:00
|
|
|
0, G_MAXINT, 6,
|
2005-03-22 02:14:55 +00:00
|
|
|
GTK_PARAM_READWRITE));
|
2004-12-14 06:39:45 +00:00
|
|
|
|
|
|
|
/**
|
2006-07-10 16:59:43 +00:00
|
|
|
* GtkIconView:margin:
|
2004-12-14 06:39:45 +00:00
|
|
|
*
|
|
|
|
* The margin property specifies the space which is inserted
|
|
|
|
* at the edges of the icon view.
|
|
|
|
*
|
|
|
|
* Since: 2.6
|
|
|
|
*/
|
|
|
|
g_object_class_install_property (gobject_class,
|
|
|
|
PROP_MARGIN,
|
|
|
|
g_param_spec_int ("margin",
|
|
|
|
P_("Margin"),
|
|
|
|
P_("Space which is inserted at the edges of the icon view"),
|
|
|
|
0, G_MAXINT, 6,
|
2005-03-22 02:14:55 +00:00
|
|
|
GTK_PARAM_READWRITE));
|
2004-12-14 06:39:45 +00:00
|
|
|
|
|
|
|
/**
|
2010-09-02 03:03:48 +00:00
|
|
|
* GtkIconView:item-orientation:
|
2004-12-14 06:39:45 +00:00
|
|
|
*
|
2010-09-02 03:03:48 +00:00
|
|
|
* The item-orientation property specifies how the cells (i.e. the icon and
|
2004-12-14 06:39:45 +00:00
|
|
|
* the text) of the item are positioned relative to each other.
|
|
|
|
*
|
|
|
|
* Since: 2.6
|
|
|
|
*/
|
2004-07-18 03:39:50 +00:00
|
|
|
g_object_class_install_property (gobject_class,
|
2010-09-02 03:03:48 +00:00
|
|
|
PROP_ITEM_ORIENTATION,
|
|
|
|
g_param_spec_enum ("item-orientation",
|
|
|
|
P_("Item Orientation"),
|
2004-07-18 03:39:50 +00:00
|
|
|
P_("How the text and icon of each item are positioned relative to each other"),
|
|
|
|
GTK_TYPE_ORIENTATION,
|
|
|
|
GTK_ORIENTATION_VERTICAL,
|
2005-03-22 02:14:55 +00:00
|
|
|
GTK_PARAM_READWRITE));
|
2002-04-30 17:08:52 +00:00
|
|
|
|
2005-05-06 04:14:32 +00:00
|
|
|
/**
|
2005-09-13 17:53:21 +00:00
|
|
|
* GtkIconView:reorderable:
|
2005-05-06 04:14:32 +00:00
|
|
|
*
|
|
|
|
* The reorderable property specifies if the items can be reordered
|
|
|
|
* by DND.
|
|
|
|
*
|
|
|
|
* Since: 2.8
|
|
|
|
*/
|
|
|
|
g_object_class_install_property (gobject_class,
|
|
|
|
PROP_REORDERABLE,
|
|
|
|
g_param_spec_boolean ("reorderable",
|
|
|
|
P_("Reorderable"),
|
|
|
|
P_("View is reorderable"),
|
|
|
|
FALSE,
|
|
|
|
G_PARAM_READWRITE));
|
|
|
|
|
2007-07-19 14:59:44 +00:00
|
|
|
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));
|
|
|
|
|
2009-08-07 03:56:30 +00:00
|
|
|
/**
|
|
|
|
* 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));
|
|
|
|
|
2010-12-10 08:15:39 +00:00
|
|
|
/**
|
|
|
|
* GtkIconView:cell-area:
|
|
|
|
*
|
|
|
|
* The #GtkCellArea used to layout cell renderers for this view.
|
|
|
|
*
|
2011-02-24 07:05:41 +00:00
|
|
|
* If no area is specified when creating the icon view with gtk_icon_view_new_with_area()
|
|
|
|
* a #GtkCellAreaBox will be used.
|
|
|
|
*
|
2010-12-10 08:15:39 +00:00
|
|
|
* Since: 3.0
|
|
|
|
*/
|
|
|
|
g_object_class_install_property (gobject_class,
|
|
|
|
PROP_CELL_AREA,
|
|
|
|
g_param_spec_object ("cell-area",
|
|
|
|
P_("Cell Area"),
|
|
|
|
P_("The GtkCellArea used to layout cells"),
|
|
|
|
GTK_TYPE_CELL_AREA,
|
|
|
|
GTK_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY));
|
|
|
|
|
2010-10-18 04:21:39 +00:00
|
|
|
/* Scrollable interface properties */
|
2010-10-26 00:59:02 +00:00
|
|
|
g_object_class_override_property (gobject_class, PROP_HADJUSTMENT, "hadjustment");
|
|
|
|
g_object_class_override_property (gobject_class, PROP_VADJUSTMENT, "vadjustment");
|
|
|
|
g_object_class_override_property (gobject_class, PROP_HSCROLL_POLICY, "hscroll-policy");
|
|
|
|
g_object_class_override_property (gobject_class, PROP_VSCROLL_POLICY, "vscroll-policy");
|
2007-07-19 14:59:44 +00:00
|
|
|
|
2004-07-04 15:56:55 +00:00
|
|
|
/* Style properties */
|
2003-07-03 13:10:41 +00:00
|
|
|
gtk_widget_class_install_style_property (widget_class,
|
2005-03-09 06:15:13 +00:00
|
|
|
g_param_spec_boxed ("selection-box-color",
|
2004-07-04 15:56:55 +00:00
|
|
|
P_("Selection Box Color"),
|
|
|
|
P_("Color of the selection box"),
|
2003-07-03 13:10:41 +00:00
|
|
|
GDK_TYPE_COLOR,
|
2005-03-22 02:14:55 +00:00
|
|
|
GTK_PARAM_READABLE));
|
2003-07-03 13:10:41 +00:00
|
|
|
|
|
|
|
gtk_widget_class_install_style_property (widget_class,
|
2005-03-09 06:15:13 +00:00
|
|
|
g_param_spec_uchar ("selection-box-alpha",
|
2004-07-04 15:56:55 +00:00
|
|
|
P_("Selection Box Alpha"),
|
|
|
|
P_("Opacity of the selection box"),
|
2003-07-03 13:10:41 +00:00
|
|
|
0, 0xff,
|
|
|
|
0x40,
|
2005-03-22 02:14:55 +00:00
|
|
|
GTK_PARAM_READABLE));
|
2003-07-03 13:10:41 +00:00
|
|
|
|
2002-04-30 17:08:52 +00:00
|
|
|
/* Signals */
|
2008-12-30 00:52:04 +00:00
|
|
|
/**
|
|
|
|
* 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.
|
|
|
|
*/
|
2004-07-04 15:56:55 +00:00
|
|
|
icon_view_signals[ITEM_ACTIVATED] =
|
2008-08-11 12:54:57 +00:00
|
|
|
g_signal_new (I_("item-activated"),
|
2002-04-30 17:08:52 +00:00
|
|
|
G_TYPE_FROM_CLASS (gobject_class),
|
|
|
|
G_SIGNAL_RUN_LAST,
|
2004-07-04 15:56:55 +00:00
|
|
|
G_STRUCT_OFFSET (GtkIconViewClass, item_activated),
|
2002-04-30 17:08:52 +00:00
|
|
|
NULL, NULL,
|
2002-07-29 21:11:23 +00:00
|
|
|
g_cclosure_marshal_VOID__BOXED,
|
2002-04-30 17:08:52 +00:00
|
|
|
G_TYPE_NONE, 1,
|
Update icon list to use the tree model instead.
2004-07-02 Anders Carlsson <andersca@gnome.org>
* libegg/iconlist/eggiconlist.c: (egg_icon_list_class_init),
(egg_icon_list_init), (egg_icon_list_destroy),
(egg_icon_list_finalize), (egg_icon_list_set_property),
(egg_icon_list_get_property), (egg_icon_list_button_press),
(egg_icon_list_select_first_matching_item),
(egg_icon_list_maybe_begin_dragging_items),
(egg_icon_list_real_toggle_cursor_item),
(egg_icon_list_calculate_item_size),
(egg_icon_list_invalidate_sizes), (egg_icon_list_paint_item),
(egg_icon_list_item_new), (egg_icon_list_item_unref),
(egg_icon_list_get_item_text), (egg_icon_list_get_item_icon),
(egg_icon_list_get_item_at_pos), (egg_icon_list_get_path_at_pos),
(egg_icon_list_selected_foreach), (egg_icon_list_select_path),
(egg_icon_list_unselect_path), (egg_icon_list_path_is_selected),
(egg_icon_list_item_activated), (egg_icon_list_get_items),
(egg_icon_list_row_changed), (egg_icon_list_row_inserted),
(egg_icon_list_row_deleted), (egg_icon_list_rows_reordered),
(egg_icon_list_build_items), (egg_icon_list_set_model),
(egg_icon_list_get_model), (egg_icon_list_set_text_column),
(egg_icon_list_set_pixbuf_column):
* libegg/iconlist/eggiconlist.h:
* libegg/iconlist/testiconlist.c: (fill_model), (create_model),
(foreach_selected_print), (item_removed), (remove_selected),
(item_cb), (do_popup_menu), (main):
* libegg/util/eggmarshalers.list:
Update icon list to use the tree model instead.
2004-07-02 12:04:49 +00:00
|
|
|
GTK_TYPE_TREE_PATH);
|
2002-04-30 17:08:52 +00:00
|
|
|
|
2008-12-30 00:52:04 +00:00
|
|
|
/**
|
|
|
|
* 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.
|
|
|
|
*/
|
2004-07-04 15:56:55 +00:00
|
|
|
icon_view_signals[SELECTION_CHANGED] =
|
2006-07-06 05:14:03 +00:00
|
|
|
g_signal_new (I_("selection-changed"),
|
2002-04-30 17:08:52 +00:00
|
|
|
G_TYPE_FROM_CLASS (gobject_class),
|
|
|
|
G_SIGNAL_RUN_FIRST,
|
2004-07-04 15:56:55 +00:00
|
|
|
G_STRUCT_OFFSET (GtkIconViewClass, selection_changed),
|
2002-04-30 17:08:52 +00:00
|
|
|
NULL, NULL,
|
|
|
|
g_cclosure_marshal_VOID__VOID,
|
|
|
|
G_TYPE_NONE, 0);
|
|
|
|
|
2008-12-30 00:52:04 +00:00
|
|
|
/**
|
|
|
|
* 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.
|
|
|
|
*/
|
2004-07-04 15:56:55 +00:00
|
|
|
icon_view_signals[SELECT_ALL] =
|
2008-08-11 12:54:57 +00:00
|
|
|
g_signal_new (I_("select-all"),
|
2002-04-30 17:08:52 +00:00
|
|
|
G_TYPE_FROM_CLASS (gobject_class),
|
|
|
|
G_SIGNAL_RUN_LAST | G_SIGNAL_ACTION,
|
2004-07-04 15:56:55 +00:00
|
|
|
G_STRUCT_OFFSET (GtkIconViewClass, select_all),
|
2002-04-30 17:08:52 +00:00
|
|
|
NULL, NULL,
|
|
|
|
g_cclosure_marshal_VOID__VOID,
|
|
|
|
G_TYPE_NONE, 0);
|
|
|
|
|
2008-12-30 00:52:04 +00:00
|
|
|
/**
|
|
|
|
* 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.
|
|
|
|
*/
|
2004-07-04 15:56:55 +00:00
|
|
|
icon_view_signals[UNSELECT_ALL] =
|
2008-08-11 12:54:57 +00:00
|
|
|
g_signal_new (I_("unselect-all"),
|
2002-04-30 17:08:52 +00:00
|
|
|
G_TYPE_FROM_CLASS (gobject_class),
|
|
|
|
G_SIGNAL_RUN_LAST | G_SIGNAL_ACTION,
|
2004-07-04 15:56:55 +00:00
|
|
|
G_STRUCT_OFFSET (GtkIconViewClass, unselect_all),
|
2002-04-30 17:08:52 +00:00
|
|
|
NULL, NULL,
|
|
|
|
g_cclosure_marshal_VOID__VOID,
|
|
|
|
G_TYPE_NONE, 0);
|
|
|
|
|
2008-12-30 00:52:04 +00:00
|
|
|
/**
|
|
|
|
* 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.
|
|
|
|
*/
|
2004-07-04 15:56:55 +00:00
|
|
|
icon_view_signals[SELECT_CURSOR_ITEM] =
|
2008-08-11 12:54:57 +00:00
|
|
|
g_signal_new (I_("select-cursor-item"),
|
2002-04-30 17:08:52 +00:00
|
|
|
G_TYPE_FROM_CLASS (gobject_class),
|
|
|
|
G_SIGNAL_RUN_LAST | G_SIGNAL_ACTION,
|
2004-07-04 15:56:55 +00:00
|
|
|
G_STRUCT_OFFSET (GtkIconViewClass, select_cursor_item),
|
2002-04-30 17:08:52 +00:00
|
|
|
NULL, NULL,
|
|
|
|
g_cclosure_marshal_VOID__VOID,
|
|
|
|
G_TYPE_NONE, 0);
|
|
|
|
|
2008-12-30 00:52:04 +00:00
|
|
|
/**
|
|
|
|
* 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.
|
|
|
|
*/
|
2004-07-04 23:19:46 +00:00
|
|
|
icon_view_signals[TOGGLE_CURSOR_ITEM] =
|
2008-08-11 12:54:57 +00:00
|
|
|
g_signal_new (I_("toggle-cursor-item"),
|
2002-04-30 17:08:52 +00:00
|
|
|
G_TYPE_FROM_CLASS (gobject_class),
|
|
|
|
G_SIGNAL_RUN_LAST | G_SIGNAL_ACTION,
|
2004-07-04 15:56:55 +00:00
|
|
|
G_STRUCT_OFFSET (GtkIconViewClass, toggle_cursor_item),
|
2002-04-30 17:08:52 +00:00
|
|
|
NULL, NULL,
|
|
|
|
g_cclosure_marshal_VOID__VOID,
|
|
|
|
G_TYPE_NONE, 0);
|
|
|
|
|
2008-12-30 00:52:04 +00:00
|
|
|
/**
|
|
|
|
* 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.
|
|
|
|
*/
|
2004-07-04 23:19:46 +00:00
|
|
|
icon_view_signals[ACTIVATE_CURSOR_ITEM] =
|
2008-08-11 12:54:57 +00:00
|
|
|
g_signal_new (I_("activate-cursor-item"),
|
2004-07-04 23:19:46 +00:00
|
|
|
G_TYPE_FROM_CLASS (gobject_class),
|
|
|
|
G_SIGNAL_RUN_LAST | G_SIGNAL_ACTION,
|
|
|
|
G_STRUCT_OFFSET (GtkIconViewClass, activate_cursor_item),
|
|
|
|
NULL, NULL,
|
|
|
|
_gtk_marshal_BOOLEAN__VOID,
|
|
|
|
G_TYPE_BOOLEAN, 0);
|
|
|
|
|
2008-12-30 00:52:04 +00:00
|
|
|
/**
|
|
|
|
* 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.
|
|
|
|
*/
|
2004-07-04 15:56:55 +00:00
|
|
|
icon_view_signals[MOVE_CURSOR] =
|
2008-08-11 12:54:57 +00:00
|
|
|
g_signal_new (I_("move-cursor"),
|
2004-06-18 05:17:01 +00:00
|
|
|
G_TYPE_FROM_CLASS (gobject_class),
|
|
|
|
G_SIGNAL_RUN_LAST | G_SIGNAL_ACTION,
|
2004-07-04 15:56:55 +00:00
|
|
|
G_STRUCT_OFFSET (GtkIconViewClass, move_cursor),
|
2004-06-18 05:17:01 +00:00
|
|
|
NULL, NULL,
|
2004-07-04 15:56:55 +00:00
|
|
|
_gtk_marshal_BOOLEAN__ENUM_INT,
|
2004-06-18 05:17:01 +00:00
|
|
|
G_TYPE_BOOLEAN, 2,
|
|
|
|
GTK_TYPE_MOVEMENT_STEP,
|
|
|
|
G_TYPE_INT);
|
|
|
|
|
2002-04-30 17:08:52 +00:00
|
|
|
/* Key bindings */
|
2010-09-08 17:35:51 +00:00
|
|
|
gtk_binding_entry_add_signal (binding_set, GDK_KEY_a, GDK_CONTROL_MASK,
|
2008-08-11 12:54:57 +00:00
|
|
|
"select-all", 0);
|
2010-09-08 17:35:51 +00:00
|
|
|
gtk_binding_entry_add_signal (binding_set, GDK_KEY_a, GDK_CONTROL_MASK | GDK_SHIFT_MASK,
|
2008-08-11 12:54:57 +00:00
|
|
|
"unselect-all", 0);
|
2010-09-08 17:35:51 +00:00
|
|
|
gtk_binding_entry_add_signal (binding_set, GDK_KEY_space, GDK_CONTROL_MASK,
|
2008-08-11 12:54:57 +00:00
|
|
|
"toggle-cursor-item", 0);
|
2010-09-08 17:35:51 +00:00
|
|
|
gtk_binding_entry_add_signal (binding_set, GDK_KEY_KP_Space, GDK_CONTROL_MASK,
|
2008-08-11 12:54:57 +00:00
|
|
|
"toggle-cursor-item", 0);
|
2005-09-01 05:11:46 +00:00
|
|
|
|
2010-09-08 17:35:51 +00:00
|
|
|
gtk_binding_entry_add_signal (binding_set, GDK_KEY_space, 0,
|
2008-08-11 12:54:57 +00:00
|
|
|
"activate-cursor-item", 0);
|
2010-09-08 17:35:51 +00:00
|
|
|
gtk_binding_entry_add_signal (binding_set, GDK_KEY_KP_Space, 0,
|
2008-08-11 12:54:57 +00:00
|
|
|
"activate-cursor-item", 0);
|
2010-09-08 17:35:51 +00:00
|
|
|
gtk_binding_entry_add_signal (binding_set, GDK_KEY_Return, 0,
|
2008-08-11 12:54:57 +00:00
|
|
|
"activate-cursor-item", 0);
|
2010-09-08 17:35:51 +00:00
|
|
|
gtk_binding_entry_add_signal (binding_set, GDK_KEY_ISO_Enter, 0,
|
2008-08-11 12:54:57 +00:00
|
|
|
"activate-cursor-item", 0);
|
2010-09-08 17:35:51 +00:00
|
|
|
gtk_binding_entry_add_signal (binding_set, GDK_KEY_KP_Enter, 0,
|
2008-08-11 12:54:57 +00:00
|
|
|
"activate-cursor-item", 0);
|
2004-07-04 23:19:46 +00:00
|
|
|
|
2010-09-08 17:35:51 +00:00
|
|
|
gtk_icon_view_add_move_binding (binding_set, GDK_KEY_Up, 0,
|
2004-06-18 05:17:01 +00:00
|
|
|
GTK_MOVEMENT_DISPLAY_LINES, -1);
|
2010-09-08 17:35:51 +00:00
|
|
|
gtk_icon_view_add_move_binding (binding_set, GDK_KEY_KP_Up, 0,
|
2004-06-18 05:17:01 +00:00
|
|
|
GTK_MOVEMENT_DISPLAY_LINES, -1);
|
|
|
|
|
2010-09-08 17:35:51 +00:00
|
|
|
gtk_icon_view_add_move_binding (binding_set, GDK_KEY_Down, 0,
|
2004-06-18 05:17:01 +00:00
|
|
|
GTK_MOVEMENT_DISPLAY_LINES, 1);
|
2010-09-08 17:35:51 +00:00
|
|
|
gtk_icon_view_add_move_binding (binding_set, GDK_KEY_KP_Down, 0,
|
2004-06-18 05:17:01 +00:00
|
|
|
GTK_MOVEMENT_DISPLAY_LINES, 1);
|
|
|
|
|
2010-09-08 17:35:51 +00:00
|
|
|
gtk_icon_view_add_move_binding (binding_set, GDK_KEY_p, GDK_CONTROL_MASK,
|
2004-06-18 05:17:01 +00:00
|
|
|
GTK_MOVEMENT_DISPLAY_LINES, -1);
|
|
|
|
|
2010-09-08 17:35:51 +00:00
|
|
|
gtk_icon_view_add_move_binding (binding_set, GDK_KEY_n, GDK_CONTROL_MASK,
|
2004-06-18 05:17:01 +00:00
|
|
|
GTK_MOVEMENT_DISPLAY_LINES, 1);
|
|
|
|
|
2010-09-08 17:35:51 +00:00
|
|
|
gtk_icon_view_add_move_binding (binding_set, GDK_KEY_Home, 0,
|
2004-06-18 05:17:01 +00:00
|
|
|
GTK_MOVEMENT_BUFFER_ENDS, -1);
|
2010-09-08 17:35:51 +00:00
|
|
|
gtk_icon_view_add_move_binding (binding_set, GDK_KEY_KP_Home, 0,
|
2004-06-18 05:17:01 +00:00
|
|
|
GTK_MOVEMENT_BUFFER_ENDS, -1);
|
|
|
|
|
2010-09-08 17:35:51 +00:00
|
|
|
gtk_icon_view_add_move_binding (binding_set, GDK_KEY_End, 0,
|
2004-06-18 05:17:01 +00:00
|
|
|
GTK_MOVEMENT_BUFFER_ENDS, 1);
|
2010-09-08 17:35:51 +00:00
|
|
|
gtk_icon_view_add_move_binding (binding_set, GDK_KEY_KP_End, 0,
|
2004-06-18 05:17:01 +00:00
|
|
|
GTK_MOVEMENT_BUFFER_ENDS, 1);
|
|
|
|
|
2010-09-08 17:35:51 +00:00
|
|
|
gtk_icon_view_add_move_binding (binding_set, GDK_KEY_Page_Up, 0,
|
2004-06-18 05:17:01 +00:00
|
|
|
GTK_MOVEMENT_PAGES, -1);
|
2010-09-08 17:35:51 +00:00
|
|
|
gtk_icon_view_add_move_binding (binding_set, GDK_KEY_KP_Page_Up, 0,
|
2004-06-18 05:17:01 +00:00
|
|
|
GTK_MOVEMENT_PAGES, -1);
|
|
|
|
|
2010-09-08 17:35:51 +00:00
|
|
|
gtk_icon_view_add_move_binding (binding_set, GDK_KEY_Page_Down, 0,
|
2004-06-18 05:17:01 +00:00
|
|
|
GTK_MOVEMENT_PAGES, 1);
|
2010-09-08 17:35:51 +00:00
|
|
|
gtk_icon_view_add_move_binding (binding_set, GDK_KEY_KP_Page_Down, 0,
|
2004-06-18 05:17:01 +00:00
|
|
|
GTK_MOVEMENT_PAGES, 1);
|
|
|
|
|
2010-09-08 17:35:51 +00:00
|
|
|
gtk_icon_view_add_move_binding (binding_set, GDK_KEY_Right, 0,
|
2004-06-18 05:17:01 +00:00
|
|
|
GTK_MOVEMENT_VISUAL_POSITIONS, 1);
|
2010-09-08 17:35:51 +00:00
|
|
|
gtk_icon_view_add_move_binding (binding_set, GDK_KEY_Left, 0,
|
2004-06-18 05:17:01 +00:00
|
|
|
GTK_MOVEMENT_VISUAL_POSITIONS, -1);
|
|
|
|
|
2010-09-08 17:35:51 +00:00
|
|
|
gtk_icon_view_add_move_binding (binding_set, GDK_KEY_KP_Right, 0,
|
2004-06-18 05:17:01 +00:00
|
|
|
GTK_MOVEMENT_VISUAL_POSITIONS, 1);
|
2010-09-08 17:35:51 +00:00
|
|
|
gtk_icon_view_add_move_binding (binding_set, GDK_KEY_KP_Left, 0,
|
2004-06-18 05:17:01 +00:00
|
|
|
GTK_MOVEMENT_VISUAL_POSITIONS, -1);
|
|
|
|
}
|
2002-04-30 17:08:52 +00:00
|
|
|
|
Add GtkBuilder, fixes #172535
2007-06-15 Johan Dahlin <jdahlin@async.com.br>
* demos/gtk-demo/Makefile.am:
* demos/gtk-demo/builder.c: (quit_activate), (about_activate),
(do_builder):
* demos/gtk-demo/demo.ui:
* docs/reference/gtk/gtk-docs.sgml:
* docs/reference/gtk/gtk-sections.txt:
* docs/reference/gtk/gtk.types:
* docs/reference/gtk/tmpl/gtkbuildable.sgml:
* docs/reference/gtk/tmpl/gtkbuilder.sgml:
* gtk/Makefile.am:
* gtk/gtk.h:
* gtk/gtk.symbols:
* gtk/gtkaction.c: (gtk_action_buildable_init),
(gtk_action_buildable_set_name), (gtk_action_buildable_get_name):
* gtk/gtkactiongroup.c: (gtk_action_group_get_type),
(gtk_action_group_buildable_init),
(gtk_action_group_buildable_add),
(gtk_action_group_buildable_set_name),
(gtk_action_group_buildable_get_name):
* gtk/gtkbuildable.c: (gtk_buildable_get_type),
(gtk_buildable_set_name), (gtk_buildable_get_name),
(gtk_buildable_add), (gtk_buildable_set_property),
(gtk_buildable_parser_finished), (gtk_buildable_construct_child),
(gtk_buildable_custom_tag_start), (gtk_buildable_custom_tag_end),
(gtk_buildable_custom_finished),
(gtk_buildable_get_internal_child):
* gtk/gtkbuildable.h:
* gtk/gtkbuilder.c: (gtk_builder_class_init), (gtk_builder_init),
(gtk_builder_finalize), (gtk_builder_set_property),
(gtk_builder_get_property), (_gtk_builder_resolve_type_lazily),
(gtk_builder_real_get_type_from_name),
(gtk_builder_get_parameters), (gtk_builder_get_internal_child),
(_gtk_builder_construct), (_gtk_builder_add),
(apply_delayed_properties), (_gtk_builder_finish),
(gtk_builder_new), (gtk_builder_add_from_file),
(gtk_builder_add_from_string), (gtk_builder_get_object),
(object_add_to_list), (gtk_builder_get_objects),
(gtk_builder_set_translation_domain),
(gtk_builder_get_translation_domain),
(gtk_builder_connect_signals_default),
(gtk_builder_connect_signals), (gtk_builder_connect_signals_full),
(gtk_builder_value_from_string),
(gtk_builder_value_from_string_type),
(_gtk_builder_enum_from_string), (_gtk_builder_flags_from_string),
(gtk_builder_get_type_from_name), (gtk_builder_error_quark):
* gtk/gtkbuilder.h:
* gtk/gtkbuilderparser.c: (state_push), (state_peek), (state_pop),
(error_missing_attribute), (error_invalid_attribute),
(error_invalid_tag), (builder_construct), (parse_object),
(free_object_info), (_get_type_by_symbol), (parse_child),
(free_child_info), (parse_property), (free_property_info),
(parse_signal), (_free_signal_info), (parse_interface),
(create_subparser), (free_subparser), (subparser_start),
(subparser_end), (parse_custom), (start_element), (end_element),
(text), (_gtk_builder_parser_parse_buffer):
* gtk/gtkbuilderprivate.h:
* gtk/gtkcelllayout.c: (attributes_start_element),
(attributes_text_element),
(_gtk_cell_layout_buildable_custom_tag_start),
(_gtk_cell_layout_buildable_custom_tag_end),
(_gtk_cell_layout_buildable_add):
* gtk/gtkcelllayout.h:
* gtk/gtkcellview.c: (gtk_cell_view_buildable_init),
(gtk_cell_view_buildable_custom_tag_start),
(gtk_cell_view_buildable_custom_tag_end):
* gtk/gtkcolorseldialog.c:
(gtk_color_selection_dialog_buildable_interface_init),
(gtk_color_selection_dialog_buildable_get_internal_child):
* gtk/gtkcombobox.c: (gtk_combo_box_buildable_init),
(gtk_combo_box_buildable_custom_tag_start),
(gtk_combo_box_buildable_custom_tag_end):
* gtk/gtkcomboboxentry.c:
(gtk_combo_box_entry_buildable_interface_init),
(gtk_combo_box_entry_buildable_get_internal_child):
* gtk/gtkcontainer.c: (gtk_container_get_type),
(gtk_container_buildable_init), (gtk_container_buildable_add),
(gtk_container_buildable_set_child_property),
(attributes_start_element), (attributes_text_element),
(gtk_container_buildable_custom_tag_start),
(gtk_container_buildable_custom_tag_end):
* gtk/gtkdebug.h:
* gtk/gtkdialog.c: (gtk_dialog_buildable_interface_init),
(gtk_dialog_buildable_get_internal_child),
(attributes_start_element), (attributes_text_element),
(gtk_dialog_buildable_custom_tag_start),
(gtk_dialog_buildable_custom_finished):
* gtk/gtkentrycompletion.c: (gtk_entry_completion_buildable_init):
* gtk/gtkexpander.c: (gtk_expander_buildable_add),
(gtk_expander_buildable_init):
* gtk/gtkfontsel.c:
(gtk_font_selection_dialog_buildable_interface_init),
(gtk_font_selection_dialog_buildable_get_internal_child):
* gtk/gtkframe.c: (gtk_frame_buildable_init),
(gtk_frame_buildable_add):
* gtk/gtkiconview.c: (gtk_icon_view_buildable_init),
(gtk_icon_view_buildable_custom_tag_start),
(gtk_icon_view_buildable_custom_tag_end):
* gtk/gtkliststore.c: (gtk_list_store_buildable_init),
(list_store_start_element), (list_store_end_element),
(list_store_text), (gtk_list_store_buildable_custom_tag_start),
(gtk_list_store_buildable_custom_tag_end):
* gtk/gtkmain.c:
* gtk/gtknotebook.c: (gtk_notebook_buildable_init),
(gtk_notebook_buildable_add):
* gtk/gtksizegroup.c: (gtk_size_group_buildable_init),
(size_group_start_element),
(gtk_size_group_buildable_custom_tag_start),
(gtk_size_group_buildable_custom_finished):
* gtk/gtktreestore.c: (gtk_tree_store_buildable_init),
(tree_model_start_element),
(gtk_tree_store_buildable_custom_tag_start),
(gtk_tree_store_buildable_custom_finished):
* gtk/gtktreeview.c: (gtk_tree_view_buildable_init),
(gtk_tree_view_buildable_add):
* gtk/gtktreeviewcolumn.c: (gtk_tree_view_column_buildable_init):
* gtk/gtkuimanager.c: (gtk_ui_manager_buildable_init),
(gtk_ui_manager_buildable_add),
(gtk_ui_manager_buildable_construct_child),
(gtk_ui_manager_buildable_custom_tag_start),
(gtk_ui_manager_buildable_custom_tag_end):
* gtk/gtkwidget.c: (gtk_widget_get_type),
(gtk_widget_buildable_interface_init),
(gtk_widget_buildable_set_name), (gtk_widget_buildable_get_name),
(gtk_widget_buildable_set_property),
(gtk_widget_buildable_parser_finshed), (accel_group_start_element),
(gtk_widget_buildable_custom_tag_start),
(gtk_widget_buildable_custom_finshed):
* gtk/gtkwindow.c: (gtk_window_buildable_interface_init),
(gtk_window_buildable_set_property),
(gtk_window_buildable_parser_finished):
* tests/Makefile.am:
* tests/buildertest.c: (builder_new_from_string), (test_parser),
(signal_normal), (signal_after), (signal_object),
(signal_object_after), (signal_first), (signal_second),
(signal_extra), (signal_extra2), (test_connect_signals),
(test_uimanager_simple), (test_domain), (test_translation),
(test_sizegroup), (test_list_store), (test_tree_store),
(test_types), (test_spin_button), (test_notebook),
(test_construct_only_property), (test_children),
(test_child_properties), (test_treeview_column), (test_icon_view),
(test_combo_box), (test_combo_box_entry), (test_cell_view),
(test_dialog), (test_accelerators), (test_widget), (main):
Add GtkBuilder, fixes #172535
svn path=/trunk/; revision=18141
2007-06-15 17:53:46 +00:00
|
|
|
static void
|
|
|
|
gtk_icon_view_buildable_init (GtkBuildableIface *iface)
|
|
|
|
{
|
|
|
|
parent_buildable_iface = g_type_interface_peek_parent (iface);
|
2007-06-19 12:23:36 +00:00
|
|
|
iface->add_child = _gtk_cell_layout_buildable_add_child;
|
Add GtkBuilder, fixes #172535
2007-06-15 Johan Dahlin <jdahlin@async.com.br>
* demos/gtk-demo/Makefile.am:
* demos/gtk-demo/builder.c: (quit_activate), (about_activate),
(do_builder):
* demos/gtk-demo/demo.ui:
* docs/reference/gtk/gtk-docs.sgml:
* docs/reference/gtk/gtk-sections.txt:
* docs/reference/gtk/gtk.types:
* docs/reference/gtk/tmpl/gtkbuildable.sgml:
* docs/reference/gtk/tmpl/gtkbuilder.sgml:
* gtk/Makefile.am:
* gtk/gtk.h:
* gtk/gtk.symbols:
* gtk/gtkaction.c: (gtk_action_buildable_init),
(gtk_action_buildable_set_name), (gtk_action_buildable_get_name):
* gtk/gtkactiongroup.c: (gtk_action_group_get_type),
(gtk_action_group_buildable_init),
(gtk_action_group_buildable_add),
(gtk_action_group_buildable_set_name),
(gtk_action_group_buildable_get_name):
* gtk/gtkbuildable.c: (gtk_buildable_get_type),
(gtk_buildable_set_name), (gtk_buildable_get_name),
(gtk_buildable_add), (gtk_buildable_set_property),
(gtk_buildable_parser_finished), (gtk_buildable_construct_child),
(gtk_buildable_custom_tag_start), (gtk_buildable_custom_tag_end),
(gtk_buildable_custom_finished),
(gtk_buildable_get_internal_child):
* gtk/gtkbuildable.h:
* gtk/gtkbuilder.c: (gtk_builder_class_init), (gtk_builder_init),
(gtk_builder_finalize), (gtk_builder_set_property),
(gtk_builder_get_property), (_gtk_builder_resolve_type_lazily),
(gtk_builder_real_get_type_from_name),
(gtk_builder_get_parameters), (gtk_builder_get_internal_child),
(_gtk_builder_construct), (_gtk_builder_add),
(apply_delayed_properties), (_gtk_builder_finish),
(gtk_builder_new), (gtk_builder_add_from_file),
(gtk_builder_add_from_string), (gtk_builder_get_object),
(object_add_to_list), (gtk_builder_get_objects),
(gtk_builder_set_translation_domain),
(gtk_builder_get_translation_domain),
(gtk_builder_connect_signals_default),
(gtk_builder_connect_signals), (gtk_builder_connect_signals_full),
(gtk_builder_value_from_string),
(gtk_builder_value_from_string_type),
(_gtk_builder_enum_from_string), (_gtk_builder_flags_from_string),
(gtk_builder_get_type_from_name), (gtk_builder_error_quark):
* gtk/gtkbuilder.h:
* gtk/gtkbuilderparser.c: (state_push), (state_peek), (state_pop),
(error_missing_attribute), (error_invalid_attribute),
(error_invalid_tag), (builder_construct), (parse_object),
(free_object_info), (_get_type_by_symbol), (parse_child),
(free_child_info), (parse_property), (free_property_info),
(parse_signal), (_free_signal_info), (parse_interface),
(create_subparser), (free_subparser), (subparser_start),
(subparser_end), (parse_custom), (start_element), (end_element),
(text), (_gtk_builder_parser_parse_buffer):
* gtk/gtkbuilderprivate.h:
* gtk/gtkcelllayout.c: (attributes_start_element),
(attributes_text_element),
(_gtk_cell_layout_buildable_custom_tag_start),
(_gtk_cell_layout_buildable_custom_tag_end),
(_gtk_cell_layout_buildable_add):
* gtk/gtkcelllayout.h:
* gtk/gtkcellview.c: (gtk_cell_view_buildable_init),
(gtk_cell_view_buildable_custom_tag_start),
(gtk_cell_view_buildable_custom_tag_end):
* gtk/gtkcolorseldialog.c:
(gtk_color_selection_dialog_buildable_interface_init),
(gtk_color_selection_dialog_buildable_get_internal_child):
* gtk/gtkcombobox.c: (gtk_combo_box_buildable_init),
(gtk_combo_box_buildable_custom_tag_start),
(gtk_combo_box_buildable_custom_tag_end):
* gtk/gtkcomboboxentry.c:
(gtk_combo_box_entry_buildable_interface_init),
(gtk_combo_box_entry_buildable_get_internal_child):
* gtk/gtkcontainer.c: (gtk_container_get_type),
(gtk_container_buildable_init), (gtk_container_buildable_add),
(gtk_container_buildable_set_child_property),
(attributes_start_element), (attributes_text_element),
(gtk_container_buildable_custom_tag_start),
(gtk_container_buildable_custom_tag_end):
* gtk/gtkdebug.h:
* gtk/gtkdialog.c: (gtk_dialog_buildable_interface_init),
(gtk_dialog_buildable_get_internal_child),
(attributes_start_element), (attributes_text_element),
(gtk_dialog_buildable_custom_tag_start),
(gtk_dialog_buildable_custom_finished):
* gtk/gtkentrycompletion.c: (gtk_entry_completion_buildable_init):
* gtk/gtkexpander.c: (gtk_expander_buildable_add),
(gtk_expander_buildable_init):
* gtk/gtkfontsel.c:
(gtk_font_selection_dialog_buildable_interface_init),
(gtk_font_selection_dialog_buildable_get_internal_child):
* gtk/gtkframe.c: (gtk_frame_buildable_init),
(gtk_frame_buildable_add):
* gtk/gtkiconview.c: (gtk_icon_view_buildable_init),
(gtk_icon_view_buildable_custom_tag_start),
(gtk_icon_view_buildable_custom_tag_end):
* gtk/gtkliststore.c: (gtk_list_store_buildable_init),
(list_store_start_element), (list_store_end_element),
(list_store_text), (gtk_list_store_buildable_custom_tag_start),
(gtk_list_store_buildable_custom_tag_end):
* gtk/gtkmain.c:
* gtk/gtknotebook.c: (gtk_notebook_buildable_init),
(gtk_notebook_buildable_add):
* gtk/gtksizegroup.c: (gtk_size_group_buildable_init),
(size_group_start_element),
(gtk_size_group_buildable_custom_tag_start),
(gtk_size_group_buildable_custom_finished):
* gtk/gtktreestore.c: (gtk_tree_store_buildable_init),
(tree_model_start_element),
(gtk_tree_store_buildable_custom_tag_start),
(gtk_tree_store_buildable_custom_finished):
* gtk/gtktreeview.c: (gtk_tree_view_buildable_init),
(gtk_tree_view_buildable_add):
* gtk/gtktreeviewcolumn.c: (gtk_tree_view_column_buildable_init):
* gtk/gtkuimanager.c: (gtk_ui_manager_buildable_init),
(gtk_ui_manager_buildable_add),
(gtk_ui_manager_buildable_construct_child),
(gtk_ui_manager_buildable_custom_tag_start),
(gtk_ui_manager_buildable_custom_tag_end):
* gtk/gtkwidget.c: (gtk_widget_get_type),
(gtk_widget_buildable_interface_init),
(gtk_widget_buildable_set_name), (gtk_widget_buildable_get_name),
(gtk_widget_buildable_set_property),
(gtk_widget_buildable_parser_finshed), (accel_group_start_element),
(gtk_widget_buildable_custom_tag_start),
(gtk_widget_buildable_custom_finshed):
* gtk/gtkwindow.c: (gtk_window_buildable_interface_init),
(gtk_window_buildable_set_property),
(gtk_window_buildable_parser_finished):
* tests/Makefile.am:
* tests/buildertest.c: (builder_new_from_string), (test_parser),
(signal_normal), (signal_after), (signal_object),
(signal_object_after), (signal_first), (signal_second),
(signal_extra), (signal_extra2), (test_connect_signals),
(test_uimanager_simple), (test_domain), (test_translation),
(test_sizegroup), (test_list_store), (test_tree_store),
(test_types), (test_spin_button), (test_notebook),
(test_construct_only_property), (test_children),
(test_child_properties), (test_treeview_column), (test_icon_view),
(test_combo_box), (test_combo_box_entry), (test_cell_view),
(test_dialog), (test_accelerators), (test_widget), (main):
Add GtkBuilder, fixes #172535
svn path=/trunk/; revision=18141
2007-06-15 17:53:46 +00:00
|
|
|
iface->custom_tag_start = gtk_icon_view_buildable_custom_tag_start;
|
|
|
|
iface->custom_tag_end = gtk_icon_view_buildable_custom_tag_end;
|
|
|
|
}
|
|
|
|
|
2005-05-02 20:28:37 +00:00
|
|
|
static void
|
|
|
|
gtk_icon_view_cell_layout_init (GtkCellLayoutIface *iface)
|
|
|
|
{
|
2010-12-12 07:29:41 +00:00
|
|
|
iface->get_area = gtk_icon_view_cell_layout_get_area;
|
2005-05-02 20:28:37 +00:00
|
|
|
}
|
|
|
|
|
2002-04-30 17:08:52 +00:00
|
|
|
static void
|
2004-07-04 15:56:55 +00:00
|
|
|
gtk_icon_view_init (GtkIconView *icon_view)
|
2002-04-30 17:08:52 +00:00
|
|
|
{
|
2010-06-23 18:00:42 +00:00
|
|
|
icon_view->priv = G_TYPE_INSTANCE_GET_PRIVATE (icon_view,
|
|
|
|
GTK_TYPE_ICON_VIEW,
|
|
|
|
GtkIconViewPrivate);
|
|
|
|
|
2004-07-04 15:56:55 +00:00
|
|
|
icon_view->priv->width = 0;
|
|
|
|
icon_view->priv->height = 0;
|
|
|
|
icon_view->priv->selection_mode = GTK_SELECTION_SINGLE;
|
|
|
|
icon_view->priv->pressed_button = -1;
|
|
|
|
icon_view->priv->press_start_x = -1;
|
|
|
|
icon_view->priv->press_start_y = -1;
|
|
|
|
icon_view->priv->text_column = -1;
|
|
|
|
icon_view->priv->markup_column = -1;
|
|
|
|
icon_view->priv->pixbuf_column = -1;
|
2010-12-12 10:59:41 +00:00
|
|
|
icon_view->priv->text_cell = NULL;
|
|
|
|
icon_view->priv->pixbuf_cell = NULL;
|
2007-07-19 14:59:44 +00:00
|
|
|
icon_view->priv->tooltip_column = -1;
|
Update icon list to use the tree model instead.
2004-07-02 Anders Carlsson <andersca@gnome.org>
* libegg/iconlist/eggiconlist.c: (egg_icon_list_class_init),
(egg_icon_list_init), (egg_icon_list_destroy),
(egg_icon_list_finalize), (egg_icon_list_set_property),
(egg_icon_list_get_property), (egg_icon_list_button_press),
(egg_icon_list_select_first_matching_item),
(egg_icon_list_maybe_begin_dragging_items),
(egg_icon_list_real_toggle_cursor_item),
(egg_icon_list_calculate_item_size),
(egg_icon_list_invalidate_sizes), (egg_icon_list_paint_item),
(egg_icon_list_item_new), (egg_icon_list_item_unref),
(egg_icon_list_get_item_text), (egg_icon_list_get_item_icon),
(egg_icon_list_get_item_at_pos), (egg_icon_list_get_path_at_pos),
(egg_icon_list_selected_foreach), (egg_icon_list_select_path),
(egg_icon_list_unselect_path), (egg_icon_list_path_is_selected),
(egg_icon_list_item_activated), (egg_icon_list_get_items),
(egg_icon_list_row_changed), (egg_icon_list_row_inserted),
(egg_icon_list_row_deleted), (egg_icon_list_rows_reordered),
(egg_icon_list_build_items), (egg_icon_list_set_model),
(egg_icon_list_get_model), (egg_icon_list_set_text_column),
(egg_icon_list_set_pixbuf_column):
* libegg/iconlist/eggiconlist.h:
* libegg/iconlist/testiconlist.c: (fill_model), (create_model),
(foreach_selected_print), (item_removed), (remove_selected),
(item_cb), (do_popup_menu), (main):
* libegg/util/eggmarshalers.list:
Update icon list to use the tree model instead.
2004-07-02 12:04:49 +00:00
|
|
|
|
2010-03-02 03:40:38 +00:00
|
|
|
gtk_widget_set_can_focus (GTK_WIDGET (icon_view), TRUE);
|
2005-05-02 20:28:37 +00:00
|
|
|
|
2010-09-02 03:03:48 +00:00
|
|
|
icon_view->priv->item_orientation = GTK_ORIENTATION_VERTICAL;
|
2004-12-14 06:39:45 +00:00
|
|
|
|
|
|
|
icon_view->priv->columns = -1;
|
|
|
|
icon_view->priv->item_width = -1;
|
|
|
|
icon_view->priv->spacing = 0;
|
|
|
|
icon_view->priv->row_spacing = 6;
|
|
|
|
icon_view->priv->column_spacing = 6;
|
|
|
|
icon_view->priv->margin = 6;
|
2009-08-07 03:56:30 +00:00
|
|
|
icon_view->priv->item_padding = 6;
|
2008-09-27 12:53:05 +00:00
|
|
|
|
|
|
|
icon_view->priv->draw_focus = TRUE;
|
2010-12-12 15:24:26 +00:00
|
|
|
|
|
|
|
icon_view->priv->row_contexts =
|
|
|
|
g_ptr_array_new_with_free_func ((GDestroyNotify)g_object_unref);
|
2002-04-30 17:08:52 +00:00
|
|
|
}
|
|
|
|
|
Update icon list to use the tree model instead.
2004-07-02 Anders Carlsson <andersca@gnome.org>
* libegg/iconlist/eggiconlist.c: (egg_icon_list_class_init),
(egg_icon_list_init), (egg_icon_list_destroy),
(egg_icon_list_finalize), (egg_icon_list_set_property),
(egg_icon_list_get_property), (egg_icon_list_button_press),
(egg_icon_list_select_first_matching_item),
(egg_icon_list_maybe_begin_dragging_items),
(egg_icon_list_real_toggle_cursor_item),
(egg_icon_list_calculate_item_size),
(egg_icon_list_invalidate_sizes), (egg_icon_list_paint_item),
(egg_icon_list_item_new), (egg_icon_list_item_unref),
(egg_icon_list_get_item_text), (egg_icon_list_get_item_icon),
(egg_icon_list_get_item_at_pos), (egg_icon_list_get_path_at_pos),
(egg_icon_list_selected_foreach), (egg_icon_list_select_path),
(egg_icon_list_unselect_path), (egg_icon_list_path_is_selected),
(egg_icon_list_item_activated), (egg_icon_list_get_items),
(egg_icon_list_row_changed), (egg_icon_list_row_inserted),
(egg_icon_list_row_deleted), (egg_icon_list_rows_reordered),
(egg_icon_list_build_items), (egg_icon_list_set_model),
(egg_icon_list_get_model), (egg_icon_list_set_text_column),
(egg_icon_list_set_pixbuf_column):
* libegg/iconlist/eggiconlist.h:
* libegg/iconlist/testiconlist.c: (fill_model), (create_model),
(foreach_selected_print), (item_removed), (remove_selected),
(item_cb), (do_popup_menu), (main):
* libegg/util/eggmarshalers.list:
Update icon list to use the tree model instead.
2004-07-02 12:04:49 +00:00
|
|
|
/* GObject methods */
|
2010-12-10 08:15:39 +00:00
|
|
|
static GObject *
|
|
|
|
gtk_icon_view_constructor (GType type,
|
|
|
|
guint n_construct_properties,
|
|
|
|
GObjectConstructParam *construct_properties)
|
|
|
|
{
|
|
|
|
GtkIconView *icon_view;
|
|
|
|
GObject *object;
|
|
|
|
|
|
|
|
object = G_OBJECT_CLASS (gtk_icon_view_parent_class)->constructor
|
|
|
|
(type, n_construct_properties, construct_properties);
|
|
|
|
|
|
|
|
icon_view = (GtkIconView *) object;
|
2010-12-12 07:29:41 +00:00
|
|
|
|
2011-01-31 22:34:37 +00:00
|
|
|
gtk_icon_view_ensure_cell_area (icon_view, NULL);
|
2010-12-10 08:15:39 +00:00
|
|
|
|
2010-12-12 10:59:41 +00:00
|
|
|
return object;
|
2010-12-10 08:15:39 +00:00
|
|
|
}
|
|
|
|
|
Update icon list to use the tree model instead.
2004-07-02 Anders Carlsson <andersca@gnome.org>
* libegg/iconlist/eggiconlist.c: (egg_icon_list_class_init),
(egg_icon_list_init), (egg_icon_list_destroy),
(egg_icon_list_finalize), (egg_icon_list_set_property),
(egg_icon_list_get_property), (egg_icon_list_button_press),
(egg_icon_list_select_first_matching_item),
(egg_icon_list_maybe_begin_dragging_items),
(egg_icon_list_real_toggle_cursor_item),
(egg_icon_list_calculate_item_size),
(egg_icon_list_invalidate_sizes), (egg_icon_list_paint_item),
(egg_icon_list_item_new), (egg_icon_list_item_unref),
(egg_icon_list_get_item_text), (egg_icon_list_get_item_icon),
(egg_icon_list_get_item_at_pos), (egg_icon_list_get_path_at_pos),
(egg_icon_list_selected_foreach), (egg_icon_list_select_path),
(egg_icon_list_unselect_path), (egg_icon_list_path_is_selected),
(egg_icon_list_item_activated), (egg_icon_list_get_items),
(egg_icon_list_row_changed), (egg_icon_list_row_inserted),
(egg_icon_list_row_deleted), (egg_icon_list_rows_reordered),
(egg_icon_list_build_items), (egg_icon_list_set_model),
(egg_icon_list_get_model), (egg_icon_list_set_text_column),
(egg_icon_list_set_pixbuf_column):
* libegg/iconlist/eggiconlist.h:
* libegg/iconlist/testiconlist.c: (fill_model), (create_model),
(foreach_selected_print), (item_removed), (remove_selected),
(item_cb), (do_popup_menu), (main):
* libegg/util/eggmarshalers.list:
Update icon list to use the tree model instead.
2004-07-02 12:04:49 +00:00
|
|
|
static void
|
2010-12-10 08:15:39 +00:00
|
|
|
gtk_icon_view_dispose (GObject *object)
|
Update icon list to use the tree model instead.
2004-07-02 Anders Carlsson <andersca@gnome.org>
* libegg/iconlist/eggiconlist.c: (egg_icon_list_class_init),
(egg_icon_list_init), (egg_icon_list_destroy),
(egg_icon_list_finalize), (egg_icon_list_set_property),
(egg_icon_list_get_property), (egg_icon_list_button_press),
(egg_icon_list_select_first_matching_item),
(egg_icon_list_maybe_begin_dragging_items),
(egg_icon_list_real_toggle_cursor_item),
(egg_icon_list_calculate_item_size),
(egg_icon_list_invalidate_sizes), (egg_icon_list_paint_item),
(egg_icon_list_item_new), (egg_icon_list_item_unref),
(egg_icon_list_get_item_text), (egg_icon_list_get_item_icon),
(egg_icon_list_get_item_at_pos), (egg_icon_list_get_path_at_pos),
(egg_icon_list_selected_foreach), (egg_icon_list_select_path),
(egg_icon_list_unselect_path), (egg_icon_list_path_is_selected),
(egg_icon_list_item_activated), (egg_icon_list_get_items),
(egg_icon_list_row_changed), (egg_icon_list_row_inserted),
(egg_icon_list_row_deleted), (egg_icon_list_rows_reordered),
(egg_icon_list_build_items), (egg_icon_list_set_model),
(egg_icon_list_get_model), (egg_icon_list_set_text_column),
(egg_icon_list_set_pixbuf_column):
* libegg/iconlist/eggiconlist.h:
* libegg/iconlist/testiconlist.c: (fill_model), (create_model),
(foreach_selected_print), (item_removed), (remove_selected),
(item_cb), (do_popup_menu), (main):
* libegg/util/eggmarshalers.list:
Update icon list to use the tree model instead.
2004-07-02 12:04:49 +00:00
|
|
|
{
|
2010-12-10 08:15:39 +00:00
|
|
|
GtkIconView *icon_view;
|
|
|
|
GtkIconViewPrivate *priv;
|
|
|
|
|
|
|
|
icon_view = GTK_ICON_VIEW (object);
|
|
|
|
priv = icon_view->priv;
|
|
|
|
|
|
|
|
if (priv->cell_area_context)
|
|
|
|
{
|
2010-12-13 09:08:37 +00:00
|
|
|
g_signal_handler_disconnect (priv->cell_area_context, priv->context_changed_id);
|
|
|
|
priv->context_changed_id = 0;
|
|
|
|
|
2010-12-10 08:15:39 +00:00
|
|
|
g_object_unref (priv->cell_area_context);
|
|
|
|
priv->cell_area_context = NULL;
|
|
|
|
}
|
|
|
|
|
2010-12-12 15:24:26 +00:00
|
|
|
if (priv->row_contexts)
|
|
|
|
{
|
|
|
|
g_ptr_array_free (priv->row_contexts, TRUE);
|
|
|
|
priv->row_contexts = NULL;
|
|
|
|
}
|
|
|
|
|
2010-12-10 08:15:39 +00:00
|
|
|
if (priv->cell_area)
|
|
|
|
{
|
2010-12-14 06:37:42 +00:00
|
|
|
gtk_cell_area_stop_editing (icon_view->priv->cell_area, TRUE);
|
|
|
|
|
2010-12-12 10:59:41 +00:00
|
|
|
g_signal_handler_disconnect (priv->cell_area, priv->add_editable_id);
|
|
|
|
g_signal_handler_disconnect (priv->cell_area, priv->remove_editable_id);
|
|
|
|
priv->add_editable_id = 0;
|
|
|
|
priv->remove_editable_id = 0;
|
|
|
|
|
2010-12-10 08:15:39 +00:00
|
|
|
g_object_unref (priv->cell_area);
|
|
|
|
priv->cell_area = NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
G_OBJECT_CLASS (gtk_icon_view_parent_class)->dispose (object);
|
2002-04-30 17:08:52 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2004-07-04 15:56:55 +00:00
|
|
|
gtk_icon_view_set_property (GObject *object,
|
2002-04-30 17:08:52 +00:00
|
|
|
guint prop_id,
|
|
|
|
const GValue *value,
|
|
|
|
GParamSpec *pspec)
|
|
|
|
{
|
2004-07-04 15:56:55 +00:00
|
|
|
GtkIconView *icon_view;
|
2010-12-10 08:15:39 +00:00
|
|
|
GtkCellArea *area;
|
2002-04-30 17:08:52 +00:00
|
|
|
|
2004-07-04 15:56:55 +00:00
|
|
|
icon_view = GTK_ICON_VIEW (object);
|
2002-04-30 17:08:52 +00:00
|
|
|
|
|
|
|
switch (prop_id)
|
|
|
|
{
|
|
|
|
case PROP_SELECTION_MODE:
|
2004-07-04 15:56:55 +00:00
|
|
|
gtk_icon_view_set_selection_mode (icon_view, g_value_get_enum (value));
|
2002-04-30 17:08:52 +00:00
|
|
|
break;
|
Update icon list to use the tree model instead.
2004-07-02 Anders Carlsson <andersca@gnome.org>
* libegg/iconlist/eggiconlist.c: (egg_icon_list_class_init),
(egg_icon_list_init), (egg_icon_list_destroy),
(egg_icon_list_finalize), (egg_icon_list_set_property),
(egg_icon_list_get_property), (egg_icon_list_button_press),
(egg_icon_list_select_first_matching_item),
(egg_icon_list_maybe_begin_dragging_items),
(egg_icon_list_real_toggle_cursor_item),
(egg_icon_list_calculate_item_size),
(egg_icon_list_invalidate_sizes), (egg_icon_list_paint_item),
(egg_icon_list_item_new), (egg_icon_list_item_unref),
(egg_icon_list_get_item_text), (egg_icon_list_get_item_icon),
(egg_icon_list_get_item_at_pos), (egg_icon_list_get_path_at_pos),
(egg_icon_list_selected_foreach), (egg_icon_list_select_path),
(egg_icon_list_unselect_path), (egg_icon_list_path_is_selected),
(egg_icon_list_item_activated), (egg_icon_list_get_items),
(egg_icon_list_row_changed), (egg_icon_list_row_inserted),
(egg_icon_list_row_deleted), (egg_icon_list_rows_reordered),
(egg_icon_list_build_items), (egg_icon_list_set_model),
(egg_icon_list_get_model), (egg_icon_list_set_text_column),
(egg_icon_list_set_pixbuf_column):
* libegg/iconlist/eggiconlist.h:
* libegg/iconlist/testiconlist.c: (fill_model), (create_model),
(foreach_selected_print), (item_removed), (remove_selected),
(item_cb), (do_popup_menu), (main):
* libegg/util/eggmarshalers.list:
Update icon list to use the tree model instead.
2004-07-02 12:04:49 +00:00
|
|
|
case PROP_PIXBUF_COLUMN:
|
2004-07-04 15:56:55 +00:00
|
|
|
gtk_icon_view_set_pixbuf_column (icon_view, g_value_get_int (value));
|
Update icon list to use the tree model instead.
2004-07-02 Anders Carlsson <andersca@gnome.org>
* libegg/iconlist/eggiconlist.c: (egg_icon_list_class_init),
(egg_icon_list_init), (egg_icon_list_destroy),
(egg_icon_list_finalize), (egg_icon_list_set_property),
(egg_icon_list_get_property), (egg_icon_list_button_press),
(egg_icon_list_select_first_matching_item),
(egg_icon_list_maybe_begin_dragging_items),
(egg_icon_list_real_toggle_cursor_item),
(egg_icon_list_calculate_item_size),
(egg_icon_list_invalidate_sizes), (egg_icon_list_paint_item),
(egg_icon_list_item_new), (egg_icon_list_item_unref),
(egg_icon_list_get_item_text), (egg_icon_list_get_item_icon),
(egg_icon_list_get_item_at_pos), (egg_icon_list_get_path_at_pos),
(egg_icon_list_selected_foreach), (egg_icon_list_select_path),
(egg_icon_list_unselect_path), (egg_icon_list_path_is_selected),
(egg_icon_list_item_activated), (egg_icon_list_get_items),
(egg_icon_list_row_changed), (egg_icon_list_row_inserted),
(egg_icon_list_row_deleted), (egg_icon_list_rows_reordered),
(egg_icon_list_build_items), (egg_icon_list_set_model),
(egg_icon_list_get_model), (egg_icon_list_set_text_column),
(egg_icon_list_set_pixbuf_column):
* libegg/iconlist/eggiconlist.h:
* libegg/iconlist/testiconlist.c: (fill_model), (create_model),
(foreach_selected_print), (item_removed), (remove_selected),
(item_cb), (do_popup_menu), (main):
* libegg/util/eggmarshalers.list:
Update icon list to use the tree model instead.
2004-07-02 12:04:49 +00:00
|
|
|
break;
|
|
|
|
case PROP_TEXT_COLUMN:
|
2004-07-04 15:56:55 +00:00
|
|
|
gtk_icon_view_set_text_column (icon_view, g_value_get_int (value));
|
2002-04-30 17:08:52 +00:00
|
|
|
break;
|
Add markup column support.
2004-07-02 Anders Carlsson <andersca@gnome.org>
* libegg/iconlist/eggiconlist.c: (egg_icon_list_class_init),
(egg_icon_list_init), (egg_icon_list_set_property),
(egg_icon_list_get_property), (egg_icon_list_calculate_item_size),
(egg_icon_list_paint_item), (egg_icon_list_update_item_text),
(egg_icon_list_get_text_column), (egg_icon_list_set_markup_column),
(egg_icon_list_get_markup_column),
(egg_icon_list_set_pixbuf_column),
(egg_icon_list_get_pixbuf_column):
* libegg/iconlist/eggiconlist.h:
* libegg/iconlist/testiconlist.c: (fill_model), (create_model):
Add markup column support.
2004-07-02 13:20:16 +00:00
|
|
|
case PROP_MARKUP_COLUMN:
|
2004-07-04 15:56:55 +00:00
|
|
|
gtk_icon_view_set_markup_column (icon_view, g_value_get_int (value));
|
Add markup column support.
2004-07-02 Anders Carlsson <andersca@gnome.org>
* libegg/iconlist/eggiconlist.c: (egg_icon_list_class_init),
(egg_icon_list_init), (egg_icon_list_set_property),
(egg_icon_list_get_property), (egg_icon_list_calculate_item_size),
(egg_icon_list_paint_item), (egg_icon_list_update_item_text),
(egg_icon_list_get_text_column), (egg_icon_list_set_markup_column),
(egg_icon_list_get_markup_column),
(egg_icon_list_set_pixbuf_column),
(egg_icon_list_get_pixbuf_column):
* libegg/iconlist/eggiconlist.h:
* libegg/iconlist/testiconlist.c: (fill_model), (create_model):
Add markup column support.
2004-07-02 13:20:16 +00:00
|
|
|
break;
|
Update icon list to use the tree model instead.
2004-07-02 Anders Carlsson <andersca@gnome.org>
* libegg/iconlist/eggiconlist.c: (egg_icon_list_class_init),
(egg_icon_list_init), (egg_icon_list_destroy),
(egg_icon_list_finalize), (egg_icon_list_set_property),
(egg_icon_list_get_property), (egg_icon_list_button_press),
(egg_icon_list_select_first_matching_item),
(egg_icon_list_maybe_begin_dragging_items),
(egg_icon_list_real_toggle_cursor_item),
(egg_icon_list_calculate_item_size),
(egg_icon_list_invalidate_sizes), (egg_icon_list_paint_item),
(egg_icon_list_item_new), (egg_icon_list_item_unref),
(egg_icon_list_get_item_text), (egg_icon_list_get_item_icon),
(egg_icon_list_get_item_at_pos), (egg_icon_list_get_path_at_pos),
(egg_icon_list_selected_foreach), (egg_icon_list_select_path),
(egg_icon_list_unselect_path), (egg_icon_list_path_is_selected),
(egg_icon_list_item_activated), (egg_icon_list_get_items),
(egg_icon_list_row_changed), (egg_icon_list_row_inserted),
(egg_icon_list_row_deleted), (egg_icon_list_rows_reordered),
(egg_icon_list_build_items), (egg_icon_list_set_model),
(egg_icon_list_get_model), (egg_icon_list_set_text_column),
(egg_icon_list_set_pixbuf_column):
* libegg/iconlist/eggiconlist.h:
* libegg/iconlist/testiconlist.c: (fill_model), (create_model),
(foreach_selected_print), (item_removed), (remove_selected),
(item_cb), (do_popup_menu), (main):
* libegg/util/eggmarshalers.list:
Update icon list to use the tree model instead.
2004-07-02 12:04:49 +00:00
|
|
|
case PROP_MODEL:
|
2004-07-04 15:56:55 +00:00
|
|
|
gtk_icon_view_set_model (icon_view, g_value_get_object (value));
|
2002-04-30 17:08:52 +00:00
|
|
|
break;
|
2010-09-02 03:03:48 +00:00
|
|
|
case PROP_ITEM_ORIENTATION:
|
|
|
|
gtk_icon_view_set_item_orientation (icon_view, g_value_get_enum (value));
|
2004-07-18 03:39:50 +00:00
|
|
|
break;
|
2004-12-14 06:39:45 +00:00
|
|
|
case PROP_COLUMNS:
|
|
|
|
gtk_icon_view_set_columns (icon_view, g_value_get_int (value));
|
|
|
|
break;
|
|
|
|
case PROP_ITEM_WIDTH:
|
|
|
|
gtk_icon_view_set_item_width (icon_view, g_value_get_int (value));
|
|
|
|
break;
|
|
|
|
case PROP_SPACING:
|
|
|
|
gtk_icon_view_set_spacing (icon_view, g_value_get_int (value));
|
|
|
|
break;
|
|
|
|
case PROP_ROW_SPACING:
|
|
|
|
gtk_icon_view_set_row_spacing (icon_view, g_value_get_int (value));
|
|
|
|
break;
|
|
|
|
case PROP_COLUMN_SPACING:
|
|
|
|
gtk_icon_view_set_column_spacing (icon_view, g_value_get_int (value));
|
|
|
|
break;
|
|
|
|
case PROP_MARGIN:
|
|
|
|
gtk_icon_view_set_margin (icon_view, g_value_get_int (value));
|
|
|
|
break;
|
2005-05-06 04:14:32 +00:00
|
|
|
case PROP_REORDERABLE:
|
|
|
|
gtk_icon_view_set_reorderable (icon_view, g_value_get_boolean (value));
|
|
|
|
break;
|
Update icon list to use the tree model instead.
2004-07-02 Anders Carlsson <andersca@gnome.org>
* libegg/iconlist/eggiconlist.c: (egg_icon_list_class_init),
(egg_icon_list_init), (egg_icon_list_destroy),
(egg_icon_list_finalize), (egg_icon_list_set_property),
(egg_icon_list_get_property), (egg_icon_list_button_press),
(egg_icon_list_select_first_matching_item),
(egg_icon_list_maybe_begin_dragging_items),
(egg_icon_list_real_toggle_cursor_item),
(egg_icon_list_calculate_item_size),
(egg_icon_list_invalidate_sizes), (egg_icon_list_paint_item),
(egg_icon_list_item_new), (egg_icon_list_item_unref),
(egg_icon_list_get_item_text), (egg_icon_list_get_item_icon),
(egg_icon_list_get_item_at_pos), (egg_icon_list_get_path_at_pos),
(egg_icon_list_selected_foreach), (egg_icon_list_select_path),
(egg_icon_list_unselect_path), (egg_icon_list_path_is_selected),
(egg_icon_list_item_activated), (egg_icon_list_get_items),
(egg_icon_list_row_changed), (egg_icon_list_row_inserted),
(egg_icon_list_row_deleted), (egg_icon_list_rows_reordered),
(egg_icon_list_build_items), (egg_icon_list_set_model),
(egg_icon_list_get_model), (egg_icon_list_set_text_column),
(egg_icon_list_set_pixbuf_column):
* libegg/iconlist/eggiconlist.h:
* libegg/iconlist/testiconlist.c: (fill_model), (create_model),
(foreach_selected_print), (item_removed), (remove_selected),
(item_cb), (do_popup_menu), (main):
* libegg/util/eggmarshalers.list:
Update icon list to use the tree model instead.
2004-07-02 12:04:49 +00:00
|
|
|
|
2007-07-19 14:59:44 +00:00
|
|
|
case PROP_TOOLTIP_COLUMN:
|
|
|
|
gtk_icon_view_set_tooltip_column (icon_view, g_value_get_int (value));
|
|
|
|
break;
|
|
|
|
|
2009-08-11 18:18:13 +00:00
|
|
|
case PROP_ITEM_PADDING:
|
|
|
|
gtk_icon_view_set_item_padding (icon_view, g_value_get_int (value));
|
|
|
|
break;
|
|
|
|
|
2010-12-10 08:15:39 +00:00
|
|
|
case PROP_CELL_AREA:
|
|
|
|
/* Construct-only, can only be assigned once */
|
|
|
|
area = g_value_get_object (value);
|
|
|
|
if (area)
|
2011-01-31 22:34:37 +00:00
|
|
|
{
|
|
|
|
if (icon_view->priv->cell_area != NULL)
|
|
|
|
{
|
|
|
|
g_warning ("cell-area has already been set, ignoring construct property");
|
|
|
|
g_object_ref_sink (area);
|
|
|
|
g_object_unref (area);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
gtk_icon_view_ensure_cell_area (icon_view, area);
|
|
|
|
}
|
2010-12-10 08:15:39 +00:00
|
|
|
break;
|
|
|
|
|
2010-10-18 04:21:39 +00:00
|
|
|
case PROP_HADJUSTMENT:
|
|
|
|
gtk_icon_view_set_hadjustment (icon_view, g_value_get_object (value));
|
|
|
|
break;
|
|
|
|
case PROP_VADJUSTMENT:
|
|
|
|
gtk_icon_view_set_vadjustment (icon_view, g_value_get_object (value));
|
|
|
|
break;
|
2010-10-26 00:59:02 +00:00
|
|
|
case PROP_HSCROLL_POLICY:
|
|
|
|
icon_view->priv->hscroll_policy = g_value_get_enum (value);
|
|
|
|
gtk_widget_queue_resize (GTK_WIDGET (icon_view));
|
|
|
|
break;
|
|
|
|
case PROP_VSCROLL_POLICY:
|
|
|
|
icon_view->priv->vscroll_policy = g_value_get_enum (value);
|
|
|
|
gtk_widget_queue_resize (GTK_WIDGET (icon_view));
|
|
|
|
break;
|
2010-10-18 04:21:39 +00:00
|
|
|
|
2002-04-30 17:08:52 +00:00
|
|
|
default:
|
|
|
|
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2004-07-04 15:56:55 +00:00
|
|
|
gtk_icon_view_get_property (GObject *object,
|
2002-04-30 17:08:52 +00:00
|
|
|
guint prop_id,
|
|
|
|
GValue *value,
|
|
|
|
GParamSpec *pspec)
|
|
|
|
{
|
2004-07-04 15:56:55 +00:00
|
|
|
GtkIconView *icon_view;
|
2002-04-30 17:08:52 +00:00
|
|
|
|
2004-07-04 15:56:55 +00:00
|
|
|
icon_view = GTK_ICON_VIEW (object);
|
2002-04-30 17:08:52 +00:00
|
|
|
|
|
|
|
switch (prop_id)
|
|
|
|
{
|
|
|
|
case PROP_SELECTION_MODE:
|
2004-07-04 15:56:55 +00:00
|
|
|
g_value_set_enum (value, icon_view->priv->selection_mode);
|
2002-04-30 17:08:52 +00:00
|
|
|
break;
|
Update icon list to use the tree model instead.
2004-07-02 Anders Carlsson <andersca@gnome.org>
* libegg/iconlist/eggiconlist.c: (egg_icon_list_class_init),
(egg_icon_list_init), (egg_icon_list_destroy),
(egg_icon_list_finalize), (egg_icon_list_set_property),
(egg_icon_list_get_property), (egg_icon_list_button_press),
(egg_icon_list_select_first_matching_item),
(egg_icon_list_maybe_begin_dragging_items),
(egg_icon_list_real_toggle_cursor_item),
(egg_icon_list_calculate_item_size),
(egg_icon_list_invalidate_sizes), (egg_icon_list_paint_item),
(egg_icon_list_item_new), (egg_icon_list_item_unref),
(egg_icon_list_get_item_text), (egg_icon_list_get_item_icon),
(egg_icon_list_get_item_at_pos), (egg_icon_list_get_path_at_pos),
(egg_icon_list_selected_foreach), (egg_icon_list_select_path),
(egg_icon_list_unselect_path), (egg_icon_list_path_is_selected),
(egg_icon_list_item_activated), (egg_icon_list_get_items),
(egg_icon_list_row_changed), (egg_icon_list_row_inserted),
(egg_icon_list_row_deleted), (egg_icon_list_rows_reordered),
(egg_icon_list_build_items), (egg_icon_list_set_model),
(egg_icon_list_get_model), (egg_icon_list_set_text_column),
(egg_icon_list_set_pixbuf_column):
* libegg/iconlist/eggiconlist.h:
* libegg/iconlist/testiconlist.c: (fill_model), (create_model),
(foreach_selected_print), (item_removed), (remove_selected),
(item_cb), (do_popup_menu), (main):
* libegg/util/eggmarshalers.list:
Update icon list to use the tree model instead.
2004-07-02 12:04:49 +00:00
|
|
|
case PROP_PIXBUF_COLUMN:
|
2004-07-04 15:56:55 +00:00
|
|
|
g_value_set_int (value, icon_view->priv->pixbuf_column);
|
Update icon list to use the tree model instead.
2004-07-02 Anders Carlsson <andersca@gnome.org>
* libegg/iconlist/eggiconlist.c: (egg_icon_list_class_init),
(egg_icon_list_init), (egg_icon_list_destroy),
(egg_icon_list_finalize), (egg_icon_list_set_property),
(egg_icon_list_get_property), (egg_icon_list_button_press),
(egg_icon_list_select_first_matching_item),
(egg_icon_list_maybe_begin_dragging_items),
(egg_icon_list_real_toggle_cursor_item),
(egg_icon_list_calculate_item_size),
(egg_icon_list_invalidate_sizes), (egg_icon_list_paint_item),
(egg_icon_list_item_new), (egg_icon_list_item_unref),
(egg_icon_list_get_item_text), (egg_icon_list_get_item_icon),
(egg_icon_list_get_item_at_pos), (egg_icon_list_get_path_at_pos),
(egg_icon_list_selected_foreach), (egg_icon_list_select_path),
(egg_icon_list_unselect_path), (egg_icon_list_path_is_selected),
(egg_icon_list_item_activated), (egg_icon_list_get_items),
(egg_icon_list_row_changed), (egg_icon_list_row_inserted),
(egg_icon_list_row_deleted), (egg_icon_list_rows_reordered),
(egg_icon_list_build_items), (egg_icon_list_set_model),
(egg_icon_list_get_model), (egg_icon_list_set_text_column),
(egg_icon_list_set_pixbuf_column):
* libegg/iconlist/eggiconlist.h:
* libegg/iconlist/testiconlist.c: (fill_model), (create_model),
(foreach_selected_print), (item_removed), (remove_selected),
(item_cb), (do_popup_menu), (main):
* libegg/util/eggmarshalers.list:
Update icon list to use the tree model instead.
2004-07-02 12:04:49 +00:00
|
|
|
break;
|
|
|
|
case PROP_TEXT_COLUMN:
|
2004-07-04 15:56:55 +00:00
|
|
|
g_value_set_int (value, icon_view->priv->text_column);
|
2002-04-30 17:08:52 +00:00
|
|
|
break;
|
Add markup column support.
2004-07-02 Anders Carlsson <andersca@gnome.org>
* libegg/iconlist/eggiconlist.c: (egg_icon_list_class_init),
(egg_icon_list_init), (egg_icon_list_set_property),
(egg_icon_list_get_property), (egg_icon_list_calculate_item_size),
(egg_icon_list_paint_item), (egg_icon_list_update_item_text),
(egg_icon_list_get_text_column), (egg_icon_list_set_markup_column),
(egg_icon_list_get_markup_column),
(egg_icon_list_set_pixbuf_column),
(egg_icon_list_get_pixbuf_column):
* libegg/iconlist/eggiconlist.h:
* libegg/iconlist/testiconlist.c: (fill_model), (create_model):
Add markup column support.
2004-07-02 13:20:16 +00:00
|
|
|
case PROP_MARKUP_COLUMN:
|
2004-07-04 15:56:55 +00:00
|
|
|
g_value_set_int (value, icon_view->priv->markup_column);
|
Add markup column support.
2004-07-02 Anders Carlsson <andersca@gnome.org>
* libegg/iconlist/eggiconlist.c: (egg_icon_list_class_init),
(egg_icon_list_init), (egg_icon_list_set_property),
(egg_icon_list_get_property), (egg_icon_list_calculate_item_size),
(egg_icon_list_paint_item), (egg_icon_list_update_item_text),
(egg_icon_list_get_text_column), (egg_icon_list_set_markup_column),
(egg_icon_list_get_markup_column),
(egg_icon_list_set_pixbuf_column),
(egg_icon_list_get_pixbuf_column):
* libegg/iconlist/eggiconlist.h:
* libegg/iconlist/testiconlist.c: (fill_model), (create_model):
Add markup column support.
2004-07-02 13:20:16 +00:00
|
|
|
break;
|
Update icon list to use the tree model instead.
2004-07-02 Anders Carlsson <andersca@gnome.org>
* libegg/iconlist/eggiconlist.c: (egg_icon_list_class_init),
(egg_icon_list_init), (egg_icon_list_destroy),
(egg_icon_list_finalize), (egg_icon_list_set_property),
(egg_icon_list_get_property), (egg_icon_list_button_press),
(egg_icon_list_select_first_matching_item),
(egg_icon_list_maybe_begin_dragging_items),
(egg_icon_list_real_toggle_cursor_item),
(egg_icon_list_calculate_item_size),
(egg_icon_list_invalidate_sizes), (egg_icon_list_paint_item),
(egg_icon_list_item_new), (egg_icon_list_item_unref),
(egg_icon_list_get_item_text), (egg_icon_list_get_item_icon),
(egg_icon_list_get_item_at_pos), (egg_icon_list_get_path_at_pos),
(egg_icon_list_selected_foreach), (egg_icon_list_select_path),
(egg_icon_list_unselect_path), (egg_icon_list_path_is_selected),
(egg_icon_list_item_activated), (egg_icon_list_get_items),
(egg_icon_list_row_changed), (egg_icon_list_row_inserted),
(egg_icon_list_row_deleted), (egg_icon_list_rows_reordered),
(egg_icon_list_build_items), (egg_icon_list_set_model),
(egg_icon_list_get_model), (egg_icon_list_set_text_column),
(egg_icon_list_set_pixbuf_column):
* libegg/iconlist/eggiconlist.h:
* libegg/iconlist/testiconlist.c: (fill_model), (create_model),
(foreach_selected_print), (item_removed), (remove_selected),
(item_cb), (do_popup_menu), (main):
* libegg/util/eggmarshalers.list:
Update icon list to use the tree model instead.
2004-07-02 12:04:49 +00:00
|
|
|
case PROP_MODEL:
|
2004-07-04 15:56:55 +00:00
|
|
|
g_value_set_object (value, icon_view->priv->model);
|
2002-04-30 17:08:52 +00:00
|
|
|
break;
|
2010-09-02 03:03:48 +00:00
|
|
|
case PROP_ITEM_ORIENTATION:
|
|
|
|
g_value_set_enum (value, icon_view->priv->item_orientation);
|
2004-07-18 03:39:50 +00:00
|
|
|
break;
|
2004-12-14 06:39:45 +00:00
|
|
|
case PROP_COLUMNS:
|
|
|
|
g_value_set_int (value, icon_view->priv->columns);
|
|
|
|
break;
|
|
|
|
case PROP_ITEM_WIDTH:
|
|
|
|
g_value_set_int (value, icon_view->priv->item_width);
|
|
|
|
break;
|
|
|
|
case PROP_SPACING:
|
|
|
|
g_value_set_int (value, icon_view->priv->spacing);
|
|
|
|
break;
|
|
|
|
case PROP_ROW_SPACING:
|
|
|
|
g_value_set_int (value, icon_view->priv->row_spacing);
|
|
|
|
break;
|
|
|
|
case PROP_COLUMN_SPACING:
|
|
|
|
g_value_set_int (value, icon_view->priv->column_spacing);
|
|
|
|
break;
|
|
|
|
case PROP_MARGIN:
|
|
|
|
g_value_set_int (value, icon_view->priv->margin);
|
|
|
|
break;
|
2005-05-06 04:14:32 +00:00
|
|
|
case PROP_REORDERABLE:
|
|
|
|
g_value_set_boolean (value, icon_view->priv->reorderable);
|
|
|
|
break;
|
2007-07-19 14:59:44 +00:00
|
|
|
case PROP_TOOLTIP_COLUMN:
|
|
|
|
g_value_set_int (value, icon_view->priv->tooltip_column);
|
|
|
|
break;
|
2004-12-14 06:39:45 +00:00
|
|
|
|
2009-08-11 18:18:13 +00:00
|
|
|
case PROP_ITEM_PADDING:
|
|
|
|
g_value_set_int (value, icon_view->priv->item_padding);
|
|
|
|
break;
|
|
|
|
|
2010-12-10 08:15:39 +00:00
|
|
|
case PROP_CELL_AREA:
|
|
|
|
g_value_set_object (value, icon_view->priv->cell_area);
|
|
|
|
break;
|
|
|
|
|
2010-10-18 04:21:39 +00:00
|
|
|
case PROP_HADJUSTMENT:
|
|
|
|
g_value_set_object (value, icon_view->priv->hadjustment);
|
|
|
|
break;
|
|
|
|
case PROP_VADJUSTMENT:
|
|
|
|
g_value_set_object (value, icon_view->priv->vadjustment);
|
|
|
|
break;
|
2010-10-26 00:59:02 +00:00
|
|
|
case PROP_HSCROLL_POLICY:
|
|
|
|
g_value_set_enum (value, icon_view->priv->hscroll_policy);
|
|
|
|
break;
|
|
|
|
case PROP_VSCROLL_POLICY:
|
|
|
|
g_value_set_enum (value, icon_view->priv->vscroll_policy);
|
|
|
|
break;
|
2010-10-18 04:21:39 +00:00
|
|
|
|
2002-04-30 17:08:52 +00:00
|
|
|
default:
|
|
|
|
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2010-09-18 23:55:42 +00:00
|
|
|
/* GtkWidget methods */
|
|
|
|
static void
|
|
|
|
gtk_icon_view_destroy (GtkWidget *widget)
|
|
|
|
{
|
|
|
|
GtkIconView *icon_view = GTK_ICON_VIEW (widget);
|
|
|
|
|
|
|
|
gtk_icon_view_set_model (icon_view, NULL);
|
|
|
|
|
|
|
|
if (icon_view->priv->layout_idle_id != 0)
|
|
|
|
{
|
|
|
|
g_source_remove (icon_view->priv->layout_idle_id);
|
|
|
|
icon_view->priv->layout_idle_id = 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (icon_view->priv->scroll_to_path != NULL)
|
|
|
|
{
|
|
|
|
gtk_tree_row_reference_free (icon_view->priv->scroll_to_path);
|
|
|
|
icon_view->priv->scroll_to_path = NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
remove_scroll_timeout (icon_view);
|
|
|
|
|
|
|
|
if (icon_view->priv->hadjustment != NULL)
|
|
|
|
{
|
|
|
|
g_object_unref (icon_view->priv->hadjustment);
|
|
|
|
icon_view->priv->hadjustment = NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (icon_view->priv->vadjustment != NULL)
|
|
|
|
{
|
|
|
|
g_object_unref (icon_view->priv->vadjustment);
|
|
|
|
icon_view->priv->vadjustment = NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
GTK_WIDGET_CLASS (gtk_icon_view_parent_class)->destroy (widget);
|
|
|
|
}
|
|
|
|
|
2002-04-30 17:08:52 +00:00
|
|
|
static void
|
2004-07-04 15:56:55 +00:00
|
|
|
gtk_icon_view_realize (GtkWidget *widget)
|
2002-04-30 17:08:52 +00:00
|
|
|
{
|
2010-08-11 21:10:57 +00:00
|
|
|
GtkIconView *icon_view = GTK_ICON_VIEW (widget);
|
|
|
|
GtkAllocation allocation;
|
|
|
|
GdkWindow *window;
|
2002-04-30 17:08:52 +00:00
|
|
|
GdkWindowAttr attributes;
|
|
|
|
gint attributes_mask;
|
2011-01-12 20:26:25 +00:00
|
|
|
GtkStyleContext *context;
|
2002-04-30 17:08:52 +00:00
|
|
|
|
2010-03-06 10:51:33 +00:00
|
|
|
gtk_widget_set_realized (widget, TRUE);
|
2002-04-30 17:08:52 +00:00
|
|
|
|
2010-08-11 21:10:57 +00:00
|
|
|
gtk_widget_get_allocation (widget, &allocation);
|
|
|
|
|
2002-04-30 17:08:52 +00:00
|
|
|
/* Make the main, clipping window */
|
|
|
|
attributes.window_type = GDK_WINDOW_CHILD;
|
2010-08-11 21:10:57 +00:00
|
|
|
attributes.x = allocation.x;
|
|
|
|
attributes.y = allocation.y;
|
|
|
|
attributes.width = allocation.width;
|
|
|
|
attributes.height = allocation.height;
|
2002-04-30 17:08:52 +00:00
|
|
|
attributes.wclass = GDK_INPUT_OUTPUT;
|
|
|
|
attributes.visual = gtk_widget_get_visual (widget);
|
|
|
|
attributes.event_mask = GDK_VISIBILITY_NOTIFY_MASK;
|
|
|
|
|
2010-08-28 16:04:08 +00:00
|
|
|
attributes_mask = GDK_WA_X | GDK_WA_Y | GDK_WA_VISUAL;
|
2002-04-30 17:08:52 +00:00
|
|
|
|
2010-08-11 21:10:57 +00:00
|
|
|
window = gdk_window_new (gtk_widget_get_parent_window (widget),
|
|
|
|
&attributes, attributes_mask);
|
|
|
|
gtk_widget_set_window (widget, window);
|
|
|
|
gdk_window_set_user_data (window, widget);
|
|
|
|
|
|
|
|
gtk_widget_get_allocation (widget, &allocation);
|
2002-04-30 17:08:52 +00:00
|
|
|
|
2004-07-13 05:15:49 +00:00
|
|
|
/* Make the window for the icon view */
|
2002-04-30 17:08:52 +00:00
|
|
|
attributes.x = 0;
|
|
|
|
attributes.y = 0;
|
2010-08-11 21:10:57 +00:00
|
|
|
attributes.width = MAX (icon_view->priv->width, allocation.width);
|
|
|
|
attributes.height = MAX (icon_view->priv->height, allocation.height);
|
2002-04-30 17:08:52 +00:00
|
|
|
attributes.event_mask = (GDK_EXPOSURE_MASK |
|
|
|
|
GDK_SCROLL_MASK |
|
|
|
|
GDK_POINTER_MOTION_MASK |
|
|
|
|
GDK_BUTTON_PRESS_MASK |
|
|
|
|
GDK_BUTTON_RELEASE_MASK |
|
|
|
|
GDK_KEY_PRESS_MASK |
|
|
|
|
GDK_KEY_RELEASE_MASK) |
|
|
|
|
gtk_widget_get_events (widget);
|
|
|
|
|
2010-08-11 21:10:57 +00:00
|
|
|
icon_view->priv->bin_window = gdk_window_new (window,
|
2004-11-09 19:49:13 +00:00
|
|
|
&attributes, attributes_mask);
|
2004-07-04 15:56:55 +00:00
|
|
|
gdk_window_set_user_data (icon_view->priv->bin_window, widget);
|
2002-04-30 17:08:52 +00:00
|
|
|
|
2011-01-12 20:26:25 +00:00
|
|
|
context = gtk_widget_get_style_context (widget);
|
|
|
|
|
|
|
|
gtk_style_context_save (context);
|
|
|
|
gtk_style_context_add_class (context, GTK_STYLE_CLASS_VIEW);
|
|
|
|
gtk_style_context_set_background (context, icon_view->priv->bin_window);
|
|
|
|
gtk_style_context_restore (context);
|
2005-04-29 20:09:56 +00:00
|
|
|
|
|
|
|
gdk_window_show (icon_view->priv->bin_window);
|
2002-04-30 17:08:52 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2004-07-04 15:56:55 +00:00
|
|
|
gtk_icon_view_unrealize (GtkWidget *widget)
|
2002-04-30 17:08:52 +00:00
|
|
|
{
|
2004-07-04 15:56:55 +00:00
|
|
|
GtkIconView *icon_view;
|
2002-04-30 17:08:52 +00:00
|
|
|
|
2004-07-04 15:56:55 +00:00
|
|
|
icon_view = GTK_ICON_VIEW (widget);
|
2002-04-30 17:08:52 +00:00
|
|
|
|
2004-07-04 15:56:55 +00:00
|
|
|
gdk_window_set_user_data (icon_view->priv->bin_window, NULL);
|
|
|
|
gdk_window_destroy (icon_view->priv->bin_window);
|
|
|
|
icon_view->priv->bin_window = NULL;
|
2002-04-30 17:08:52 +00:00
|
|
|
|
2008-08-12 09:44:32 +00:00
|
|
|
GTK_WIDGET_CLASS (gtk_icon_view_parent_class)->unrealize (widget);
|
2002-04-30 17:08:52 +00:00
|
|
|
}
|
|
|
|
|
2006-08-16 20:42:15 +00:00
|
|
|
static void
|
2011-01-12 20:26:25 +00:00
|
|
|
_gtk_icon_view_update_background (GtkIconView *icon_view)
|
2006-08-16 20:42:15 +00:00
|
|
|
{
|
2011-01-12 20:26:25 +00:00
|
|
|
GtkWidget *widget = GTK_WIDGET (icon_view);
|
2006-08-16 20:42:15 +00:00
|
|
|
|
2010-03-02 06:16:02 +00:00
|
|
|
if (gtk_widget_get_realized (widget))
|
2006-08-16 20:42:15 +00:00
|
|
|
{
|
2011-01-12 20:26:25 +00:00
|
|
|
GtkStyleContext *context;
|
|
|
|
|
|
|
|
context = gtk_widget_get_style_context (widget);
|
|
|
|
|
|
|
|
gtk_style_context_save (context);
|
|
|
|
gtk_style_context_add_class (context, GTK_STYLE_CLASS_VIEW);
|
2010-08-11 21:10:57 +00:00
|
|
|
|
2011-01-12 20:26:25 +00:00
|
|
|
gtk_style_context_set_background (context, gtk_widget_get_window (widget));
|
|
|
|
gtk_style_context_set_background (context, icon_view->priv->bin_window);
|
|
|
|
|
|
|
|
gtk_style_context_restore (context);
|
2006-08-16 20:42:15 +00:00
|
|
|
}
|
2011-01-12 20:26:25 +00:00
|
|
|
}
|
2006-08-16 20:42:15 +00:00
|
|
|
|
2011-01-12 20:26:25 +00:00
|
|
|
static void
|
|
|
|
gtk_icon_view_state_flags_changed (GtkWidget *widget,
|
|
|
|
GtkStateFlags previous_state)
|
|
|
|
{
|
|
|
|
_gtk_icon_view_update_background (GTK_ICON_VIEW (widget));
|
2006-08-16 20:42:15 +00:00
|
|
|
gtk_widget_queue_draw (widget);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2011-01-12 20:26:25 +00:00
|
|
|
gtk_icon_view_style_updated (GtkWidget *widget)
|
2006-08-16 20:42:15 +00:00
|
|
|
{
|
2011-02-07 12:30:37 +00:00
|
|
|
GTK_WIDGET_CLASS (gtk_icon_view_parent_class)->style_updated (widget);
|
|
|
|
|
2011-01-12 20:26:25 +00:00
|
|
|
_gtk_icon_view_update_background (GTK_ICON_VIEW (widget));
|
2006-08-16 20:42:15 +00:00
|
|
|
gtk_widget_queue_resize (widget);
|
|
|
|
}
|
|
|
|
|
2002-04-30 17:08:52 +00:00
|
|
|
static void
|
2010-10-27 05:11:36 +00:00
|
|
|
gtk_icon_view_get_preferred_width (GtkWidget *widget,
|
|
|
|
gint *minimum,
|
|
|
|
gint *natural)
|
2002-04-30 17:08:52 +00:00
|
|
|
{
|
2010-10-27 05:11:36 +00:00
|
|
|
*minimum = *natural = GTK_ICON_VIEW (widget)->priv->width;
|
|
|
|
}
|
2005-05-02 20:28:37 +00:00
|
|
|
|
2010-10-27 05:11:36 +00:00
|
|
|
static void
|
|
|
|
gtk_icon_view_get_preferred_height (GtkWidget *widget,
|
|
|
|
gint *minimum,
|
|
|
|
gint *natural)
|
|
|
|
{
|
|
|
|
*minimum = *natural = GTK_ICON_VIEW (widget)->priv->height;
|
2005-05-02 20:28:37 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
gtk_icon_view_allocate_children (GtkIconView *icon_view)
|
|
|
|
{
|
|
|
|
GList *list;
|
|
|
|
|
|
|
|
for (list = icon_view->priv->children; list; list = list->next)
|
|
|
|
{
|
|
|
|
GtkIconViewChild *child = list->data;
|
|
|
|
|
|
|
|
/* totally ignore our child's requisition */
|
2010-12-12 07:29:41 +00:00
|
|
|
gtk_widget_size_allocate (child->widget, &child->area);
|
2005-05-02 20:28:37 +00:00
|
|
|
}
|
2002-04-30 17:08:52 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2004-07-04 15:56:55 +00:00
|
|
|
gtk_icon_view_size_allocate (GtkWidget *widget,
|
2002-04-30 17:08:52 +00:00
|
|
|
GtkAllocation *allocation)
|
|
|
|
{
|
2005-05-02 20:28:37 +00:00
|
|
|
GtkIconView *icon_view = GTK_ICON_VIEW (widget);
|
|
|
|
|
2010-08-11 21:10:57 +00:00
|
|
|
gtk_widget_set_allocation (widget, allocation);
|
|
|
|
|
2010-03-02 06:16:02 +00:00
|
|
|
if (gtk_widget_get_realized (widget))
|
2002-04-30 17:08:52 +00:00
|
|
|
{
|
2010-08-11 21:10:57 +00:00
|
|
|
gdk_window_move_resize (gtk_widget_get_window (widget),
|
2002-04-30 17:08:52 +00:00
|
|
|
allocation->x, allocation->y,
|
|
|
|
allocation->width, allocation->height);
|
2004-07-04 15:56:55 +00:00
|
|
|
gdk_window_resize (icon_view->priv->bin_window,
|
|
|
|
MAX (icon_view->priv->width, allocation->width),
|
|
|
|
MAX (icon_view->priv->height, allocation->height));
|
2002-04-30 17:08:52 +00:00
|
|
|
}
|
|
|
|
|
2005-05-02 20:28:37 +00:00
|
|
|
gtk_icon_view_layout (icon_view);
|
|
|
|
|
|
|
|
gtk_icon_view_allocate_children (icon_view);
|
|
|
|
|
2010-10-18 04:21:39 +00:00
|
|
|
/* Delay signal emission */
|
|
|
|
g_object_freeze_notify (G_OBJECT (icon_view->priv->hadjustment));
|
|
|
|
g_object_freeze_notify (G_OBJECT (icon_view->priv->vadjustment));
|
2005-03-17 18:37:35 +00:00
|
|
|
|
2010-10-18 04:21:39 +00:00
|
|
|
gtk_icon_view_set_hadjustment_values (icon_view);
|
|
|
|
gtk_icon_view_set_vadjustment_values (icon_view);
|
2005-03-17 18:37:35 +00:00
|
|
|
|
2010-03-02 06:16:02 +00:00
|
|
|
if (gtk_widget_get_realized (widget) &&
|
2005-08-20 20:16:34 +00:00
|
|
|
icon_view->priv->scroll_to_path)
|
|
|
|
{
|
|
|
|
GtkTreePath *path;
|
|
|
|
path = gtk_tree_row_reference_get_path (icon_view->priv->scroll_to_path);
|
|
|
|
gtk_tree_row_reference_free (icon_view->priv->scroll_to_path);
|
|
|
|
icon_view->priv->scroll_to_path = NULL;
|
|
|
|
|
|
|
|
gtk_icon_view_scroll_to_path (icon_view, path,
|
|
|
|
icon_view->priv->scroll_to_use_align,
|
|
|
|
icon_view->priv->scroll_to_row_align,
|
|
|
|
icon_view->priv->scroll_to_col_align);
|
|
|
|
gtk_tree_path_free (path);
|
|
|
|
}
|
2010-10-18 04:21:39 +00:00
|
|
|
|
|
|
|
/* Emit any pending signals now */
|
|
|
|
g_object_thaw_notify (G_OBJECT (icon_view->priv->hadjustment));
|
|
|
|
g_object_thaw_notify (G_OBJECT (icon_view->priv->vadjustment));
|
2002-04-30 17:08:52 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static gboolean
|
2010-09-06 16:54:04 +00:00
|
|
|
gtk_icon_view_draw (GtkWidget *widget,
|
|
|
|
cairo_t *cr)
|
2002-04-30 17:08:52 +00:00
|
|
|
{
|
2004-07-04 15:56:55 +00:00
|
|
|
GtkIconView *icon_view;
|
2002-04-30 17:08:52 +00:00
|
|
|
GList *icons;
|
2005-05-06 04:14:32 +00:00
|
|
|
GtkTreePath *path;
|
|
|
|
gint dest_index;
|
|
|
|
GtkIconViewDropPosition dest_pos;
|
|
|
|
GtkIconViewItem *dest_item = NULL;
|
2002-04-30 17:08:52 +00:00
|
|
|
|
2004-07-04 15:56:55 +00:00
|
|
|
icon_view = GTK_ICON_VIEW (widget);
|
2002-04-30 17:08:52 +00:00
|
|
|
|
2010-09-06 16:54:04 +00:00
|
|
|
if (!gtk_cairo_should_draw_window (cr, icon_view->priv->bin_window))
|
2002-04-30 17:08:52 +00:00
|
|
|
return FALSE;
|
|
|
|
|
2010-09-06 16:54:04 +00:00
|
|
|
cairo_save (cr);
|
|
|
|
|
2010-09-23 09:54:16 +00:00
|
|
|
gtk_cairo_transform_to_window (cr, widget, icon_view->priv->bin_window);
|
2010-09-06 16:54:04 +00:00
|
|
|
|
2005-03-17 01:54:40 +00:00
|
|
|
cairo_set_line_width (cr, 1.);
|
|
|
|
|
2005-05-06 04:14:32 +00:00
|
|
|
gtk_icon_view_get_drag_dest_item (icon_view, &path, &dest_pos);
|
|
|
|
|
|
|
|
if (path)
|
|
|
|
{
|
2010-06-28 18:15:10 +00:00
|
|
|
dest_index = gtk_tree_path_get_indices (path)[0];
|
2005-05-06 04:14:32 +00:00
|
|
|
gtk_tree_path_free (path);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
dest_index = -1;
|
|
|
|
|
2005-05-02 20:28:37 +00:00
|
|
|
for (icons = icon_view->priv->items; icons; icons = icons->next)
|
|
|
|
{
|
|
|
|
GtkIconViewItem *item = icons->data;
|
2010-12-13 08:41:50 +00:00
|
|
|
GdkRectangle paint_area;
|
|
|
|
|
|
|
|
paint_area.x = ((GdkRectangle *)item)->x - icon_view->priv->item_padding;
|
|
|
|
paint_area.y = ((GdkRectangle *)item)->y - icon_view->priv->item_padding;
|
|
|
|
paint_area.width = ((GdkRectangle *)item)->width + icon_view->priv->item_padding * 2;
|
|
|
|
paint_area.height = ((GdkRectangle *)item)->height + icon_view->priv->item_padding * 2;
|
2005-05-02 20:28:37 +00:00
|
|
|
|
2010-08-22 02:32:52 +00:00
|
|
|
cairo_save (cr);
|
|
|
|
|
2010-12-13 08:41:50 +00:00
|
|
|
cairo_rectangle (cr, paint_area.x, paint_area.y, paint_area.width, paint_area.height);
|
2010-08-22 02:32:52 +00:00
|
|
|
cairo_clip (cr);
|
|
|
|
|
2010-09-06 16:44:32 +00:00
|
|
|
if (gdk_cairo_get_clip_rectangle (cr, NULL))
|
2010-08-22 02:32:52 +00:00
|
|
|
{
|
|
|
|
gtk_icon_view_paint_item (icon_view, cr, item,
|
2010-12-13 08:41:50 +00:00
|
|
|
((GdkRectangle *)item)->x, ((GdkRectangle *)item)->y,
|
2010-08-22 02:32:52 +00:00
|
|
|
icon_view->priv->draw_focus);
|
|
|
|
|
|
|
|
if (dest_index == item->index)
|
|
|
|
dest_item = item;
|
|
|
|
}
|
|
|
|
|
|
|
|
cairo_restore (cr);
|
2005-05-02 20:28:37 +00:00
|
|
|
}
|
2002-04-30 17:08:52 +00:00
|
|
|
|
2011-01-12 20:26:25 +00:00
|
|
|
if (dest_item &&
|
|
|
|
dest_pos != GTK_ICON_VIEW_NO_DROP)
|
2005-05-06 04:14:32 +00:00
|
|
|
{
|
2011-01-12 20:26:25 +00:00
|
|
|
GtkStyleContext *context;
|
|
|
|
GtkStateFlags state;
|
|
|
|
GdkRectangle rect = { 0 };
|
2010-08-11 21:10:57 +00:00
|
|
|
|
2011-01-12 20:26:25 +00:00
|
|
|
context = gtk_widget_get_style_context (widget);
|
|
|
|
state = gtk_widget_get_state_flags (widget);
|
2010-08-11 21:10:57 +00:00
|
|
|
|
2005-05-06 04:14:32 +00:00
|
|
|
switch (dest_pos)
|
|
|
|
{
|
|
|
|
case GTK_ICON_VIEW_DROP_INTO:
|
2011-01-12 20:26:25 +00:00
|
|
|
rect = dest_item->cell_area;
|
2005-05-06 04:14:32 +00:00
|
|
|
break;
|
|
|
|
case GTK_ICON_VIEW_DROP_ABOVE:
|
2011-01-12 20:26:25 +00:00
|
|
|
rect.x = dest_item->cell_area.x;
|
|
|
|
rect.y = dest_item->cell_area.y - 1;
|
|
|
|
rect.width = dest_item->cell_area.width;
|
|
|
|
rect.height = 2;
|
2005-05-06 04:14:32 +00:00
|
|
|
break;
|
|
|
|
case GTK_ICON_VIEW_DROP_LEFT:
|
2011-01-12 20:26:25 +00:00
|
|
|
rect.x = dest_item->cell_area.x - 1;
|
|
|
|
rect.y = dest_item->cell_area.y;
|
|
|
|
rect.width = 2;
|
|
|
|
rect.height = dest_item->cell_area.height;
|
2005-05-06 04:14:32 +00:00
|
|
|
break;
|
|
|
|
case GTK_ICON_VIEW_DROP_BELOW:
|
2011-01-12 20:26:25 +00:00
|
|
|
rect.x = dest_item->cell_area.x;
|
|
|
|
rect.y = dest_item->cell_area.y + dest_item->cell_area.height - 1;
|
|
|
|
rect.width = dest_item->cell_area.width;
|
|
|
|
rect.height = 2;
|
2005-05-06 04:14:32 +00:00
|
|
|
break;
|
|
|
|
case GTK_ICON_VIEW_DROP_RIGHT:
|
2011-01-12 20:26:25 +00:00
|
|
|
rect.x = dest_item->cell_area.x + dest_item->cell_area.width - 1;
|
|
|
|
rect.y = dest_item->cell_area.y;
|
|
|
|
rect.width = 2;
|
|
|
|
rect.height = dest_item->cell_area.height;
|
2005-05-06 04:14:32 +00:00
|
|
|
case GTK_ICON_VIEW_NO_DROP: ;
|
|
|
|
break;
|
2011-01-12 20:26:25 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
gtk_style_context_set_state (context, state);
|
|
|
|
gtk_render_focus (context, cr,
|
|
|
|
rect.x, rect.y,
|
|
|
|
rect.width, rect.height);
|
2005-05-06 04:14:32 +00:00
|
|
|
}
|
|
|
|
|
2004-07-04 15:56:55 +00:00
|
|
|
if (icon_view->priv->doing_rubberband)
|
2010-09-06 15:46:37 +00:00
|
|
|
gtk_icon_view_paint_rubberband (icon_view, cr);
|
2002-04-30 17:08:52 +00:00
|
|
|
|
2010-09-06 16:54:04 +00:00
|
|
|
cairo_restore (cr);
|
2005-03-17 01:54:40 +00:00
|
|
|
|
2010-09-06 16:54:04 +00:00
|
|
|
GTK_WIDGET_CLASS (gtk_icon_view_parent_class)->draw (widget, cr);
|
2005-05-02 20:28:37 +00:00
|
|
|
|
2002-04-30 17:08:52 +00:00
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
2004-05-31 19:44:01 +00:00
|
|
|
static gboolean
|
2005-05-06 04:14:32 +00:00
|
|
|
rubberband_scroll_timeout (gpointer data)
|
2004-05-31 19:44:01 +00:00
|
|
|
{
|
2010-05-24 02:04:10 +00:00
|
|
|
GtkIconView *icon_view = data;
|
2004-05-31 19:44:01 +00:00
|
|
|
|
2010-05-24 02:04:10 +00:00
|
|
|
gtk_adjustment_set_value (icon_view->priv->vadjustment,
|
2011-01-05 19:57:46 +00:00
|
|
|
gtk_adjustment_get_value (icon_view->priv->vadjustment) +
|
2010-05-24 02:04:10 +00:00
|
|
|
icon_view->priv->scroll_value_diff);
|
2004-05-31 19:44:01 +00:00
|
|
|
|
2004-07-04 15:56:55 +00:00
|
|
|
gtk_icon_view_update_rubberband (icon_view);
|
2004-05-31 19:44:01 +00:00
|
|
|
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
2002-04-30 17:08:52 +00:00
|
|
|
static gboolean
|
2004-07-04 15:56:55 +00:00
|
|
|
gtk_icon_view_motion (GtkWidget *widget,
|
2002-04-30 17:08:52 +00:00
|
|
|
GdkEventMotion *event)
|
|
|
|
{
|
2010-08-11 21:10:57 +00:00
|
|
|
GtkAllocation allocation;
|
2004-07-04 15:56:55 +00:00
|
|
|
GtkIconView *icon_view;
|
2004-05-31 19:44:01 +00:00
|
|
|
gint abs_y;
|
|
|
|
|
2004-07-04 15:56:55 +00:00
|
|
|
icon_view = GTK_ICON_VIEW (widget);
|
2005-05-06 04:14:32 +00:00
|
|
|
|
|
|
|
gtk_icon_view_maybe_begin_drag (icon_view, event);
|
|
|
|
|
2004-07-04 15:56:55 +00:00
|
|
|
if (icon_view->priv->doing_rubberband)
|
2004-05-31 19:44:01 +00:00
|
|
|
{
|
2004-07-04 15:56:55 +00:00
|
|
|
gtk_icon_view_update_rubberband (widget);
|
Fix the "selection_changed" signal to not get emitted twice in some cases.
2004-07-04 Anders Carlsson <andersca@gnome.org>
* configure.in:
* libegg/iconlist/eggiconlist.c: (egg_icon_list_expose),
(scroll_timeout), (egg_icon_list_motion),
(egg_icon_list_button_press), (egg_icon_list_update_rubberband),
(egg_icon_list_start_rubberbanding),
(egg_icon_list_stop_rubberbanding),
(egg_icon_list_unselect_all_internal),
(egg_icon_list_real_select_all),
(egg_icon_list_adjustment_changed), (egg_icon_list_item_free),
(egg_icon_list_select_item), (verify_items),
(egg_icon_list_row_changed), (egg_icon_list_row_inserted),
(egg_icon_list_row_deleted), (egg_icon_list_rows_reordered),
(egg_icon_list_select_all_between),
(egg_icon_list_move_cursor_up_down),
(egg_icon_list_move_cursor_page_up_down),
(egg_icon_list_move_cursor_left_right),
(egg_icon_list_move_cursor_start_end), (egg_icon_list_set_model),
(egg_icon_list_get_selected_items), (egg_icon_list_select_all),
(egg_icon_list_unselect_all):
* libegg/iconlist/eggiconlist.h:
* libegg/iconlist/testiconlist.c: (foreach_selected_remove):
Fix the "selection_changed" signal to not get emitted twice in some cases.
Also fix a bunch of issues reported by Jonathan.
2004-07-04 12:43:26 +00:00
|
|
|
|
2004-07-04 15:56:55 +00:00
|
|
|
abs_y = event->y - icon_view->priv->height *
|
2011-01-05 19:57:46 +00:00
|
|
|
(gtk_adjustment_get_value (icon_view->priv->vadjustment) /
|
|
|
|
(gtk_adjustment_get_upper (icon_view->priv->vadjustment) -
|
|
|
|
gtk_adjustment_get_lower (icon_view->priv->vadjustment)));
|
2004-05-31 19:44:01 +00:00
|
|
|
|
2010-08-11 21:10:57 +00:00
|
|
|
gtk_widget_get_allocation (widget, &allocation);
|
|
|
|
|
|
|
|
if (abs_y < 0 || abs_y > allocation.height)
|
2004-05-31 19:44:01 +00:00
|
|
|
{
|
|
|
|
if (abs_y < 0)
|
2004-07-04 15:56:55 +00:00
|
|
|
icon_view->priv->scroll_value_diff = abs_y;
|
2004-05-31 19:44:01 +00:00
|
|
|
else
|
2010-08-11 21:10:57 +00:00
|
|
|
icon_view->priv->scroll_value_diff = abs_y - allocation.height;
|
2004-05-31 19:44:01 +00:00
|
|
|
|
2004-07-04 15:56:55 +00:00
|
|
|
icon_view->priv->event_last_x = event->x;
|
|
|
|
icon_view->priv->event_last_y = event->y;
|
2004-05-31 19:44:01 +00:00
|
|
|
|
2005-05-06 04:14:32 +00:00
|
|
|
if (icon_view->priv->scroll_timeout_id == 0)
|
2006-12-22 19:10:43 +00:00
|
|
|
icon_view->priv->scroll_timeout_id = gdk_threads_add_timeout (30, rubberband_scroll_timeout,
|
2005-05-06 04:14:32 +00:00
|
|
|
icon_view);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
remove_scroll_timeout (icon_view);
|
2004-05-31 19:44:01 +00:00
|
|
|
}
|
2002-04-30 17:08:52 +00:00
|
|
|
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
2005-05-02 20:28:37 +00:00
|
|
|
static void
|
|
|
|
gtk_icon_view_remove (GtkContainer *container,
|
|
|
|
GtkWidget *widget)
|
2002-04-30 17:08:52 +00:00
|
|
|
{
|
2004-07-04 15:56:55 +00:00
|
|
|
GtkIconView *icon_view;
|
2005-05-02 20:28:37 +00:00
|
|
|
GtkIconViewChild *child = NULL;
|
|
|
|
GList *tmp_list;
|
Update icon list to use the tree model instead.
2004-07-02 Anders Carlsson <andersca@gnome.org>
* libegg/iconlist/eggiconlist.c: (egg_icon_list_class_init),
(egg_icon_list_init), (egg_icon_list_destroy),
(egg_icon_list_finalize), (egg_icon_list_set_property),
(egg_icon_list_get_property), (egg_icon_list_button_press),
(egg_icon_list_select_first_matching_item),
(egg_icon_list_maybe_begin_dragging_items),
(egg_icon_list_real_toggle_cursor_item),
(egg_icon_list_calculate_item_size),
(egg_icon_list_invalidate_sizes), (egg_icon_list_paint_item),
(egg_icon_list_item_new), (egg_icon_list_item_unref),
(egg_icon_list_get_item_text), (egg_icon_list_get_item_icon),
(egg_icon_list_get_item_at_pos), (egg_icon_list_get_path_at_pos),
(egg_icon_list_selected_foreach), (egg_icon_list_select_path),
(egg_icon_list_unselect_path), (egg_icon_list_path_is_selected),
(egg_icon_list_item_activated), (egg_icon_list_get_items),
(egg_icon_list_row_changed), (egg_icon_list_row_inserted),
(egg_icon_list_row_deleted), (egg_icon_list_rows_reordered),
(egg_icon_list_build_items), (egg_icon_list_set_model),
(egg_icon_list_get_model), (egg_icon_list_set_text_column),
(egg_icon_list_set_pixbuf_column):
* libegg/iconlist/eggiconlist.h:
* libegg/iconlist/testiconlist.c: (fill_model), (create_model),
(foreach_selected_print), (item_removed), (remove_selected),
(item_cb), (do_popup_menu), (main):
* libegg/util/eggmarshalers.list:
Update icon list to use the tree model instead.
2004-07-02 12:04:49 +00:00
|
|
|
|
2005-05-02 20:28:37 +00:00
|
|
|
icon_view = GTK_ICON_VIEW (container);
|
|
|
|
|
|
|
|
tmp_list = icon_view->priv->children;
|
|
|
|
while (tmp_list)
|
|
|
|
{
|
|
|
|
child = tmp_list->data;
|
|
|
|
if (child->widget == widget)
|
|
|
|
{
|
|
|
|
gtk_widget_unparent (widget);
|
2002-04-30 17:08:52 +00:00
|
|
|
|
2005-05-02 20:28:37 +00:00
|
|
|
icon_view->priv->children = g_list_remove_link (icon_view->priv->children, tmp_list);
|
|
|
|
g_list_free_1 (tmp_list);
|
|
|
|
g_free (child);
|
|
|
|
return;
|
|
|
|
}
|
2002-04-30 17:08:52 +00:00
|
|
|
|
2005-05-02 20:28:37 +00:00
|
|
|
tmp_list = tmp_list->next;
|
|
|
|
}
|
|
|
|
}
|
2002-04-30 17:08:52 +00:00
|
|
|
|
2005-05-02 20:28:37 +00:00
|
|
|
static void
|
|
|
|
gtk_icon_view_forall (GtkContainer *container,
|
|
|
|
gboolean include_internals,
|
|
|
|
GtkCallback callback,
|
|
|
|
gpointer callback_data)
|
|
|
|
{
|
|
|
|
GtkIconView *icon_view;
|
|
|
|
GtkIconViewChild *child = NULL;
|
|
|
|
GList *tmp_list;
|
2002-04-30 17:08:52 +00:00
|
|
|
|
2005-05-02 20:28:37 +00:00
|
|
|
icon_view = GTK_ICON_VIEW (container);
|
2004-06-18 05:17:01 +00:00
|
|
|
|
2005-05-02 20:28:37 +00:00
|
|
|
tmp_list = icon_view->priv->children;
|
|
|
|
while (tmp_list)
|
|
|
|
{
|
|
|
|
child = tmp_list->data;
|
|
|
|
tmp_list = tmp_list->next;
|
2002-04-30 17:08:52 +00:00
|
|
|
|
2005-05-02 20:28:37 +00:00
|
|
|
(* callback) (child->widget, callback_data);
|
2002-04-30 17:08:52 +00:00
|
|
|
}
|
2005-05-02 20:28:37 +00:00
|
|
|
}
|
2002-04-30 17:08:52 +00:00
|
|
|
|
2008-02-12 16:43:04 +00:00
|
|
|
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);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2010-12-12 10:59:41 +00:00
|
|
|
static void
|
|
|
|
gtk_icon_view_add_editable (GtkCellArea *area,
|
|
|
|
GtkCellRenderer *renderer,
|
|
|
|
GtkCellEditable *editable,
|
|
|
|
GdkRectangle *cell_area,
|
|
|
|
const gchar *path,
|
|
|
|
GtkIconView *icon_view)
|
2005-05-02 20:28:37 +00:00
|
|
|
{
|
|
|
|
GtkIconViewChild *child;
|
2010-12-12 10:59:41 +00:00
|
|
|
GtkWidget *widget = GTK_WIDGET (editable);
|
2002-04-30 17:08:52 +00:00
|
|
|
|
2005-05-02 20:28:37 +00:00
|
|
|
child = g_new (GtkIconViewChild, 1);
|
|
|
|
|
2010-12-12 07:29:41 +00:00
|
|
|
child->widget = widget;
|
2010-12-12 10:59:41 +00:00
|
|
|
child->area.x = cell_area->x;
|
|
|
|
child->area.y = cell_area->y;
|
|
|
|
child->area.width = cell_area->width;
|
|
|
|
child->area.height = cell_area->height;
|
2002-04-30 17:08:52 +00:00
|
|
|
|
2005-05-02 20:28:37 +00:00
|
|
|
icon_view->priv->children = g_list_append (icon_view->priv->children, child);
|
|
|
|
|
2010-03-02 06:16:02 +00:00
|
|
|
if (gtk_widget_get_realized (GTK_WIDGET (icon_view)))
|
2005-05-02 20:28:37 +00:00
|
|
|
gtk_widget_set_parent_window (child->widget, icon_view->priv->bin_window);
|
|
|
|
|
|
|
|
gtk_widget_set_parent (widget, GTK_WIDGET (icon_view));
|
2002-04-30 17:08:52 +00:00
|
|
|
}
|
|
|
|
|
2005-05-02 20:28:37 +00:00
|
|
|
static void
|
2010-12-12 10:59:41 +00:00
|
|
|
gtk_icon_view_remove_editable (GtkCellArea *area,
|
|
|
|
GtkCellRenderer *renderer,
|
|
|
|
GtkCellEditable *editable,
|
|
|
|
GtkIconView *icon_view)
|
2002-04-30 17:08:52 +00:00
|
|
|
{
|
2010-12-12 10:59:41 +00:00
|
|
|
GtkTreePath *path;
|
2004-05-31 19:44:01 +00:00
|
|
|
|
2010-03-01 03:21:41 +00:00
|
|
|
if (gtk_widget_has_focus (GTK_WIDGET (editable)))
|
2005-05-02 20:28:37 +00:00
|
|
|
gtk_widget_grab_focus (GTK_WIDGET (icon_view));
|
|
|
|
|
|
|
|
gtk_container_remove (GTK_CONTAINER (icon_view),
|
|
|
|
GTK_WIDGET (editable));
|
|
|
|
|
2010-12-12 10:59:41 +00:00
|
|
|
path = gtk_tree_path_new_from_string (gtk_cell_area_get_current_path_string (area));
|
|
|
|
gtk_icon_view_queue_draw_path (icon_view, path);
|
|
|
|
gtk_tree_path_free (path);
|
2005-05-02 20:28:37 +00:00
|
|
|
}
|
|
|
|
|
2010-12-13 09:08:37 +00:00
|
|
|
static void
|
|
|
|
gtk_icon_view_context_changed (GtkCellAreaContext *context,
|
|
|
|
GParamSpec *pspec,
|
|
|
|
GtkIconView *icon_view)
|
|
|
|
{
|
|
|
|
if (!strcmp (pspec->name, "minimum-width") ||
|
|
|
|
!strcmp (pspec->name, "natural-width") ||
|
|
|
|
!strcmp (pspec->name, "minimum-height") ||
|
|
|
|
!strcmp (pspec->name, "natural-height"))
|
|
|
|
gtk_icon_view_invalidate_sizes (icon_view);
|
|
|
|
}
|
|
|
|
|
2005-05-02 20:28:37 +00:00
|
|
|
/**
|
|
|
|
* gtk_icon_view_set_cursor:
|
|
|
|
* @icon_view: A #GtkIconView
|
|
|
|
* @path: A #GtkTreePath
|
2009-12-10 10:23:40 +00:00
|
|
|
* @cell: (allow-none): One of the cell renderers of @icon_view, or %NULL
|
2005-05-02 20:28:37 +00:00
|
|
|
* @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
|
2009-12-10 10:23:40 +00:00
|
|
|
* useful when you want to focus the user's attention on a particular item.
|
2005-05-02 20:28:37 +00:00
|
|
|
* 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.
|
|
|
|
*
|
|
|
|
* This function is often followed by <literal>gtk_widget_grab_focus
|
|
|
|
* (icon_view)</literal> in order to give keyboard focus to the widget.
|
|
|
|
* Please note that editing can only happen when the widget is realized.
|
|
|
|
*
|
|
|
|
* Since: 2.8
|
|
|
|
**/
|
|
|
|
void
|
|
|
|
gtk_icon_view_set_cursor (GtkIconView *icon_view,
|
|
|
|
GtkTreePath *path,
|
|
|
|
GtkCellRenderer *cell,
|
|
|
|
gboolean start_editing)
|
|
|
|
{
|
2005-09-13 19:57:42 +00:00
|
|
|
GtkIconViewItem *item = NULL;
|
2005-05-02 20:28:37 +00:00
|
|
|
|
|
|
|
g_return_if_fail (GTK_IS_ICON_VIEW (icon_view));
|
|
|
|
g_return_if_fail (path != NULL);
|
|
|
|
g_return_if_fail (cell == NULL || GTK_IS_CELL_RENDERER (cell));
|
|
|
|
|
2011-02-25 05:53:12 +00:00
|
|
|
if (icon_view->priv->cell_area)
|
|
|
|
gtk_cell_area_stop_editing (icon_view->priv->cell_area, TRUE);
|
2005-08-20 20:16:34 +00:00
|
|
|
|
|
|
|
if (gtk_tree_path_get_depth (path) == 1)
|
2005-09-19 18:36:04 +00:00
|
|
|
item = g_list_nth_data (icon_view->priv->items,
|
2010-06-28 18:15:10 +00:00
|
|
|
gtk_tree_path_get_indices(path)[0]);
|
2005-05-02 20:28:37 +00:00
|
|
|
|
|
|
|
if (!item)
|
|
|
|
return;
|
2006-03-20 03:16:43 +00:00
|
|
|
|
2010-12-12 07:29:41 +00:00
|
|
|
gtk_icon_view_set_cursor_item (icon_view, item, cell);
|
2006-03-20 03:16:43 +00:00
|
|
|
gtk_icon_view_scroll_to_path (icon_view, path, FALSE, 0.0, 0.0);
|
2010-12-12 07:29:41 +00:00
|
|
|
|
2011-02-25 05:53:12 +00:00
|
|
|
if (start_editing &&
|
|
|
|
icon_view->priv->cell_area)
|
2010-12-12 10:59:41 +00:00
|
|
|
{
|
2010-12-12 15:24:26 +00:00
|
|
|
GtkCellAreaContext *context;
|
2010-12-12 10:59:41 +00:00
|
|
|
|
2010-12-12 15:24:26 +00:00
|
|
|
context = g_ptr_array_index (icon_view->priv->row_contexts, item->row);
|
2010-12-12 10:59:41 +00:00
|
|
|
gtk_icon_view_set_cell_data (icon_view, item);
|
2010-12-12 15:24:26 +00:00
|
|
|
gtk_cell_area_activate (icon_view->priv->cell_area, context,
|
2010-12-13 08:41:50 +00:00
|
|
|
GTK_WIDGET (icon_view), (GdkRectangle *)item,
|
|
|
|
0 /* XXX flags */, TRUE);
|
2010-12-12 10:59:41 +00:00
|
|
|
}
|
2005-05-02 20:28:37 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* gtk_icon_view_get_cursor:
|
|
|
|
* @icon_view: A #GtkIconView
|
2011-01-18 09:10:30 +00:00
|
|
|
* @path: (out) (allow-none): Return location for the current cursor path,
|
|
|
|
* or %NULL
|
|
|
|
* @cell: (out) (allow-none): Return location the current focus cell, or %NULL
|
2005-05-02 20:28:37 +00:00
|
|
|
*
|
|
|
|
* 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 no cell currently has focus, then *@cell will be %NULL.
|
|
|
|
*
|
|
|
|
* The returned #GtkTreePath must be freed with gtk_tree_path_free().
|
|
|
|
*
|
|
|
|
* Return value: %TRUE if the cursor is set.
|
|
|
|
*
|
|
|
|
* Since: 2.8
|
|
|
|
**/
|
|
|
|
gboolean
|
|
|
|
gtk_icon_view_get_cursor (GtkIconView *icon_view,
|
|
|
|
GtkTreePath **path,
|
|
|
|
GtkCellRenderer **cell)
|
|
|
|
{
|
|
|
|
GtkIconViewItem *item;
|
|
|
|
|
|
|
|
g_return_val_if_fail (GTK_IS_ICON_VIEW (icon_view), FALSE);
|
|
|
|
|
|
|
|
item = icon_view->priv->cursor_item;
|
|
|
|
|
|
|
|
if (path != NULL)
|
|
|
|
{
|
|
|
|
if (item != NULL)
|
|
|
|
*path = gtk_tree_path_new_from_indices (item->index, -1);
|
|
|
|
else
|
|
|
|
*path = NULL;
|
|
|
|
}
|
|
|
|
|
2011-02-25 05:53:12 +00:00
|
|
|
if (cell != NULL && item != NULL && icon_view->priv->cell_area != NULL)
|
2010-12-12 07:29:41 +00:00
|
|
|
*cell = gtk_cell_area_get_focus_cell (icon_view->priv->cell_area);
|
2005-05-02 20:28:37 +00:00
|
|
|
|
|
|
|
return (item != NULL);
|
|
|
|
}
|
|
|
|
|
|
|
|
static gboolean
|
|
|
|
gtk_icon_view_button_press (GtkWidget *widget,
|
|
|
|
GdkEventButton *event)
|
|
|
|
{
|
|
|
|
GtkIconView *icon_view;
|
|
|
|
GtkIconViewItem *item;
|
|
|
|
gboolean dirty = FALSE;
|
2010-12-12 07:29:41 +00:00
|
|
|
GtkCellRenderer *cell = NULL, *cursor_cell = NULL;
|
2005-05-02 20:28:37 +00:00
|
|
|
|
|
|
|
icon_view = GTK_ICON_VIEW (widget);
|
|
|
|
|
|
|
|
if (event->window != icon_view->priv->bin_window)
|
|
|
|
return FALSE;
|
|
|
|
|
2010-03-01 03:21:41 +00:00
|
|
|
if (!gtk_widget_has_focus (widget))
|
2005-05-02 20:28:37 +00:00
|
|
|
gtk_widget_grab_focus (widget);
|
|
|
|
|
|
|
|
if (event->button == 1 && event->type == GDK_BUTTON_PRESS)
|
|
|
|
{
|
|
|
|
item = gtk_icon_view_get_item_at_coords (icon_view,
|
|
|
|
event->x, event->y,
|
2008-09-24 08:04:15 +00:00
|
|
|
FALSE,
|
2010-12-12 07:29:41 +00:00
|
|
|
&cell);
|
2008-09-24 08:04:15 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
* 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.
|
|
|
|
*/
|
2010-12-12 07:29:41 +00:00
|
|
|
if (item != NULL && (cell != NULL || item->selected))
|
2005-05-02 20:28:37 +00:00
|
|
|
{
|
2010-12-12 07:29:41 +00:00
|
|
|
if (cell != NULL)
|
2008-09-24 08:04:15 +00:00
|
|
|
{
|
2010-12-12 07:29:41 +00:00
|
|
|
if (gtk_cell_renderer_is_activatable (cell))
|
|
|
|
cursor_cell = cell;
|
2008-09-24 08:04:15 +00:00
|
|
|
}
|
|
|
|
|
2005-05-02 20:28:37 +00:00
|
|
|
gtk_icon_view_scroll_to_item (icon_view, item);
|
|
|
|
|
|
|
|
if (icon_view->priv->selection_mode == GTK_SELECTION_NONE)
|
|
|
|
{
|
|
|
|
gtk_icon_view_set_cursor_item (icon_view, item, cursor_cell);
|
|
|
|
}
|
|
|
|
else if (icon_view->priv->selection_mode == GTK_SELECTION_MULTIPLE &&
|
|
|
|
(event->state & GDK_SHIFT_MASK))
|
|
|
|
{
|
|
|
|
gtk_icon_view_unselect_all_internal (icon_view);
|
|
|
|
|
|
|
|
gtk_icon_view_set_cursor_item (icon_view, item, cursor_cell);
|
|
|
|
if (!icon_view->priv->anchor_item)
|
|
|
|
icon_view->priv->anchor_item = item;
|
|
|
|
else
|
|
|
|
gtk_icon_view_select_all_between (icon_view,
|
|
|
|
icon_view->priv->anchor_item,
|
|
|
|
item);
|
|
|
|
dirty = TRUE;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
if ((icon_view->priv->selection_mode == GTK_SELECTION_MULTIPLE ||
|
|
|
|
((icon_view->priv->selection_mode == GTK_SELECTION_SINGLE) && item->selected)) &&
|
|
|
|
(event->state & GDK_CONTROL_MASK))
|
|
|
|
{
|
|
|
|
item->selected = !item->selected;
|
|
|
|
gtk_icon_view_queue_draw_item (icon_view, item);
|
|
|
|
dirty = TRUE;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2009-04-18 15:47:07 +00:00
|
|
|
gtk_icon_view_unselect_all_internal (icon_view);
|
|
|
|
|
|
|
|
item->selected = TRUE;
|
|
|
|
gtk_icon_view_queue_draw_item (icon_view, item);
|
|
|
|
dirty = TRUE;
|
2005-05-02 20:28:37 +00:00
|
|
|
}
|
|
|
|
gtk_icon_view_set_cursor_item (icon_view, item, cursor_cell);
|
|
|
|
icon_view->priv->anchor_item = item;
|
|
|
|
}
|
2005-05-06 04:14:32 +00:00
|
|
|
|
2005-05-02 20:28:37 +00:00
|
|
|
/* Save press to possibly begin a drag */
|
|
|
|
if (icon_view->priv->pressed_button < 0)
|
|
|
|
{
|
|
|
|
icon_view->priv->pressed_button = event->button;
|
|
|
|
icon_view->priv->press_start_x = event->x;
|
|
|
|
icon_view->priv->press_start_y = event->y;
|
|
|
|
}
|
2005-05-06 04:14:32 +00:00
|
|
|
|
2005-05-02 20:28:37 +00:00
|
|
|
if (!icon_view->priv->last_single_clicked)
|
|
|
|
icon_view->priv->last_single_clicked = item;
|
|
|
|
|
|
|
|
/* cancel the current editing, if it exists */
|
2010-12-12 10:59:41 +00:00
|
|
|
gtk_cell_area_stop_editing (icon_view->priv->cell_area, TRUE);
|
2008-09-24 08:04:15 +00:00
|
|
|
|
2010-12-12 10:59:41 +00:00
|
|
|
if (cell != NULL && gtk_cell_renderer_is_activatable (cell))
|
2008-09-24 08:04:15 +00:00
|
|
|
{
|
2010-12-12 15:24:26 +00:00
|
|
|
GtkCellAreaContext *context;
|
2010-12-12 11:37:38 +00:00
|
|
|
|
2010-12-12 15:24:26 +00:00
|
|
|
context = g_ptr_array_index (icon_view->priv->row_contexts, item->row);
|
2010-12-12 11:37:38 +00:00
|
|
|
|
2010-12-12 07:29:41 +00:00
|
|
|
gtk_icon_view_set_cell_data (icon_view, item);
|
2010-12-12 15:24:26 +00:00
|
|
|
gtk_cell_area_activate (icon_view->priv->cell_area, context,
|
2010-12-12 07:29:41 +00:00
|
|
|
GTK_WIDGET (icon_view),
|
2010-12-13 08:41:50 +00:00
|
|
|
(GdkRectangle *)item, 0/* XXX flags */, FALSE);
|
2008-09-24 08:04:15 +00:00
|
|
|
}
|
2005-05-02 20:28:37 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
if (icon_view->priv->selection_mode != GTK_SELECTION_BROWSE &&
|
|
|
|
!(event->state & GDK_CONTROL_MASK))
|
|
|
|
{
|
|
|
|
dirty = gtk_icon_view_unselect_all_internal (icon_view);
|
|
|
|
}
|
|
|
|
|
|
|
|
if (icon_view->priv->selection_mode == GTK_SELECTION_MULTIPLE)
|
2010-05-25 22:38:44 +00:00
|
|
|
gtk_icon_view_start_rubberbanding (icon_view, event->device, event->x, event->y);
|
2005-05-02 20:28:37 +00:00
|
|
|
}
|
|
|
|
|
2008-09-27 12:53:05 +00:00
|
|
|
/* don't draw keyboard focus around an clicked-on item */
|
|
|
|
icon_view->priv->draw_focus = FALSE;
|
2005-05-02 20:28:37 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
if (event->button == 1 && event->type == GDK_2BUTTON_PRESS)
|
|
|
|
{
|
|
|
|
item = gtk_icon_view_get_item_at_coords (icon_view,
|
|
|
|
event->x, event->y,
|
2008-09-24 08:04:15 +00:00
|
|
|
FALSE,
|
2005-05-02 20:28:37 +00:00
|
|
|
NULL);
|
|
|
|
|
|
|
|
if (item && item == icon_view->priv->last_single_clicked)
|
|
|
|
{
|
|
|
|
GtkTreePath *path;
|
|
|
|
|
|
|
|
path = gtk_tree_path_new_from_indices (item->index, -1);
|
|
|
|
gtk_icon_view_item_activated (icon_view, path);
|
|
|
|
gtk_tree_path_free (path);
|
|
|
|
}
|
|
|
|
|
|
|
|
icon_view->priv->last_single_clicked = NULL;
|
2005-12-20 18:21:21 +00:00
|
|
|
icon_view->priv->pressed_button = -1;
|
2005-05-02 20:28:37 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
if (dirty)
|
|
|
|
g_signal_emit (icon_view, icon_view_signals[SELECTION_CHANGED], 0);
|
|
|
|
|
|
|
|
return event->button == 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
static gboolean
|
|
|
|
gtk_icon_view_button_release (GtkWidget *widget,
|
|
|
|
GdkEventButton *event)
|
|
|
|
{
|
|
|
|
GtkIconView *icon_view;
|
|
|
|
|
|
|
|
icon_view = GTK_ICON_VIEW (widget);
|
|
|
|
|
|
|
|
if (icon_view->priv->pressed_button == event->button)
|
|
|
|
icon_view->priv->pressed_button = -1;
|
2005-05-06 04:14:32 +00:00
|
|
|
|
2005-05-02 20:28:37 +00:00
|
|
|
gtk_icon_view_stop_rubberbanding (icon_view);
|
|
|
|
|
2005-05-06 04:14:32 +00:00
|
|
|
remove_scroll_timeout (icon_view);
|
2005-05-02 20:28:37 +00:00
|
|
|
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
2007-05-09 14:06:02 +00:00
|
|
|
static gboolean
|
|
|
|
gtk_icon_view_key_press (GtkWidget *widget,
|
|
|
|
GdkEventKey *event)
|
|
|
|
{
|
|
|
|
GtkIconView *icon_view = GTK_ICON_VIEW (widget);
|
|
|
|
|
|
|
|
if (icon_view->priv->doing_rubberband)
|
|
|
|
{
|
2010-09-08 17:35:51 +00:00
|
|
|
if (event->keyval == GDK_KEY_Escape)
|
2007-05-09 14:06:02 +00:00
|
|
|
gtk_icon_view_stop_rubberbanding (icon_view);
|
|
|
|
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
2008-08-12 09:06:34 +00:00
|
|
|
return GTK_WIDGET_CLASS (gtk_icon_view_parent_class)->key_press_event (widget, event);
|
2007-05-09 14:06:02 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static gboolean
|
|
|
|
gtk_icon_view_key_release (GtkWidget *widget,
|
|
|
|
GdkEventKey *event)
|
|
|
|
{
|
|
|
|
GtkIconView *icon_view = GTK_ICON_VIEW (widget);
|
|
|
|
|
|
|
|
if (icon_view->priv->doing_rubberband)
|
|
|
|
return TRUE;
|
|
|
|
|
2008-08-12 09:06:34 +00:00
|
|
|
return GTK_WIDGET_CLASS (gtk_icon_view_parent_class)->key_press_event (widget, event);
|
2007-05-09 14:06:02 +00:00
|
|
|
}
|
|
|
|
|
2005-05-02 20:28:37 +00:00
|
|
|
static void
|
|
|
|
gtk_icon_view_update_rubberband (gpointer data)
|
|
|
|
{
|
|
|
|
GtkIconView *icon_view;
|
|
|
|
gint x, y;
|
|
|
|
GdkRectangle old_area;
|
2002-04-30 17:08:52 +00:00
|
|
|
GdkRectangle new_area;
|
|
|
|
GdkRectangle common;
|
2010-06-28 12:54:37 +00:00
|
|
|
cairo_region_t *invalid_region;
|
2002-04-30 17:08:52 +00:00
|
|
|
|
2004-07-04 15:56:55 +00:00
|
|
|
icon_view = GTK_ICON_VIEW (data);
|
2002-04-30 17:08:52 +00:00
|
|
|
|
2010-05-25 22:38:44 +00:00
|
|
|
gdk_window_get_device_position (icon_view->priv->bin_window,
|
|
|
|
icon_view->priv->rubberband_device,
|
|
|
|
&x, &y, NULL);
|
2002-04-30 17:08:52 +00:00
|
|
|
|
|
|
|
x = MAX (x, 0);
|
|
|
|
y = MAX (y, 0);
|
|
|
|
|
2004-07-04 15:56:55 +00:00
|
|
|
old_area.x = MIN (icon_view->priv->rubberband_x1,
|
|
|
|
icon_view->priv->rubberband_x2);
|
|
|
|
old_area.y = MIN (icon_view->priv->rubberband_y1,
|
|
|
|
icon_view->priv->rubberband_y2);
|
|
|
|
old_area.width = ABS (icon_view->priv->rubberband_x2 -
|
|
|
|
icon_view->priv->rubberband_x1) + 1;
|
|
|
|
old_area.height = ABS (icon_view->priv->rubberband_y2 -
|
|
|
|
icon_view->priv->rubberband_y1) + 1;
|
2002-04-30 17:08:52 +00:00
|
|
|
|
2004-07-04 15:56:55 +00:00
|
|
|
new_area.x = MIN (icon_view->priv->rubberband_x1, x);
|
|
|
|
new_area.y = MIN (icon_view->priv->rubberband_y1, y);
|
|
|
|
new_area.width = ABS (x - icon_view->priv->rubberband_x1) + 1;
|
|
|
|
new_area.height = ABS (y - icon_view->priv->rubberband_y1) + 1;
|
2002-04-30 17:08:52 +00:00
|
|
|
|
2010-06-28 12:44:12 +00:00
|
|
|
invalid_region = cairo_region_create_rectangle (&old_area);
|
|
|
|
cairo_region_union_rectangle (invalid_region, &new_area);
|
2002-08-20 19:50:19 +00:00
|
|
|
|
2002-04-30 17:08:52 +00:00
|
|
|
gdk_rectangle_intersect (&old_area, &new_area, &common);
|
2002-08-20 19:50:19 +00:00
|
|
|
if (common.width > 2 && common.height > 2)
|
2002-04-30 17:08:52 +00:00
|
|
|
{
|
2010-06-28 12:54:37 +00:00
|
|
|
cairo_region_t *common_region;
|
2002-08-20 19:50:19 +00:00
|
|
|
|
|
|
|
/* make sure the border is invalidated */
|
2002-04-30 17:08:52 +00:00
|
|
|
common.x += 1;
|
|
|
|
common.y += 1;
|
2002-08-20 19:50:19 +00:00
|
|
|
common.width -= 2;
|
2002-04-30 17:08:52 +00:00
|
|
|
common.height -= 2;
|
2002-08-20 19:50:19 +00:00
|
|
|
|
2010-06-28 12:44:12 +00:00
|
|
|
common_region = cairo_region_create_rectangle (&common);
|
2002-04-30 17:08:52 +00:00
|
|
|
|
2010-06-28 12:44:12 +00:00
|
|
|
cairo_region_subtract (invalid_region, common_region);
|
|
|
|
cairo_region_destroy (common_region);
|
2002-08-20 19:50:19 +00:00
|
|
|
}
|
2002-04-30 17:08:52 +00:00
|
|
|
|
2004-07-04 15:56:55 +00:00
|
|
|
gdk_window_invalidate_region (icon_view->priv->bin_window, invalid_region, TRUE);
|
2002-04-30 17:08:52 +00:00
|
|
|
|
2010-06-28 12:44:12 +00:00
|
|
|
cairo_region_destroy (invalid_region);
|
2002-04-30 17:08:52 +00:00
|
|
|
|
2004-07-04 15:56:55 +00:00
|
|
|
icon_view->priv->rubberband_x2 = x;
|
|
|
|
icon_view->priv->rubberband_y2 = y;
|
2002-04-30 17:08:52 +00:00
|
|
|
|
2004-07-04 15:56:55 +00:00
|
|
|
gtk_icon_view_update_rubberband_selection (icon_view);
|
2002-04-30 17:08:52 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2004-07-04 15:56:55 +00:00
|
|
|
gtk_icon_view_start_rubberbanding (GtkIconView *icon_view,
|
2010-05-25 22:38:44 +00:00
|
|
|
GdkDevice *device,
|
2002-04-30 17:08:52 +00:00
|
|
|
gint x,
|
|
|
|
gint y)
|
|
|
|
{
|
|
|
|
GList *items;
|
|
|
|
|
2010-05-25 22:38:44 +00:00
|
|
|
if (icon_view->priv->rubberband_device)
|
|
|
|
return;
|
2002-04-30 17:08:52 +00:00
|
|
|
|
2004-07-04 15:56:55 +00:00
|
|
|
for (items = icon_view->priv->items; items; items = items->next)
|
2002-04-30 17:08:52 +00:00
|
|
|
{
|
2004-07-04 15:56:55 +00:00
|
|
|
GtkIconViewItem *item = items->data;
|
2002-04-30 17:08:52 +00:00
|
|
|
|
|
|
|
item->selected_before_rubberbanding = item->selected;
|
|
|
|
}
|
|
|
|
|
2004-07-04 15:56:55 +00:00
|
|
|
icon_view->priv->rubberband_x1 = x;
|
|
|
|
icon_view->priv->rubberband_y1 = y;
|
|
|
|
icon_view->priv->rubberband_x2 = x;
|
|
|
|
icon_view->priv->rubberband_y2 = y;
|
2002-04-30 17:08:52 +00:00
|
|
|
|
2004-07-04 15:56:55 +00:00
|
|
|
icon_view->priv->doing_rubberband = TRUE;
|
2010-05-25 22:38:44 +00:00
|
|
|
icon_view->priv->rubberband_device = device;
|
2002-04-30 17:08:52 +00:00
|
|
|
|
2010-05-25 22:38:44 +00:00
|
|
|
gtk_device_grab_add (GTK_WIDGET (icon_view), device, TRUE);
|
2002-04-30 17:08:52 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2004-07-04 15:56:55 +00:00
|
|
|
gtk_icon_view_stop_rubberbanding (GtkIconView *icon_view)
|
2002-04-30 17:08:52 +00:00
|
|
|
{
|
2004-07-04 15:56:55 +00:00
|
|
|
if (!icon_view->priv->doing_rubberband)
|
2002-04-30 17:08:52 +00:00
|
|
|
return;
|
|
|
|
|
2010-05-25 22:38:44 +00:00
|
|
|
gtk_device_grab_remove (GTK_WIDGET (icon_view),
|
|
|
|
icon_view->priv->rubberband_device);
|
|
|
|
|
2004-07-04 15:56:55 +00:00
|
|
|
icon_view->priv->doing_rubberband = FALSE;
|
2010-05-25 22:38:44 +00:00
|
|
|
icon_view->priv->rubberband_device = NULL;
|
2002-04-30 17:08:52 +00:00
|
|
|
|
2004-07-04 15:56:55 +00:00
|
|
|
gtk_widget_queue_draw (GTK_WIDGET (icon_view));
|
2002-04-30 17:08:52 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2004-07-04 15:56:55 +00:00
|
|
|
gtk_icon_view_update_rubberband_selection (GtkIconView *icon_view)
|
2002-04-30 17:08:52 +00:00
|
|
|
{
|
|
|
|
GList *items;
|
|
|
|
gint x, y, width, height;
|
|
|
|
gboolean dirty = FALSE;
|
|
|
|
|
2004-07-04 15:56:55 +00:00
|
|
|
x = MIN (icon_view->priv->rubberband_x1,
|
|
|
|
icon_view->priv->rubberband_x2);
|
|
|
|
y = MIN (icon_view->priv->rubberband_y1,
|
|
|
|
icon_view->priv->rubberband_y2);
|
|
|
|
width = ABS (icon_view->priv->rubberband_x1 -
|
|
|
|
icon_view->priv->rubberband_x2);
|
|
|
|
height = ABS (icon_view->priv->rubberband_y1 -
|
|
|
|
icon_view->priv->rubberband_y2);
|
2002-04-30 17:08:52 +00:00
|
|
|
|
2004-07-04 15:56:55 +00:00
|
|
|
for (items = icon_view->priv->items; items; items = items->next)
|
2002-04-30 17:08:52 +00:00
|
|
|
{
|
2004-07-04 15:56:55 +00:00
|
|
|
GtkIconViewItem *item = items->data;
|
2002-04-30 17:08:52 +00:00
|
|
|
gboolean is_in;
|
|
|
|
gboolean selected;
|
|
|
|
|
2005-05-02 20:28:37 +00:00
|
|
|
is_in = gtk_icon_view_item_hit_test (icon_view, item,
|
|
|
|
x, y, width, height);
|
2002-04-30 17:08:52 +00:00
|
|
|
|
|
|
|
selected = is_in ^ item->selected_before_rubberbanding;
|
|
|
|
|
|
|
|
if (item->selected != selected)
|
|
|
|
{
|
|
|
|
item->selected = selected;
|
|
|
|
dirty = TRUE;
|
2004-07-04 15:56:55 +00:00
|
|
|
gtk_icon_view_queue_draw_item (icon_view, item);
|
2002-04-30 17:08:52 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (dirty)
|
2004-07-04 15:56:55 +00:00
|
|
|
g_signal_emit (icon_view, icon_view_signals[SELECTION_CHANGED], 0);
|
2002-04-30 17:08:52 +00:00
|
|
|
}
|
|
|
|
|
2010-12-12 07:29:41 +00:00
|
|
|
|
|
|
|
typedef struct {
|
|
|
|
GdkRectangle hit_rect;
|
|
|
|
gboolean hit;
|
|
|
|
} HitTestData;
|
|
|
|
|
|
|
|
static gboolean
|
|
|
|
hit_test (GtkCellRenderer *renderer,
|
|
|
|
const GdkRectangle *cell_area,
|
|
|
|
const GdkRectangle *cell_background,
|
|
|
|
HitTestData *data)
|
|
|
|
{
|
|
|
|
if (MIN (data->hit_rect.x + data->hit_rect.width, cell_area->x + cell_area->width) -
|
|
|
|
MAX (data->hit_rect.x, cell_area->x) > 0 &&
|
|
|
|
MIN (data->hit_rect.y + data->hit_rect.height, cell_area->y + cell_area->height) -
|
|
|
|
MAX (data->hit_rect.y, cell_area->y) > 0)
|
|
|
|
data->hit = TRUE;
|
|
|
|
|
|
|
|
return (data->hit != FALSE);
|
|
|
|
}
|
|
|
|
|
2002-04-30 17:08:52 +00:00
|
|
|
static gboolean
|
2005-05-02 20:28:37 +00:00
|
|
|
gtk_icon_view_item_hit_test (GtkIconView *icon_view,
|
|
|
|
GtkIconViewItem *item,
|
2002-04-30 17:08:52 +00:00
|
|
|
gint x,
|
|
|
|
gint y,
|
|
|
|
gint width,
|
|
|
|
gint height)
|
|
|
|
{
|
2010-12-12 07:29:41 +00:00
|
|
|
HitTestData data = { { x, y, width, height }, FALSE };
|
2010-12-12 15:24:26 +00:00
|
|
|
GtkCellAreaContext *context;
|
2010-12-13 08:41:50 +00:00
|
|
|
GdkRectangle *item_area = (GdkRectangle *)item;
|
2010-12-12 15:24:26 +00:00
|
|
|
|
2010-12-13 08:41:50 +00:00
|
|
|
if (MIN (x + width, item_area->x + item_area->width) - MAX (x, item_area->x) <= 0 ||
|
|
|
|
MIN (y + height, item_area->y + item_area->height) - MAX (y, item_area->y) <= 0)
|
2007-09-10 00:43:58 +00:00
|
|
|
return FALSE;
|
|
|
|
|
2010-12-12 15:24:26 +00:00
|
|
|
context = g_ptr_array_index (icon_view->priv->row_contexts, item->row);
|
2010-12-12 11:37:38 +00:00
|
|
|
|
2010-12-12 07:29:41 +00:00
|
|
|
gtk_icon_view_set_cell_data (icon_view, item);
|
2010-12-12 15:24:26 +00:00
|
|
|
gtk_cell_area_foreach_alloc (icon_view->priv->cell_area, context,
|
2010-12-12 07:29:41 +00:00
|
|
|
GTK_WIDGET (icon_view),
|
2010-12-13 08:41:50 +00:00
|
|
|
item_area, item_area,
|
2010-12-12 07:29:41 +00:00
|
|
|
(GtkCellAllocCallback)hit_test, &data);
|
2002-04-30 17:08:52 +00:00
|
|
|
|
2010-12-12 07:29:41 +00:00
|
|
|
return data.hit;
|
2002-04-30 17:08:52 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static gboolean
|
2004-07-04 15:56:55 +00:00
|
|
|
gtk_icon_view_unselect_all_internal (GtkIconView *icon_view)
|
2002-04-30 17:08:52 +00:00
|
|
|
{
|
|
|
|
gboolean dirty = FALSE;
|
|
|
|
GList *items;
|
Fix the "selection_changed" signal to not get emitted twice in some cases.
2004-07-04 Anders Carlsson <andersca@gnome.org>
* configure.in:
* libegg/iconlist/eggiconlist.c: (egg_icon_list_expose),
(scroll_timeout), (egg_icon_list_motion),
(egg_icon_list_button_press), (egg_icon_list_update_rubberband),
(egg_icon_list_start_rubberbanding),
(egg_icon_list_stop_rubberbanding),
(egg_icon_list_unselect_all_internal),
(egg_icon_list_real_select_all),
(egg_icon_list_adjustment_changed), (egg_icon_list_item_free),
(egg_icon_list_select_item), (verify_items),
(egg_icon_list_row_changed), (egg_icon_list_row_inserted),
(egg_icon_list_row_deleted), (egg_icon_list_rows_reordered),
(egg_icon_list_select_all_between),
(egg_icon_list_move_cursor_up_down),
(egg_icon_list_move_cursor_page_up_down),
(egg_icon_list_move_cursor_left_right),
(egg_icon_list_move_cursor_start_end), (egg_icon_list_set_model),
(egg_icon_list_get_selected_items), (egg_icon_list_select_all),
(egg_icon_list_unselect_all):
* libegg/iconlist/eggiconlist.h:
* libegg/iconlist/testiconlist.c: (foreach_selected_remove):
Fix the "selection_changed" signal to not get emitted twice in some cases.
Also fix a bunch of issues reported by Jonathan.
2004-07-04 12:43:26 +00:00
|
|
|
|
2004-08-04 20:32:26 +00:00
|
|
|
if (icon_view->priv->selection_mode == GTK_SELECTION_NONE)
|
Fix the "selection_changed" signal to not get emitted twice in some cases.
2004-07-04 Anders Carlsson <andersca@gnome.org>
* configure.in:
* libegg/iconlist/eggiconlist.c: (egg_icon_list_expose),
(scroll_timeout), (egg_icon_list_motion),
(egg_icon_list_button_press), (egg_icon_list_update_rubberband),
(egg_icon_list_start_rubberbanding),
(egg_icon_list_stop_rubberbanding),
(egg_icon_list_unselect_all_internal),
(egg_icon_list_real_select_all),
(egg_icon_list_adjustment_changed), (egg_icon_list_item_free),
(egg_icon_list_select_item), (verify_items),
(egg_icon_list_row_changed), (egg_icon_list_row_inserted),
(egg_icon_list_row_deleted), (egg_icon_list_rows_reordered),
(egg_icon_list_select_all_between),
(egg_icon_list_move_cursor_up_down),
(egg_icon_list_move_cursor_page_up_down),
(egg_icon_list_move_cursor_left_right),
(egg_icon_list_move_cursor_start_end), (egg_icon_list_set_model),
(egg_icon_list_get_selected_items), (egg_icon_list_select_all),
(egg_icon_list_unselect_all):
* libegg/iconlist/eggiconlist.h:
* libegg/iconlist/testiconlist.c: (foreach_selected_remove):
Fix the "selection_changed" signal to not get emitted twice in some cases.
Also fix a bunch of issues reported by Jonathan.
2004-07-04 12:43:26 +00:00
|
|
|
return FALSE;
|
2004-08-04 20:32:26 +00:00
|
|
|
|
2004-07-04 15:56:55 +00:00
|
|
|
for (items = icon_view->priv->items; items; items = items->next)
|
2002-04-30 17:08:52 +00:00
|
|
|
{
|
2004-07-04 15:56:55 +00:00
|
|
|
GtkIconViewItem *item = items->data;
|
2002-04-30 17:08:52 +00:00
|
|
|
|
|
|
|
if (item->selected)
|
|
|
|
{
|
|
|
|
item->selected = FALSE;
|
|
|
|
dirty = TRUE;
|
2004-07-04 15:56:55 +00:00
|
|
|
gtk_icon_view_queue_draw_item (icon_view, item);
|
2008-02-12 16:43:04 +00:00
|
|
|
gtk_icon_view_item_selected_changed (icon_view, item);
|
2002-04-30 17:08:52 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return dirty;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2004-07-04 15:56:55 +00:00
|
|
|
/* GtkIconView signals */
|
2002-04-30 17:08:52 +00:00
|
|
|
static void
|
2004-07-04 15:56:55 +00:00
|
|
|
gtk_icon_view_real_select_all (GtkIconView *icon_view)
|
2002-04-30 17:08:52 +00:00
|
|
|
{
|
2004-07-04 15:56:55 +00:00
|
|
|
gtk_icon_view_select_all (icon_view);
|
2002-04-30 17:08:52 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2004-07-04 15:56:55 +00:00
|
|
|
gtk_icon_view_real_unselect_all (GtkIconView *icon_view)
|
2002-04-30 17:08:52 +00:00
|
|
|
{
|
2004-07-04 15:56:55 +00:00
|
|
|
gtk_icon_view_unselect_all (icon_view);
|
2002-04-30 17:08:52 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2004-07-04 15:56:55 +00:00
|
|
|
gtk_icon_view_real_select_cursor_item (GtkIconView *icon_view)
|
2002-04-30 17:08:52 +00:00
|
|
|
{
|
2004-07-04 15:56:55 +00:00
|
|
|
gtk_icon_view_unselect_all (icon_view);
|
2011-01-24 02:50:39 +00:00
|
|
|
|
2004-07-04 15:56:55 +00:00
|
|
|
if (icon_view->priv->cursor_item != NULL)
|
|
|
|
gtk_icon_view_select_item (icon_view, icon_view->priv->cursor_item);
|
2002-04-30 17:08:52 +00:00
|
|
|
}
|
|
|
|
|
2004-07-04 23:19:46 +00:00
|
|
|
static gboolean
|
|
|
|
gtk_icon_view_real_activate_cursor_item (GtkIconView *icon_view)
|
|
|
|
{
|
|
|
|
GtkTreePath *path;
|
2010-12-12 15:24:26 +00:00
|
|
|
GtkCellAreaContext *context;
|
2011-01-24 02:50:39 +00:00
|
|
|
|
2004-07-04 23:19:46 +00:00
|
|
|
if (!icon_view->priv->cursor_item)
|
|
|
|
return FALSE;
|
|
|
|
|
2010-12-12 15:24:26 +00:00
|
|
|
context = g_ptr_array_index (icon_view->priv->row_contexts, icon_view->priv->cursor_item->row);
|
|
|
|
|
2010-12-12 07:29:41 +00:00
|
|
|
gtk_icon_view_set_cell_data (icon_view, icon_view->priv->cursor_item);
|
2011-01-24 02:50:39 +00:00
|
|
|
gtk_cell_area_activate (icon_view->priv->cell_area, context,
|
|
|
|
GTK_WIDGET (icon_view),
|
|
|
|
(GdkRectangle *)icon_view->priv->cursor_item,
|
|
|
|
0 /* XXX flags */,
|
|
|
|
FALSE);
|
2005-05-02 20:28:37 +00:00
|
|
|
|
|
|
|
path = gtk_tree_path_new_from_indices (icon_view->priv->cursor_item->index, -1);
|
2004-07-04 23:19:46 +00:00
|
|
|
gtk_icon_view_item_activated (icon_view, path);
|
|
|
|
gtk_tree_path_free (path);
|
|
|
|
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
2002-04-30 17:08:52 +00:00
|
|
|
static void
|
2004-07-04 15:56:55 +00:00
|
|
|
gtk_icon_view_real_toggle_cursor_item (GtkIconView *icon_view)
|
2002-04-30 17:08:52 +00:00
|
|
|
{
|
2004-07-04 15:56:55 +00:00
|
|
|
if (!icon_view->priv->cursor_item)
|
2002-04-30 17:08:52 +00:00
|
|
|
return;
|
|
|
|
|
2004-07-04 15:56:55 +00:00
|
|
|
switch (icon_view->priv->selection_mode)
|
2002-04-30 17:08:52 +00:00
|
|
|
{
|
Update icon list to use the tree model instead.
2004-07-02 Anders Carlsson <andersca@gnome.org>
* libegg/iconlist/eggiconlist.c: (egg_icon_list_class_init),
(egg_icon_list_init), (egg_icon_list_destroy),
(egg_icon_list_finalize), (egg_icon_list_set_property),
(egg_icon_list_get_property), (egg_icon_list_button_press),
(egg_icon_list_select_first_matching_item),
(egg_icon_list_maybe_begin_dragging_items),
(egg_icon_list_real_toggle_cursor_item),
(egg_icon_list_calculate_item_size),
(egg_icon_list_invalidate_sizes), (egg_icon_list_paint_item),
(egg_icon_list_item_new), (egg_icon_list_item_unref),
(egg_icon_list_get_item_text), (egg_icon_list_get_item_icon),
(egg_icon_list_get_item_at_pos), (egg_icon_list_get_path_at_pos),
(egg_icon_list_selected_foreach), (egg_icon_list_select_path),
(egg_icon_list_unselect_path), (egg_icon_list_path_is_selected),
(egg_icon_list_item_activated), (egg_icon_list_get_items),
(egg_icon_list_row_changed), (egg_icon_list_row_inserted),
(egg_icon_list_row_deleted), (egg_icon_list_rows_reordered),
(egg_icon_list_build_items), (egg_icon_list_set_model),
(egg_icon_list_get_model), (egg_icon_list_set_text_column),
(egg_icon_list_set_pixbuf_column):
* libegg/iconlist/eggiconlist.h:
* libegg/iconlist/testiconlist.c: (fill_model), (create_model),
(foreach_selected_print), (item_removed), (remove_selected),
(item_cb), (do_popup_menu), (main):
* libegg/util/eggmarshalers.list:
Update icon list to use the tree model instead.
2004-07-02 12:04:49 +00:00
|
|
|
case GTK_SELECTION_NONE:
|
|
|
|
break;
|
|
|
|
case GTK_SELECTION_BROWSE:
|
2004-07-04 15:56:55 +00:00
|
|
|
gtk_icon_view_select_item (icon_view, icon_view->priv->cursor_item);
|
Update icon list to use the tree model instead.
2004-07-02 Anders Carlsson <andersca@gnome.org>
* libegg/iconlist/eggiconlist.c: (egg_icon_list_class_init),
(egg_icon_list_init), (egg_icon_list_destroy),
(egg_icon_list_finalize), (egg_icon_list_set_property),
(egg_icon_list_get_property), (egg_icon_list_button_press),
(egg_icon_list_select_first_matching_item),
(egg_icon_list_maybe_begin_dragging_items),
(egg_icon_list_real_toggle_cursor_item),
(egg_icon_list_calculate_item_size),
(egg_icon_list_invalidate_sizes), (egg_icon_list_paint_item),
(egg_icon_list_item_new), (egg_icon_list_item_unref),
(egg_icon_list_get_item_text), (egg_icon_list_get_item_icon),
(egg_icon_list_get_item_at_pos), (egg_icon_list_get_path_at_pos),
(egg_icon_list_selected_foreach), (egg_icon_list_select_path),
(egg_icon_list_unselect_path), (egg_icon_list_path_is_selected),
(egg_icon_list_item_activated), (egg_icon_list_get_items),
(egg_icon_list_row_changed), (egg_icon_list_row_inserted),
(egg_icon_list_row_deleted), (egg_icon_list_rows_reordered),
(egg_icon_list_build_items), (egg_icon_list_set_model),
(egg_icon_list_get_model), (egg_icon_list_set_text_column),
(egg_icon_list_set_pixbuf_column):
* libegg/iconlist/eggiconlist.h:
* libegg/iconlist/testiconlist.c: (fill_model), (create_model),
(foreach_selected_print), (item_removed), (remove_selected),
(item_cb), (do_popup_menu), (main):
* libegg/util/eggmarshalers.list:
Update icon list to use the tree model instead.
2004-07-02 12:04:49 +00:00
|
|
|
break;
|
|
|
|
case GTK_SELECTION_SINGLE:
|
2004-07-04 15:56:55 +00:00
|
|
|
if (icon_view->priv->cursor_item->selected)
|
|
|
|
gtk_icon_view_unselect_item (icon_view, icon_view->priv->cursor_item);
|
2002-04-30 17:08:52 +00:00
|
|
|
else
|
2004-07-04 15:56:55 +00:00
|
|
|
gtk_icon_view_select_item (icon_view, icon_view->priv->cursor_item);
|
Update icon list to use the tree model instead.
2004-07-02 Anders Carlsson <andersca@gnome.org>
* libegg/iconlist/eggiconlist.c: (egg_icon_list_class_init),
(egg_icon_list_init), (egg_icon_list_destroy),
(egg_icon_list_finalize), (egg_icon_list_set_property),
(egg_icon_list_get_property), (egg_icon_list_button_press),
(egg_icon_list_select_first_matching_item),
(egg_icon_list_maybe_begin_dragging_items),
(egg_icon_list_real_toggle_cursor_item),
(egg_icon_list_calculate_item_size),
(egg_icon_list_invalidate_sizes), (egg_icon_list_paint_item),
(egg_icon_list_item_new), (egg_icon_list_item_unref),
(egg_icon_list_get_item_text), (egg_icon_list_get_item_icon),
(egg_icon_list_get_item_at_pos), (egg_icon_list_get_path_at_pos),
(egg_icon_list_selected_foreach), (egg_icon_list_select_path),
(egg_icon_list_unselect_path), (egg_icon_list_path_is_selected),
(egg_icon_list_item_activated), (egg_icon_list_get_items),
(egg_icon_list_row_changed), (egg_icon_list_row_inserted),
(egg_icon_list_row_deleted), (egg_icon_list_rows_reordered),
(egg_icon_list_build_items), (egg_icon_list_set_model),
(egg_icon_list_get_model), (egg_icon_list_set_text_column),
(egg_icon_list_set_pixbuf_column):
* libegg/iconlist/eggiconlist.h:
* libegg/iconlist/testiconlist.c: (fill_model), (create_model),
(foreach_selected_print), (item_removed), (remove_selected),
(item_cb), (do_popup_menu), (main):
* libegg/util/eggmarshalers.list:
Update icon list to use the tree model instead.
2004-07-02 12:04:49 +00:00
|
|
|
break;
|
|
|
|
case GTK_SELECTION_MULTIPLE:
|
2004-07-04 15:56:55 +00:00
|
|
|
icon_view->priv->cursor_item->selected = !icon_view->priv->cursor_item->selected;
|
|
|
|
g_signal_emit (icon_view, icon_view_signals[SELECTION_CHANGED], 0);
|
2002-04-30 17:08:52 +00:00
|
|
|
|
2008-02-12 16:43:04 +00:00
|
|
|
gtk_icon_view_item_selected_changed (icon_view, icon_view->priv->cursor_item);
|
2004-07-04 15:56:55 +00:00
|
|
|
gtk_icon_view_queue_draw_item (icon_view, icon_view->priv->cursor_item);
|
Update icon list to use the tree model instead.
2004-07-02 Anders Carlsson <andersca@gnome.org>
* libegg/iconlist/eggiconlist.c: (egg_icon_list_class_init),
(egg_icon_list_init), (egg_icon_list_destroy),
(egg_icon_list_finalize), (egg_icon_list_set_property),
(egg_icon_list_get_property), (egg_icon_list_button_press),
(egg_icon_list_select_first_matching_item),
(egg_icon_list_maybe_begin_dragging_items),
(egg_icon_list_real_toggle_cursor_item),
(egg_icon_list_calculate_item_size),
(egg_icon_list_invalidate_sizes), (egg_icon_list_paint_item),
(egg_icon_list_item_new), (egg_icon_list_item_unref),
(egg_icon_list_get_item_text), (egg_icon_list_get_item_icon),
(egg_icon_list_get_item_at_pos), (egg_icon_list_get_path_at_pos),
(egg_icon_list_selected_foreach), (egg_icon_list_select_path),
(egg_icon_list_unselect_path), (egg_icon_list_path_is_selected),
(egg_icon_list_item_activated), (egg_icon_list_get_items),
(egg_icon_list_row_changed), (egg_icon_list_row_inserted),
(egg_icon_list_row_deleted), (egg_icon_list_rows_reordered),
(egg_icon_list_build_items), (egg_icon_list_set_model),
(egg_icon_list_get_model), (egg_icon_list_set_text_column),
(egg_icon_list_set_pixbuf_column):
* libegg/iconlist/eggiconlist.h:
* libegg/iconlist/testiconlist.c: (fill_model), (create_model),
(foreach_selected_print), (item_removed), (remove_selected),
(item_cb), (do_popup_menu), (main):
* libegg/util/eggmarshalers.list:
Update icon list to use the tree model instead.
2004-07-02 12:04:49 +00:00
|
|
|
break;
|
2002-04-30 17:08:52 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Internal functions */
|
2010-10-17 08:27:41 +00:00
|
|
|
static void
|
|
|
|
gtk_icon_view_process_updates (GtkIconView *icon_view)
|
|
|
|
{
|
|
|
|
/* Prior to drawing, we check if a layout has been scheduled. If so,
|
|
|
|
* do it now that all cell view items have valid sizes before we proceeed
|
|
|
|
* (and resize the bin_window if required).
|
|
|
|
*/
|
|
|
|
if (icon_view->priv->layout_idle_id != 0)
|
|
|
|
gtk_icon_view_layout (icon_view);
|
|
|
|
|
|
|
|
gdk_window_process_updates (icon_view->priv->bin_window, TRUE);
|
|
|
|
}
|
|
|
|
|
2010-10-18 04:21:39 +00:00
|
|
|
static void
|
|
|
|
gtk_icon_view_set_hadjustment_values (GtkIconView *icon_view)
|
|
|
|
{
|
|
|
|
GtkAllocation allocation;
|
|
|
|
GtkAdjustment *adj = icon_view->priv->hadjustment;
|
|
|
|
gdouble old_page_size;
|
|
|
|
gdouble old_upper;
|
|
|
|
gdouble old_value;
|
|
|
|
gdouble new_value;
|
|
|
|
gdouble new_upper;
|
|
|
|
|
|
|
|
gtk_widget_get_allocation (GTK_WIDGET (icon_view), &allocation);
|
|
|
|
|
|
|
|
old_value = gtk_adjustment_get_value (adj);
|
|
|
|
old_upper = gtk_adjustment_get_upper (adj);
|
|
|
|
old_page_size = gtk_adjustment_get_page_size (adj);
|
|
|
|
new_upper = MAX (allocation.width, icon_view->priv->width);
|
|
|
|
|
|
|
|
if (gtk_widget_get_direction (GTK_WIDGET (icon_view)) == GTK_TEXT_DIR_RTL)
|
|
|
|
{
|
|
|
|
/* Make sure no scrolling occurs for RTL locales also (if possible) */
|
|
|
|
/* Quick explanation:
|
|
|
|
* In LTR locales, leftmost portion of visible rectangle should stay
|
|
|
|
* fixed, which means left edge of scrollbar thumb should remain fixed
|
|
|
|
* and thus adjustment's value should stay the same.
|
|
|
|
*
|
|
|
|
* In RTL locales, we want to keep rightmost portion of visible
|
|
|
|
* rectangle fixed. This means right edge of thumb should remain fixed.
|
|
|
|
* In this case, upper - value - page_size should remain constant.
|
|
|
|
*/
|
|
|
|
new_value = (new_upper - allocation.width) -
|
|
|
|
(old_upper - old_value - old_page_size);
|
|
|
|
new_value = CLAMP (new_value, 0, new_upper - allocation.width);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
new_value = CLAMP (old_value, 0, new_upper - allocation.width);
|
|
|
|
|
2011-01-05 22:14:02 +00:00
|
|
|
gtk_adjustment_configure (adj,
|
|
|
|
new_value,
|
|
|
|
0.0,
|
|
|
|
new_upper,
|
|
|
|
allocation.width * 0.1,
|
|
|
|
allocation.width * 0.9,
|
|
|
|
allocation.width);
|
2010-10-18 04:21:39 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
gtk_icon_view_set_vadjustment_values (GtkIconView *icon_view)
|
|
|
|
{
|
|
|
|
GtkAllocation allocation;
|
|
|
|
GtkAdjustment *adj = icon_view->priv->vadjustment;
|
|
|
|
|
|
|
|
gtk_widget_get_allocation (GTK_WIDGET (icon_view), &allocation);
|
|
|
|
|
2011-01-05 22:14:02 +00:00
|
|
|
gtk_adjustment_configure (adj,
|
|
|
|
gtk_adjustment_get_value (adj),
|
|
|
|
0.0,
|
|
|
|
MAX (allocation.height, icon_view->priv->height),
|
|
|
|
allocation.height * 0.1,
|
|
|
|
allocation.height * 0.9,
|
|
|
|
allocation.height);
|
2010-10-18 04:21:39 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
gtk_icon_view_set_hadjustment (GtkIconView *icon_view,
|
|
|
|
GtkAdjustment *adjustment)
|
|
|
|
{
|
|
|
|
GtkIconViewPrivate *priv = icon_view->priv;
|
2010-11-28 01:56:09 +00:00
|
|
|
AtkObject *atk_obj;
|
2010-10-18 04:21:39 +00:00
|
|
|
|
|
|
|
if (adjustment && priv->hadjustment == adjustment)
|
|
|
|
return;
|
|
|
|
|
|
|
|
if (priv->hadjustment != NULL)
|
|
|
|
{
|
|
|
|
g_signal_handlers_disconnect_matched (priv->hadjustment,
|
|
|
|
G_SIGNAL_MATCH_DATA,
|
|
|
|
0, 0, NULL, NULL, icon_view);
|
|
|
|
g_object_unref (priv->hadjustment);
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!adjustment)
|
|
|
|
adjustment = gtk_adjustment_new (0.0, 0.0, 0.0,
|
|
|
|
0.0, 0.0, 0.0);
|
|
|
|
|
|
|
|
g_signal_connect (adjustment, "value-changed",
|
|
|
|
G_CALLBACK (gtk_icon_view_adjustment_changed), icon_view);
|
|
|
|
priv->hadjustment = g_object_ref_sink (adjustment);
|
|
|
|
gtk_icon_view_set_hadjustment_values (icon_view);
|
|
|
|
|
2010-11-28 01:56:09 +00:00
|
|
|
atk_obj = gtk_widget_get_accessible (GTK_WIDGET (icon_view));
|
|
|
|
gtk_icon_view_accessible_set_adjustment (atk_obj,
|
2010-10-18 04:21:39 +00:00
|
|
|
GTK_ORIENTATION_HORIZONTAL,
|
2010-11-28 01:56:09 +00:00
|
|
|
adjustment);
|
2010-10-18 04:21:39 +00:00
|
|
|
|
|
|
|
g_object_notify (G_OBJECT (icon_view), "hadjustment");
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
gtk_icon_view_set_vadjustment (GtkIconView *icon_view,
|
|
|
|
GtkAdjustment *adjustment)
|
|
|
|
{
|
|
|
|
GtkIconViewPrivate *priv = icon_view->priv;
|
2010-11-28 01:56:09 +00:00
|
|
|
AtkObject *atk_obj;
|
2010-10-18 04:21:39 +00:00
|
|
|
|
|
|
|
if (adjustment && priv->vadjustment == adjustment)
|
|
|
|
return;
|
|
|
|
|
|
|
|
if (priv->vadjustment != NULL)
|
|
|
|
{
|
|
|
|
g_signal_handlers_disconnect_matched (priv->vadjustment,
|
|
|
|
G_SIGNAL_MATCH_DATA,
|
|
|
|
0, 0, NULL, NULL, icon_view);
|
|
|
|
g_object_unref (priv->vadjustment);
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!adjustment)
|
|
|
|
adjustment = gtk_adjustment_new (0.0, 0.0, 0.0,
|
|
|
|
0.0, 0.0, 0.0);
|
|
|
|
|
|
|
|
g_signal_connect (adjustment, "value-changed",
|
|
|
|
G_CALLBACK (gtk_icon_view_adjustment_changed), icon_view);
|
|
|
|
priv->vadjustment = g_object_ref_sink (adjustment);
|
|
|
|
gtk_icon_view_set_vadjustment_values (icon_view);
|
|
|
|
|
2010-11-28 01:56:09 +00:00
|
|
|
atk_obj = gtk_widget_get_accessible (GTK_WIDGET (icon_view));
|
|
|
|
gtk_icon_view_accessible_set_adjustment (atk_obj,
|
2010-10-18 04:21:39 +00:00
|
|
|
GTK_ORIENTATION_VERTICAL,
|
2010-11-28 01:56:09 +00:00
|
|
|
adjustment);
|
2010-10-18 04:21:39 +00:00
|
|
|
|
|
|
|
g_object_notify (G_OBJECT (icon_view), "vadjustment");
|
|
|
|
}
|
|
|
|
|
2002-04-30 17:08:52 +00:00
|
|
|
static void
|
2004-07-04 15:56:55 +00:00
|
|
|
gtk_icon_view_adjustment_changed (GtkAdjustment *adjustment,
|
2010-10-18 04:21:39 +00:00
|
|
|
GtkIconView *icon_view)
|
2002-04-30 17:08:52 +00:00
|
|
|
{
|
2010-10-18 04:21:39 +00:00
|
|
|
GtkIconViewPrivate *priv = icon_view->priv;
|
|
|
|
|
2010-03-02 06:16:02 +00:00
|
|
|
if (gtk_widget_get_realized (GTK_WIDGET (icon_view)))
|
2002-04-30 17:08:52 +00:00
|
|
|
{
|
2010-10-18 04:21:39 +00:00
|
|
|
gdk_window_move (priv->bin_window,
|
2011-01-05 19:57:46 +00:00
|
|
|
- gtk_adjustment_get_value (priv->hadjustment),
|
|
|
|
- gtk_adjustment_get_value (priv->vadjustment));
|
2004-06-26 19:07:25 +00:00
|
|
|
|
2004-07-04 15:56:55 +00:00
|
|
|
if (icon_view->priv->doing_rubberband)
|
2010-10-18 04:21:39 +00:00
|
|
|
gtk_icon_view_update_rubberband (GTK_WIDGET (icon_view));
|
2004-06-26 19:07:25 +00:00
|
|
|
|
2010-10-17 08:27:41 +00:00
|
|
|
gtk_icon_view_process_updates (icon_view);
|
2002-04-30 17:08:52 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static GList *
|
2004-12-14 06:39:45 +00:00
|
|
|
gtk_icon_view_layout_single_row (GtkIconView *icon_view,
|
|
|
|
GList *first_item,
|
|
|
|
gint item_width,
|
|
|
|
gint row,
|
|
|
|
gint *y,
|
|
|
|
gint *maximum_width)
|
2002-04-30 17:08:52 +00:00
|
|
|
{
|
2010-08-11 21:10:57 +00:00
|
|
|
GtkAllocation allocation;
|
2010-12-12 15:24:26 +00:00
|
|
|
GtkCellAreaContext *context;
|
2010-12-12 07:29:41 +00:00
|
|
|
GtkIconViewPrivate *priv = icon_view->priv;
|
2010-08-11 21:10:57 +00:00
|
|
|
GtkWidget *widget = GTK_WIDGET (icon_view);
|
2005-05-02 20:28:37 +00:00
|
|
|
gint x, current_width;
|
2002-04-30 17:08:52 +00:00
|
|
|
GList *items, *last_item;
|
2004-06-18 05:17:01 +00:00
|
|
|
gint col;
|
2010-12-12 07:29:41 +00:00
|
|
|
gint max_height = 0;
|
2005-05-02 20:28:37 +00:00
|
|
|
gboolean rtl;
|
|
|
|
|
2010-08-11 21:10:57 +00:00
|
|
|
rtl = gtk_widget_get_direction (widget) == GTK_TEXT_DIR_RTL;
|
2004-06-16 00:03:31 +00:00
|
|
|
|
2002-04-30 17:08:52 +00:00
|
|
|
x = 0;
|
2004-06-18 05:17:01 +00:00
|
|
|
col = 0;
|
2002-04-30 17:08:52 +00:00
|
|
|
items = first_item;
|
|
|
|
current_width = 0;
|
|
|
|
|
2010-12-12 07:29:41 +00:00
|
|
|
x += priv->margin;
|
|
|
|
current_width += 2 * priv->margin;
|
2004-07-18 03:05:24 +00:00
|
|
|
|
2010-12-12 07:29:41 +00:00
|
|
|
gtk_widget_get_allocation (widget, &allocation);
|
2002-04-30 17:08:52 +00:00
|
|
|
|
2010-12-12 15:24:26 +00:00
|
|
|
context = gtk_cell_area_copy_context (priv->cell_area, priv->cell_area_context);
|
2010-12-13 08:41:50 +00:00
|
|
|
g_ptr_array_add (priv->row_contexts, context);
|
2010-12-12 15:24:26 +00:00
|
|
|
|
2010-12-13 08:41:50 +00:00
|
|
|
/* In the first loop we iterate horizontally until we hit allocation width
|
|
|
|
* and collect the aligned height-for-width */
|
2005-05-02 20:28:37 +00:00
|
|
|
items = first_item;
|
2002-04-30 17:08:52 +00:00
|
|
|
while (items)
|
|
|
|
{
|
2004-07-04 15:56:55 +00:00
|
|
|
GtkIconViewItem *item = items->data;
|
2010-12-13 08:41:50 +00:00
|
|
|
GdkRectangle *item_area = (GdkRectangle *)item;
|
2002-04-30 17:08:52 +00:00
|
|
|
|
2010-12-13 08:41:50 +00:00
|
|
|
item_area->width = item_width;
|
2005-05-02 20:28:37 +00:00
|
|
|
|
2010-12-13 08:41:50 +00:00
|
|
|
current_width += item_area->width + icon_view->priv->item_padding * 2;
|
2005-05-02 20:28:37 +00:00
|
|
|
|
2004-12-14 06:39:45 +00:00
|
|
|
if (items != first_item)
|
|
|
|
{
|
2010-08-11 21:10:57 +00:00
|
|
|
if ((icon_view->priv->columns <= 0 && current_width > allocation.width) ||
|
2004-12-14 06:39:45 +00:00
|
|
|
(icon_view->priv->columns > 0 && col >= icon_view->priv->columns))
|
|
|
|
break;
|
|
|
|
}
|
2002-04-30 17:08:52 +00:00
|
|
|
|
2010-12-12 15:24:26 +00:00
|
|
|
/* Get this item's particular width & height (all alignments are cached by now) */
|
|
|
|
gtk_icon_view_set_cell_data (icon_view, item);
|
|
|
|
gtk_cell_area_get_preferred_height_for_width (priv->cell_area,
|
|
|
|
context,
|
|
|
|
widget, item_width,
|
|
|
|
NULL, NULL);
|
2010-12-12 11:59:41 +00:00
|
|
|
|
2010-12-12 07:29:41 +00:00
|
|
|
current_width += icon_view->priv->column_spacing;
|
2002-04-30 17:08:52 +00:00
|
|
|
|
2010-12-13 08:41:50 +00:00
|
|
|
item_area->y = *y + icon_view->priv->item_padding;
|
|
|
|
item_area->x = x + icon_view->priv->item_padding;
|
2002-04-30 17:08:52 +00:00
|
|
|
|
2010-12-12 07:29:41 +00:00
|
|
|
x = current_width - icon_view->priv->margin;
|
2005-05-02 20:28:37 +00:00
|
|
|
|
2002-04-30 17:08:52 +00:00
|
|
|
if (current_width > *maximum_width)
|
|
|
|
*maximum_width = current_width;
|
|
|
|
|
2004-06-18 05:17:01 +00:00
|
|
|
item->row = row;
|
|
|
|
item->col = col;
|
|
|
|
|
2010-12-12 07:29:41 +00:00
|
|
|
col ++;
|
2002-04-30 17:08:52 +00:00
|
|
|
items = items->next;
|
|
|
|
}
|
|
|
|
|
|
|
|
last_item = items;
|
|
|
|
|
2010-12-12 15:24:26 +00:00
|
|
|
gtk_cell_area_context_get_preferred_height_for_width (context, item_width, &max_height, NULL);
|
|
|
|
gtk_cell_area_context_allocate (context, item_width, max_height);
|
|
|
|
|
2010-12-13 08:41:50 +00:00
|
|
|
/* In the second loop the item height has been aligned and derived and
|
|
|
|
* we just set the height and handle rtl layout */
|
2002-04-30 17:08:52 +00:00
|
|
|
for (items = first_item; items != last_item; items = items->next)
|
|
|
|
{
|
2004-07-04 15:56:55 +00:00
|
|
|
GtkIconViewItem *item = items->data;
|
2010-12-13 08:41:50 +00:00
|
|
|
GdkRectangle *item_area = (GdkRectangle *)item;
|
2002-04-30 17:08:52 +00:00
|
|
|
|
2008-12-21 08:10:53 +00:00
|
|
|
if (rtl)
|
|
|
|
{
|
2010-12-13 08:41:50 +00:00
|
|
|
item_area->x = *maximum_width - item_area->width - item_area->x;
|
2008-12-21 08:10:53 +00:00
|
|
|
item->col = col - 1 - item->col;
|
|
|
|
}
|
|
|
|
|
2010-12-12 11:37:38 +00:00
|
|
|
/* All items in the same row get the same height */
|
2010-12-13 08:41:50 +00:00
|
|
|
item_area->height = max_height;
|
2002-04-30 17:08:52 +00:00
|
|
|
}
|
2010-12-13 08:41:50 +00:00
|
|
|
|
|
|
|
/* Adjust the new y coordinate. */
|
|
|
|
*y += max_height + icon_view->priv->row_spacing + icon_view->priv->item_padding * 2;
|
2002-04-30 17:08:52 +00:00
|
|
|
|
|
|
|
return last_item;
|
|
|
|
}
|
|
|
|
|
2010-12-14 06:37:42 +00:00
|
|
|
static void
|
|
|
|
adjust_wrap_width (GtkIconView *icon_view)
|
|
|
|
{
|
|
|
|
if (icon_view->priv->text_cell)
|
|
|
|
{
|
|
|
|
gint wrap_width = 50;
|
|
|
|
|
|
|
|
/* Here we go with the same old guess, try the icon size and set double
|
|
|
|
* the size of the first icon found in the list, naive but works much
|
|
|
|
* of the time */
|
|
|
|
if (icon_view->priv->items && icon_view->priv->pixbuf_cell)
|
|
|
|
{
|
|
|
|
gtk_icon_view_set_cell_data (icon_view, icon_view->priv->items->data);
|
|
|
|
gtk_cell_renderer_get_preferred_width (icon_view->priv->pixbuf_cell,
|
|
|
|
GTK_WIDGET (icon_view),
|
|
|
|
&wrap_width, NULL);
|
|
|
|
|
|
|
|
wrap_width = MAX (wrap_width * 2, 50);
|
|
|
|
}
|
|
|
|
|
|
|
|
g_object_set (icon_view->priv->text_cell, "wrap-width", wrap_width, NULL);
|
|
|
|
g_object_set (icon_view->priv->text_cell, "width", wrap_width, NULL);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2002-04-30 17:08:52 +00:00
|
|
|
static void
|
2004-07-04 15:56:55 +00:00
|
|
|
gtk_icon_view_layout (GtkIconView *icon_view)
|
2002-04-30 17:08:52 +00:00
|
|
|
{
|
2010-08-11 21:10:57 +00:00
|
|
|
GtkAllocation allocation;
|
|
|
|
GtkWidget *widget;
|
|
|
|
GList *icons;
|
|
|
|
gint y = 0, maximum_width = 0;
|
2004-06-18 05:17:01 +00:00
|
|
|
gint row;
|
2004-12-14 06:39:45 +00:00
|
|
|
gint item_width;
|
2010-09-09 07:27:22 +00:00
|
|
|
gboolean size_changed = FALSE;
|
2004-07-04 20:35:35 +00:00
|
|
|
|
2006-03-02 19:52:26 +00:00
|
|
|
if (icon_view->priv->layout_idle_id != 0)
|
|
|
|
{
|
|
|
|
g_source_remove (icon_view->priv->layout_idle_id);
|
|
|
|
icon_view->priv->layout_idle_id = 0;
|
|
|
|
}
|
|
|
|
|
2005-05-02 20:28:37 +00:00
|
|
|
if (icon_view->priv->model == NULL)
|
2004-07-04 20:35:35 +00:00
|
|
|
return;
|
|
|
|
|
2004-07-04 15:56:55 +00:00
|
|
|
widget = GTK_WIDGET (icon_view);
|
2002-04-30 17:08:52 +00:00
|
|
|
|
2004-12-14 06:39:45 +00:00
|
|
|
item_width = icon_view->priv->item_width;
|
2004-06-16 00:03:31 +00:00
|
|
|
|
2010-12-14 06:37:42 +00:00
|
|
|
/* Update the wrap width for the text cell before going and requesting sizes */
|
|
|
|
adjust_wrap_width (icon_view);
|
|
|
|
|
|
|
|
/* Update the context widths for any invalidated items */
|
2010-12-12 10:59:41 +00:00
|
|
|
gtk_icon_view_cache_widths (icon_view);
|
|
|
|
|
|
|
|
/* Fetch the new item width if needed */
|
2004-12-14 06:39:45 +00:00
|
|
|
if (item_width < 0)
|
2010-12-13 08:41:50 +00:00
|
|
|
gtk_cell_area_context_get_preferred_width (icon_view->priv->cell_area_context,
|
|
|
|
&item_width, NULL);
|
2004-12-14 06:39:45 +00:00
|
|
|
|
2010-12-13 08:41:50 +00:00
|
|
|
gtk_cell_area_context_allocate (icon_view->priv->cell_area_context, item_width, -1);
|
2010-12-12 11:37:38 +00:00
|
|
|
|
2004-12-14 06:39:45 +00:00
|
|
|
icons = icon_view->priv->items;
|
|
|
|
y += icon_view->priv->margin;
|
|
|
|
row = 0;
|
2010-12-12 15:24:26 +00:00
|
|
|
|
|
|
|
/* Clear the per row contexts */
|
|
|
|
g_ptr_array_set_size (icon_view->priv->row_contexts, 0);
|
2004-12-14 06:39:45 +00:00
|
|
|
|
2002-04-30 17:08:52 +00:00
|
|
|
do
|
|
|
|
{
|
2004-12-14 06:39:45 +00:00
|
|
|
icons = gtk_icon_view_layout_single_row (icon_view, icons,
|
|
|
|
item_width, row,
|
|
|
|
&y, &maximum_width);
|
2004-06-18 05:17:01 +00:00
|
|
|
row++;
|
2002-04-30 17:08:52 +00:00
|
|
|
}
|
|
|
|
while (icons != NULL);
|
|
|
|
|
2004-07-04 15:56:55 +00:00
|
|
|
if (maximum_width != icon_view->priv->width)
|
2010-09-09 07:27:22 +00:00
|
|
|
{
|
|
|
|
icon_view->priv->width = maximum_width;
|
|
|
|
size_changed = TRUE;
|
|
|
|
}
|
2006-03-02 19:52:26 +00:00
|
|
|
|
2004-12-14 06:39:45 +00:00
|
|
|
y += icon_view->priv->margin;
|
2002-04-30 17:08:52 +00:00
|
|
|
|
2004-07-04 15:56:55 +00:00
|
|
|
if (y != icon_view->priv->height)
|
2010-09-09 07:27:22 +00:00
|
|
|
{
|
|
|
|
icon_view->priv->height = y;
|
|
|
|
size_changed = TRUE;
|
|
|
|
}
|
2002-04-30 17:08:52 +00:00
|
|
|
|
2011-01-05 22:00:54 +00:00
|
|
|
gtk_icon_view_set_hadjustment_values (icon_view);
|
|
|
|
gtk_icon_view_set_vadjustment_values (icon_view);
|
2002-04-30 17:08:52 +00:00
|
|
|
|
2010-09-09 07:27:22 +00:00
|
|
|
if (size_changed)
|
2007-05-30 13:28:24 +00:00
|
|
|
gtk_widget_queue_resize_no_redraw (widget);
|
|
|
|
|
2010-08-11 21:10:57 +00:00
|
|
|
gtk_widget_get_allocation (widget, &allocation);
|
2010-03-02 06:16:02 +00:00
|
|
|
if (gtk_widget_get_realized (GTK_WIDGET (icon_view)))
|
2006-03-02 19:52:26 +00:00
|
|
|
gdk_window_resize (icon_view->priv->bin_window,
|
2010-08-11 21:10:57 +00:00
|
|
|
MAX (icon_view->priv->width, allocation.width),
|
|
|
|
MAX (icon_view->priv->height, allocation.height));
|
2002-04-30 17:08:52 +00:00
|
|
|
|
2006-03-02 19:52:26 +00:00
|
|
|
if (icon_view->priv->scroll_to_path)
|
2005-05-02 20:28:37 +00:00
|
|
|
{
|
2006-03-02 19:52:26 +00:00
|
|
|
GtkTreePath *path;
|
2005-05-02 20:28:37 +00:00
|
|
|
|
2006-03-02 19:52:26 +00:00
|
|
|
path = gtk_tree_row_reference_get_path (icon_view->priv->scroll_to_path);
|
|
|
|
gtk_tree_row_reference_free (icon_view->priv->scroll_to_path);
|
|
|
|
icon_view->priv->scroll_to_path = NULL;
|
|
|
|
|
|
|
|
gtk_icon_view_scroll_to_path (icon_view, path,
|
|
|
|
icon_view->priv->scroll_to_use_align,
|
|
|
|
icon_view->priv->scroll_to_row_align,
|
|
|
|
icon_view->priv->scroll_to_col_align);
|
|
|
|
gtk_tree_path_free (path);
|
|
|
|
}
|
|
|
|
|
2007-05-30 13:28:24 +00:00
|
|
|
gtk_widget_queue_draw (widget);
|
2005-05-02 20:28:37 +00:00
|
|
|
}
|
|
|
|
|
2010-12-12 07:29:41 +00:00
|
|
|
/* This ensures that all widths have been cached in the
|
|
|
|
* context and we have proper alignments to go on.
|
2005-05-02 20:28:37 +00:00
|
|
|
*/
|
|
|
|
static void
|
2010-12-12 07:29:41 +00:00
|
|
|
gtk_icon_view_cache_widths (GtkIconView *icon_view)
|
2002-04-30 17:08:52 +00:00
|
|
|
{
|
2010-12-12 07:29:41 +00:00
|
|
|
GList *items;
|
2005-01-06 21:09:37 +00:00
|
|
|
|
2010-12-13 09:08:37 +00:00
|
|
|
g_signal_handler_block (icon_view->priv->cell_area_context,
|
|
|
|
icon_view->priv->context_changed_id);
|
|
|
|
|
2010-12-12 07:29:41 +00:00
|
|
|
for (items = icon_view->priv->items; items; items = items->next)
|
Update icon list to use the tree model instead.
2004-07-02 Anders Carlsson <andersca@gnome.org>
* libegg/iconlist/eggiconlist.c: (egg_icon_list_class_init),
(egg_icon_list_init), (egg_icon_list_destroy),
(egg_icon_list_finalize), (egg_icon_list_set_property),
(egg_icon_list_get_property), (egg_icon_list_button_press),
(egg_icon_list_select_first_matching_item),
(egg_icon_list_maybe_begin_dragging_items),
(egg_icon_list_real_toggle_cursor_item),
(egg_icon_list_calculate_item_size),
(egg_icon_list_invalidate_sizes), (egg_icon_list_paint_item),
(egg_icon_list_item_new), (egg_icon_list_item_unref),
(egg_icon_list_get_item_text), (egg_icon_list_get_item_icon),
(egg_icon_list_get_item_at_pos), (egg_icon_list_get_path_at_pos),
(egg_icon_list_selected_foreach), (egg_icon_list_select_path),
(egg_icon_list_unselect_path), (egg_icon_list_path_is_selected),
(egg_icon_list_item_activated), (egg_icon_list_get_items),
(egg_icon_list_row_changed), (egg_icon_list_row_inserted),
(egg_icon_list_row_deleted), (egg_icon_list_rows_reordered),
(egg_icon_list_build_items), (egg_icon_list_set_model),
(egg_icon_list_get_model), (egg_icon_list_set_text_column),
(egg_icon_list_set_pixbuf_column):
* libegg/iconlist/eggiconlist.h:
* libegg/iconlist/testiconlist.c: (fill_model), (create_model),
(foreach_selected_print), (item_removed), (remove_selected),
(item_cb), (do_popup_menu), (main):
* libegg/util/eggmarshalers.list:
Update icon list to use the tree model instead.
2004-07-02 12:04:49 +00:00
|
|
|
{
|
2010-12-12 07:29:41 +00:00
|
|
|
GtkIconViewItem *item = items->data;
|
2006-03-06 04:55:53 +00:00
|
|
|
|
2010-12-12 10:59:41 +00:00
|
|
|
/* Only fetch the width of items with invalidated sizes */
|
2010-12-13 08:41:50 +00:00
|
|
|
if (item->cell_area.width < 0)
|
2010-12-12 10:59:41 +00:00
|
|
|
{
|
|
|
|
gtk_icon_view_set_cell_data (icon_view, item);
|
|
|
|
gtk_cell_area_get_preferred_width (icon_view->priv->cell_area,
|
|
|
|
icon_view->priv->cell_area_context,
|
|
|
|
GTK_WIDGET (icon_view), NULL, NULL);
|
|
|
|
}
|
Update icon list to use the tree model instead.
2004-07-02 Anders Carlsson <andersca@gnome.org>
* libegg/iconlist/eggiconlist.c: (egg_icon_list_class_init),
(egg_icon_list_init), (egg_icon_list_destroy),
(egg_icon_list_finalize), (egg_icon_list_set_property),
(egg_icon_list_get_property), (egg_icon_list_button_press),
(egg_icon_list_select_first_matching_item),
(egg_icon_list_maybe_begin_dragging_items),
(egg_icon_list_real_toggle_cursor_item),
(egg_icon_list_calculate_item_size),
(egg_icon_list_invalidate_sizes), (egg_icon_list_paint_item),
(egg_icon_list_item_new), (egg_icon_list_item_unref),
(egg_icon_list_get_item_text), (egg_icon_list_get_item_icon),
(egg_icon_list_get_item_at_pos), (egg_icon_list_get_path_at_pos),
(egg_icon_list_selected_foreach), (egg_icon_list_select_path),
(egg_icon_list_unselect_path), (egg_icon_list_path_is_selected),
(egg_icon_list_item_activated), (egg_icon_list_get_items),
(egg_icon_list_row_changed), (egg_icon_list_row_inserted),
(egg_icon_list_row_deleted), (egg_icon_list_rows_reordered),
(egg_icon_list_build_items), (egg_icon_list_set_model),
(egg_icon_list_get_model), (egg_icon_list_set_text_column),
(egg_icon_list_set_pixbuf_column):
* libegg/iconlist/eggiconlist.h:
* libegg/iconlist/testiconlist.c: (fill_model), (create_model),
(foreach_selected_print), (item_removed), (remove_selected),
(item_cb), (do_popup_menu), (main):
* libegg/util/eggmarshalers.list:
Update icon list to use the tree model instead.
2004-07-02 12:04:49 +00:00
|
|
|
}
|
2010-12-13 09:08:37 +00:00
|
|
|
|
|
|
|
g_signal_handler_unblock (icon_view->priv->cell_area_context,
|
|
|
|
icon_view->priv->context_changed_id);
|
2005-05-02 20:28:37 +00:00
|
|
|
}
|
|
|
|
|
Update icon list to use the tree model instead.
2004-07-02 Anders Carlsson <andersca@gnome.org>
* libegg/iconlist/eggiconlist.c: (egg_icon_list_class_init),
(egg_icon_list_init), (egg_icon_list_destroy),
(egg_icon_list_finalize), (egg_icon_list_set_property),
(egg_icon_list_get_property), (egg_icon_list_button_press),
(egg_icon_list_select_first_matching_item),
(egg_icon_list_maybe_begin_dragging_items),
(egg_icon_list_real_toggle_cursor_item),
(egg_icon_list_calculate_item_size),
(egg_icon_list_invalidate_sizes), (egg_icon_list_paint_item),
(egg_icon_list_item_new), (egg_icon_list_item_unref),
(egg_icon_list_get_item_text), (egg_icon_list_get_item_icon),
(egg_icon_list_get_item_at_pos), (egg_icon_list_get_path_at_pos),
(egg_icon_list_selected_foreach), (egg_icon_list_select_path),
(egg_icon_list_unselect_path), (egg_icon_list_path_is_selected),
(egg_icon_list_item_activated), (egg_icon_list_get_items),
(egg_icon_list_row_changed), (egg_icon_list_row_inserted),
(egg_icon_list_row_deleted), (egg_icon_list_rows_reordered),
(egg_icon_list_build_items), (egg_icon_list_set_model),
(egg_icon_list_get_model), (egg_icon_list_set_text_column),
(egg_icon_list_set_pixbuf_column):
* libegg/iconlist/eggiconlist.h:
* libegg/iconlist/testiconlist.c: (fill_model), (create_model),
(foreach_selected_print), (item_removed), (remove_selected),
(item_cb), (do_popup_menu), (main):
* libegg/util/eggmarshalers.list:
Update icon list to use the tree model instead.
2004-07-02 12:04:49 +00:00
|
|
|
static void
|
2004-07-04 15:56:55 +00:00
|
|
|
gtk_icon_view_invalidate_sizes (GtkIconView *icon_view)
|
Update icon list to use the tree model instead.
2004-07-02 Anders Carlsson <andersca@gnome.org>
* libegg/iconlist/eggiconlist.c: (egg_icon_list_class_init),
(egg_icon_list_init), (egg_icon_list_destroy),
(egg_icon_list_finalize), (egg_icon_list_set_property),
(egg_icon_list_get_property), (egg_icon_list_button_press),
(egg_icon_list_select_first_matching_item),
(egg_icon_list_maybe_begin_dragging_items),
(egg_icon_list_real_toggle_cursor_item),
(egg_icon_list_calculate_item_size),
(egg_icon_list_invalidate_sizes), (egg_icon_list_paint_item),
(egg_icon_list_item_new), (egg_icon_list_item_unref),
(egg_icon_list_get_item_text), (egg_icon_list_get_item_icon),
(egg_icon_list_get_item_at_pos), (egg_icon_list_get_path_at_pos),
(egg_icon_list_selected_foreach), (egg_icon_list_select_path),
(egg_icon_list_unselect_path), (egg_icon_list_path_is_selected),
(egg_icon_list_item_activated), (egg_icon_list_get_items),
(egg_icon_list_row_changed), (egg_icon_list_row_inserted),
(egg_icon_list_row_deleted), (egg_icon_list_rows_reordered),
(egg_icon_list_build_items), (egg_icon_list_set_model),
(egg_icon_list_get_model), (egg_icon_list_set_text_column),
(egg_icon_list_set_pixbuf_column):
* libegg/iconlist/eggiconlist.h:
* libegg/iconlist/testiconlist.c: (fill_model), (create_model),
(foreach_selected_print), (item_removed), (remove_selected),
(item_cb), (do_popup_menu), (main):
* libegg/util/eggmarshalers.list:
Update icon list to use the tree model instead.
2004-07-02 12:04:49 +00:00
|
|
|
{
|
2010-12-13 09:08:37 +00:00
|
|
|
/* Clear all item sizes */
|
2004-07-04 15:56:55 +00:00
|
|
|
g_list_foreach (icon_view->priv->items,
|
|
|
|
(GFunc)gtk_icon_view_item_invalidate_size, NULL);
|
2010-12-13 09:08:37 +00:00
|
|
|
|
|
|
|
/* Reset the context */
|
2011-02-23 11:50:50 +00:00
|
|
|
if (icon_view->priv->cell_area_context)
|
|
|
|
{
|
|
|
|
g_signal_handler_block (icon_view->priv->cell_area_context,
|
|
|
|
icon_view->priv->context_changed_id);
|
|
|
|
gtk_cell_area_context_reset (icon_view->priv->cell_area_context);
|
|
|
|
g_signal_handler_unblock (icon_view->priv->cell_area_context,
|
|
|
|
icon_view->priv->context_changed_id);
|
|
|
|
}
|
2010-12-13 09:08:37 +00:00
|
|
|
|
|
|
|
/* Re-layout the items */
|
|
|
|
gtk_icon_view_queue_layout (icon_view);
|
2002-04-30 17:08:52 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2004-07-04 15:56:55 +00:00
|
|
|
gtk_icon_view_item_invalidate_size (GtkIconViewItem *item)
|
2002-04-30 17:08:52 +00:00
|
|
|
{
|
2010-12-13 08:41:50 +00:00
|
|
|
item->cell_area.width = -1;
|
|
|
|
item->cell_area.height = -1;
|
2002-04-30 17:08:52 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2004-07-04 15:56:55 +00:00
|
|
|
gtk_icon_view_paint_item (GtkIconView *icon_view,
|
2011-01-24 02:50:39 +00:00
|
|
|
cairo_t *cr,
|
|
|
|
GtkIconViewItem *item,
|
|
|
|
gint x,
|
|
|
|
gint y,
|
|
|
|
gboolean draw_focus)
|
2002-04-30 17:08:52 +00:00
|
|
|
{
|
2010-12-12 07:29:41 +00:00
|
|
|
GdkRectangle cell_area;
|
2011-01-12 20:26:25 +00:00
|
|
|
GtkStateFlags state = 0;
|
|
|
|
GtkCellRendererState flags = 0;
|
|
|
|
GtkStyleContext *style_context;
|
2010-08-11 21:10:57 +00:00
|
|
|
GtkWidget *widget = GTK_WIDGET (icon_view);
|
2010-12-12 07:29:41 +00:00
|
|
|
GtkIconViewPrivate *priv = icon_view->priv;
|
2010-12-12 15:24:26 +00:00
|
|
|
GtkCellAreaContext *context;
|
2010-08-11 21:10:57 +00:00
|
|
|
|
2010-12-12 07:29:41 +00:00
|
|
|
if (priv->model == NULL)
|
Update icon list to use the tree model instead.
2004-07-02 Anders Carlsson <andersca@gnome.org>
* libegg/iconlist/eggiconlist.c: (egg_icon_list_class_init),
(egg_icon_list_init), (egg_icon_list_destroy),
(egg_icon_list_finalize), (egg_icon_list_set_property),
(egg_icon_list_get_property), (egg_icon_list_button_press),
(egg_icon_list_select_first_matching_item),
(egg_icon_list_maybe_begin_dragging_items),
(egg_icon_list_real_toggle_cursor_item),
(egg_icon_list_calculate_item_size),
(egg_icon_list_invalidate_sizes), (egg_icon_list_paint_item),
(egg_icon_list_item_new), (egg_icon_list_item_unref),
(egg_icon_list_get_item_text), (egg_icon_list_get_item_icon),
(egg_icon_list_get_item_at_pos), (egg_icon_list_get_path_at_pos),
(egg_icon_list_selected_foreach), (egg_icon_list_select_path),
(egg_icon_list_unselect_path), (egg_icon_list_path_is_selected),
(egg_icon_list_item_activated), (egg_icon_list_get_items),
(egg_icon_list_row_changed), (egg_icon_list_row_inserted),
(egg_icon_list_row_deleted), (egg_icon_list_rows_reordered),
(egg_icon_list_build_items), (egg_icon_list_set_model),
(egg_icon_list_get_model), (egg_icon_list_set_text_column),
(egg_icon_list_set_pixbuf_column):
* libegg/iconlist/eggiconlist.h:
* libegg/iconlist/testiconlist.c: (fill_model), (create_model),
(foreach_selected_print), (item_removed), (remove_selected),
(item_cb), (do_popup_menu), (main):
* libegg/util/eggmarshalers.list:
Update icon list to use the tree model instead.
2004-07-02 12:04:49 +00:00
|
|
|
return;
|
2011-01-24 02:50:39 +00:00
|
|
|
|
2010-12-12 07:29:41 +00:00
|
|
|
gtk_icon_view_set_cell_data (icon_view, item);
|
2010-08-11 21:10:57 +00:00
|
|
|
|
2011-01-12 20:26:25 +00:00
|
|
|
style_context = gtk_widget_get_style_context (widget);
|
|
|
|
|
|
|
|
gtk_style_context_save (style_context);
|
|
|
|
gtk_style_context_add_class (style_context, GTK_STYLE_CLASS_VIEW);
|
|
|
|
gtk_style_context_add_class (style_context, GTK_STYLE_CLASS_CELL);
|
|
|
|
|
2005-05-02 20:28:37 +00:00
|
|
|
if (item->selected)
|
2008-09-24 08:04:15 +00:00
|
|
|
{
|
2011-01-12 20:26:25 +00:00
|
|
|
if (gtk_widget_has_focus (widget) &&
|
|
|
|
item == icon_view->priv->cursor_item)
|
|
|
|
{
|
|
|
|
state |= GTK_STATE_FLAG_FOCUSED;
|
|
|
|
flags |= GTK_CELL_RENDERER_FOCUSED;
|
|
|
|
}
|
|
|
|
|
|
|
|
state |= GTK_STATE_FLAG_SELECTED;
|
|
|
|
flags |= GTK_CELL_RENDERER_SELECTED;
|
|
|
|
|
|
|
|
gtk_style_context_set_state (style_context, state);
|
|
|
|
gtk_render_background (style_context, cr,
|
|
|
|
x - icon_view->priv->item_padding,
|
|
|
|
y - icon_view->priv->item_padding,
|
|
|
|
item->cell_area.width + icon_view->priv->item_padding * 2,
|
|
|
|
item->cell_area.height + icon_view->priv->item_padding * 2);
|
2008-09-24 08:04:15 +00:00
|
|
|
}
|
2010-12-12 10:59:41 +00:00
|
|
|
|
|
|
|
cell_area.x = x;
|
|
|
|
cell_area.y = y;
|
2010-12-13 08:41:50 +00:00
|
|
|
cell_area.width = item->cell_area.width;
|
|
|
|
cell_area.height = item->cell_area.height;
|
2008-09-24 08:04:15 +00:00
|
|
|
|
2010-12-12 15:24:26 +00:00
|
|
|
context = g_ptr_array_index (priv->row_contexts, item->row);
|
|
|
|
gtk_cell_area_render (priv->cell_area, context,
|
2011-01-24 02:50:39 +00:00
|
|
|
widget, cr, &cell_area, &cell_area, flags,
|
|
|
|
draw_focus);
|
2011-01-12 20:26:25 +00:00
|
|
|
|
|
|
|
gtk_style_context_restore (style_context);
|
2002-04-30 17:08:52 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2004-07-04 15:56:55 +00:00
|
|
|
gtk_icon_view_paint_rubberband (GtkIconView *icon_view,
|
2010-09-06 15:46:37 +00:00
|
|
|
cairo_t *cr)
|
2002-04-30 17:08:52 +00:00
|
|
|
{
|
2011-01-12 20:26:25 +00:00
|
|
|
GtkStyleContext *context;
|
2002-04-30 17:08:52 +00:00
|
|
|
GdkRectangle rect;
|
2003-07-03 13:10:41 +00:00
|
|
|
|
2010-09-06 15:46:37 +00:00
|
|
|
cairo_save (cr);
|
2002-04-30 17:08:52 +00:00
|
|
|
|
2010-09-06 15:46:37 +00:00
|
|
|
rect.x = MIN (icon_view->priv->rubberband_x1, icon_view->priv->rubberband_x2);
|
|
|
|
rect.y = MIN (icon_view->priv->rubberband_y1, icon_view->priv->rubberband_y2);
|
|
|
|
rect.width = ABS (icon_view->priv->rubberband_x1 - icon_view->priv->rubberband_x2) + 1;
|
|
|
|
rect.height = ABS (icon_view->priv->rubberband_y1 - icon_view->priv->rubberband_y2) + 1;
|
2002-04-30 17:08:52 +00:00
|
|
|
|
2011-01-12 20:26:25 +00:00
|
|
|
context = gtk_widget_get_style_context (GTK_WIDGET (icon_view));
|
2003-07-03 13:10:41 +00:00
|
|
|
|
2011-01-12 20:26:25 +00:00
|
|
|
gtk_style_context_save (context);
|
|
|
|
gtk_style_context_add_class (context, GTK_STYLE_CLASS_RUBBERBAND);
|
2003-07-03 13:10:41 +00:00
|
|
|
|
2005-05-11 19:16:19 +00:00
|
|
|
gdk_cairo_rectangle (cr, &rect);
|
2005-03-17 01:54:40 +00:00
|
|
|
cairo_clip (cr);
|
2005-04-18 15:11:01 +00:00
|
|
|
|
2011-01-12 20:26:25 +00:00
|
|
|
gtk_render_background (context, cr,
|
|
|
|
rect.x, rect.y,
|
|
|
|
rect.width, rect.height);
|
|
|
|
gtk_render_frame (context, cr,
|
|
|
|
rect.x, rect.y,
|
|
|
|
rect.width, rect.height);
|
2010-09-06 15:46:37 +00:00
|
|
|
|
2011-01-12 20:26:25 +00:00
|
|
|
gtk_style_context_restore (context);
|
2010-09-06 15:46:37 +00:00
|
|
|
cairo_restore (cr);
|
2002-04-30 17:08:52 +00:00
|
|
|
}
|
|
|
|
|
2005-05-06 04:14:32 +00:00
|
|
|
static void
|
|
|
|
gtk_icon_view_queue_draw_path (GtkIconView *icon_view,
|
|
|
|
GtkTreePath *path)
|
|
|
|
{
|
|
|
|
GList *l;
|
|
|
|
gint index;
|
|
|
|
|
2010-06-28 18:15:10 +00:00
|
|
|
index = gtk_tree_path_get_indices (path)[0];
|
2005-05-06 04:14:32 +00:00
|
|
|
|
|
|
|
for (l = icon_view->priv->items; l; l = l->next)
|
|
|
|
{
|
|
|
|
GtkIconViewItem *item = l->data;
|
|
|
|
|
|
|
|
if (item->index == index)
|
|
|
|
{
|
|
|
|
gtk_icon_view_queue_draw_item (icon_view, item);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2002-04-30 17:08:52 +00:00
|
|
|
static void
|
2004-07-04 15:56:55 +00:00
|
|
|
gtk_icon_view_queue_draw_item (GtkIconView *icon_view,
|
|
|
|
GtkIconViewItem *item)
|
2002-04-30 17:08:52 +00:00
|
|
|
{
|
2010-12-13 08:41:50 +00:00
|
|
|
GdkRectangle rect;
|
|
|
|
GdkRectangle *item_area = (GdkRectangle *)item;
|
2002-04-30 17:08:52 +00:00
|
|
|
|
2010-12-13 08:41:50 +00:00
|
|
|
rect.x = item_area->x - icon_view->priv->item_padding;
|
|
|
|
rect.y = item_area->y - icon_view->priv->item_padding;
|
|
|
|
rect.width = item_area->width + icon_view->priv->item_padding * 2;
|
|
|
|
rect.height = item_area->height + icon_view->priv->item_padding * 2;
|
2002-04-30 17:08:52 +00:00
|
|
|
|
2004-07-04 15:56:55 +00:00
|
|
|
if (icon_view->priv->bin_window)
|
|
|
|
gdk_window_invalidate_rect (icon_view->priv->bin_window, &rect, TRUE);
|
2002-04-30 17:08:52 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static gboolean
|
|
|
|
layout_callback (gpointer user_data)
|
|
|
|
{
|
2004-07-04 15:56:55 +00:00
|
|
|
GtkIconView *icon_view;
|
2002-04-30 17:08:52 +00:00
|
|
|
|
2004-07-04 15:56:55 +00:00
|
|
|
icon_view = GTK_ICON_VIEW (user_data);
|
2002-04-30 17:08:52 +00:00
|
|
|
|
2004-07-04 15:56:55 +00:00
|
|
|
icon_view->priv->layout_idle_id = 0;
|
2002-04-30 17:08:52 +00:00
|
|
|
|
2004-07-04 15:56:55 +00:00
|
|
|
gtk_icon_view_layout (icon_view);
|
2002-04-30 17:08:52 +00:00
|
|
|
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2004-07-04 15:56:55 +00:00
|
|
|
gtk_icon_view_queue_layout (GtkIconView *icon_view)
|
2002-04-30 17:08:52 +00:00
|
|
|
{
|
2004-07-04 15:56:55 +00:00
|
|
|
if (icon_view->priv->layout_idle_id != 0)
|
2002-04-30 17:08:52 +00:00
|
|
|
return;
|
|
|
|
|
2010-10-17 08:27:41 +00:00
|
|
|
icon_view->priv->layout_idle_id =
|
|
|
|
gdk_threads_add_idle_full (GTK_ICON_VIEW_PRIORITY_LAYOUT,
|
|
|
|
layout_callback, icon_view, NULL);
|
2002-04-30 17:08:52 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2004-07-04 15:56:55 +00:00
|
|
|
gtk_icon_view_set_cursor_item (GtkIconView *icon_view,
|
2005-05-02 20:28:37 +00:00
|
|
|
GtkIconViewItem *item,
|
2010-12-12 07:29:41 +00:00
|
|
|
GtkCellRenderer *cursor_cell)
|
2002-04-30 17:08:52 +00:00
|
|
|
{
|
2004-08-12 05:37:10 +00:00
|
|
|
AtkObject *obj;
|
|
|
|
AtkObject *item_obj;
|
2008-02-12 16:43:04 +00:00
|
|
|
AtkObject *cursor_item_obj;
|
2004-08-12 05:37:10 +00:00
|
|
|
|
2011-01-05 16:30:17 +00:00
|
|
|
/* When hitting this path from keynav, the focus cell is
|
|
|
|
* already set, we dont need to notify the atk object
|
|
|
|
* but we still need to queue the draw here (in the case
|
|
|
|
* that the focus cell changes but not the cursor item).
|
|
|
|
*/
|
|
|
|
gtk_icon_view_queue_draw_item (icon_view, item);
|
|
|
|
|
2005-05-02 20:28:37 +00:00
|
|
|
if (icon_view->priv->cursor_item == item &&
|
2010-12-12 07:29:41 +00:00
|
|
|
(cursor_cell == NULL || cursor_cell == gtk_cell_area_get_focus_cell (icon_view->priv->cell_area)))
|
2002-04-30 17:08:52 +00:00
|
|
|
return;
|
|
|
|
|
2008-02-12 16:43:04 +00:00
|
|
|
obj = gtk_widget_get_accessible (GTK_WIDGET (icon_view));
|
2004-07-04 15:56:55 +00:00
|
|
|
if (icon_view->priv->cursor_item != NULL)
|
2008-02-12 16:43:04 +00:00
|
|
|
{
|
|
|
|
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);
|
|
|
|
}
|
|
|
|
}
|
2004-07-04 15:56:55 +00:00
|
|
|
icon_view->priv->cursor_item = item;
|
2010-12-12 07:29:41 +00:00
|
|
|
|
2011-01-05 12:58:32 +00:00
|
|
|
if (cursor_cell)
|
|
|
|
gtk_cell_area_set_focus_cell (icon_view->priv->cell_area, cursor_cell);
|
|
|
|
else
|
|
|
|
{
|
|
|
|
/* Make sure there is a cell in focus initially */
|
|
|
|
if (!gtk_cell_area_get_focus_cell (icon_view->priv->cell_area))
|
|
|
|
gtk_cell_area_focus (icon_view->priv->cell_area, GTK_DIR_TAB_FORWARD);
|
|
|
|
}
|
2004-08-12 05:37:10 +00:00
|
|
|
|
|
|
|
/* Notify that accessible focus object has changed */
|
|
|
|
item_obj = atk_object_ref_accessible_child (obj, item->index);
|
2004-08-18 15:45:13 +00:00
|
|
|
|
|
|
|
if (item_obj != NULL)
|
|
|
|
{
|
|
|
|
atk_focus_tracker_notify (item_obj);
|
2008-02-12 16:43:04 +00:00
|
|
|
atk_object_notify_state_change (item_obj, ATK_STATE_FOCUSED, TRUE);
|
2004-08-18 15:45:13 +00:00
|
|
|
g_object_unref (item_obj);
|
|
|
|
}
|
2002-04-30 17:08:52 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2004-07-04 15:56:55 +00:00
|
|
|
static GtkIconViewItem *
|
|
|
|
gtk_icon_view_item_new (void)
|
2002-04-30 17:08:52 +00:00
|
|
|
{
|
2004-07-04 15:56:55 +00:00
|
|
|
GtkIconViewItem *item;
|
2002-04-30 17:08:52 +00:00
|
|
|
|
2010-12-12 10:59:41 +00:00
|
|
|
item = g_slice_new0 (GtkIconViewItem);
|
2002-07-29 21:11:23 +00:00
|
|
|
|
2010-12-13 08:41:50 +00:00
|
|
|
item->cell_area.width = -1;
|
|
|
|
item->cell_area.height = -1;
|
2002-04-30 17:08:52 +00:00
|
|
|
|
|
|
|
return item;
|
|
|
|
}
|
|
|
|
|
Document functions and fix a few bugs.
2004-07-03 Anders Carlsson <andersca@gnome.org>
* libegg/iconlist/eggiconlist.c: (egg_icon_list_add_move_binding),
(egg_icon_list_real_move_cursor), (egg_icon_list_new),
(egg_icon_list_new_with_model), (egg_icon_list_get_path_at_pos),
(egg_icon_list_selected_foreach),
(egg_icon_list_set_selection_mode),
(egg_icon_list_get_selection_mode), (egg_icon_list_set_model),
(egg_icon_list_get_model), (egg_icon_list_set_text_column),
(egg_icon_list_get_text_column), (egg_icon_list_set_markup_column),
(egg_icon_list_get_markup_column),
(egg_icon_list_set_pixbuf_column),
(egg_icon_list_get_pixbuf_column), (egg_icon_list_select_path),
(egg_icon_list_unselect_path), (egg_icon_list_select_all),
(egg_icon_list_unselect_all), (egg_icon_list_path_is_selected),
(egg_icon_list_item_activated):
* libegg/iconlist/eggiconlist.h:
* libegg/iconlist/testiconlist.c: (foreach_selected_remove_func),
(foreach_selected_remove), (selection_changed), (main):
Document functions and fix a few bugs.
2004-07-03 08:01:34 +00:00
|
|
|
static void
|
2004-07-04 15:56:55 +00:00
|
|
|
gtk_icon_view_item_free (GtkIconViewItem *item)
|
2002-07-29 21:11:23 +00:00
|
|
|
{
|
|
|
|
g_return_if_fail (item != NULL);
|
|
|
|
|
2010-12-12 10:59:41 +00:00
|
|
|
g_slice_free (GtkIconViewItem, item);
|
Update icon list to use the tree model instead.
2004-07-02 Anders Carlsson <andersca@gnome.org>
* libegg/iconlist/eggiconlist.c: (egg_icon_list_class_init),
(egg_icon_list_init), (egg_icon_list_destroy),
(egg_icon_list_finalize), (egg_icon_list_set_property),
(egg_icon_list_get_property), (egg_icon_list_button_press),
(egg_icon_list_select_first_matching_item),
(egg_icon_list_maybe_begin_dragging_items),
(egg_icon_list_real_toggle_cursor_item),
(egg_icon_list_calculate_item_size),
(egg_icon_list_invalidate_sizes), (egg_icon_list_paint_item),
(egg_icon_list_item_new), (egg_icon_list_item_unref),
(egg_icon_list_get_item_text), (egg_icon_list_get_item_icon),
(egg_icon_list_get_item_at_pos), (egg_icon_list_get_path_at_pos),
(egg_icon_list_selected_foreach), (egg_icon_list_select_path),
(egg_icon_list_unselect_path), (egg_icon_list_path_is_selected),
(egg_icon_list_item_activated), (egg_icon_list_get_items),
(egg_icon_list_row_changed), (egg_icon_list_row_inserted),
(egg_icon_list_row_deleted), (egg_icon_list_rows_reordered),
(egg_icon_list_build_items), (egg_icon_list_set_model),
(egg_icon_list_get_model), (egg_icon_list_set_text_column),
(egg_icon_list_set_pixbuf_column):
* libegg/iconlist/eggiconlist.h:
* libegg/iconlist/testiconlist.c: (fill_model), (create_model),
(foreach_selected_print), (item_removed), (remove_selected),
(item_cb), (do_popup_menu), (main):
* libegg/util/eggmarshalers.list:
Update icon list to use the tree model instead.
2004-07-02 12:04:49 +00:00
|
|
|
}
|
2002-04-30 17:08:52 +00:00
|
|
|
|
2004-07-04 15:56:55 +00:00
|
|
|
static GtkIconViewItem *
|
2005-05-02 20:28:37 +00:00
|
|
|
gtk_icon_view_get_item_at_coords (GtkIconView *icon_view,
|
|
|
|
gint x,
|
|
|
|
gint y,
|
2005-05-06 04:14:32 +00:00
|
|
|
gboolean only_in_cell,
|
2010-12-12 07:29:41 +00:00
|
|
|
GtkCellRenderer **cell_at_pos)
|
2002-04-30 17:08:52 +00:00
|
|
|
{
|
2010-12-12 07:29:41 +00:00
|
|
|
GList *items;
|
2005-05-02 20:28:37 +00:00
|
|
|
|
2009-09-28 16:41:29 +00:00
|
|
|
if (cell_at_pos)
|
|
|
|
*cell_at_pos = NULL;
|
|
|
|
|
2004-07-04 15:56:55 +00:00
|
|
|
for (items = icon_view->priv->items; items; items = items->next)
|
2002-04-30 17:08:52 +00:00
|
|
|
{
|
2004-07-04 15:56:55 +00:00
|
|
|
GtkIconViewItem *item = items->data;
|
2010-12-13 08:41:50 +00:00
|
|
|
GdkRectangle *item_area = (GdkRectangle *)item;
|
2005-05-02 20:28:37 +00:00
|
|
|
|
2010-12-13 08:41:50 +00:00
|
|
|
if (x >= item_area->x - icon_view->priv->column_spacing/2 &&
|
|
|
|
x <= item_area->x + item_area->width + icon_view->priv->column_spacing/2 &&
|
|
|
|
y >= item_area->y - icon_view->priv->row_spacing/2 &&
|
|
|
|
y <= item_area->y + item_area->height + icon_view->priv->row_spacing/2)
|
2005-05-06 04:14:32 +00:00
|
|
|
{
|
|
|
|
if (only_in_cell || cell_at_pos)
|
2005-05-02 20:28:37 +00:00
|
|
|
{
|
2010-12-12 10:59:41 +00:00
|
|
|
GtkCellRenderer *cell = NULL;
|
2010-12-12 15:24:26 +00:00
|
|
|
GtkCellAreaContext *context;
|
2009-09-28 16:41:29 +00:00
|
|
|
|
2010-12-12 15:24:26 +00:00
|
|
|
context = g_ptr_array_index (icon_view->priv->row_contexts, item->row);
|
2010-12-12 07:29:41 +00:00
|
|
|
gtk_icon_view_set_cell_data (icon_view, item);
|
2010-12-12 10:59:41 +00:00
|
|
|
|
2010-12-13 08:41:50 +00:00
|
|
|
if (x >= item_area->x && x <= item_area->x + item_area->width &&
|
|
|
|
y >= item_area->y && y <= item_area->y + item_area->height)
|
2010-12-12 15:24:26 +00:00
|
|
|
cell = gtk_cell_area_get_cell_at_position (icon_view->priv->cell_area, context,
|
2010-12-12 10:59:41 +00:00
|
|
|
GTK_WIDGET (icon_view),
|
2010-12-13 08:41:50 +00:00
|
|
|
item_area,
|
2010-12-12 10:59:41 +00:00
|
|
|
x, y, NULL);
|
2009-09-28 16:41:29 +00:00
|
|
|
|
2010-12-12 07:29:41 +00:00
|
|
|
if (cell_at_pos)
|
|
|
|
*cell_at_pos = cell;
|
2005-05-06 04:14:32 +00:00
|
|
|
|
2009-08-13 13:45:04 +00:00
|
|
|
if (only_in_cell)
|
2010-12-12 07:29:41 +00:00
|
|
|
return cell != NULL ? item : NULL;
|
|
|
|
else
|
|
|
|
return item;
|
2005-05-02 20:28:37 +00:00
|
|
|
}
|
2005-05-06 04:14:32 +00:00
|
|
|
return item;
|
2002-04-30 17:08:52 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
Update icon list to use the tree model instead.
2004-07-02 Anders Carlsson <andersca@gnome.org>
* libegg/iconlist/eggiconlist.c: (egg_icon_list_class_init),
(egg_icon_list_init), (egg_icon_list_destroy),
(egg_icon_list_finalize), (egg_icon_list_set_property),
(egg_icon_list_get_property), (egg_icon_list_button_press),
(egg_icon_list_select_first_matching_item),
(egg_icon_list_maybe_begin_dragging_items),
(egg_icon_list_real_toggle_cursor_item),
(egg_icon_list_calculate_item_size),
(egg_icon_list_invalidate_sizes), (egg_icon_list_paint_item),
(egg_icon_list_item_new), (egg_icon_list_item_unref),
(egg_icon_list_get_item_text), (egg_icon_list_get_item_icon),
(egg_icon_list_get_item_at_pos), (egg_icon_list_get_path_at_pos),
(egg_icon_list_selected_foreach), (egg_icon_list_select_path),
(egg_icon_list_unselect_path), (egg_icon_list_path_is_selected),
(egg_icon_list_item_activated), (egg_icon_list_get_items),
(egg_icon_list_row_changed), (egg_icon_list_row_inserted),
(egg_icon_list_row_deleted), (egg_icon_list_rows_reordered),
(egg_icon_list_build_items), (egg_icon_list_set_model),
(egg_icon_list_get_model), (egg_icon_list_set_text_column),
(egg_icon_list_set_pixbuf_column):
* libegg/iconlist/eggiconlist.h:
* libegg/iconlist/testiconlist.c: (fill_model), (create_model),
(foreach_selected_print), (item_removed), (remove_selected),
(item_cb), (do_popup_menu), (main):
* libegg/util/eggmarshalers.list:
Update icon list to use the tree model instead.
2004-07-02 12:04:49 +00:00
|
|
|
static void
|
2004-07-04 15:56:55 +00:00
|
|
|
gtk_icon_view_select_item (GtkIconView *icon_view,
|
|
|
|
GtkIconViewItem *item)
|
2002-04-30 17:08:52 +00:00
|
|
|
{
|
2004-07-04 15:56:55 +00:00
|
|
|
g_return_if_fail (GTK_IS_ICON_VIEW (icon_view));
|
2002-04-30 17:08:52 +00:00
|
|
|
g_return_if_fail (item != NULL);
|
|
|
|
|
|
|
|
if (item->selected)
|
|
|
|
return;
|
|
|
|
|
2004-07-04 15:56:55 +00:00
|
|
|
if (icon_view->priv->selection_mode == GTK_SELECTION_NONE)
|
2002-04-30 17:08:52 +00:00
|
|
|
return;
|
2004-07-04 15:56:55 +00:00
|
|
|
else if (icon_view->priv->selection_mode != GTK_SELECTION_MULTIPLE)
|
|
|
|
gtk_icon_view_unselect_all_internal (icon_view);
|
2002-04-30 17:08:52 +00:00
|
|
|
|
|
|
|
item->selected = TRUE;
|
|
|
|
|
2008-02-12 16:43:04 +00:00
|
|
|
gtk_icon_view_item_selected_changed (icon_view, item);
|
2004-07-04 15:56:55 +00:00
|
|
|
g_signal_emit (icon_view, icon_view_signals[SELECTION_CHANGED], 0);
|
2008-02-12 16:43:04 +00:00
|
|
|
|
|
|
|
gtk_icon_view_queue_draw_item (icon_view, item);
|
2002-04-30 17:08:52 +00:00
|
|
|
}
|
|
|
|
|
Update icon list to use the tree model instead.
2004-07-02 Anders Carlsson <andersca@gnome.org>
* libegg/iconlist/eggiconlist.c: (egg_icon_list_class_init),
(egg_icon_list_init), (egg_icon_list_destroy),
(egg_icon_list_finalize), (egg_icon_list_set_property),
(egg_icon_list_get_property), (egg_icon_list_button_press),
(egg_icon_list_select_first_matching_item),
(egg_icon_list_maybe_begin_dragging_items),
(egg_icon_list_real_toggle_cursor_item),
(egg_icon_list_calculate_item_size),
(egg_icon_list_invalidate_sizes), (egg_icon_list_paint_item),
(egg_icon_list_item_new), (egg_icon_list_item_unref),
(egg_icon_list_get_item_text), (egg_icon_list_get_item_icon),
(egg_icon_list_get_item_at_pos), (egg_icon_list_get_path_at_pos),
(egg_icon_list_selected_foreach), (egg_icon_list_select_path),
(egg_icon_list_unselect_path), (egg_icon_list_path_is_selected),
(egg_icon_list_item_activated), (egg_icon_list_get_items),
(egg_icon_list_row_changed), (egg_icon_list_row_inserted),
(egg_icon_list_row_deleted), (egg_icon_list_rows_reordered),
(egg_icon_list_build_items), (egg_icon_list_set_model),
(egg_icon_list_get_model), (egg_icon_list_set_text_column),
(egg_icon_list_set_pixbuf_column):
* libegg/iconlist/eggiconlist.h:
* libegg/iconlist/testiconlist.c: (fill_model), (create_model),
(foreach_selected_print), (item_removed), (remove_selected),
(item_cb), (do_popup_menu), (main):
* libegg/util/eggmarshalers.list:
Update icon list to use the tree model instead.
2004-07-02 12:04:49 +00:00
|
|
|
|
|
|
|
static void
|
2004-07-04 15:56:55 +00:00
|
|
|
gtk_icon_view_unselect_item (GtkIconView *icon_view,
|
|
|
|
GtkIconViewItem *item)
|
2002-04-30 17:08:52 +00:00
|
|
|
{
|
2004-07-04 15:56:55 +00:00
|
|
|
g_return_if_fail (GTK_IS_ICON_VIEW (icon_view));
|
2002-04-30 17:08:52 +00:00
|
|
|
g_return_if_fail (item != NULL);
|
|
|
|
|
|
|
|
if (!item->selected)
|
|
|
|
return;
|
|
|
|
|
2004-07-04 15:56:55 +00:00
|
|
|
if (icon_view->priv->selection_mode == GTK_SELECTION_NONE ||
|
|
|
|
icon_view->priv->selection_mode == GTK_SELECTION_BROWSE)
|
2002-04-30 17:08:52 +00:00
|
|
|
return;
|
|
|
|
|
|
|
|
item->selected = FALSE;
|
|
|
|
|
2008-02-12 16:43:04 +00:00
|
|
|
gtk_icon_view_item_selected_changed (icon_view, item);
|
2004-07-04 15:56:55 +00:00
|
|
|
g_signal_emit (icon_view, icon_view_signals[SELECTION_CHANGED], 0);
|
2002-04-30 17:08:52 +00:00
|
|
|
|
2004-07-04 15:56:55 +00:00
|
|
|
gtk_icon_view_queue_draw_item (icon_view, item);
|
2002-04-30 17:08:52 +00:00
|
|
|
}
|
|
|
|
|
Fix the "selection_changed" signal to not get emitted twice in some cases.
2004-07-04 Anders Carlsson <andersca@gnome.org>
* configure.in:
* libegg/iconlist/eggiconlist.c: (egg_icon_list_expose),
(scroll_timeout), (egg_icon_list_motion),
(egg_icon_list_button_press), (egg_icon_list_update_rubberband),
(egg_icon_list_start_rubberbanding),
(egg_icon_list_stop_rubberbanding),
(egg_icon_list_unselect_all_internal),
(egg_icon_list_real_select_all),
(egg_icon_list_adjustment_changed), (egg_icon_list_item_free),
(egg_icon_list_select_item), (verify_items),
(egg_icon_list_row_changed), (egg_icon_list_row_inserted),
(egg_icon_list_row_deleted), (egg_icon_list_rows_reordered),
(egg_icon_list_select_all_between),
(egg_icon_list_move_cursor_up_down),
(egg_icon_list_move_cursor_page_up_down),
(egg_icon_list_move_cursor_left_right),
(egg_icon_list_move_cursor_start_end), (egg_icon_list_set_model),
(egg_icon_list_get_selected_items), (egg_icon_list_select_all),
(egg_icon_list_unselect_all):
* libegg/iconlist/eggiconlist.h:
* libegg/iconlist/testiconlist.c: (foreach_selected_remove):
Fix the "selection_changed" signal to not get emitted twice in some cases.
Also fix a bunch of issues reported by Jonathan.
2004-07-04 12:43:26 +00:00
|
|
|
static void
|
2004-07-04 15:56:55 +00:00
|
|
|
verify_items (GtkIconView *icon_view)
|
Fix the "selection_changed" signal to not get emitted twice in some cases.
2004-07-04 Anders Carlsson <andersca@gnome.org>
* configure.in:
* libegg/iconlist/eggiconlist.c: (egg_icon_list_expose),
(scroll_timeout), (egg_icon_list_motion),
(egg_icon_list_button_press), (egg_icon_list_update_rubberband),
(egg_icon_list_start_rubberbanding),
(egg_icon_list_stop_rubberbanding),
(egg_icon_list_unselect_all_internal),
(egg_icon_list_real_select_all),
(egg_icon_list_adjustment_changed), (egg_icon_list_item_free),
(egg_icon_list_select_item), (verify_items),
(egg_icon_list_row_changed), (egg_icon_list_row_inserted),
(egg_icon_list_row_deleted), (egg_icon_list_rows_reordered),
(egg_icon_list_select_all_between),
(egg_icon_list_move_cursor_up_down),
(egg_icon_list_move_cursor_page_up_down),
(egg_icon_list_move_cursor_left_right),
(egg_icon_list_move_cursor_start_end), (egg_icon_list_set_model),
(egg_icon_list_get_selected_items), (egg_icon_list_select_all),
(egg_icon_list_unselect_all):
* libegg/iconlist/eggiconlist.h:
* libegg/iconlist/testiconlist.c: (foreach_selected_remove):
Fix the "selection_changed" signal to not get emitted twice in some cases.
Also fix a bunch of issues reported by Jonathan.
2004-07-04 12:43:26 +00:00
|
|
|
{
|
|
|
|
GList *items;
|
|
|
|
int i = 0;
|
|
|
|
|
2004-07-04 15:56:55 +00:00
|
|
|
for (items = icon_view->priv->items; items; items = items->next)
|
Fix the "selection_changed" signal to not get emitted twice in some cases.
2004-07-04 Anders Carlsson <andersca@gnome.org>
* configure.in:
* libegg/iconlist/eggiconlist.c: (egg_icon_list_expose),
(scroll_timeout), (egg_icon_list_motion),
(egg_icon_list_button_press), (egg_icon_list_update_rubberband),
(egg_icon_list_start_rubberbanding),
(egg_icon_list_stop_rubberbanding),
(egg_icon_list_unselect_all_internal),
(egg_icon_list_real_select_all),
(egg_icon_list_adjustment_changed), (egg_icon_list_item_free),
(egg_icon_list_select_item), (verify_items),
(egg_icon_list_row_changed), (egg_icon_list_row_inserted),
(egg_icon_list_row_deleted), (egg_icon_list_rows_reordered),
(egg_icon_list_select_all_between),
(egg_icon_list_move_cursor_up_down),
(egg_icon_list_move_cursor_page_up_down),
(egg_icon_list_move_cursor_left_right),
(egg_icon_list_move_cursor_start_end), (egg_icon_list_set_model),
(egg_icon_list_get_selected_items), (egg_icon_list_select_all),
(egg_icon_list_unselect_all):
* libegg/iconlist/eggiconlist.h:
* libegg/iconlist/testiconlist.c: (foreach_selected_remove):
Fix the "selection_changed" signal to not get emitted twice in some cases.
Also fix a bunch of issues reported by Jonathan.
2004-07-04 12:43:26 +00:00
|
|
|
{
|
2004-07-04 15:56:55 +00:00
|
|
|
GtkIconViewItem *item = items->data;
|
Fix the "selection_changed" signal to not get emitted twice in some cases.
2004-07-04 Anders Carlsson <andersca@gnome.org>
* configure.in:
* libegg/iconlist/eggiconlist.c: (egg_icon_list_expose),
(scroll_timeout), (egg_icon_list_motion),
(egg_icon_list_button_press), (egg_icon_list_update_rubberband),
(egg_icon_list_start_rubberbanding),
(egg_icon_list_stop_rubberbanding),
(egg_icon_list_unselect_all_internal),
(egg_icon_list_real_select_all),
(egg_icon_list_adjustment_changed), (egg_icon_list_item_free),
(egg_icon_list_select_item), (verify_items),
(egg_icon_list_row_changed), (egg_icon_list_row_inserted),
(egg_icon_list_row_deleted), (egg_icon_list_rows_reordered),
(egg_icon_list_select_all_between),
(egg_icon_list_move_cursor_up_down),
(egg_icon_list_move_cursor_page_up_down),
(egg_icon_list_move_cursor_left_right),
(egg_icon_list_move_cursor_start_end), (egg_icon_list_set_model),
(egg_icon_list_get_selected_items), (egg_icon_list_select_all),
(egg_icon_list_unselect_all):
* libegg/iconlist/eggiconlist.h:
* libegg/iconlist/testiconlist.c: (foreach_selected_remove):
Fix the "selection_changed" signal to not get emitted twice in some cases.
Also fix a bunch of issues reported by Jonathan.
2004-07-04 12:43:26 +00:00
|
|
|
|
|
|
|
if (item->index != i)
|
2005-05-02 20:28:37 +00:00
|
|
|
g_error ("List item does not match its index: "
|
|
|
|
"item index %d and list index %d\n", item->index, i);
|
Fix the "selection_changed" signal to not get emitted twice in some cases.
2004-07-04 Anders Carlsson <andersca@gnome.org>
* configure.in:
* libegg/iconlist/eggiconlist.c: (egg_icon_list_expose),
(scroll_timeout), (egg_icon_list_motion),
(egg_icon_list_button_press), (egg_icon_list_update_rubberband),
(egg_icon_list_start_rubberbanding),
(egg_icon_list_stop_rubberbanding),
(egg_icon_list_unselect_all_internal),
(egg_icon_list_real_select_all),
(egg_icon_list_adjustment_changed), (egg_icon_list_item_free),
(egg_icon_list_select_item), (verify_items),
(egg_icon_list_row_changed), (egg_icon_list_row_inserted),
(egg_icon_list_row_deleted), (egg_icon_list_rows_reordered),
(egg_icon_list_select_all_between),
(egg_icon_list_move_cursor_up_down),
(egg_icon_list_move_cursor_page_up_down),
(egg_icon_list_move_cursor_left_right),
(egg_icon_list_move_cursor_start_end), (egg_icon_list_set_model),
(egg_icon_list_get_selected_items), (egg_icon_list_select_all),
(egg_icon_list_unselect_all):
* libegg/iconlist/eggiconlist.h:
* libegg/iconlist/testiconlist.c: (foreach_selected_remove):
Fix the "selection_changed" signal to not get emitted twice in some cases.
Also fix a bunch of issues reported by Jonathan.
2004-07-04 12:43:26 +00:00
|
|
|
|
|
|
|
i++;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
Update icon list to use the tree model instead.
2004-07-02 Anders Carlsson <andersca@gnome.org>
* libegg/iconlist/eggiconlist.c: (egg_icon_list_class_init),
(egg_icon_list_init), (egg_icon_list_destroy),
(egg_icon_list_finalize), (egg_icon_list_set_property),
(egg_icon_list_get_property), (egg_icon_list_button_press),
(egg_icon_list_select_first_matching_item),
(egg_icon_list_maybe_begin_dragging_items),
(egg_icon_list_real_toggle_cursor_item),
(egg_icon_list_calculate_item_size),
(egg_icon_list_invalidate_sizes), (egg_icon_list_paint_item),
(egg_icon_list_item_new), (egg_icon_list_item_unref),
(egg_icon_list_get_item_text), (egg_icon_list_get_item_icon),
(egg_icon_list_get_item_at_pos), (egg_icon_list_get_path_at_pos),
(egg_icon_list_selected_foreach), (egg_icon_list_select_path),
(egg_icon_list_unselect_path), (egg_icon_list_path_is_selected),
(egg_icon_list_item_activated), (egg_icon_list_get_items),
(egg_icon_list_row_changed), (egg_icon_list_row_inserted),
(egg_icon_list_row_deleted), (egg_icon_list_rows_reordered),
(egg_icon_list_build_items), (egg_icon_list_set_model),
(egg_icon_list_get_model), (egg_icon_list_set_text_column),
(egg_icon_list_set_pixbuf_column):
* libegg/iconlist/eggiconlist.h:
* libegg/iconlist/testiconlist.c: (fill_model), (create_model),
(foreach_selected_print), (item_removed), (remove_selected),
(item_cb), (do_popup_menu), (main):
* libegg/util/eggmarshalers.list:
Update icon list to use the tree model instead.
2004-07-02 12:04:49 +00:00
|
|
|
static void
|
2004-07-04 15:56:55 +00:00
|
|
|
gtk_icon_view_row_changed (GtkTreeModel *model,
|
2011-01-24 02:50:39 +00:00
|
|
|
GtkTreePath *path,
|
|
|
|
GtkTreeIter *iter,
|
|
|
|
gpointer data)
|
Update icon list to use the tree model instead.
2004-07-02 Anders Carlsson <andersca@gnome.org>
* libegg/iconlist/eggiconlist.c: (egg_icon_list_class_init),
(egg_icon_list_init), (egg_icon_list_destroy),
(egg_icon_list_finalize), (egg_icon_list_set_property),
(egg_icon_list_get_property), (egg_icon_list_button_press),
(egg_icon_list_select_first_matching_item),
(egg_icon_list_maybe_begin_dragging_items),
(egg_icon_list_real_toggle_cursor_item),
(egg_icon_list_calculate_item_size),
(egg_icon_list_invalidate_sizes), (egg_icon_list_paint_item),
(egg_icon_list_item_new), (egg_icon_list_item_unref),
(egg_icon_list_get_item_text), (egg_icon_list_get_item_icon),
(egg_icon_list_get_item_at_pos), (egg_icon_list_get_path_at_pos),
(egg_icon_list_selected_foreach), (egg_icon_list_select_path),
(egg_icon_list_unselect_path), (egg_icon_list_path_is_selected),
(egg_icon_list_item_activated), (egg_icon_list_get_items),
(egg_icon_list_row_changed), (egg_icon_list_row_inserted),
(egg_icon_list_row_deleted), (egg_icon_list_rows_reordered),
(egg_icon_list_build_items), (egg_icon_list_set_model),
(egg_icon_list_get_model), (egg_icon_list_set_text_column),
(egg_icon_list_set_pixbuf_column):
* libegg/iconlist/eggiconlist.h:
* libegg/iconlist/testiconlist.c: (fill_model), (create_model),
(foreach_selected_print), (item_removed), (remove_selected),
(item_cb), (do_popup_menu), (main):
* libegg/util/eggmarshalers.list:
Update icon list to use the tree model instead.
2004-07-02 12:04:49 +00:00
|
|
|
{
|
2010-10-21 10:54:08 +00:00
|
|
|
GtkIconView *icon_view = GTK_ICON_VIEW (data);
|
Update icon list to use the tree model instead.
2004-07-02 Anders Carlsson <andersca@gnome.org>
* libegg/iconlist/eggiconlist.c: (egg_icon_list_class_init),
(egg_icon_list_init), (egg_icon_list_destroy),
(egg_icon_list_finalize), (egg_icon_list_set_property),
(egg_icon_list_get_property), (egg_icon_list_button_press),
(egg_icon_list_select_first_matching_item),
(egg_icon_list_maybe_begin_dragging_items),
(egg_icon_list_real_toggle_cursor_item),
(egg_icon_list_calculate_item_size),
(egg_icon_list_invalidate_sizes), (egg_icon_list_paint_item),
(egg_icon_list_item_new), (egg_icon_list_item_unref),
(egg_icon_list_get_item_text), (egg_icon_list_get_item_icon),
(egg_icon_list_get_item_at_pos), (egg_icon_list_get_path_at_pos),
(egg_icon_list_selected_foreach), (egg_icon_list_select_path),
(egg_icon_list_unselect_path), (egg_icon_list_path_is_selected),
(egg_icon_list_item_activated), (egg_icon_list_get_items),
(egg_icon_list_row_changed), (egg_icon_list_row_inserted),
(egg_icon_list_row_deleted), (egg_icon_list_rows_reordered),
(egg_icon_list_build_items), (egg_icon_list_set_model),
(egg_icon_list_get_model), (egg_icon_list_set_text_column),
(egg_icon_list_set_pixbuf_column):
* libegg/iconlist/eggiconlist.h:
* libegg/iconlist/testiconlist.c: (fill_model), (create_model),
(foreach_selected_print), (item_removed), (remove_selected),
(item_cb), (do_popup_menu), (main):
* libegg/util/eggmarshalers.list:
Update icon list to use the tree model instead.
2004-07-02 12:04:49 +00:00
|
|
|
|
2010-10-21 10:54:08 +00:00
|
|
|
/* ignore changes in branches */
|
|
|
|
if (gtk_tree_path_get_depth (path) > 1)
|
|
|
|
return;
|
2005-05-02 20:28:37 +00:00
|
|
|
|
2011-02-23 11:50:50 +00:00
|
|
|
/* An icon view subclass might add it's own model and populate
|
|
|
|
* things at init() time instead of waiting for the constructor()
|
|
|
|
* to be called
|
|
|
|
*/
|
|
|
|
if (icon_view->priv->cell_area)
|
|
|
|
gtk_cell_area_stop_editing (icon_view->priv->cell_area, TRUE);
|
Update icon list to use the tree model instead.
2004-07-02 Anders Carlsson <andersca@gnome.org>
* libegg/iconlist/eggiconlist.c: (egg_icon_list_class_init),
(egg_icon_list_init), (egg_icon_list_destroy),
(egg_icon_list_finalize), (egg_icon_list_set_property),
(egg_icon_list_get_property), (egg_icon_list_button_press),
(egg_icon_list_select_first_matching_item),
(egg_icon_list_maybe_begin_dragging_items),
(egg_icon_list_real_toggle_cursor_item),
(egg_icon_list_calculate_item_size),
(egg_icon_list_invalidate_sizes), (egg_icon_list_paint_item),
(egg_icon_list_item_new), (egg_icon_list_item_unref),
(egg_icon_list_get_item_text), (egg_icon_list_get_item_icon),
(egg_icon_list_get_item_at_pos), (egg_icon_list_get_path_at_pos),
(egg_icon_list_selected_foreach), (egg_icon_list_select_path),
(egg_icon_list_unselect_path), (egg_icon_list_path_is_selected),
(egg_icon_list_item_activated), (egg_icon_list_get_items),
(egg_icon_list_row_changed), (egg_icon_list_row_inserted),
(egg_icon_list_row_deleted), (egg_icon_list_rows_reordered),
(egg_icon_list_build_items), (egg_icon_list_set_model),
(egg_icon_list_get_model), (egg_icon_list_set_text_column),
(egg_icon_list_set_pixbuf_column):
* libegg/iconlist/eggiconlist.h:
* libegg/iconlist/testiconlist.c: (fill_model), (create_model),
(foreach_selected_print), (item_removed), (remove_selected),
(item_cb), (do_popup_menu), (main):
* libegg/util/eggmarshalers.list:
Update icon list to use the tree model instead.
2004-07-02 12:04:49 +00:00
|
|
|
|
2010-12-13 09:08:37 +00:00
|
|
|
/* Here we can use a "grow-only" strategy for optimization
|
2011-01-24 02:50:39 +00:00
|
|
|
* and only invalidate a single item and queue a relayout
|
|
|
|
* instead of invalidating the whole thing.
|
2010-12-13 09:08:37 +00:00
|
|
|
*
|
|
|
|
* For now GtkIconView still cant deal with huge models
|
2011-01-24 02:50:39 +00:00
|
|
|
* so just invalidate the whole thing when the model
|
2010-12-13 09:08:37 +00:00
|
|
|
* changes.
|
|
|
|
*/
|
|
|
|
gtk_icon_view_invalidate_sizes (icon_view);
|
Fix the "selection_changed" signal to not get emitted twice in some cases.
2004-07-04 Anders Carlsson <andersca@gnome.org>
* configure.in:
* libegg/iconlist/eggiconlist.c: (egg_icon_list_expose),
(scroll_timeout), (egg_icon_list_motion),
(egg_icon_list_button_press), (egg_icon_list_update_rubberband),
(egg_icon_list_start_rubberbanding),
(egg_icon_list_stop_rubberbanding),
(egg_icon_list_unselect_all_internal),
(egg_icon_list_real_select_all),
(egg_icon_list_adjustment_changed), (egg_icon_list_item_free),
(egg_icon_list_select_item), (verify_items),
(egg_icon_list_row_changed), (egg_icon_list_row_inserted),
(egg_icon_list_row_deleted), (egg_icon_list_rows_reordered),
(egg_icon_list_select_all_between),
(egg_icon_list_move_cursor_up_down),
(egg_icon_list_move_cursor_page_up_down),
(egg_icon_list_move_cursor_left_right),
(egg_icon_list_move_cursor_start_end), (egg_icon_list_set_model),
(egg_icon_list_get_selected_items), (egg_icon_list_select_all),
(egg_icon_list_unselect_all):
* libegg/iconlist/eggiconlist.h:
* libegg/iconlist/testiconlist.c: (foreach_selected_remove):
Fix the "selection_changed" signal to not get emitted twice in some cases.
Also fix a bunch of issues reported by Jonathan.
2004-07-04 12:43:26 +00:00
|
|
|
|
2004-07-04 15:56:55 +00:00
|
|
|
verify_items (icon_view);
|
2002-04-30 17:08:52 +00:00
|
|
|
}
|
|
|
|
|
Update icon list to use the tree model instead.
2004-07-02 Anders Carlsson <andersca@gnome.org>
* libegg/iconlist/eggiconlist.c: (egg_icon_list_class_init),
(egg_icon_list_init), (egg_icon_list_destroy),
(egg_icon_list_finalize), (egg_icon_list_set_property),
(egg_icon_list_get_property), (egg_icon_list_button_press),
(egg_icon_list_select_first_matching_item),
(egg_icon_list_maybe_begin_dragging_items),
(egg_icon_list_real_toggle_cursor_item),
(egg_icon_list_calculate_item_size),
(egg_icon_list_invalidate_sizes), (egg_icon_list_paint_item),
(egg_icon_list_item_new), (egg_icon_list_item_unref),
(egg_icon_list_get_item_text), (egg_icon_list_get_item_icon),
(egg_icon_list_get_item_at_pos), (egg_icon_list_get_path_at_pos),
(egg_icon_list_selected_foreach), (egg_icon_list_select_path),
(egg_icon_list_unselect_path), (egg_icon_list_path_is_selected),
(egg_icon_list_item_activated), (egg_icon_list_get_items),
(egg_icon_list_row_changed), (egg_icon_list_row_inserted),
(egg_icon_list_row_deleted), (egg_icon_list_rows_reordered),
(egg_icon_list_build_items), (egg_icon_list_set_model),
(egg_icon_list_get_model), (egg_icon_list_set_text_column),
(egg_icon_list_set_pixbuf_column):
* libegg/iconlist/eggiconlist.h:
* libegg/iconlist/testiconlist.c: (fill_model), (create_model),
(foreach_selected_print), (item_removed), (remove_selected),
(item_cb), (do_popup_menu), (main):
* libegg/util/eggmarshalers.list:
Update icon list to use the tree model instead.
2004-07-02 12:04:49 +00:00
|
|
|
static void
|
2004-07-04 15:56:55 +00:00
|
|
|
gtk_icon_view_row_inserted (GtkTreeModel *model,
|
Update icon list to use the tree model instead.
2004-07-02 Anders Carlsson <andersca@gnome.org>
* libegg/iconlist/eggiconlist.c: (egg_icon_list_class_init),
(egg_icon_list_init), (egg_icon_list_destroy),
(egg_icon_list_finalize), (egg_icon_list_set_property),
(egg_icon_list_get_property), (egg_icon_list_button_press),
(egg_icon_list_select_first_matching_item),
(egg_icon_list_maybe_begin_dragging_items),
(egg_icon_list_real_toggle_cursor_item),
(egg_icon_list_calculate_item_size),
(egg_icon_list_invalidate_sizes), (egg_icon_list_paint_item),
(egg_icon_list_item_new), (egg_icon_list_item_unref),
(egg_icon_list_get_item_text), (egg_icon_list_get_item_icon),
(egg_icon_list_get_item_at_pos), (egg_icon_list_get_path_at_pos),
(egg_icon_list_selected_foreach), (egg_icon_list_select_path),
(egg_icon_list_unselect_path), (egg_icon_list_path_is_selected),
(egg_icon_list_item_activated), (egg_icon_list_get_items),
(egg_icon_list_row_changed), (egg_icon_list_row_inserted),
(egg_icon_list_row_deleted), (egg_icon_list_rows_reordered),
(egg_icon_list_build_items), (egg_icon_list_set_model),
(egg_icon_list_get_model), (egg_icon_list_set_text_column),
(egg_icon_list_set_pixbuf_column):
* libegg/iconlist/eggiconlist.h:
* libegg/iconlist/testiconlist.c: (fill_model), (create_model),
(foreach_selected_print), (item_removed), (remove_selected),
(item_cb), (do_popup_menu), (main):
* libegg/util/eggmarshalers.list:
Update icon list to use the tree model instead.
2004-07-02 12:04:49 +00:00
|
|
|
GtkTreePath *path,
|
|
|
|
GtkTreeIter *iter,
|
|
|
|
gpointer data)
|
2002-04-30 17:08:52 +00:00
|
|
|
{
|
2010-10-21 10:54:08 +00:00
|
|
|
GtkIconView *icon_view = GTK_ICON_VIEW (data);
|
2005-09-13 19:57:42 +00:00
|
|
|
gint index;
|
2004-07-04 15:56:55 +00:00
|
|
|
GtkIconViewItem *item;
|
Update icon list to use the tree model instead.
2004-07-02 Anders Carlsson <andersca@gnome.org>
* libegg/iconlist/eggiconlist.c: (egg_icon_list_class_init),
(egg_icon_list_init), (egg_icon_list_destroy),
(egg_icon_list_finalize), (egg_icon_list_set_property),
(egg_icon_list_get_property), (egg_icon_list_button_press),
(egg_icon_list_select_first_matching_item),
(egg_icon_list_maybe_begin_dragging_items),
(egg_icon_list_real_toggle_cursor_item),
(egg_icon_list_calculate_item_size),
(egg_icon_list_invalidate_sizes), (egg_icon_list_paint_item),
(egg_icon_list_item_new), (egg_icon_list_item_unref),
(egg_icon_list_get_item_text), (egg_icon_list_get_item_icon),
(egg_icon_list_get_item_at_pos), (egg_icon_list_get_path_at_pos),
(egg_icon_list_selected_foreach), (egg_icon_list_select_path),
(egg_icon_list_unselect_path), (egg_icon_list_path_is_selected),
(egg_icon_list_item_activated), (egg_icon_list_get_items),
(egg_icon_list_row_changed), (egg_icon_list_row_inserted),
(egg_icon_list_row_deleted), (egg_icon_list_rows_reordered),
(egg_icon_list_build_items), (egg_icon_list_set_model),
(egg_icon_list_get_model), (egg_icon_list_set_text_column),
(egg_icon_list_set_pixbuf_column):
* libegg/iconlist/eggiconlist.h:
* libegg/iconlist/testiconlist.c: (fill_model), (create_model),
(foreach_selected_print), (item_removed), (remove_selected),
(item_cb), (do_popup_menu), (main):
* libegg/util/eggmarshalers.list:
Update icon list to use the tree model instead.
2004-07-02 12:04:49 +00:00
|
|
|
gboolean iters_persist;
|
Fix the "selection_changed" signal to not get emitted twice in some cases.
2004-07-04 Anders Carlsson <andersca@gnome.org>
* configure.in:
* libegg/iconlist/eggiconlist.c: (egg_icon_list_expose),
(scroll_timeout), (egg_icon_list_motion),
(egg_icon_list_button_press), (egg_icon_list_update_rubberband),
(egg_icon_list_start_rubberbanding),
(egg_icon_list_stop_rubberbanding),
(egg_icon_list_unselect_all_internal),
(egg_icon_list_real_select_all),
(egg_icon_list_adjustment_changed), (egg_icon_list_item_free),
(egg_icon_list_select_item), (verify_items),
(egg_icon_list_row_changed), (egg_icon_list_row_inserted),
(egg_icon_list_row_deleted), (egg_icon_list_rows_reordered),
(egg_icon_list_select_all_between),
(egg_icon_list_move_cursor_up_down),
(egg_icon_list_move_cursor_page_up_down),
(egg_icon_list_move_cursor_left_right),
(egg_icon_list_move_cursor_start_end), (egg_icon_list_set_model),
(egg_icon_list_get_selected_items), (egg_icon_list_select_all),
(egg_icon_list_unselect_all):
* libegg/iconlist/eggiconlist.h:
* libegg/iconlist/testiconlist.c: (foreach_selected_remove):
Fix the "selection_changed" signal to not get emitted twice in some cases.
Also fix a bunch of issues reported by Jonathan.
2004-07-04 12:43:26 +00:00
|
|
|
GList *list;
|
2010-10-21 10:54:08 +00:00
|
|
|
|
|
|
|
/* ignore changes in branches */
|
|
|
|
if (gtk_tree_path_get_depth (path) > 1)
|
|
|
|
return;
|
2005-05-02 20:28:37 +00:00
|
|
|
|
2004-07-04 15:56:55 +00:00
|
|
|
iters_persist = gtk_tree_model_get_flags (icon_view->priv->model) & GTK_TREE_MODEL_ITERS_PERSIST;
|
Update icon list to use the tree model instead.
2004-07-02 Anders Carlsson <andersca@gnome.org>
* libegg/iconlist/eggiconlist.c: (egg_icon_list_class_init),
(egg_icon_list_init), (egg_icon_list_destroy),
(egg_icon_list_finalize), (egg_icon_list_set_property),
(egg_icon_list_get_property), (egg_icon_list_button_press),
(egg_icon_list_select_first_matching_item),
(egg_icon_list_maybe_begin_dragging_items),
(egg_icon_list_real_toggle_cursor_item),
(egg_icon_list_calculate_item_size),
(egg_icon_list_invalidate_sizes), (egg_icon_list_paint_item),
(egg_icon_list_item_new), (egg_icon_list_item_unref),
(egg_icon_list_get_item_text), (egg_icon_list_get_item_icon),
(egg_icon_list_get_item_at_pos), (egg_icon_list_get_path_at_pos),
(egg_icon_list_selected_foreach), (egg_icon_list_select_path),
(egg_icon_list_unselect_path), (egg_icon_list_path_is_selected),
(egg_icon_list_item_activated), (egg_icon_list_get_items),
(egg_icon_list_row_changed), (egg_icon_list_row_inserted),
(egg_icon_list_row_deleted), (egg_icon_list_rows_reordered),
(egg_icon_list_build_items), (egg_icon_list_set_model),
(egg_icon_list_get_model), (egg_icon_list_set_text_column),
(egg_icon_list_set_pixbuf_column):
* libegg/iconlist/eggiconlist.h:
* libegg/iconlist/testiconlist.c: (fill_model), (create_model),
(foreach_selected_print), (item_removed), (remove_selected),
(item_cb), (do_popup_menu), (main):
* libegg/util/eggmarshalers.list:
Update icon list to use the tree model instead.
2004-07-02 12:04:49 +00:00
|
|
|
|
2010-06-28 18:15:10 +00:00
|
|
|
index = gtk_tree_path_get_indices(path)[0];
|
Update icon list to use the tree model instead.
2004-07-02 Anders Carlsson <andersca@gnome.org>
* libegg/iconlist/eggiconlist.c: (egg_icon_list_class_init),
(egg_icon_list_init), (egg_icon_list_destroy),
(egg_icon_list_finalize), (egg_icon_list_set_property),
(egg_icon_list_get_property), (egg_icon_list_button_press),
(egg_icon_list_select_first_matching_item),
(egg_icon_list_maybe_begin_dragging_items),
(egg_icon_list_real_toggle_cursor_item),
(egg_icon_list_calculate_item_size),
(egg_icon_list_invalidate_sizes), (egg_icon_list_paint_item),
(egg_icon_list_item_new), (egg_icon_list_item_unref),
(egg_icon_list_get_item_text), (egg_icon_list_get_item_icon),
(egg_icon_list_get_item_at_pos), (egg_icon_list_get_path_at_pos),
(egg_icon_list_selected_foreach), (egg_icon_list_select_path),
(egg_icon_list_unselect_path), (egg_icon_list_path_is_selected),
(egg_icon_list_item_activated), (egg_icon_list_get_items),
(egg_icon_list_row_changed), (egg_icon_list_row_inserted),
(egg_icon_list_row_deleted), (egg_icon_list_rows_reordered),
(egg_icon_list_build_items), (egg_icon_list_set_model),
(egg_icon_list_get_model), (egg_icon_list_set_text_column),
(egg_icon_list_set_pixbuf_column):
* libegg/iconlist/eggiconlist.h:
* libegg/iconlist/testiconlist.c: (fill_model), (create_model),
(foreach_selected_print), (item_removed), (remove_selected),
(item_cb), (do_popup_menu), (main):
* libegg/util/eggmarshalers.list:
Update icon list to use the tree model instead.
2004-07-02 12:04:49 +00:00
|
|
|
|
2004-07-04 15:56:55 +00:00
|
|
|
item = gtk_icon_view_item_new ();
|
Update icon list to use the tree model instead.
2004-07-02 Anders Carlsson <andersca@gnome.org>
* libegg/iconlist/eggiconlist.c: (egg_icon_list_class_init),
(egg_icon_list_init), (egg_icon_list_destroy),
(egg_icon_list_finalize), (egg_icon_list_set_property),
(egg_icon_list_get_property), (egg_icon_list_button_press),
(egg_icon_list_select_first_matching_item),
(egg_icon_list_maybe_begin_dragging_items),
(egg_icon_list_real_toggle_cursor_item),
(egg_icon_list_calculate_item_size),
(egg_icon_list_invalidate_sizes), (egg_icon_list_paint_item),
(egg_icon_list_item_new), (egg_icon_list_item_unref),
(egg_icon_list_get_item_text), (egg_icon_list_get_item_icon),
(egg_icon_list_get_item_at_pos), (egg_icon_list_get_path_at_pos),
(egg_icon_list_selected_foreach), (egg_icon_list_select_path),
(egg_icon_list_unselect_path), (egg_icon_list_path_is_selected),
(egg_icon_list_item_activated), (egg_icon_list_get_items),
(egg_icon_list_row_changed), (egg_icon_list_row_inserted),
(egg_icon_list_row_deleted), (egg_icon_list_rows_reordered),
(egg_icon_list_build_items), (egg_icon_list_set_model),
(egg_icon_list_get_model), (egg_icon_list_set_text_column),
(egg_icon_list_set_pixbuf_column):
* libegg/iconlist/eggiconlist.h:
* libegg/iconlist/testiconlist.c: (fill_model), (create_model),
(foreach_selected_print), (item_removed), (remove_selected),
(item_cb), (do_popup_menu), (main):
* libegg/util/eggmarshalers.list:
Update icon list to use the tree model instead.
2004-07-02 12:04:49 +00:00
|
|
|
|
|
|
|
if (iters_persist)
|
|
|
|
item->iter = *iter;
|
|
|
|
|
|
|
|
item->index = index;
|
|
|
|
|
|
|
|
/* FIXME: We can be more efficient here,
|
|
|
|
we can store a tail pointer and use that when
|
|
|
|
appending (which is a rather common operation)
|
|
|
|
*/
|
2004-07-04 15:56:55 +00:00
|
|
|
icon_view->priv->items = g_list_insert (icon_view->priv->items,
|
Update icon list to use the tree model instead.
2004-07-02 Anders Carlsson <andersca@gnome.org>
* libegg/iconlist/eggiconlist.c: (egg_icon_list_class_init),
(egg_icon_list_init), (egg_icon_list_destroy),
(egg_icon_list_finalize), (egg_icon_list_set_property),
(egg_icon_list_get_property), (egg_icon_list_button_press),
(egg_icon_list_select_first_matching_item),
(egg_icon_list_maybe_begin_dragging_items),
(egg_icon_list_real_toggle_cursor_item),
(egg_icon_list_calculate_item_size),
(egg_icon_list_invalidate_sizes), (egg_icon_list_paint_item),
(egg_icon_list_item_new), (egg_icon_list_item_unref),
(egg_icon_list_get_item_text), (egg_icon_list_get_item_icon),
(egg_icon_list_get_item_at_pos), (egg_icon_list_get_path_at_pos),
(egg_icon_list_selected_foreach), (egg_icon_list_select_path),
(egg_icon_list_unselect_path), (egg_icon_list_path_is_selected),
(egg_icon_list_item_activated), (egg_icon_list_get_items),
(egg_icon_list_row_changed), (egg_icon_list_row_inserted),
(egg_icon_list_row_deleted), (egg_icon_list_rows_reordered),
(egg_icon_list_build_items), (egg_icon_list_set_model),
(egg_icon_list_get_model), (egg_icon_list_set_text_column),
(egg_icon_list_set_pixbuf_column):
* libegg/iconlist/eggiconlist.h:
* libegg/iconlist/testiconlist.c: (fill_model), (create_model),
(foreach_selected_print), (item_removed), (remove_selected),
(item_cb), (do_popup_menu), (main):
* libegg/util/eggmarshalers.list:
Update icon list to use the tree model instead.
2004-07-02 12:04:49 +00:00
|
|
|
item, index);
|
2002-04-30 17:08:52 +00:00
|
|
|
|
2004-07-04 15:56:55 +00:00
|
|
|
list = g_list_nth (icon_view->priv->items, index + 1);
|
Fix the "selection_changed" signal to not get emitted twice in some cases.
2004-07-04 Anders Carlsson <andersca@gnome.org>
* configure.in:
* libegg/iconlist/eggiconlist.c: (egg_icon_list_expose),
(scroll_timeout), (egg_icon_list_motion),
(egg_icon_list_button_press), (egg_icon_list_update_rubberband),
(egg_icon_list_start_rubberbanding),
(egg_icon_list_stop_rubberbanding),
(egg_icon_list_unselect_all_internal),
(egg_icon_list_real_select_all),
(egg_icon_list_adjustment_changed), (egg_icon_list_item_free),
(egg_icon_list_select_item), (verify_items),
(egg_icon_list_row_changed), (egg_icon_list_row_inserted),
(egg_icon_list_row_deleted), (egg_icon_list_rows_reordered),
(egg_icon_list_select_all_between),
(egg_icon_list_move_cursor_up_down),
(egg_icon_list_move_cursor_page_up_down),
(egg_icon_list_move_cursor_left_right),
(egg_icon_list_move_cursor_start_end), (egg_icon_list_set_model),
(egg_icon_list_get_selected_items), (egg_icon_list_select_all),
(egg_icon_list_unselect_all):
* libegg/iconlist/eggiconlist.h:
* libegg/iconlist/testiconlist.c: (foreach_selected_remove):
Fix the "selection_changed" signal to not get emitted twice in some cases.
Also fix a bunch of issues reported by Jonathan.
2004-07-04 12:43:26 +00:00
|
|
|
for (; list; list = list->next)
|
|
|
|
{
|
|
|
|
item = list->data;
|
|
|
|
|
|
|
|
item->index++;
|
|
|
|
}
|
|
|
|
|
2004-07-04 15:56:55 +00:00
|
|
|
verify_items (icon_view);
|
2006-03-02 19:52:26 +00:00
|
|
|
|
|
|
|
gtk_icon_view_queue_layout (icon_view);
|
2002-04-30 17:08:52 +00:00
|
|
|
}
|
|
|
|
|
Update icon list to use the tree model instead.
2004-07-02 Anders Carlsson <andersca@gnome.org>
* libegg/iconlist/eggiconlist.c: (egg_icon_list_class_init),
(egg_icon_list_init), (egg_icon_list_destroy),
(egg_icon_list_finalize), (egg_icon_list_set_property),
(egg_icon_list_get_property), (egg_icon_list_button_press),
(egg_icon_list_select_first_matching_item),
(egg_icon_list_maybe_begin_dragging_items),
(egg_icon_list_real_toggle_cursor_item),
(egg_icon_list_calculate_item_size),
(egg_icon_list_invalidate_sizes), (egg_icon_list_paint_item),
(egg_icon_list_item_new), (egg_icon_list_item_unref),
(egg_icon_list_get_item_text), (egg_icon_list_get_item_icon),
(egg_icon_list_get_item_at_pos), (egg_icon_list_get_path_at_pos),
(egg_icon_list_selected_foreach), (egg_icon_list_select_path),
(egg_icon_list_unselect_path), (egg_icon_list_path_is_selected),
(egg_icon_list_item_activated), (egg_icon_list_get_items),
(egg_icon_list_row_changed), (egg_icon_list_row_inserted),
(egg_icon_list_row_deleted), (egg_icon_list_rows_reordered),
(egg_icon_list_build_items), (egg_icon_list_set_model),
(egg_icon_list_get_model), (egg_icon_list_set_text_column),
(egg_icon_list_set_pixbuf_column):
* libegg/iconlist/eggiconlist.h:
* libegg/iconlist/testiconlist.c: (fill_model), (create_model),
(foreach_selected_print), (item_removed), (remove_selected),
(item_cb), (do_popup_menu), (main):
* libegg/util/eggmarshalers.list:
Update icon list to use the tree model instead.
2004-07-02 12:04:49 +00:00
|
|
|
static void
|
2004-07-04 15:56:55 +00:00
|
|
|
gtk_icon_view_row_deleted (GtkTreeModel *model,
|
Update icon list to use the tree model instead.
2004-07-02 Anders Carlsson <andersca@gnome.org>
* libegg/iconlist/eggiconlist.c: (egg_icon_list_class_init),
(egg_icon_list_init), (egg_icon_list_destroy),
(egg_icon_list_finalize), (egg_icon_list_set_property),
(egg_icon_list_get_property), (egg_icon_list_button_press),
(egg_icon_list_select_first_matching_item),
(egg_icon_list_maybe_begin_dragging_items),
(egg_icon_list_real_toggle_cursor_item),
(egg_icon_list_calculate_item_size),
(egg_icon_list_invalidate_sizes), (egg_icon_list_paint_item),
(egg_icon_list_item_new), (egg_icon_list_item_unref),
(egg_icon_list_get_item_text), (egg_icon_list_get_item_icon),
(egg_icon_list_get_item_at_pos), (egg_icon_list_get_path_at_pos),
(egg_icon_list_selected_foreach), (egg_icon_list_select_path),
(egg_icon_list_unselect_path), (egg_icon_list_path_is_selected),
(egg_icon_list_item_activated), (egg_icon_list_get_items),
(egg_icon_list_row_changed), (egg_icon_list_row_inserted),
(egg_icon_list_row_deleted), (egg_icon_list_rows_reordered),
(egg_icon_list_build_items), (egg_icon_list_set_model),
(egg_icon_list_get_model), (egg_icon_list_set_text_column),
(egg_icon_list_set_pixbuf_column):
* libegg/iconlist/eggiconlist.h:
* libegg/iconlist/testiconlist.c: (fill_model), (create_model),
(foreach_selected_print), (item_removed), (remove_selected),
(item_cb), (do_popup_menu), (main):
* libegg/util/eggmarshalers.list:
Update icon list to use the tree model instead.
2004-07-02 12:04:49 +00:00
|
|
|
GtkTreePath *path,
|
|
|
|
gpointer data)
|
2002-04-30 17:08:52 +00:00
|
|
|
{
|
2010-10-21 10:54:08 +00:00
|
|
|
GtkIconView *icon_view = GTK_ICON_VIEW (data);
|
Update icon list to use the tree model instead.
2004-07-02 Anders Carlsson <andersca@gnome.org>
* libegg/iconlist/eggiconlist.c: (egg_icon_list_class_init),
(egg_icon_list_init), (egg_icon_list_destroy),
(egg_icon_list_finalize), (egg_icon_list_set_property),
(egg_icon_list_get_property), (egg_icon_list_button_press),
(egg_icon_list_select_first_matching_item),
(egg_icon_list_maybe_begin_dragging_items),
(egg_icon_list_real_toggle_cursor_item),
(egg_icon_list_calculate_item_size),
(egg_icon_list_invalidate_sizes), (egg_icon_list_paint_item),
(egg_icon_list_item_new), (egg_icon_list_item_unref),
(egg_icon_list_get_item_text), (egg_icon_list_get_item_icon),
(egg_icon_list_get_item_at_pos), (egg_icon_list_get_path_at_pos),
(egg_icon_list_selected_foreach), (egg_icon_list_select_path),
(egg_icon_list_unselect_path), (egg_icon_list_path_is_selected),
(egg_icon_list_item_activated), (egg_icon_list_get_items),
(egg_icon_list_row_changed), (egg_icon_list_row_inserted),
(egg_icon_list_row_deleted), (egg_icon_list_rows_reordered),
(egg_icon_list_build_items), (egg_icon_list_set_model),
(egg_icon_list_get_model), (egg_icon_list_set_text_column),
(egg_icon_list_set_pixbuf_column):
* libegg/iconlist/eggiconlist.h:
* libegg/iconlist/testiconlist.c: (fill_model), (create_model),
(foreach_selected_print), (item_removed), (remove_selected),
(item_cb), (do_popup_menu), (main):
* libegg/util/eggmarshalers.list:
Update icon list to use the tree model instead.
2004-07-02 12:04:49 +00:00
|
|
|
gint index;
|
2004-07-04 15:56:55 +00:00
|
|
|
GtkIconViewItem *item;
|
Fix the "selection_changed" signal to not get emitted twice in some cases.
2004-07-04 Anders Carlsson <andersca@gnome.org>
* configure.in:
* libegg/iconlist/eggiconlist.c: (egg_icon_list_expose),
(scroll_timeout), (egg_icon_list_motion),
(egg_icon_list_button_press), (egg_icon_list_update_rubberband),
(egg_icon_list_start_rubberbanding),
(egg_icon_list_stop_rubberbanding),
(egg_icon_list_unselect_all_internal),
(egg_icon_list_real_select_all),
(egg_icon_list_adjustment_changed), (egg_icon_list_item_free),
(egg_icon_list_select_item), (verify_items),
(egg_icon_list_row_changed), (egg_icon_list_row_inserted),
(egg_icon_list_row_deleted), (egg_icon_list_rows_reordered),
(egg_icon_list_select_all_between),
(egg_icon_list_move_cursor_up_down),
(egg_icon_list_move_cursor_page_up_down),
(egg_icon_list_move_cursor_left_right),
(egg_icon_list_move_cursor_start_end), (egg_icon_list_set_model),
(egg_icon_list_get_selected_items), (egg_icon_list_select_all),
(egg_icon_list_unselect_all):
* libegg/iconlist/eggiconlist.h:
* libegg/iconlist/testiconlist.c: (foreach_selected_remove):
Fix the "selection_changed" signal to not get emitted twice in some cases.
Also fix a bunch of issues reported by Jonathan.
2004-07-04 12:43:26 +00:00
|
|
|
GList *list, *next;
|
2004-07-03 20:36:01 +00:00
|
|
|
gboolean emit = FALSE;
|
2010-10-21 10:54:08 +00:00
|
|
|
|
|
|
|
/* ignore changes in branches */
|
|
|
|
if (gtk_tree_path_get_depth (path) > 1)
|
|
|
|
return;
|
Update icon list to use the tree model instead.
2004-07-02 Anders Carlsson <andersca@gnome.org>
* libegg/iconlist/eggiconlist.c: (egg_icon_list_class_init),
(egg_icon_list_init), (egg_icon_list_destroy),
(egg_icon_list_finalize), (egg_icon_list_set_property),
(egg_icon_list_get_property), (egg_icon_list_button_press),
(egg_icon_list_select_first_matching_item),
(egg_icon_list_maybe_begin_dragging_items),
(egg_icon_list_real_toggle_cursor_item),
(egg_icon_list_calculate_item_size),
(egg_icon_list_invalidate_sizes), (egg_icon_list_paint_item),
(egg_icon_list_item_new), (egg_icon_list_item_unref),
(egg_icon_list_get_item_text), (egg_icon_list_get_item_icon),
(egg_icon_list_get_item_at_pos), (egg_icon_list_get_path_at_pos),
(egg_icon_list_selected_foreach), (egg_icon_list_select_path),
(egg_icon_list_unselect_path), (egg_icon_list_path_is_selected),
(egg_icon_list_item_activated), (egg_icon_list_get_items),
(egg_icon_list_row_changed), (egg_icon_list_row_inserted),
(egg_icon_list_row_deleted), (egg_icon_list_rows_reordered),
(egg_icon_list_build_items), (egg_icon_list_set_model),
(egg_icon_list_get_model), (egg_icon_list_set_text_column),
(egg_icon_list_set_pixbuf_column):
* libegg/iconlist/eggiconlist.h:
* libegg/iconlist/testiconlist.c: (fill_model), (create_model),
(foreach_selected_print), (item_removed), (remove_selected),
(item_cb), (do_popup_menu), (main):
* libegg/util/eggmarshalers.list:
Update icon list to use the tree model instead.
2004-07-02 12:04:49 +00:00
|
|
|
|
2010-06-28 18:15:10 +00:00
|
|
|
index = gtk_tree_path_get_indices(path)[0];
|
Update icon list to use the tree model instead.
2004-07-02 Anders Carlsson <andersca@gnome.org>
* libegg/iconlist/eggiconlist.c: (egg_icon_list_class_init),
(egg_icon_list_init), (egg_icon_list_destroy),
(egg_icon_list_finalize), (egg_icon_list_set_property),
(egg_icon_list_get_property), (egg_icon_list_button_press),
(egg_icon_list_select_first_matching_item),
(egg_icon_list_maybe_begin_dragging_items),
(egg_icon_list_real_toggle_cursor_item),
(egg_icon_list_calculate_item_size),
(egg_icon_list_invalidate_sizes), (egg_icon_list_paint_item),
(egg_icon_list_item_new), (egg_icon_list_item_unref),
(egg_icon_list_get_item_text), (egg_icon_list_get_item_icon),
(egg_icon_list_get_item_at_pos), (egg_icon_list_get_path_at_pos),
(egg_icon_list_selected_foreach), (egg_icon_list_select_path),
(egg_icon_list_unselect_path), (egg_icon_list_path_is_selected),
(egg_icon_list_item_activated), (egg_icon_list_get_items),
(egg_icon_list_row_changed), (egg_icon_list_row_inserted),
(egg_icon_list_row_deleted), (egg_icon_list_rows_reordered),
(egg_icon_list_build_items), (egg_icon_list_set_model),
(egg_icon_list_get_model), (egg_icon_list_set_text_column),
(egg_icon_list_set_pixbuf_column):
* libegg/iconlist/eggiconlist.h:
* libegg/iconlist/testiconlist.c: (fill_model), (create_model),
(foreach_selected_print), (item_removed), (remove_selected),
(item_cb), (do_popup_menu), (main):
* libegg/util/eggmarshalers.list:
Update icon list to use the tree model instead.
2004-07-02 12:04:49 +00:00
|
|
|
|
2004-07-04 15:56:55 +00:00
|
|
|
list = g_list_nth (icon_view->priv->items, index);
|
Update icon list to use the tree model instead.
2004-07-02 Anders Carlsson <andersca@gnome.org>
* libegg/iconlist/eggiconlist.c: (egg_icon_list_class_init),
(egg_icon_list_init), (egg_icon_list_destroy),
(egg_icon_list_finalize), (egg_icon_list_set_property),
(egg_icon_list_get_property), (egg_icon_list_button_press),
(egg_icon_list_select_first_matching_item),
(egg_icon_list_maybe_begin_dragging_items),
(egg_icon_list_real_toggle_cursor_item),
(egg_icon_list_calculate_item_size),
(egg_icon_list_invalidate_sizes), (egg_icon_list_paint_item),
(egg_icon_list_item_new), (egg_icon_list_item_unref),
(egg_icon_list_get_item_text), (egg_icon_list_get_item_icon),
(egg_icon_list_get_item_at_pos), (egg_icon_list_get_path_at_pos),
(egg_icon_list_selected_foreach), (egg_icon_list_select_path),
(egg_icon_list_unselect_path), (egg_icon_list_path_is_selected),
(egg_icon_list_item_activated), (egg_icon_list_get_items),
(egg_icon_list_row_changed), (egg_icon_list_row_inserted),
(egg_icon_list_row_deleted), (egg_icon_list_rows_reordered),
(egg_icon_list_build_items), (egg_icon_list_set_model),
(egg_icon_list_get_model), (egg_icon_list_set_text_column),
(egg_icon_list_set_pixbuf_column):
* libegg/iconlist/eggiconlist.h:
* libegg/iconlist/testiconlist.c: (fill_model), (create_model),
(foreach_selected_print), (item_removed), (remove_selected),
(item_cb), (do_popup_menu), (main):
* libegg/util/eggmarshalers.list:
Update icon list to use the tree model instead.
2004-07-02 12:04:49 +00:00
|
|
|
item = list->data;
|
2004-07-03 20:36:01 +00:00
|
|
|
|
2011-02-25 07:00:20 +00:00
|
|
|
if (icon_view->priv->cell_area)
|
|
|
|
gtk_cell_area_stop_editing (icon_view->priv->cell_area, TRUE);
|
2005-05-02 20:28:37 +00:00
|
|
|
|
2004-07-04 15:56:55 +00:00
|
|
|
if (item == icon_view->priv->anchor_item)
|
|
|
|
icon_view->priv->anchor_item = NULL;
|
2004-07-03 20:36:01 +00:00
|
|
|
|
2004-07-04 15:56:55 +00:00
|
|
|
if (item == icon_view->priv->cursor_item)
|
|
|
|
icon_view->priv->cursor_item = NULL;
|
2004-07-03 20:36:01 +00:00
|
|
|
|
|
|
|
if (item->selected)
|
|
|
|
emit = TRUE;
|
|
|
|
|
2004-07-04 15:56:55 +00:00
|
|
|
gtk_icon_view_item_free (item);
|
2004-07-03 20:36:01 +00:00
|
|
|
|
Fix the "selection_changed" signal to not get emitted twice in some cases.
2004-07-04 Anders Carlsson <andersca@gnome.org>
* configure.in:
* libegg/iconlist/eggiconlist.c: (egg_icon_list_expose),
(scroll_timeout), (egg_icon_list_motion),
(egg_icon_list_button_press), (egg_icon_list_update_rubberband),
(egg_icon_list_start_rubberbanding),
(egg_icon_list_stop_rubberbanding),
(egg_icon_list_unselect_all_internal),
(egg_icon_list_real_select_all),
(egg_icon_list_adjustment_changed), (egg_icon_list_item_free),
(egg_icon_list_select_item), (verify_items),
(egg_icon_list_row_changed), (egg_icon_list_row_inserted),
(egg_icon_list_row_deleted), (egg_icon_list_rows_reordered),
(egg_icon_list_select_all_between),
(egg_icon_list_move_cursor_up_down),
(egg_icon_list_move_cursor_page_up_down),
(egg_icon_list_move_cursor_left_right),
(egg_icon_list_move_cursor_start_end), (egg_icon_list_set_model),
(egg_icon_list_get_selected_items), (egg_icon_list_select_all),
(egg_icon_list_unselect_all):
* libegg/iconlist/eggiconlist.h:
* libegg/iconlist/testiconlist.c: (foreach_selected_remove):
Fix the "selection_changed" signal to not get emitted twice in some cases.
Also fix a bunch of issues reported by Jonathan.
2004-07-04 12:43:26 +00:00
|
|
|
for (next = list->next; next; next = next->next)
|
|
|
|
{
|
|
|
|
item = next->data;
|
|
|
|
|
|
|
|
item->index--;
|
|
|
|
}
|
|
|
|
|
2004-07-04 15:56:55 +00:00
|
|
|
icon_view->priv->items = g_list_delete_link (icon_view->priv->items, list);
|
Update icon list to use the tree model instead.
2004-07-02 Anders Carlsson <andersca@gnome.org>
* libegg/iconlist/eggiconlist.c: (egg_icon_list_class_init),
(egg_icon_list_init), (egg_icon_list_destroy),
(egg_icon_list_finalize), (egg_icon_list_set_property),
(egg_icon_list_get_property), (egg_icon_list_button_press),
(egg_icon_list_select_first_matching_item),
(egg_icon_list_maybe_begin_dragging_items),
(egg_icon_list_real_toggle_cursor_item),
(egg_icon_list_calculate_item_size),
(egg_icon_list_invalidate_sizes), (egg_icon_list_paint_item),
(egg_icon_list_item_new), (egg_icon_list_item_unref),
(egg_icon_list_get_item_text), (egg_icon_list_get_item_icon),
(egg_icon_list_get_item_at_pos), (egg_icon_list_get_path_at_pos),
(egg_icon_list_selected_foreach), (egg_icon_list_select_path),
(egg_icon_list_unselect_path), (egg_icon_list_path_is_selected),
(egg_icon_list_item_activated), (egg_icon_list_get_items),
(egg_icon_list_row_changed), (egg_icon_list_row_inserted),
(egg_icon_list_row_deleted), (egg_icon_list_rows_reordered),
(egg_icon_list_build_items), (egg_icon_list_set_model),
(egg_icon_list_get_model), (egg_icon_list_set_text_column),
(egg_icon_list_set_pixbuf_column):
* libegg/iconlist/eggiconlist.h:
* libegg/iconlist/testiconlist.c: (fill_model), (create_model),
(foreach_selected_print), (item_removed), (remove_selected),
(item_cb), (do_popup_menu), (main):
* libegg/util/eggmarshalers.list:
Update icon list to use the tree model instead.
2004-07-02 12:04:49 +00:00
|
|
|
|
2004-07-04 15:56:55 +00:00
|
|
|
verify_items (icon_view);
|
Fix the "selection_changed" signal to not get emitted twice in some cases.
2004-07-04 Anders Carlsson <andersca@gnome.org>
* configure.in:
* libegg/iconlist/eggiconlist.c: (egg_icon_list_expose),
(scroll_timeout), (egg_icon_list_motion),
(egg_icon_list_button_press), (egg_icon_list_update_rubberband),
(egg_icon_list_start_rubberbanding),
(egg_icon_list_stop_rubberbanding),
(egg_icon_list_unselect_all_internal),
(egg_icon_list_real_select_all),
(egg_icon_list_adjustment_changed), (egg_icon_list_item_free),
(egg_icon_list_select_item), (verify_items),
(egg_icon_list_row_changed), (egg_icon_list_row_inserted),
(egg_icon_list_row_deleted), (egg_icon_list_rows_reordered),
(egg_icon_list_select_all_between),
(egg_icon_list_move_cursor_up_down),
(egg_icon_list_move_cursor_page_up_down),
(egg_icon_list_move_cursor_left_right),
(egg_icon_list_move_cursor_start_end), (egg_icon_list_set_model),
(egg_icon_list_get_selected_items), (egg_icon_list_select_all),
(egg_icon_list_unselect_all):
* libegg/iconlist/eggiconlist.h:
* libegg/iconlist/testiconlist.c: (foreach_selected_remove):
Fix the "selection_changed" signal to not get emitted twice in some cases.
Also fix a bunch of issues reported by Jonathan.
2004-07-04 12:43:26 +00:00
|
|
|
|
2006-03-02 19:52:26 +00:00
|
|
|
gtk_icon_view_queue_layout (icon_view);
|
|
|
|
|
2004-07-03 20:36:01 +00:00
|
|
|
if (emit)
|
2004-07-04 15:56:55 +00:00
|
|
|
g_signal_emit (icon_view, icon_view_signals[SELECTION_CHANGED], 0);
|
Update icon list to use the tree model instead.
2004-07-02 Anders Carlsson <andersca@gnome.org>
* libegg/iconlist/eggiconlist.c: (egg_icon_list_class_init),
(egg_icon_list_init), (egg_icon_list_destroy),
(egg_icon_list_finalize), (egg_icon_list_set_property),
(egg_icon_list_get_property), (egg_icon_list_button_press),
(egg_icon_list_select_first_matching_item),
(egg_icon_list_maybe_begin_dragging_items),
(egg_icon_list_real_toggle_cursor_item),
(egg_icon_list_calculate_item_size),
(egg_icon_list_invalidate_sizes), (egg_icon_list_paint_item),
(egg_icon_list_item_new), (egg_icon_list_item_unref),
(egg_icon_list_get_item_text), (egg_icon_list_get_item_icon),
(egg_icon_list_get_item_at_pos), (egg_icon_list_get_path_at_pos),
(egg_icon_list_selected_foreach), (egg_icon_list_select_path),
(egg_icon_list_unselect_path), (egg_icon_list_path_is_selected),
(egg_icon_list_item_activated), (egg_icon_list_get_items),
(egg_icon_list_row_changed), (egg_icon_list_row_inserted),
(egg_icon_list_row_deleted), (egg_icon_list_rows_reordered),
(egg_icon_list_build_items), (egg_icon_list_set_model),
(egg_icon_list_get_model), (egg_icon_list_set_text_column),
(egg_icon_list_set_pixbuf_column):
* libegg/iconlist/eggiconlist.h:
* libegg/iconlist/testiconlist.c: (fill_model), (create_model),
(foreach_selected_print), (item_removed), (remove_selected),
(item_cb), (do_popup_menu), (main):
* libegg/util/eggmarshalers.list:
Update icon list to use the tree model instead.
2004-07-02 12:04:49 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2004-07-04 15:56:55 +00:00
|
|
|
gtk_icon_view_rows_reordered (GtkTreeModel *model,
|
Update icon list to use the tree model instead.
2004-07-02 Anders Carlsson <andersca@gnome.org>
* libegg/iconlist/eggiconlist.c: (egg_icon_list_class_init),
(egg_icon_list_init), (egg_icon_list_destroy),
(egg_icon_list_finalize), (egg_icon_list_set_property),
(egg_icon_list_get_property), (egg_icon_list_button_press),
(egg_icon_list_select_first_matching_item),
(egg_icon_list_maybe_begin_dragging_items),
(egg_icon_list_real_toggle_cursor_item),
(egg_icon_list_calculate_item_size),
(egg_icon_list_invalidate_sizes), (egg_icon_list_paint_item),
(egg_icon_list_item_new), (egg_icon_list_item_unref),
(egg_icon_list_get_item_text), (egg_icon_list_get_item_icon),
(egg_icon_list_get_item_at_pos), (egg_icon_list_get_path_at_pos),
(egg_icon_list_selected_foreach), (egg_icon_list_select_path),
(egg_icon_list_unselect_path), (egg_icon_list_path_is_selected),
(egg_icon_list_item_activated), (egg_icon_list_get_items),
(egg_icon_list_row_changed), (egg_icon_list_row_inserted),
(egg_icon_list_row_deleted), (egg_icon_list_rows_reordered),
(egg_icon_list_build_items), (egg_icon_list_set_model),
(egg_icon_list_get_model), (egg_icon_list_set_text_column),
(egg_icon_list_set_pixbuf_column):
* libegg/iconlist/eggiconlist.h:
* libegg/iconlist/testiconlist.c: (fill_model), (create_model),
(foreach_selected_print), (item_removed), (remove_selected),
(item_cb), (do_popup_menu), (main):
* libegg/util/eggmarshalers.list:
Update icon list to use the tree model instead.
2004-07-02 12:04:49 +00:00
|
|
|
GtkTreePath *parent,
|
|
|
|
GtkTreeIter *iter,
|
|
|
|
gint *new_order,
|
|
|
|
gpointer data)
|
|
|
|
{
|
2010-10-21 10:54:08 +00:00
|
|
|
GtkIconView *icon_view = GTK_ICON_VIEW (data);
|
Update icon list to use the tree model instead.
2004-07-02 Anders Carlsson <andersca@gnome.org>
* libegg/iconlist/eggiconlist.c: (egg_icon_list_class_init),
(egg_icon_list_init), (egg_icon_list_destroy),
(egg_icon_list_finalize), (egg_icon_list_set_property),
(egg_icon_list_get_property), (egg_icon_list_button_press),
(egg_icon_list_select_first_matching_item),
(egg_icon_list_maybe_begin_dragging_items),
(egg_icon_list_real_toggle_cursor_item),
(egg_icon_list_calculate_item_size),
(egg_icon_list_invalidate_sizes), (egg_icon_list_paint_item),
(egg_icon_list_item_new), (egg_icon_list_item_unref),
(egg_icon_list_get_item_text), (egg_icon_list_get_item_icon),
(egg_icon_list_get_item_at_pos), (egg_icon_list_get_path_at_pos),
(egg_icon_list_selected_foreach), (egg_icon_list_select_path),
(egg_icon_list_unselect_path), (egg_icon_list_path_is_selected),
(egg_icon_list_item_activated), (egg_icon_list_get_items),
(egg_icon_list_row_changed), (egg_icon_list_row_inserted),
(egg_icon_list_row_deleted), (egg_icon_list_rows_reordered),
(egg_icon_list_build_items), (egg_icon_list_set_model),
(egg_icon_list_get_model), (egg_icon_list_set_text_column),
(egg_icon_list_set_pixbuf_column):
* libegg/iconlist/eggiconlist.h:
* libegg/iconlist/testiconlist.c: (fill_model), (create_model),
(foreach_selected_print), (item_removed), (remove_selected),
(item_cb), (do_popup_menu), (main):
* libegg/util/eggmarshalers.list:
Update icon list to use the tree model instead.
2004-07-02 12:04:49 +00:00
|
|
|
int i;
|
|
|
|
int length;
|
|
|
|
GList *items = NULL, *list;
|
2004-07-04 15:56:55 +00:00
|
|
|
GtkIconViewItem **item_array;
|
2004-12-22 06:43:32 +00:00
|
|
|
gint *order;
|
2010-10-21 10:54:08 +00:00
|
|
|
|
|
|
|
/* ignore changes in branches */
|
|
|
|
if (iter != NULL)
|
|
|
|
return;
|
2002-04-30 17:08:52 +00:00
|
|
|
|
2011-02-25 07:00:20 +00:00
|
|
|
if (icon_view->priv->cell_area)
|
|
|
|
gtk_cell_area_stop_editing (icon_view->priv->cell_area, TRUE);
|
2005-05-02 20:28:37 +00:00
|
|
|
|
Update icon list to use the tree model instead.
2004-07-02 Anders Carlsson <andersca@gnome.org>
* libegg/iconlist/eggiconlist.c: (egg_icon_list_class_init),
(egg_icon_list_init), (egg_icon_list_destroy),
(egg_icon_list_finalize), (egg_icon_list_set_property),
(egg_icon_list_get_property), (egg_icon_list_button_press),
(egg_icon_list_select_first_matching_item),
(egg_icon_list_maybe_begin_dragging_items),
(egg_icon_list_real_toggle_cursor_item),
(egg_icon_list_calculate_item_size),
(egg_icon_list_invalidate_sizes), (egg_icon_list_paint_item),
(egg_icon_list_item_new), (egg_icon_list_item_unref),
(egg_icon_list_get_item_text), (egg_icon_list_get_item_icon),
(egg_icon_list_get_item_at_pos), (egg_icon_list_get_path_at_pos),
(egg_icon_list_selected_foreach), (egg_icon_list_select_path),
(egg_icon_list_unselect_path), (egg_icon_list_path_is_selected),
(egg_icon_list_item_activated), (egg_icon_list_get_items),
(egg_icon_list_row_changed), (egg_icon_list_row_inserted),
(egg_icon_list_row_deleted), (egg_icon_list_rows_reordered),
(egg_icon_list_build_items), (egg_icon_list_set_model),
(egg_icon_list_get_model), (egg_icon_list_set_text_column),
(egg_icon_list_set_pixbuf_column):
* libegg/iconlist/eggiconlist.h:
* libegg/iconlist/testiconlist.c: (fill_model), (create_model),
(foreach_selected_print), (item_removed), (remove_selected),
(item_cb), (do_popup_menu), (main):
* libegg/util/eggmarshalers.list:
Update icon list to use the tree model instead.
2004-07-02 12:04:49 +00:00
|
|
|
length = gtk_tree_model_iter_n_children (model, NULL);
|
|
|
|
|
2004-12-22 06:43:32 +00:00
|
|
|
order = g_new (gint, length);
|
|
|
|
for (i = 0; i < length; i++)
|
|
|
|
order [new_order[i]] = i;
|
|
|
|
|
2004-07-04 15:56:55 +00:00
|
|
|
item_array = g_new (GtkIconViewItem *, length);
|
|
|
|
for (i = 0, list = icon_view->priv->items; list != NULL; list = list->next, i++)
|
2004-12-22 06:43:32 +00:00
|
|
|
item_array[order[i]] = list->data;
|
|
|
|
g_free (order);
|
Update icon list to use the tree model instead.
2004-07-02 Anders Carlsson <andersca@gnome.org>
* libegg/iconlist/eggiconlist.c: (egg_icon_list_class_init),
(egg_icon_list_init), (egg_icon_list_destroy),
(egg_icon_list_finalize), (egg_icon_list_set_property),
(egg_icon_list_get_property), (egg_icon_list_button_press),
(egg_icon_list_select_first_matching_item),
(egg_icon_list_maybe_begin_dragging_items),
(egg_icon_list_real_toggle_cursor_item),
(egg_icon_list_calculate_item_size),
(egg_icon_list_invalidate_sizes), (egg_icon_list_paint_item),
(egg_icon_list_item_new), (egg_icon_list_item_unref),
(egg_icon_list_get_item_text), (egg_icon_list_get_item_icon),
(egg_icon_list_get_item_at_pos), (egg_icon_list_get_path_at_pos),
(egg_icon_list_selected_foreach), (egg_icon_list_select_path),
(egg_icon_list_unselect_path), (egg_icon_list_path_is_selected),
(egg_icon_list_item_activated), (egg_icon_list_get_items),
(egg_icon_list_row_changed), (egg_icon_list_row_inserted),
(egg_icon_list_row_deleted), (egg_icon_list_rows_reordered),
(egg_icon_list_build_items), (egg_icon_list_set_model),
(egg_icon_list_get_model), (egg_icon_list_set_text_column),
(egg_icon_list_set_pixbuf_column):
* libegg/iconlist/eggiconlist.h:
* libegg/iconlist/testiconlist.c: (fill_model), (create_model),
(foreach_selected_print), (item_removed), (remove_selected),
(item_cb), (do_popup_menu), (main):
* libegg/util/eggmarshalers.list:
Update icon list to use the tree model instead.
2004-07-02 12:04:49 +00:00
|
|
|
|
2004-12-08 04:57:40 +00:00
|
|
|
for (i = length - 1; i >= 0; i--)
|
Fix the "selection_changed" signal to not get emitted twice in some cases.
2004-07-04 Anders Carlsson <andersca@gnome.org>
* configure.in:
* libegg/iconlist/eggiconlist.c: (egg_icon_list_expose),
(scroll_timeout), (egg_icon_list_motion),
(egg_icon_list_button_press), (egg_icon_list_update_rubberband),
(egg_icon_list_start_rubberbanding),
(egg_icon_list_stop_rubberbanding),
(egg_icon_list_unselect_all_internal),
(egg_icon_list_real_select_all),
(egg_icon_list_adjustment_changed), (egg_icon_list_item_free),
(egg_icon_list_select_item), (verify_items),
(egg_icon_list_row_changed), (egg_icon_list_row_inserted),
(egg_icon_list_row_deleted), (egg_icon_list_rows_reordered),
(egg_icon_list_select_all_between),
(egg_icon_list_move_cursor_up_down),
(egg_icon_list_move_cursor_page_up_down),
(egg_icon_list_move_cursor_left_right),
(egg_icon_list_move_cursor_start_end), (egg_icon_list_set_model),
(egg_icon_list_get_selected_items), (egg_icon_list_select_all),
(egg_icon_list_unselect_all):
* libegg/iconlist/eggiconlist.h:
* libegg/iconlist/testiconlist.c: (foreach_selected_remove):
Fix the "selection_changed" signal to not get emitted twice in some cases.
Also fix a bunch of issues reported by Jonathan.
2004-07-04 12:43:26 +00:00
|
|
|
{
|
|
|
|
item_array[i]->index = i;
|
|
|
|
items = g_list_prepend (items, item_array[i]);
|
|
|
|
}
|
Update icon list to use the tree model instead.
2004-07-02 Anders Carlsson <andersca@gnome.org>
* libegg/iconlist/eggiconlist.c: (egg_icon_list_class_init),
(egg_icon_list_init), (egg_icon_list_destroy),
(egg_icon_list_finalize), (egg_icon_list_set_property),
(egg_icon_list_get_property), (egg_icon_list_button_press),
(egg_icon_list_select_first_matching_item),
(egg_icon_list_maybe_begin_dragging_items),
(egg_icon_list_real_toggle_cursor_item),
(egg_icon_list_calculate_item_size),
(egg_icon_list_invalidate_sizes), (egg_icon_list_paint_item),
(egg_icon_list_item_new), (egg_icon_list_item_unref),
(egg_icon_list_get_item_text), (egg_icon_list_get_item_icon),
(egg_icon_list_get_item_at_pos), (egg_icon_list_get_path_at_pos),
(egg_icon_list_selected_foreach), (egg_icon_list_select_path),
(egg_icon_list_unselect_path), (egg_icon_list_path_is_selected),
(egg_icon_list_item_activated), (egg_icon_list_get_items),
(egg_icon_list_row_changed), (egg_icon_list_row_inserted),
(egg_icon_list_row_deleted), (egg_icon_list_rows_reordered),
(egg_icon_list_build_items), (egg_icon_list_set_model),
(egg_icon_list_get_model), (egg_icon_list_set_text_column),
(egg_icon_list_set_pixbuf_column):
* libegg/iconlist/eggiconlist.h:
* libegg/iconlist/testiconlist.c: (fill_model), (create_model),
(foreach_selected_print), (item_removed), (remove_selected),
(item_cb), (do_popup_menu), (main):
* libegg/util/eggmarshalers.list:
Update icon list to use the tree model instead.
2004-07-02 12:04:49 +00:00
|
|
|
|
|
|
|
g_free (item_array);
|
2004-07-04 15:56:55 +00:00
|
|
|
g_list_free (icon_view->priv->items);
|
2004-12-08 04:57:40 +00:00
|
|
|
icon_view->priv->items = items;
|
Fix the "selection_changed" signal to not get emitted twice in some cases.
2004-07-04 Anders Carlsson <andersca@gnome.org>
* configure.in:
* libegg/iconlist/eggiconlist.c: (egg_icon_list_expose),
(scroll_timeout), (egg_icon_list_motion),
(egg_icon_list_button_press), (egg_icon_list_update_rubberband),
(egg_icon_list_start_rubberbanding),
(egg_icon_list_stop_rubberbanding),
(egg_icon_list_unselect_all_internal),
(egg_icon_list_real_select_all),
(egg_icon_list_adjustment_changed), (egg_icon_list_item_free),
(egg_icon_list_select_item), (verify_items),
(egg_icon_list_row_changed), (egg_icon_list_row_inserted),
(egg_icon_list_row_deleted), (egg_icon_list_rows_reordered),
(egg_icon_list_select_all_between),
(egg_icon_list_move_cursor_up_down),
(egg_icon_list_move_cursor_page_up_down),
(egg_icon_list_move_cursor_left_right),
(egg_icon_list_move_cursor_start_end), (egg_icon_list_set_model),
(egg_icon_list_get_selected_items), (egg_icon_list_select_all),
(egg_icon_list_unselect_all):
* libegg/iconlist/eggiconlist.h:
* libegg/iconlist/testiconlist.c: (foreach_selected_remove):
Fix the "selection_changed" signal to not get emitted twice in some cases.
Also fix a bunch of issues reported by Jonathan.
2004-07-04 12:43:26 +00:00
|
|
|
|
2005-04-29 15:24:30 +00:00
|
|
|
gtk_icon_view_queue_layout (icon_view);
|
|
|
|
|
2004-07-04 15:56:55 +00:00
|
|
|
verify_items (icon_view);
|
Update icon list to use the tree model instead.
2004-07-02 Anders Carlsson <andersca@gnome.org>
* libegg/iconlist/eggiconlist.c: (egg_icon_list_class_init),
(egg_icon_list_init), (egg_icon_list_destroy),
(egg_icon_list_finalize), (egg_icon_list_set_property),
(egg_icon_list_get_property), (egg_icon_list_button_press),
(egg_icon_list_select_first_matching_item),
(egg_icon_list_maybe_begin_dragging_items),
(egg_icon_list_real_toggle_cursor_item),
(egg_icon_list_calculate_item_size),
(egg_icon_list_invalidate_sizes), (egg_icon_list_paint_item),
(egg_icon_list_item_new), (egg_icon_list_item_unref),
(egg_icon_list_get_item_text), (egg_icon_list_get_item_icon),
(egg_icon_list_get_item_at_pos), (egg_icon_list_get_path_at_pos),
(egg_icon_list_selected_foreach), (egg_icon_list_select_path),
(egg_icon_list_unselect_path), (egg_icon_list_path_is_selected),
(egg_icon_list_item_activated), (egg_icon_list_get_items),
(egg_icon_list_row_changed), (egg_icon_list_row_inserted),
(egg_icon_list_row_deleted), (egg_icon_list_rows_reordered),
(egg_icon_list_build_items), (egg_icon_list_set_model),
(egg_icon_list_get_model), (egg_icon_list_set_text_column),
(egg_icon_list_set_pixbuf_column):
* libegg/iconlist/eggiconlist.h:
* libegg/iconlist/testiconlist.c: (fill_model), (create_model),
(foreach_selected_print), (item_removed), (remove_selected),
(item_cb), (do_popup_menu), (main):
* libegg/util/eggmarshalers.list:
Update icon list to use the tree model instead.
2004-07-02 12:04:49 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2004-07-04 15:56:55 +00:00
|
|
|
gtk_icon_view_build_items (GtkIconView *icon_view)
|
Update icon list to use the tree model instead.
2004-07-02 Anders Carlsson <andersca@gnome.org>
* libegg/iconlist/eggiconlist.c: (egg_icon_list_class_init),
(egg_icon_list_init), (egg_icon_list_destroy),
(egg_icon_list_finalize), (egg_icon_list_set_property),
(egg_icon_list_get_property), (egg_icon_list_button_press),
(egg_icon_list_select_first_matching_item),
(egg_icon_list_maybe_begin_dragging_items),
(egg_icon_list_real_toggle_cursor_item),
(egg_icon_list_calculate_item_size),
(egg_icon_list_invalidate_sizes), (egg_icon_list_paint_item),
(egg_icon_list_item_new), (egg_icon_list_item_unref),
(egg_icon_list_get_item_text), (egg_icon_list_get_item_icon),
(egg_icon_list_get_item_at_pos), (egg_icon_list_get_path_at_pos),
(egg_icon_list_selected_foreach), (egg_icon_list_select_path),
(egg_icon_list_unselect_path), (egg_icon_list_path_is_selected),
(egg_icon_list_item_activated), (egg_icon_list_get_items),
(egg_icon_list_row_changed), (egg_icon_list_row_inserted),
(egg_icon_list_row_deleted), (egg_icon_list_rows_reordered),
(egg_icon_list_build_items), (egg_icon_list_set_model),
(egg_icon_list_get_model), (egg_icon_list_set_text_column),
(egg_icon_list_set_pixbuf_column):
* libegg/iconlist/eggiconlist.h:
* libegg/iconlist/testiconlist.c: (fill_model), (create_model),
(foreach_selected_print), (item_removed), (remove_selected),
(item_cb), (do_popup_menu), (main):
* libegg/util/eggmarshalers.list:
Update icon list to use the tree model instead.
2004-07-02 12:04:49 +00:00
|
|
|
{
|
|
|
|
GtkTreeIter iter;
|
|
|
|
int i;
|
|
|
|
gboolean iters_persist;
|
|
|
|
GList *items = NULL;
|
|
|
|
|
2004-07-04 15:56:55 +00:00
|
|
|
iters_persist = gtk_tree_model_get_flags (icon_view->priv->model) & GTK_TREE_MODEL_ITERS_PERSIST;
|
Update icon list to use the tree model instead.
2004-07-02 Anders Carlsson <andersca@gnome.org>
* libegg/iconlist/eggiconlist.c: (egg_icon_list_class_init),
(egg_icon_list_init), (egg_icon_list_destroy),
(egg_icon_list_finalize), (egg_icon_list_set_property),
(egg_icon_list_get_property), (egg_icon_list_button_press),
(egg_icon_list_select_first_matching_item),
(egg_icon_list_maybe_begin_dragging_items),
(egg_icon_list_real_toggle_cursor_item),
(egg_icon_list_calculate_item_size),
(egg_icon_list_invalidate_sizes), (egg_icon_list_paint_item),
(egg_icon_list_item_new), (egg_icon_list_item_unref),
(egg_icon_list_get_item_text), (egg_icon_list_get_item_icon),
(egg_icon_list_get_item_at_pos), (egg_icon_list_get_path_at_pos),
(egg_icon_list_selected_foreach), (egg_icon_list_select_path),
(egg_icon_list_unselect_path), (egg_icon_list_path_is_selected),
(egg_icon_list_item_activated), (egg_icon_list_get_items),
(egg_icon_list_row_changed), (egg_icon_list_row_inserted),
(egg_icon_list_row_deleted), (egg_icon_list_rows_reordered),
(egg_icon_list_build_items), (egg_icon_list_set_model),
(egg_icon_list_get_model), (egg_icon_list_set_text_column),
(egg_icon_list_set_pixbuf_column):
* libegg/iconlist/eggiconlist.h:
* libegg/iconlist/testiconlist.c: (fill_model), (create_model),
(foreach_selected_print), (item_removed), (remove_selected),
(item_cb), (do_popup_menu), (main):
* libegg/util/eggmarshalers.list:
Update icon list to use the tree model instead.
2004-07-02 12:04:49 +00:00
|
|
|
|
2004-07-04 15:56:55 +00:00
|
|
|
if (!gtk_tree_model_get_iter_first (icon_view->priv->model,
|
Update icon list to use the tree model instead.
2004-07-02 Anders Carlsson <andersca@gnome.org>
* libegg/iconlist/eggiconlist.c: (egg_icon_list_class_init),
(egg_icon_list_init), (egg_icon_list_destroy),
(egg_icon_list_finalize), (egg_icon_list_set_property),
(egg_icon_list_get_property), (egg_icon_list_button_press),
(egg_icon_list_select_first_matching_item),
(egg_icon_list_maybe_begin_dragging_items),
(egg_icon_list_real_toggle_cursor_item),
(egg_icon_list_calculate_item_size),
(egg_icon_list_invalidate_sizes), (egg_icon_list_paint_item),
(egg_icon_list_item_new), (egg_icon_list_item_unref),
(egg_icon_list_get_item_text), (egg_icon_list_get_item_icon),
(egg_icon_list_get_item_at_pos), (egg_icon_list_get_path_at_pos),
(egg_icon_list_selected_foreach), (egg_icon_list_select_path),
(egg_icon_list_unselect_path), (egg_icon_list_path_is_selected),
(egg_icon_list_item_activated), (egg_icon_list_get_items),
(egg_icon_list_row_changed), (egg_icon_list_row_inserted),
(egg_icon_list_row_deleted), (egg_icon_list_rows_reordered),
(egg_icon_list_build_items), (egg_icon_list_set_model),
(egg_icon_list_get_model), (egg_icon_list_set_text_column),
(egg_icon_list_set_pixbuf_column):
* libegg/iconlist/eggiconlist.h:
* libegg/iconlist/testiconlist.c: (fill_model), (create_model),
(foreach_selected_print), (item_removed), (remove_selected),
(item_cb), (do_popup_menu), (main):
* libegg/util/eggmarshalers.list:
Update icon list to use the tree model instead.
2004-07-02 12:04:49 +00:00
|
|
|
&iter))
|
|
|
|
return;
|
|
|
|
|
|
|
|
i = 0;
|
|
|
|
|
|
|
|
do
|
|
|
|
{
|
2004-07-04 15:56:55 +00:00
|
|
|
GtkIconViewItem *item = gtk_icon_view_item_new ();
|
Update icon list to use the tree model instead.
2004-07-02 Anders Carlsson <andersca@gnome.org>
* libegg/iconlist/eggiconlist.c: (egg_icon_list_class_init),
(egg_icon_list_init), (egg_icon_list_destroy),
(egg_icon_list_finalize), (egg_icon_list_set_property),
(egg_icon_list_get_property), (egg_icon_list_button_press),
(egg_icon_list_select_first_matching_item),
(egg_icon_list_maybe_begin_dragging_items),
(egg_icon_list_real_toggle_cursor_item),
(egg_icon_list_calculate_item_size),
(egg_icon_list_invalidate_sizes), (egg_icon_list_paint_item),
(egg_icon_list_item_new), (egg_icon_list_item_unref),
(egg_icon_list_get_item_text), (egg_icon_list_get_item_icon),
(egg_icon_list_get_item_at_pos), (egg_icon_list_get_path_at_pos),
(egg_icon_list_selected_foreach), (egg_icon_list_select_path),
(egg_icon_list_unselect_path), (egg_icon_list_path_is_selected),
(egg_icon_list_item_activated), (egg_icon_list_get_items),
(egg_icon_list_row_changed), (egg_icon_list_row_inserted),
(egg_icon_list_row_deleted), (egg_icon_list_rows_reordered),
(egg_icon_list_build_items), (egg_icon_list_set_model),
(egg_icon_list_get_model), (egg_icon_list_set_text_column),
(egg_icon_list_set_pixbuf_column):
* libegg/iconlist/eggiconlist.h:
* libegg/iconlist/testiconlist.c: (fill_model), (create_model),
(foreach_selected_print), (item_removed), (remove_selected),
(item_cb), (do_popup_menu), (main):
* libegg/util/eggmarshalers.list:
Update icon list to use the tree model instead.
2004-07-02 12:04:49 +00:00
|
|
|
|
|
|
|
if (iters_persist)
|
|
|
|
item->iter = iter;
|
|
|
|
|
|
|
|
item->index = i;
|
|
|
|
|
|
|
|
i++;
|
|
|
|
|
|
|
|
items = g_list_prepend (items, item);
|
|
|
|
|
2004-07-04 15:56:55 +00:00
|
|
|
} while (gtk_tree_model_iter_next (icon_view->priv->model, &iter));
|
Update icon list to use the tree model instead.
2004-07-02 Anders Carlsson <andersca@gnome.org>
* libegg/iconlist/eggiconlist.c: (egg_icon_list_class_init),
(egg_icon_list_init), (egg_icon_list_destroy),
(egg_icon_list_finalize), (egg_icon_list_set_property),
(egg_icon_list_get_property), (egg_icon_list_button_press),
(egg_icon_list_select_first_matching_item),
(egg_icon_list_maybe_begin_dragging_items),
(egg_icon_list_real_toggle_cursor_item),
(egg_icon_list_calculate_item_size),
(egg_icon_list_invalidate_sizes), (egg_icon_list_paint_item),
(egg_icon_list_item_new), (egg_icon_list_item_unref),
(egg_icon_list_get_item_text), (egg_icon_list_get_item_icon),
(egg_icon_list_get_item_at_pos), (egg_icon_list_get_path_at_pos),
(egg_icon_list_selected_foreach), (egg_icon_list_select_path),
(egg_icon_list_unselect_path), (egg_icon_list_path_is_selected),
(egg_icon_list_item_activated), (egg_icon_list_get_items),
(egg_icon_list_row_changed), (egg_icon_list_row_inserted),
(egg_icon_list_row_deleted), (egg_icon_list_rows_reordered),
(egg_icon_list_build_items), (egg_icon_list_set_model),
(egg_icon_list_get_model), (egg_icon_list_set_text_column),
(egg_icon_list_set_pixbuf_column):
* libegg/iconlist/eggiconlist.h:
* libegg/iconlist/testiconlist.c: (fill_model), (create_model),
(foreach_selected_print), (item_removed), (remove_selected),
(item_cb), (do_popup_menu), (main):
* libegg/util/eggmarshalers.list:
Update icon list to use the tree model instead.
2004-07-02 12:04:49 +00:00
|
|
|
|
2004-07-04 15:56:55 +00:00
|
|
|
icon_view->priv->items = g_list_reverse (items);
|
2002-04-30 17:08:52 +00:00
|
|
|
}
|
|
|
|
|
Document functions and fix a few bugs.
2004-07-03 Anders Carlsson <andersca@gnome.org>
* libegg/iconlist/eggiconlist.c: (egg_icon_list_add_move_binding),
(egg_icon_list_real_move_cursor), (egg_icon_list_new),
(egg_icon_list_new_with_model), (egg_icon_list_get_path_at_pos),
(egg_icon_list_selected_foreach),
(egg_icon_list_set_selection_mode),
(egg_icon_list_get_selection_mode), (egg_icon_list_set_model),
(egg_icon_list_get_model), (egg_icon_list_set_text_column),
(egg_icon_list_get_text_column), (egg_icon_list_set_markup_column),
(egg_icon_list_get_markup_column),
(egg_icon_list_set_pixbuf_column),
(egg_icon_list_get_pixbuf_column), (egg_icon_list_select_path),
(egg_icon_list_unselect_path), (egg_icon_list_select_all),
(egg_icon_list_unselect_all), (egg_icon_list_path_is_selected),
(egg_icon_list_item_activated):
* libegg/iconlist/eggiconlist.h:
* libegg/iconlist/testiconlist.c: (foreach_selected_remove_func),
(foreach_selected_remove), (selection_changed), (main):
Document functions and fix a few bugs.
2004-07-03 08:01:34 +00:00
|
|
|
static void
|
2004-07-04 15:56:55 +00:00
|
|
|
gtk_icon_view_add_move_binding (GtkBindingSet *binding_set,
|
Document functions and fix a few bugs.
2004-07-03 Anders Carlsson <andersca@gnome.org>
* libegg/iconlist/eggiconlist.c: (egg_icon_list_add_move_binding),
(egg_icon_list_real_move_cursor), (egg_icon_list_new),
(egg_icon_list_new_with_model), (egg_icon_list_get_path_at_pos),
(egg_icon_list_selected_foreach),
(egg_icon_list_set_selection_mode),
(egg_icon_list_get_selection_mode), (egg_icon_list_set_model),
(egg_icon_list_get_model), (egg_icon_list_set_text_column),
(egg_icon_list_get_text_column), (egg_icon_list_set_markup_column),
(egg_icon_list_get_markup_column),
(egg_icon_list_set_pixbuf_column),
(egg_icon_list_get_pixbuf_column), (egg_icon_list_select_path),
(egg_icon_list_unselect_path), (egg_icon_list_select_all),
(egg_icon_list_unselect_all), (egg_icon_list_path_is_selected),
(egg_icon_list_item_activated):
* libegg/iconlist/eggiconlist.h:
* libegg/iconlist/testiconlist.c: (foreach_selected_remove_func),
(foreach_selected_remove), (selection_changed), (main):
Document functions and fix a few bugs.
2004-07-03 08:01:34 +00:00
|
|
|
guint keyval,
|
|
|
|
guint modmask,
|
|
|
|
GtkMovementStep step,
|
|
|
|
gint count)
|
2002-04-30 17:08:52 +00:00
|
|
|
{
|
Update icon list to use the tree model instead.
2004-07-02 Anders Carlsson <andersca@gnome.org>
* libegg/iconlist/eggiconlist.c: (egg_icon_list_class_init),
(egg_icon_list_init), (egg_icon_list_destroy),
(egg_icon_list_finalize), (egg_icon_list_set_property),
(egg_icon_list_get_property), (egg_icon_list_button_press),
(egg_icon_list_select_first_matching_item),
(egg_icon_list_maybe_begin_dragging_items),
(egg_icon_list_real_toggle_cursor_item),
(egg_icon_list_calculate_item_size),
(egg_icon_list_invalidate_sizes), (egg_icon_list_paint_item),
(egg_icon_list_item_new), (egg_icon_list_item_unref),
(egg_icon_list_get_item_text), (egg_icon_list_get_item_icon),
(egg_icon_list_get_item_at_pos), (egg_icon_list_get_path_at_pos),
(egg_icon_list_selected_foreach), (egg_icon_list_select_path),
(egg_icon_list_unselect_path), (egg_icon_list_path_is_selected),
(egg_icon_list_item_activated), (egg_icon_list_get_items),
(egg_icon_list_row_changed), (egg_icon_list_row_inserted),
(egg_icon_list_row_deleted), (egg_icon_list_rows_reordered),
(egg_icon_list_build_items), (egg_icon_list_set_model),
(egg_icon_list_get_model), (egg_icon_list_set_text_column),
(egg_icon_list_set_pixbuf_column):
* libegg/iconlist/eggiconlist.h:
* libegg/iconlist/testiconlist.c: (fill_model), (create_model),
(foreach_selected_print), (item_removed), (remove_selected),
(item_cb), (do_popup_menu), (main):
* libegg/util/eggmarshalers.list:
Update icon list to use the tree model instead.
2004-07-02 12:04:49 +00:00
|
|
|
|
Document functions and fix a few bugs.
2004-07-03 Anders Carlsson <andersca@gnome.org>
* libegg/iconlist/eggiconlist.c: (egg_icon_list_add_move_binding),
(egg_icon_list_real_move_cursor), (egg_icon_list_new),
(egg_icon_list_new_with_model), (egg_icon_list_get_path_at_pos),
(egg_icon_list_selected_foreach),
(egg_icon_list_set_selection_mode),
(egg_icon_list_get_selection_mode), (egg_icon_list_set_model),
(egg_icon_list_get_model), (egg_icon_list_set_text_column),
(egg_icon_list_get_text_column), (egg_icon_list_set_markup_column),
(egg_icon_list_get_markup_column),
(egg_icon_list_set_pixbuf_column),
(egg_icon_list_get_pixbuf_column), (egg_icon_list_select_path),
(egg_icon_list_unselect_path), (egg_icon_list_select_all),
(egg_icon_list_unselect_all), (egg_icon_list_path_is_selected),
(egg_icon_list_item_activated):
* libegg/iconlist/eggiconlist.h:
* libegg/iconlist/testiconlist.c: (foreach_selected_remove_func),
(foreach_selected_remove), (selection_changed), (main):
Document functions and fix a few bugs.
2004-07-03 08:01:34 +00:00
|
|
|
gtk_binding_entry_add_signal (binding_set, keyval, modmask,
|
2008-08-11 12:54:57 +00:00
|
|
|
I_("move-cursor"), 2,
|
Document functions and fix a few bugs.
2004-07-03 Anders Carlsson <andersca@gnome.org>
* libegg/iconlist/eggiconlist.c: (egg_icon_list_add_move_binding),
(egg_icon_list_real_move_cursor), (egg_icon_list_new),
(egg_icon_list_new_with_model), (egg_icon_list_get_path_at_pos),
(egg_icon_list_selected_foreach),
(egg_icon_list_set_selection_mode),
(egg_icon_list_get_selection_mode), (egg_icon_list_set_model),
(egg_icon_list_get_model), (egg_icon_list_set_text_column),
(egg_icon_list_get_text_column), (egg_icon_list_set_markup_column),
(egg_icon_list_get_markup_column),
(egg_icon_list_set_pixbuf_column),
(egg_icon_list_get_pixbuf_column), (egg_icon_list_select_path),
(egg_icon_list_unselect_path), (egg_icon_list_select_all),
(egg_icon_list_unselect_all), (egg_icon_list_path_is_selected),
(egg_icon_list_item_activated):
* libegg/iconlist/eggiconlist.h:
* libegg/iconlist/testiconlist.c: (foreach_selected_remove_func),
(foreach_selected_remove), (selection_changed), (main):
Document functions and fix a few bugs.
2004-07-03 08:01:34 +00:00
|
|
|
G_TYPE_ENUM, step,
|
|
|
|
G_TYPE_INT, count);
|
2002-04-30 17:08:52 +00:00
|
|
|
|
Document functions and fix a few bugs.
2004-07-03 Anders Carlsson <andersca@gnome.org>
* libegg/iconlist/eggiconlist.c: (egg_icon_list_add_move_binding),
(egg_icon_list_real_move_cursor), (egg_icon_list_new),
(egg_icon_list_new_with_model), (egg_icon_list_get_path_at_pos),
(egg_icon_list_selected_foreach),
(egg_icon_list_set_selection_mode),
(egg_icon_list_get_selection_mode), (egg_icon_list_set_model),
(egg_icon_list_get_model), (egg_icon_list_set_text_column),
(egg_icon_list_get_text_column), (egg_icon_list_set_markup_column),
(egg_icon_list_get_markup_column),
(egg_icon_list_set_pixbuf_column),
(egg_icon_list_get_pixbuf_column), (egg_icon_list_select_path),
(egg_icon_list_unselect_path), (egg_icon_list_select_all),
(egg_icon_list_unselect_all), (egg_icon_list_path_is_selected),
(egg_icon_list_item_activated):
* libegg/iconlist/eggiconlist.h:
* libegg/iconlist/testiconlist.c: (foreach_selected_remove_func),
(foreach_selected_remove), (selection_changed), (main):
Document functions and fix a few bugs.
2004-07-03 08:01:34 +00:00
|
|
|
gtk_binding_entry_add_signal (binding_set, keyval, GDK_SHIFT_MASK,
|
2008-08-11 12:54:57 +00:00
|
|
|
"move-cursor", 2,
|
Document functions and fix a few bugs.
2004-07-03 Anders Carlsson <andersca@gnome.org>
* libegg/iconlist/eggiconlist.c: (egg_icon_list_add_move_binding),
(egg_icon_list_real_move_cursor), (egg_icon_list_new),
(egg_icon_list_new_with_model), (egg_icon_list_get_path_at_pos),
(egg_icon_list_selected_foreach),
(egg_icon_list_set_selection_mode),
(egg_icon_list_get_selection_mode), (egg_icon_list_set_model),
(egg_icon_list_get_model), (egg_icon_list_set_text_column),
(egg_icon_list_get_text_column), (egg_icon_list_set_markup_column),
(egg_icon_list_get_markup_column),
(egg_icon_list_set_pixbuf_column),
(egg_icon_list_get_pixbuf_column), (egg_icon_list_select_path),
(egg_icon_list_unselect_path), (egg_icon_list_select_all),
(egg_icon_list_unselect_all), (egg_icon_list_path_is_selected),
(egg_icon_list_item_activated):
* libegg/iconlist/eggiconlist.h:
* libegg/iconlist/testiconlist.c: (foreach_selected_remove_func),
(foreach_selected_remove), (selection_changed), (main):
Document functions and fix a few bugs.
2004-07-03 08:01:34 +00:00
|
|
|
G_TYPE_ENUM, step,
|
|
|
|
G_TYPE_INT, count);
|
Update icon list to use the tree model instead.
2004-07-02 Anders Carlsson <andersca@gnome.org>
* libegg/iconlist/eggiconlist.c: (egg_icon_list_class_init),
(egg_icon_list_init), (egg_icon_list_destroy),
(egg_icon_list_finalize), (egg_icon_list_set_property),
(egg_icon_list_get_property), (egg_icon_list_button_press),
(egg_icon_list_select_first_matching_item),
(egg_icon_list_maybe_begin_dragging_items),
(egg_icon_list_real_toggle_cursor_item),
(egg_icon_list_calculate_item_size),
(egg_icon_list_invalidate_sizes), (egg_icon_list_paint_item),
(egg_icon_list_item_new), (egg_icon_list_item_unref),
(egg_icon_list_get_item_text), (egg_icon_list_get_item_icon),
(egg_icon_list_get_item_at_pos), (egg_icon_list_get_path_at_pos),
(egg_icon_list_selected_foreach), (egg_icon_list_select_path),
(egg_icon_list_unselect_path), (egg_icon_list_path_is_selected),
(egg_icon_list_item_activated), (egg_icon_list_get_items),
(egg_icon_list_row_changed), (egg_icon_list_row_inserted),
(egg_icon_list_row_deleted), (egg_icon_list_rows_reordered),
(egg_icon_list_build_items), (egg_icon_list_set_model),
(egg_icon_list_get_model), (egg_icon_list_set_text_column),
(egg_icon_list_set_pixbuf_column):
* libegg/iconlist/eggiconlist.h:
* libegg/iconlist/testiconlist.c: (fill_model), (create_model),
(foreach_selected_print), (item_removed), (remove_selected),
(item_cb), (do_popup_menu), (main):
* libegg/util/eggmarshalers.list:
Update icon list to use the tree model instead.
2004-07-02 12:04:49 +00:00
|
|
|
|
Document functions and fix a few bugs.
2004-07-03 Anders Carlsson <andersca@gnome.org>
* libegg/iconlist/eggiconlist.c: (egg_icon_list_add_move_binding),
(egg_icon_list_real_move_cursor), (egg_icon_list_new),
(egg_icon_list_new_with_model), (egg_icon_list_get_path_at_pos),
(egg_icon_list_selected_foreach),
(egg_icon_list_set_selection_mode),
(egg_icon_list_get_selection_mode), (egg_icon_list_set_model),
(egg_icon_list_get_model), (egg_icon_list_set_text_column),
(egg_icon_list_get_text_column), (egg_icon_list_set_markup_column),
(egg_icon_list_get_markup_column),
(egg_icon_list_set_pixbuf_column),
(egg_icon_list_get_pixbuf_column), (egg_icon_list_select_path),
(egg_icon_list_unselect_path), (egg_icon_list_select_all),
(egg_icon_list_unselect_all), (egg_icon_list_path_is_selected),
(egg_icon_list_item_activated):
* libegg/iconlist/eggiconlist.h:
* libegg/iconlist/testiconlist.c: (foreach_selected_remove_func),
(foreach_selected_remove), (selection_changed), (main):
Document functions and fix a few bugs.
2004-07-03 08:01:34 +00:00
|
|
|
if ((modmask & GDK_CONTROL_MASK) == GDK_CONTROL_MASK)
|
|
|
|
return;
|
Update icon list to use the tree model instead.
2004-07-02 Anders Carlsson <andersca@gnome.org>
* libegg/iconlist/eggiconlist.c: (egg_icon_list_class_init),
(egg_icon_list_init), (egg_icon_list_destroy),
(egg_icon_list_finalize), (egg_icon_list_set_property),
(egg_icon_list_get_property), (egg_icon_list_button_press),
(egg_icon_list_select_first_matching_item),
(egg_icon_list_maybe_begin_dragging_items),
(egg_icon_list_real_toggle_cursor_item),
(egg_icon_list_calculate_item_size),
(egg_icon_list_invalidate_sizes), (egg_icon_list_paint_item),
(egg_icon_list_item_new), (egg_icon_list_item_unref),
(egg_icon_list_get_item_text), (egg_icon_list_get_item_icon),
(egg_icon_list_get_item_at_pos), (egg_icon_list_get_path_at_pos),
(egg_icon_list_selected_foreach), (egg_icon_list_select_path),
(egg_icon_list_unselect_path), (egg_icon_list_path_is_selected),
(egg_icon_list_item_activated), (egg_icon_list_get_items),
(egg_icon_list_row_changed), (egg_icon_list_row_inserted),
(egg_icon_list_row_deleted), (egg_icon_list_rows_reordered),
(egg_icon_list_build_items), (egg_icon_list_set_model),
(egg_icon_list_get_model), (egg_icon_list_set_text_column),
(egg_icon_list_set_pixbuf_column):
* libegg/iconlist/eggiconlist.h:
* libegg/iconlist/testiconlist.c: (fill_model), (create_model),
(foreach_selected_print), (item_removed), (remove_selected),
(item_cb), (do_popup_menu), (main):
* libegg/util/eggmarshalers.list:
Update icon list to use the tree model instead.
2004-07-02 12:04:49 +00:00
|
|
|
|
Document functions and fix a few bugs.
2004-07-03 Anders Carlsson <andersca@gnome.org>
* libegg/iconlist/eggiconlist.c: (egg_icon_list_add_move_binding),
(egg_icon_list_real_move_cursor), (egg_icon_list_new),
(egg_icon_list_new_with_model), (egg_icon_list_get_path_at_pos),
(egg_icon_list_selected_foreach),
(egg_icon_list_set_selection_mode),
(egg_icon_list_get_selection_mode), (egg_icon_list_set_model),
(egg_icon_list_get_model), (egg_icon_list_set_text_column),
(egg_icon_list_get_text_column), (egg_icon_list_set_markup_column),
(egg_icon_list_get_markup_column),
(egg_icon_list_set_pixbuf_column),
(egg_icon_list_get_pixbuf_column), (egg_icon_list_select_path),
(egg_icon_list_unselect_path), (egg_icon_list_select_all),
(egg_icon_list_unselect_all), (egg_icon_list_path_is_selected),
(egg_icon_list_item_activated):
* libegg/iconlist/eggiconlist.h:
* libegg/iconlist/testiconlist.c: (foreach_selected_remove_func),
(foreach_selected_remove), (selection_changed), (main):
Document functions and fix a few bugs.
2004-07-03 08:01:34 +00:00
|
|
|
gtk_binding_entry_add_signal (binding_set, keyval, GDK_CONTROL_MASK | GDK_SHIFT_MASK,
|
2008-08-11 12:54:57 +00:00
|
|
|
"move-cursor", 2,
|
Document functions and fix a few bugs.
2004-07-03 Anders Carlsson <andersca@gnome.org>
* libegg/iconlist/eggiconlist.c: (egg_icon_list_add_move_binding),
(egg_icon_list_real_move_cursor), (egg_icon_list_new),
(egg_icon_list_new_with_model), (egg_icon_list_get_path_at_pos),
(egg_icon_list_selected_foreach),
(egg_icon_list_set_selection_mode),
(egg_icon_list_get_selection_mode), (egg_icon_list_set_model),
(egg_icon_list_get_model), (egg_icon_list_set_text_column),
(egg_icon_list_get_text_column), (egg_icon_list_set_markup_column),
(egg_icon_list_get_markup_column),
(egg_icon_list_set_pixbuf_column),
(egg_icon_list_get_pixbuf_column), (egg_icon_list_select_path),
(egg_icon_list_unselect_path), (egg_icon_list_select_all),
(egg_icon_list_unselect_all), (egg_icon_list_path_is_selected),
(egg_icon_list_item_activated):
* libegg/iconlist/eggiconlist.h:
* libegg/iconlist/testiconlist.c: (foreach_selected_remove_func),
(foreach_selected_remove), (selection_changed), (main):
Document functions and fix a few bugs.
2004-07-03 08:01:34 +00:00
|
|
|
G_TYPE_ENUM, step,
|
|
|
|
G_TYPE_INT, count);
|
Update icon list to use the tree model instead.
2004-07-02 Anders Carlsson <andersca@gnome.org>
* libegg/iconlist/eggiconlist.c: (egg_icon_list_class_init),
(egg_icon_list_init), (egg_icon_list_destroy),
(egg_icon_list_finalize), (egg_icon_list_set_property),
(egg_icon_list_get_property), (egg_icon_list_button_press),
(egg_icon_list_select_first_matching_item),
(egg_icon_list_maybe_begin_dragging_items),
(egg_icon_list_real_toggle_cursor_item),
(egg_icon_list_calculate_item_size),
(egg_icon_list_invalidate_sizes), (egg_icon_list_paint_item),
(egg_icon_list_item_new), (egg_icon_list_item_unref),
(egg_icon_list_get_item_text), (egg_icon_list_get_item_icon),
(egg_icon_list_get_item_at_pos), (egg_icon_list_get_path_at_pos),
(egg_icon_list_selected_foreach), (egg_icon_list_select_path),
(egg_icon_list_unselect_path), (egg_icon_list_path_is_selected),
(egg_icon_list_item_activated), (egg_icon_list_get_items),
(egg_icon_list_row_changed), (egg_icon_list_row_inserted),
(egg_icon_list_row_deleted), (egg_icon_list_rows_reordered),
(egg_icon_list_build_items), (egg_icon_list_set_model),
(egg_icon_list_get_model), (egg_icon_list_set_text_column),
(egg_icon_list_set_pixbuf_column):
* libegg/iconlist/eggiconlist.h:
* libegg/iconlist/testiconlist.c: (fill_model), (create_model),
(foreach_selected_print), (item_removed), (remove_selected),
(item_cb), (do_popup_menu), (main):
* libegg/util/eggmarshalers.list:
Update icon list to use the tree model instead.
2004-07-02 12:04:49 +00:00
|
|
|
|
Document functions and fix a few bugs.
2004-07-03 Anders Carlsson <andersca@gnome.org>
* libegg/iconlist/eggiconlist.c: (egg_icon_list_add_move_binding),
(egg_icon_list_real_move_cursor), (egg_icon_list_new),
(egg_icon_list_new_with_model), (egg_icon_list_get_path_at_pos),
(egg_icon_list_selected_foreach),
(egg_icon_list_set_selection_mode),
(egg_icon_list_get_selection_mode), (egg_icon_list_set_model),
(egg_icon_list_get_model), (egg_icon_list_set_text_column),
(egg_icon_list_get_text_column), (egg_icon_list_set_markup_column),
(egg_icon_list_get_markup_column),
(egg_icon_list_set_pixbuf_column),
(egg_icon_list_get_pixbuf_column), (egg_icon_list_select_path),
(egg_icon_list_unselect_path), (egg_icon_list_select_all),
(egg_icon_list_unselect_all), (egg_icon_list_path_is_selected),
(egg_icon_list_item_activated):
* libegg/iconlist/eggiconlist.h:
* libegg/iconlist/testiconlist.c: (foreach_selected_remove_func),
(foreach_selected_remove), (selection_changed), (main):
Document functions and fix a few bugs.
2004-07-03 08:01:34 +00:00
|
|
|
gtk_binding_entry_add_signal (binding_set, keyval, GDK_CONTROL_MASK,
|
2008-08-11 12:54:57 +00:00
|
|
|
"move-cursor", 2,
|
Document functions and fix a few bugs.
2004-07-03 Anders Carlsson <andersca@gnome.org>
* libegg/iconlist/eggiconlist.c: (egg_icon_list_add_move_binding),
(egg_icon_list_real_move_cursor), (egg_icon_list_new),
(egg_icon_list_new_with_model), (egg_icon_list_get_path_at_pos),
(egg_icon_list_selected_foreach),
(egg_icon_list_set_selection_mode),
(egg_icon_list_get_selection_mode), (egg_icon_list_set_model),
(egg_icon_list_get_model), (egg_icon_list_set_text_column),
(egg_icon_list_get_text_column), (egg_icon_list_set_markup_column),
(egg_icon_list_get_markup_column),
(egg_icon_list_set_pixbuf_column),
(egg_icon_list_get_pixbuf_column), (egg_icon_list_select_path),
(egg_icon_list_unselect_path), (egg_icon_list_select_all),
(egg_icon_list_unselect_all), (egg_icon_list_path_is_selected),
(egg_icon_list_item_activated):
* libegg/iconlist/eggiconlist.h:
* libegg/iconlist/testiconlist.c: (foreach_selected_remove_func),
(foreach_selected_remove), (selection_changed), (main):
Document functions and fix a few bugs.
2004-07-03 08:01:34 +00:00
|
|
|
G_TYPE_ENUM, step,
|
|
|
|
G_TYPE_INT, count);
|
|
|
|
}
|
2002-04-30 17:08:52 +00:00
|
|
|
|
Document functions and fix a few bugs.
2004-07-03 Anders Carlsson <andersca@gnome.org>
* libegg/iconlist/eggiconlist.c: (egg_icon_list_add_move_binding),
(egg_icon_list_real_move_cursor), (egg_icon_list_new),
(egg_icon_list_new_with_model), (egg_icon_list_get_path_at_pos),
(egg_icon_list_selected_foreach),
(egg_icon_list_set_selection_mode),
(egg_icon_list_get_selection_mode), (egg_icon_list_set_model),
(egg_icon_list_get_model), (egg_icon_list_set_text_column),
(egg_icon_list_get_text_column), (egg_icon_list_set_markup_column),
(egg_icon_list_get_markup_column),
(egg_icon_list_set_pixbuf_column),
(egg_icon_list_get_pixbuf_column), (egg_icon_list_select_path),
(egg_icon_list_unselect_path), (egg_icon_list_select_all),
(egg_icon_list_unselect_all), (egg_icon_list_path_is_selected),
(egg_icon_list_item_activated):
* libegg/iconlist/eggiconlist.h:
* libegg/iconlist/testiconlist.c: (foreach_selected_remove_func),
(foreach_selected_remove), (selection_changed), (main):
Document functions and fix a few bugs.
2004-07-03 08:01:34 +00:00
|
|
|
static gboolean
|
2004-07-04 15:56:55 +00:00
|
|
|
gtk_icon_view_real_move_cursor (GtkIconView *icon_view,
|
Document functions and fix a few bugs.
2004-07-03 Anders Carlsson <andersca@gnome.org>
* libegg/iconlist/eggiconlist.c: (egg_icon_list_add_move_binding),
(egg_icon_list_real_move_cursor), (egg_icon_list_new),
(egg_icon_list_new_with_model), (egg_icon_list_get_path_at_pos),
(egg_icon_list_selected_foreach),
(egg_icon_list_set_selection_mode),
(egg_icon_list_get_selection_mode), (egg_icon_list_set_model),
(egg_icon_list_get_model), (egg_icon_list_set_text_column),
(egg_icon_list_get_text_column), (egg_icon_list_set_markup_column),
(egg_icon_list_get_markup_column),
(egg_icon_list_set_pixbuf_column),
(egg_icon_list_get_pixbuf_column), (egg_icon_list_select_path),
(egg_icon_list_unselect_path), (egg_icon_list_select_all),
(egg_icon_list_unselect_all), (egg_icon_list_path_is_selected),
(egg_icon_list_item_activated):
* libegg/iconlist/eggiconlist.h:
* libegg/iconlist/testiconlist.c: (foreach_selected_remove_func),
(foreach_selected_remove), (selection_changed), (main):
Document functions and fix a few bugs.
2004-07-03 08:01:34 +00:00
|
|
|
GtkMovementStep step,
|
|
|
|
gint count)
|
|
|
|
{
|
|
|
|
GdkModifierType state;
|
Update icon list to use the tree model instead.
2004-07-02 Anders Carlsson <andersca@gnome.org>
* libegg/iconlist/eggiconlist.c: (egg_icon_list_class_init),
(egg_icon_list_init), (egg_icon_list_destroy),
(egg_icon_list_finalize), (egg_icon_list_set_property),
(egg_icon_list_get_property), (egg_icon_list_button_press),
(egg_icon_list_select_first_matching_item),
(egg_icon_list_maybe_begin_dragging_items),
(egg_icon_list_real_toggle_cursor_item),
(egg_icon_list_calculate_item_size),
(egg_icon_list_invalidate_sizes), (egg_icon_list_paint_item),
(egg_icon_list_item_new), (egg_icon_list_item_unref),
(egg_icon_list_get_item_text), (egg_icon_list_get_item_icon),
(egg_icon_list_get_item_at_pos), (egg_icon_list_get_path_at_pos),
(egg_icon_list_selected_foreach), (egg_icon_list_select_path),
(egg_icon_list_unselect_path), (egg_icon_list_path_is_selected),
(egg_icon_list_item_activated), (egg_icon_list_get_items),
(egg_icon_list_row_changed), (egg_icon_list_row_inserted),
(egg_icon_list_row_deleted), (egg_icon_list_rows_reordered),
(egg_icon_list_build_items), (egg_icon_list_set_model),
(egg_icon_list_get_model), (egg_icon_list_set_text_column),
(egg_icon_list_set_pixbuf_column):
* libegg/iconlist/eggiconlist.h:
* libegg/iconlist/testiconlist.c: (fill_model), (create_model),
(foreach_selected_print), (item_removed), (remove_selected),
(item_cb), (do_popup_menu), (main):
* libegg/util/eggmarshalers.list:
Update icon list to use the tree model instead.
2004-07-02 12:04:49 +00:00
|
|
|
|
2004-07-04 15:56:55 +00:00
|
|
|
g_return_val_if_fail (GTK_ICON_VIEW (icon_view), FALSE);
|
Document functions and fix a few bugs.
2004-07-03 Anders Carlsson <andersca@gnome.org>
* libegg/iconlist/eggiconlist.c: (egg_icon_list_add_move_binding),
(egg_icon_list_real_move_cursor), (egg_icon_list_new),
(egg_icon_list_new_with_model), (egg_icon_list_get_path_at_pos),
(egg_icon_list_selected_foreach),
(egg_icon_list_set_selection_mode),
(egg_icon_list_get_selection_mode), (egg_icon_list_set_model),
(egg_icon_list_get_model), (egg_icon_list_set_text_column),
(egg_icon_list_get_text_column), (egg_icon_list_set_markup_column),
(egg_icon_list_get_markup_column),
(egg_icon_list_set_pixbuf_column),
(egg_icon_list_get_pixbuf_column), (egg_icon_list_select_path),
(egg_icon_list_unselect_path), (egg_icon_list_select_all),
(egg_icon_list_unselect_all), (egg_icon_list_path_is_selected),
(egg_icon_list_item_activated):
* libegg/iconlist/eggiconlist.h:
* libegg/iconlist/testiconlist.c: (foreach_selected_remove_func),
(foreach_selected_remove), (selection_changed), (main):
Document functions and fix a few bugs.
2004-07-03 08:01:34 +00:00
|
|
|
g_return_val_if_fail (step == GTK_MOVEMENT_LOGICAL_POSITIONS ||
|
|
|
|
step == GTK_MOVEMENT_VISUAL_POSITIONS ||
|
|
|
|
step == GTK_MOVEMENT_DISPLAY_LINES ||
|
|
|
|
step == GTK_MOVEMENT_PAGES ||
|
|
|
|
step == GTK_MOVEMENT_BUFFER_ENDS, FALSE);
|
Update icon list to use the tree model instead.
2004-07-02 Anders Carlsson <andersca@gnome.org>
* libegg/iconlist/eggiconlist.c: (egg_icon_list_class_init),
(egg_icon_list_init), (egg_icon_list_destroy),
(egg_icon_list_finalize), (egg_icon_list_set_property),
(egg_icon_list_get_property), (egg_icon_list_button_press),
(egg_icon_list_select_first_matching_item),
(egg_icon_list_maybe_begin_dragging_items),
(egg_icon_list_real_toggle_cursor_item),
(egg_icon_list_calculate_item_size),
(egg_icon_list_invalidate_sizes), (egg_icon_list_paint_item),
(egg_icon_list_item_new), (egg_icon_list_item_unref),
(egg_icon_list_get_item_text), (egg_icon_list_get_item_icon),
(egg_icon_list_get_item_at_pos), (egg_icon_list_get_path_at_pos),
(egg_icon_list_selected_foreach), (egg_icon_list_select_path),
(egg_icon_list_unselect_path), (egg_icon_list_path_is_selected),
(egg_icon_list_item_activated), (egg_icon_list_get_items),
(egg_icon_list_row_changed), (egg_icon_list_row_inserted),
(egg_icon_list_row_deleted), (egg_icon_list_rows_reordered),
(egg_icon_list_build_items), (egg_icon_list_set_model),
(egg_icon_list_get_model), (egg_icon_list_set_text_column),
(egg_icon_list_set_pixbuf_column):
* libegg/iconlist/eggiconlist.h:
* libegg/iconlist/testiconlist.c: (fill_model), (create_model),
(foreach_selected_print), (item_removed), (remove_selected),
(item_cb), (do_popup_menu), (main):
* libegg/util/eggmarshalers.list:
Update icon list to use the tree model instead.
2004-07-02 12:04:49 +00:00
|
|
|
|
2010-03-01 03:21:41 +00:00
|
|
|
if (!gtk_widget_has_focus (GTK_WIDGET (icon_view)))
|
Document functions and fix a few bugs.
2004-07-03 Anders Carlsson <andersca@gnome.org>
* libegg/iconlist/eggiconlist.c: (egg_icon_list_add_move_binding),
(egg_icon_list_real_move_cursor), (egg_icon_list_new),
(egg_icon_list_new_with_model), (egg_icon_list_get_path_at_pos),
(egg_icon_list_selected_foreach),
(egg_icon_list_set_selection_mode),
(egg_icon_list_get_selection_mode), (egg_icon_list_set_model),
(egg_icon_list_get_model), (egg_icon_list_set_text_column),
(egg_icon_list_get_text_column), (egg_icon_list_set_markup_column),
(egg_icon_list_get_markup_column),
(egg_icon_list_set_pixbuf_column),
(egg_icon_list_get_pixbuf_column), (egg_icon_list_select_path),
(egg_icon_list_unselect_path), (egg_icon_list_select_all),
(egg_icon_list_unselect_all), (egg_icon_list_path_is_selected),
(egg_icon_list_item_activated):
* libegg/iconlist/eggiconlist.h:
* libegg/iconlist/testiconlist.c: (foreach_selected_remove_func),
(foreach_selected_remove), (selection_changed), (main):
Document functions and fix a few bugs.
2004-07-03 08:01:34 +00:00
|
|
|
return FALSE;
|
2004-06-18 05:17:01 +00:00
|
|
|
|
2010-12-12 10:59:41 +00:00
|
|
|
gtk_cell_area_stop_editing (icon_view->priv->cell_area, FALSE);
|
2004-07-04 15:56:55 +00:00
|
|
|
gtk_widget_grab_focus (GTK_WIDGET (icon_view));
|
2004-06-18 05:17:01 +00:00
|
|
|
|
|
|
|
if (gtk_get_current_event_state (&state))
|
|
|
|
{
|
|
|
|
if ((state & GDK_CONTROL_MASK) == GDK_CONTROL_MASK)
|
2004-07-04 15:56:55 +00:00
|
|
|
icon_view->priv->ctrl_pressed = TRUE;
|
2004-06-18 05:17:01 +00:00
|
|
|
if ((state & GDK_SHIFT_MASK) == GDK_SHIFT_MASK)
|
2004-07-04 15:56:55 +00:00
|
|
|
icon_view->priv->shift_pressed = TRUE;
|
2004-06-18 05:17:01 +00:00
|
|
|
}
|
|
|
|
/* else we assume not pressed */
|
|
|
|
|
|
|
|
switch (step)
|
|
|
|
{
|
|
|
|
case GTK_MOVEMENT_LOGICAL_POSITIONS:
|
|
|
|
case GTK_MOVEMENT_VISUAL_POSITIONS:
|
2004-07-04 15:56:55 +00:00
|
|
|
gtk_icon_view_move_cursor_left_right (icon_view, count);
|
2004-06-18 05:17:01 +00:00
|
|
|
break;
|
|
|
|
case GTK_MOVEMENT_DISPLAY_LINES:
|
2004-07-04 15:56:55 +00:00
|
|
|
gtk_icon_view_move_cursor_up_down (icon_view, count);
|
2004-06-18 05:17:01 +00:00
|
|
|
break;
|
|
|
|
case GTK_MOVEMENT_PAGES:
|
2004-07-04 15:56:55 +00:00
|
|
|
gtk_icon_view_move_cursor_page_up_down (icon_view, count);
|
2004-06-18 05:17:01 +00:00
|
|
|
break;
|
|
|
|
case GTK_MOVEMENT_BUFFER_ENDS:
|
2004-07-04 15:56:55 +00:00
|
|
|
gtk_icon_view_move_cursor_start_end (icon_view, count);
|
2004-06-18 05:17:01 +00:00
|
|
|
break;
|
|
|
|
default:
|
|
|
|
g_assert_not_reached ();
|
|
|
|
}
|
|
|
|
|
2004-07-04 15:56:55 +00:00
|
|
|
icon_view->priv->ctrl_pressed = FALSE;
|
|
|
|
icon_view->priv->shift_pressed = FALSE;
|
2004-06-18 05:17:01 +00:00
|
|
|
|
2008-09-27 12:53:05 +00:00
|
|
|
icon_view->priv->draw_focus = TRUE;
|
|
|
|
|
2004-06-18 05:17:01 +00:00
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
2004-07-04 15:56:55 +00:00
|
|
|
static GtkIconViewItem *
|
|
|
|
find_item (GtkIconView *icon_view,
|
|
|
|
GtkIconViewItem *current,
|
2004-06-18 05:17:01 +00:00
|
|
|
gint row_ofs,
|
|
|
|
gint col_ofs)
|
|
|
|
{
|
|
|
|
gint row, col;
|
|
|
|
GList *items;
|
2004-07-04 15:56:55 +00:00
|
|
|
GtkIconViewItem *item;
|
2004-06-18 05:17:01 +00:00
|
|
|
|
|
|
|
/* FIXME: this could be more efficient
|
|
|
|
*/
|
|
|
|
row = current->row + row_ofs;
|
|
|
|
col = current->col + col_ofs;
|
|
|
|
|
2004-07-04 15:56:55 +00:00
|
|
|
for (items = icon_view->priv->items; items; items = items->next)
|
2004-06-18 05:17:01 +00:00
|
|
|
{
|
|
|
|
item = items->data;
|
|
|
|
if (item->row == row && item->col == col)
|
|
|
|
return item;
|
|
|
|
}
|
|
|
|
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
2004-07-04 15:56:55 +00:00
|
|
|
static GtkIconViewItem *
|
|
|
|
find_item_page_up_down (GtkIconView *icon_view,
|
|
|
|
GtkIconViewItem *current,
|
2004-06-18 05:17:01 +00:00
|
|
|
gint count)
|
|
|
|
{
|
|
|
|
GList *item, *next;
|
|
|
|
gint y, col;
|
|
|
|
|
|
|
|
col = current->col;
|
2010-12-13 08:41:50 +00:00
|
|
|
y = current->cell_area.y + count * gtk_adjustment_get_page_size (icon_view->priv->vadjustment);
|
2004-06-18 05:17:01 +00:00
|
|
|
|
2004-07-04 15:56:55 +00:00
|
|
|
item = g_list_find (icon_view->priv->items, current);
|
2004-06-18 05:17:01 +00:00
|
|
|
if (count > 0)
|
|
|
|
{
|
|
|
|
while (item)
|
|
|
|
{
|
|
|
|
for (next = item->next; next; next = next->next)
|
|
|
|
{
|
2004-07-04 15:56:55 +00:00
|
|
|
if (((GtkIconViewItem *)next->data)->col == col)
|
2004-06-18 05:17:01 +00:00
|
|
|
break;
|
|
|
|
}
|
2010-12-13 08:41:50 +00:00
|
|
|
if (!next || ((GtkIconViewItem *)next->data)->cell_area.y > y)
|
2004-06-18 05:17:01 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
item = next;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
while (item)
|
|
|
|
{
|
|
|
|
for (next = item->prev; next; next = next->prev)
|
|
|
|
{
|
2004-07-04 15:56:55 +00:00
|
|
|
if (((GtkIconViewItem *)next->data)->col == col)
|
2004-06-18 05:17:01 +00:00
|
|
|
break;
|
|
|
|
}
|
2010-12-13 08:41:50 +00:00
|
|
|
if (!next || ((GtkIconViewItem *)next->data)->cell_area.y < y)
|
2004-06-18 05:17:01 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
item = next;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (item)
|
|
|
|
return item->data;
|
|
|
|
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
Fix the "selection_changed" signal to not get emitted twice in some cases.
2004-07-04 Anders Carlsson <andersca@gnome.org>
* configure.in:
* libegg/iconlist/eggiconlist.c: (egg_icon_list_expose),
(scroll_timeout), (egg_icon_list_motion),
(egg_icon_list_button_press), (egg_icon_list_update_rubberband),
(egg_icon_list_start_rubberbanding),
(egg_icon_list_stop_rubberbanding),
(egg_icon_list_unselect_all_internal),
(egg_icon_list_real_select_all),
(egg_icon_list_adjustment_changed), (egg_icon_list_item_free),
(egg_icon_list_select_item), (verify_items),
(egg_icon_list_row_changed), (egg_icon_list_row_inserted),
(egg_icon_list_row_deleted), (egg_icon_list_rows_reordered),
(egg_icon_list_select_all_between),
(egg_icon_list_move_cursor_up_down),
(egg_icon_list_move_cursor_page_up_down),
(egg_icon_list_move_cursor_left_right),
(egg_icon_list_move_cursor_start_end), (egg_icon_list_set_model),
(egg_icon_list_get_selected_items), (egg_icon_list_select_all),
(egg_icon_list_unselect_all):
* libegg/iconlist/eggiconlist.h:
* libegg/iconlist/testiconlist.c: (foreach_selected_remove):
Fix the "selection_changed" signal to not get emitted twice in some cases.
Also fix a bunch of issues reported by Jonathan.
2004-07-04 12:43:26 +00:00
|
|
|
static gboolean
|
2004-07-04 15:56:55 +00:00
|
|
|
gtk_icon_view_select_all_between (GtkIconView *icon_view,
|
|
|
|
GtkIconViewItem *anchor,
|
|
|
|
GtkIconViewItem *cursor)
|
2004-06-18 05:17:01 +00:00
|
|
|
{
|
|
|
|
GList *items;
|
2004-07-04 15:56:55 +00:00
|
|
|
GtkIconViewItem *item;
|
2004-06-18 05:17:01 +00:00
|
|
|
gint row1, row2, col1, col2;
|
Fix the "selection_changed" signal to not get emitted twice in some cases.
2004-07-04 Anders Carlsson <andersca@gnome.org>
* configure.in:
* libegg/iconlist/eggiconlist.c: (egg_icon_list_expose),
(scroll_timeout), (egg_icon_list_motion),
(egg_icon_list_button_press), (egg_icon_list_update_rubberband),
(egg_icon_list_start_rubberbanding),
(egg_icon_list_stop_rubberbanding),
(egg_icon_list_unselect_all_internal),
(egg_icon_list_real_select_all),
(egg_icon_list_adjustment_changed), (egg_icon_list_item_free),
(egg_icon_list_select_item), (verify_items),
(egg_icon_list_row_changed), (egg_icon_list_row_inserted),
(egg_icon_list_row_deleted), (egg_icon_list_rows_reordered),
(egg_icon_list_select_all_between),
(egg_icon_list_move_cursor_up_down),
(egg_icon_list_move_cursor_page_up_down),
(egg_icon_list_move_cursor_left_right),
(egg_icon_list_move_cursor_start_end), (egg_icon_list_set_model),
(egg_icon_list_get_selected_items), (egg_icon_list_select_all),
(egg_icon_list_unselect_all):
* libegg/iconlist/eggiconlist.h:
* libegg/iconlist/testiconlist.c: (foreach_selected_remove):
Fix the "selection_changed" signal to not get emitted twice in some cases.
Also fix a bunch of issues reported by Jonathan.
2004-07-04 12:43:26 +00:00
|
|
|
gboolean dirty = FALSE;
|
|
|
|
|
2004-06-18 05:17:01 +00:00
|
|
|
if (anchor->row < cursor->row)
|
|
|
|
{
|
|
|
|
row1 = anchor->row;
|
|
|
|
row2 = cursor->row;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
row1 = cursor->row;
|
|
|
|
row2 = anchor->row;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (anchor->col < cursor->col)
|
|
|
|
{
|
|
|
|
col1 = anchor->col;
|
|
|
|
col2 = cursor->col;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
col1 = cursor->col;
|
|
|
|
col2 = anchor->col;
|
|
|
|
}
|
|
|
|
|
2004-07-04 15:56:55 +00:00
|
|
|
for (items = icon_view->priv->items; items; items = items->next)
|
2004-06-18 05:17:01 +00:00
|
|
|
{
|
|
|
|
item = items->data;
|
|
|
|
|
|
|
|
if (row1 <= item->row && item->row <= row2 &&
|
|
|
|
col1 <= item->col && item->col <= col2)
|
|
|
|
{
|
Fix the "selection_changed" signal to not get emitted twice in some cases.
2004-07-04 Anders Carlsson <andersca@gnome.org>
* configure.in:
* libegg/iconlist/eggiconlist.c: (egg_icon_list_expose),
(scroll_timeout), (egg_icon_list_motion),
(egg_icon_list_button_press), (egg_icon_list_update_rubberband),
(egg_icon_list_start_rubberbanding),
(egg_icon_list_stop_rubberbanding),
(egg_icon_list_unselect_all_internal),
(egg_icon_list_real_select_all),
(egg_icon_list_adjustment_changed), (egg_icon_list_item_free),
(egg_icon_list_select_item), (verify_items),
(egg_icon_list_row_changed), (egg_icon_list_row_inserted),
(egg_icon_list_row_deleted), (egg_icon_list_rows_reordered),
(egg_icon_list_select_all_between),
(egg_icon_list_move_cursor_up_down),
(egg_icon_list_move_cursor_page_up_down),
(egg_icon_list_move_cursor_left_right),
(egg_icon_list_move_cursor_start_end), (egg_icon_list_set_model),
(egg_icon_list_get_selected_items), (egg_icon_list_select_all),
(egg_icon_list_unselect_all):
* libegg/iconlist/eggiconlist.h:
* libegg/iconlist/testiconlist.c: (foreach_selected_remove):
Fix the "selection_changed" signal to not get emitted twice in some cases.
Also fix a bunch of issues reported by Jonathan.
2004-07-04 12:43:26 +00:00
|
|
|
if (!item->selected)
|
2008-02-12 16:43:04 +00:00
|
|
|
{
|
|
|
|
dirty = TRUE;
|
|
|
|
item->selected = TRUE;
|
|
|
|
gtk_icon_view_item_selected_changed (icon_view, item);
|
|
|
|
}
|
2004-07-04 15:56:55 +00:00
|
|
|
gtk_icon_view_queue_draw_item (icon_view, item);
|
2004-06-18 05:17:01 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
Fix the "selection_changed" signal to not get emitted twice in some cases.
2004-07-04 Anders Carlsson <andersca@gnome.org>
* configure.in:
* libegg/iconlist/eggiconlist.c: (egg_icon_list_expose),
(scroll_timeout), (egg_icon_list_motion),
(egg_icon_list_button_press), (egg_icon_list_update_rubberband),
(egg_icon_list_start_rubberbanding),
(egg_icon_list_stop_rubberbanding),
(egg_icon_list_unselect_all_internal),
(egg_icon_list_real_select_all),
(egg_icon_list_adjustment_changed), (egg_icon_list_item_free),
(egg_icon_list_select_item), (verify_items),
(egg_icon_list_row_changed), (egg_icon_list_row_inserted),
(egg_icon_list_row_deleted), (egg_icon_list_rows_reordered),
(egg_icon_list_select_all_between),
(egg_icon_list_move_cursor_up_down),
(egg_icon_list_move_cursor_page_up_down),
(egg_icon_list_move_cursor_left_right),
(egg_icon_list_move_cursor_start_end), (egg_icon_list_set_model),
(egg_icon_list_get_selected_items), (egg_icon_list_select_all),
(egg_icon_list_unselect_all):
* libegg/iconlist/eggiconlist.h:
* libegg/iconlist/testiconlist.c: (foreach_selected_remove):
Fix the "selection_changed" signal to not get emitted twice in some cases.
Also fix a bunch of issues reported by Jonathan.
2004-07-04 12:43:26 +00:00
|
|
|
return dirty;
|
2004-06-18 05:17:01 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2004-07-04 15:56:55 +00:00
|
|
|
gtk_icon_view_move_cursor_up_down (GtkIconView *icon_view,
|
2004-06-18 05:17:01 +00:00
|
|
|
gint count)
|
|
|
|
{
|
2004-07-04 15:56:55 +00:00
|
|
|
GtkIconViewItem *item;
|
2010-12-12 10:59:41 +00:00
|
|
|
GtkCellRenderer *cell;
|
Fix the "selection_changed" signal to not get emitted twice in some cases.
2004-07-04 Anders Carlsson <andersca@gnome.org>
* configure.in:
* libegg/iconlist/eggiconlist.c: (egg_icon_list_expose),
(scroll_timeout), (egg_icon_list_motion),
(egg_icon_list_button_press), (egg_icon_list_update_rubberband),
(egg_icon_list_start_rubberbanding),
(egg_icon_list_stop_rubberbanding),
(egg_icon_list_unselect_all_internal),
(egg_icon_list_real_select_all),
(egg_icon_list_adjustment_changed), (egg_icon_list_item_free),
(egg_icon_list_select_item), (verify_items),
(egg_icon_list_row_changed), (egg_icon_list_row_inserted),
(egg_icon_list_row_deleted), (egg_icon_list_rows_reordered),
(egg_icon_list_select_all_between),
(egg_icon_list_move_cursor_up_down),
(egg_icon_list_move_cursor_page_up_down),
(egg_icon_list_move_cursor_left_right),
(egg_icon_list_move_cursor_start_end), (egg_icon_list_set_model),
(egg_icon_list_get_selected_items), (egg_icon_list_select_all),
(egg_icon_list_unselect_all):
* libegg/iconlist/eggiconlist.h:
* libegg/iconlist/testiconlist.c: (foreach_selected_remove):
Fix the "selection_changed" signal to not get emitted twice in some cases.
Also fix a bunch of issues reported by Jonathan.
2004-07-04 12:43:26 +00:00
|
|
|
gboolean dirty = FALSE;
|
2005-05-02 20:28:37 +00:00
|
|
|
gint step;
|
2010-05-30 04:28:11 +00:00
|
|
|
GtkDirectionType direction;
|
|
|
|
|
2010-03-01 03:21:41 +00:00
|
|
|
if (!gtk_widget_has_focus (GTK_WIDGET (icon_view)))
|
2004-06-18 05:17:01 +00:00
|
|
|
return;
|
2010-05-30 04:28:11 +00:00
|
|
|
|
|
|
|
direction = count < 0 ? GTK_DIR_UP : GTK_DIR_DOWN;
|
|
|
|
|
2004-07-04 15:56:55 +00:00
|
|
|
if (!icon_view->priv->cursor_item)
|
2004-06-18 05:17:01 +00:00
|
|
|
{
|
|
|
|
GList *list;
|
|
|
|
|
|
|
|
if (count > 0)
|
2004-07-04 15:56:55 +00:00
|
|
|
list = icon_view->priv->items;
|
2004-06-18 05:17:01 +00:00
|
|
|
else
|
2004-07-04 15:56:55 +00:00
|
|
|
list = g_list_last (icon_view->priv->items);
|
2004-06-18 05:17:01 +00:00
|
|
|
|
2004-09-29 05:29:31 +00:00
|
|
|
item = list ? list->data : NULL;
|
2010-12-12 10:59:41 +00:00
|
|
|
|
|
|
|
/* Give focus to the first cell initially */
|
|
|
|
gtk_icon_view_set_cell_data (icon_view, item);
|
|
|
|
gtk_cell_area_focus (icon_view->priv->cell_area, direction);
|
2004-06-18 05:17:01 +00:00
|
|
|
}
|
|
|
|
else
|
2005-05-02 20:28:37 +00:00
|
|
|
{
|
|
|
|
item = icon_view->priv->cursor_item;
|
|
|
|
step = count > 0 ? 1 : -1;
|
2010-12-12 10:59:41 +00:00
|
|
|
|
|
|
|
/* Save the current focus cell in case we hit the edge */
|
|
|
|
cell = gtk_cell_area_get_focus_cell (icon_view->priv->cell_area);
|
|
|
|
|
2005-05-02 20:28:37 +00:00
|
|
|
while (item)
|
|
|
|
{
|
2010-12-12 10:59:41 +00:00
|
|
|
gtk_icon_view_set_cell_data (icon_view, item);
|
|
|
|
|
|
|
|
if (gtk_cell_area_focus (icon_view->priv->cell_area, direction))
|
2005-05-02 20:28:37 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
item = find_item (icon_view, item, step, 0);
|
|
|
|
}
|
|
|
|
}
|
2004-06-18 05:17:01 +00:00
|
|
|
|
|
|
|
if (!item)
|
2006-11-16 12:56:30 +00:00
|
|
|
{
|
2010-05-30 04:28:11 +00:00
|
|
|
if (!gtk_widget_keynav_failed (GTK_WIDGET (icon_view), direction))
|
|
|
|
{
|
|
|
|
GtkWidget *toplevel = gtk_widget_get_toplevel (GTK_WIDGET (icon_view));
|
|
|
|
if (toplevel)
|
|
|
|
gtk_widget_child_focus (toplevel,
|
|
|
|
direction == GTK_DIR_UP ?
|
|
|
|
GTK_DIR_TAB_BACKWARD :
|
|
|
|
GTK_DIR_TAB_FORWARD);
|
2011-01-05 12:58:32 +00:00
|
|
|
|
2010-05-30 04:28:11 +00:00
|
|
|
}
|
|
|
|
|
2010-12-12 10:59:41 +00:00
|
|
|
gtk_cell_area_set_focus_cell (icon_view->priv->cell_area, cell);
|
2006-11-16 12:56:30 +00:00
|
|
|
return;
|
|
|
|
}
|
2004-06-18 05:17:01 +00:00
|
|
|
|
2004-07-04 15:56:55 +00:00
|
|
|
if (icon_view->priv->ctrl_pressed ||
|
|
|
|
!icon_view->priv->shift_pressed ||
|
|
|
|
!icon_view->priv->anchor_item ||
|
|
|
|
icon_view->priv->selection_mode != GTK_SELECTION_MULTIPLE)
|
|
|
|
icon_view->priv->anchor_item = item;
|
2004-06-18 05:17:01 +00:00
|
|
|
|
2010-12-12 10:59:41 +00:00
|
|
|
cell = gtk_cell_area_get_focus_cell (icon_view->priv->cell_area);
|
2005-05-02 20:28:37 +00:00
|
|
|
gtk_icon_view_set_cursor_item (icon_view, item, cell);
|
2004-06-21 03:41:04 +00:00
|
|
|
|
2004-07-04 15:56:55 +00:00
|
|
|
if (!icon_view->priv->ctrl_pressed &&
|
|
|
|
icon_view->priv->selection_mode != GTK_SELECTION_NONE)
|
2004-06-21 03:41:04 +00:00
|
|
|
{
|
2005-04-29 17:02:06 +00:00
|
|
|
dirty = gtk_icon_view_unselect_all_internal (icon_view);
|
2004-07-04 15:56:55 +00:00
|
|
|
dirty = gtk_icon_view_select_all_between (icon_view,
|
|
|
|
icon_view->priv->anchor_item,
|
2005-04-29 17:02:06 +00:00
|
|
|
item) || dirty;
|
2004-06-21 03:41:04 +00:00
|
|
|
}
|
|
|
|
|
2004-07-04 15:56:55 +00:00
|
|
|
gtk_icon_view_scroll_to_item (icon_view, item);
|
Fix the "selection_changed" signal to not get emitted twice in some cases.
2004-07-04 Anders Carlsson <andersca@gnome.org>
* configure.in:
* libegg/iconlist/eggiconlist.c: (egg_icon_list_expose),
(scroll_timeout), (egg_icon_list_motion),
(egg_icon_list_button_press), (egg_icon_list_update_rubberband),
(egg_icon_list_start_rubberbanding),
(egg_icon_list_stop_rubberbanding),
(egg_icon_list_unselect_all_internal),
(egg_icon_list_real_select_all),
(egg_icon_list_adjustment_changed), (egg_icon_list_item_free),
(egg_icon_list_select_item), (verify_items),
(egg_icon_list_row_changed), (egg_icon_list_row_inserted),
(egg_icon_list_row_deleted), (egg_icon_list_rows_reordered),
(egg_icon_list_select_all_between),
(egg_icon_list_move_cursor_up_down),
(egg_icon_list_move_cursor_page_up_down),
(egg_icon_list_move_cursor_left_right),
(egg_icon_list_move_cursor_start_end), (egg_icon_list_set_model),
(egg_icon_list_get_selected_items), (egg_icon_list_select_all),
(egg_icon_list_unselect_all):
* libegg/iconlist/eggiconlist.h:
* libegg/iconlist/testiconlist.c: (foreach_selected_remove):
Fix the "selection_changed" signal to not get emitted twice in some cases.
Also fix a bunch of issues reported by Jonathan.
2004-07-04 12:43:26 +00:00
|
|
|
|
|
|
|
if (dirty)
|
2004-07-04 15:56:55 +00:00
|
|
|
g_signal_emit (icon_view, icon_view_signals[SELECTION_CHANGED], 0);
|
2004-06-18 05:17:01 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2004-07-04 15:56:55 +00:00
|
|
|
gtk_icon_view_move_cursor_page_up_down (GtkIconView *icon_view,
|
2004-06-18 05:17:01 +00:00
|
|
|
gint count)
|
|
|
|
{
|
2004-07-04 15:56:55 +00:00
|
|
|
GtkIconViewItem *item;
|
Fix the "selection_changed" signal to not get emitted twice in some cases.
2004-07-04 Anders Carlsson <andersca@gnome.org>
* configure.in:
* libegg/iconlist/eggiconlist.c: (egg_icon_list_expose),
(scroll_timeout), (egg_icon_list_motion),
(egg_icon_list_button_press), (egg_icon_list_update_rubberband),
(egg_icon_list_start_rubberbanding),
(egg_icon_list_stop_rubberbanding),
(egg_icon_list_unselect_all_internal),
(egg_icon_list_real_select_all),
(egg_icon_list_adjustment_changed), (egg_icon_list_item_free),
(egg_icon_list_select_item), (verify_items),
(egg_icon_list_row_changed), (egg_icon_list_row_inserted),
(egg_icon_list_row_deleted), (egg_icon_list_rows_reordered),
(egg_icon_list_select_all_between),
(egg_icon_list_move_cursor_up_down),
(egg_icon_list_move_cursor_page_up_down),
(egg_icon_list_move_cursor_left_right),
(egg_icon_list_move_cursor_start_end), (egg_icon_list_set_model),
(egg_icon_list_get_selected_items), (egg_icon_list_select_all),
(egg_icon_list_unselect_all):
* libegg/iconlist/eggiconlist.h:
* libegg/iconlist/testiconlist.c: (foreach_selected_remove):
Fix the "selection_changed" signal to not get emitted twice in some cases.
Also fix a bunch of issues reported by Jonathan.
2004-07-04 12:43:26 +00:00
|
|
|
gboolean dirty = FALSE;
|
|
|
|
|
2010-03-01 03:21:41 +00:00
|
|
|
if (!gtk_widget_has_focus (GTK_WIDGET (icon_view)))
|
2004-06-18 05:17:01 +00:00
|
|
|
return;
|
|
|
|
|
2004-07-04 15:56:55 +00:00
|
|
|
if (!icon_view->priv->cursor_item)
|
2004-06-18 05:17:01 +00:00
|
|
|
{
|
|
|
|
GList *list;
|
|
|
|
|
|
|
|
if (count > 0)
|
2004-07-04 15:56:55 +00:00
|
|
|
list = icon_view->priv->items;
|
2004-06-18 05:17:01 +00:00
|
|
|
else
|
2004-07-04 15:56:55 +00:00
|
|
|
list = g_list_last (icon_view->priv->items);
|
2004-06-18 05:17:01 +00:00
|
|
|
|
2004-09-29 05:29:31 +00:00
|
|
|
item = list ? list->data : NULL;
|
2004-06-18 05:17:01 +00:00
|
|
|
}
|
|
|
|
else
|
2004-07-04 15:56:55 +00:00
|
|
|
item = find_item_page_up_down (icon_view,
|
|
|
|
icon_view->priv->cursor_item,
|
2004-06-18 05:17:01 +00:00
|
|
|
count);
|
|
|
|
|
2006-11-16 12:56:30 +00:00
|
|
|
if (item == icon_view->priv->cursor_item)
|
|
|
|
gtk_widget_error_bell (GTK_WIDGET (icon_view));
|
|
|
|
|
2004-06-18 05:17:01 +00:00
|
|
|
if (!item)
|
|
|
|
return;
|
|
|
|
|
2004-07-04 15:56:55 +00:00
|
|
|
if (icon_view->priv->ctrl_pressed ||
|
|
|
|
!icon_view->priv->shift_pressed ||
|
|
|
|
!icon_view->priv->anchor_item ||
|
|
|
|
icon_view->priv->selection_mode != GTK_SELECTION_MULTIPLE)
|
|
|
|
icon_view->priv->anchor_item = item;
|
2004-06-18 05:17:01 +00:00
|
|
|
|
2010-12-12 07:29:41 +00:00
|
|
|
gtk_icon_view_set_cursor_item (icon_view, item, NULL);
|
2004-06-21 03:41:04 +00:00
|
|
|
|
2004-07-04 15:56:55 +00:00
|
|
|
if (!icon_view->priv->ctrl_pressed &&
|
|
|
|
icon_view->priv->selection_mode != GTK_SELECTION_NONE)
|
2004-06-21 03:41:04 +00:00
|
|
|
{
|
2005-04-29 17:02:06 +00:00
|
|
|
dirty = gtk_icon_view_unselect_all_internal (icon_view);
|
2004-07-04 15:56:55 +00:00
|
|
|
dirty = gtk_icon_view_select_all_between (icon_view,
|
|
|
|
icon_view->priv->anchor_item,
|
2005-04-29 17:02:06 +00:00
|
|
|
item) || dirty;
|
2004-06-21 03:41:04 +00:00
|
|
|
}
|
|
|
|
|
2004-07-04 15:56:55 +00:00
|
|
|
gtk_icon_view_scroll_to_item (icon_view, item);
|
Fix the "selection_changed" signal to not get emitted twice in some cases.
2004-07-04 Anders Carlsson <andersca@gnome.org>
* configure.in:
* libegg/iconlist/eggiconlist.c: (egg_icon_list_expose),
(scroll_timeout), (egg_icon_list_motion),
(egg_icon_list_button_press), (egg_icon_list_update_rubberband),
(egg_icon_list_start_rubberbanding),
(egg_icon_list_stop_rubberbanding),
(egg_icon_list_unselect_all_internal),
(egg_icon_list_real_select_all),
(egg_icon_list_adjustment_changed), (egg_icon_list_item_free),
(egg_icon_list_select_item), (verify_items),
(egg_icon_list_row_changed), (egg_icon_list_row_inserted),
(egg_icon_list_row_deleted), (egg_icon_list_rows_reordered),
(egg_icon_list_select_all_between),
(egg_icon_list_move_cursor_up_down),
(egg_icon_list_move_cursor_page_up_down),
(egg_icon_list_move_cursor_left_right),
(egg_icon_list_move_cursor_start_end), (egg_icon_list_set_model),
(egg_icon_list_get_selected_items), (egg_icon_list_select_all),
(egg_icon_list_unselect_all):
* libegg/iconlist/eggiconlist.h:
* libegg/iconlist/testiconlist.c: (foreach_selected_remove):
Fix the "selection_changed" signal to not get emitted twice in some cases.
Also fix a bunch of issues reported by Jonathan.
2004-07-04 12:43:26 +00:00
|
|
|
|
|
|
|
if (dirty)
|
2004-07-04 15:56:55 +00:00
|
|
|
g_signal_emit (icon_view, icon_view_signals[SELECTION_CHANGED], 0);
|
2004-06-18 05:17:01 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2004-07-04 15:56:55 +00:00
|
|
|
gtk_icon_view_move_cursor_left_right (GtkIconView *icon_view,
|
2004-06-18 05:17:01 +00:00
|
|
|
gint count)
|
|
|
|
{
|
2004-07-04 15:56:55 +00:00
|
|
|
GtkIconViewItem *item;
|
2010-12-12 10:59:41 +00:00
|
|
|
GtkCellRenderer *cell = NULL;
|
Fix the "selection_changed" signal to not get emitted twice in some cases.
2004-07-04 Anders Carlsson <andersca@gnome.org>
* configure.in:
* libegg/iconlist/eggiconlist.c: (egg_icon_list_expose),
(scroll_timeout), (egg_icon_list_motion),
(egg_icon_list_button_press), (egg_icon_list_update_rubberband),
(egg_icon_list_start_rubberbanding),
(egg_icon_list_stop_rubberbanding),
(egg_icon_list_unselect_all_internal),
(egg_icon_list_real_select_all),
(egg_icon_list_adjustment_changed), (egg_icon_list_item_free),
(egg_icon_list_select_item), (verify_items),
(egg_icon_list_row_changed), (egg_icon_list_row_inserted),
(egg_icon_list_row_deleted), (egg_icon_list_rows_reordered),
(egg_icon_list_select_all_between),
(egg_icon_list_move_cursor_up_down),
(egg_icon_list_move_cursor_page_up_down),
(egg_icon_list_move_cursor_left_right),
(egg_icon_list_move_cursor_start_end), (egg_icon_list_set_model),
(egg_icon_list_get_selected_items), (egg_icon_list_select_all),
(egg_icon_list_unselect_all):
* libegg/iconlist/eggiconlist.h:
* libegg/iconlist/testiconlist.c: (foreach_selected_remove):
Fix the "selection_changed" signal to not get emitted twice in some cases.
Also fix a bunch of issues reported by Jonathan.
2004-07-04 12:43:26 +00:00
|
|
|
gboolean dirty = FALSE;
|
2005-05-02 20:28:37 +00:00
|
|
|
gint step;
|
2010-05-30 06:15:40 +00:00
|
|
|
GtkDirectionType direction;
|
|
|
|
|
2010-03-01 03:21:41 +00:00
|
|
|
if (!gtk_widget_has_focus (GTK_WIDGET (icon_view)))
|
2004-06-18 05:17:01 +00:00
|
|
|
return;
|
2010-05-30 06:15:40 +00:00
|
|
|
|
|
|
|
direction = count < 0 ? GTK_DIR_LEFT : GTK_DIR_RIGHT;
|
|
|
|
|
2004-07-04 15:56:55 +00:00
|
|
|
if (!icon_view->priv->cursor_item)
|
2004-06-18 05:17:01 +00:00
|
|
|
{
|
|
|
|
GList *list;
|
|
|
|
|
|
|
|
if (count > 0)
|
2004-07-04 15:56:55 +00:00
|
|
|
list = icon_view->priv->items;
|
2004-06-18 05:17:01 +00:00
|
|
|
else
|
2004-07-04 15:56:55 +00:00
|
|
|
list = g_list_last (icon_view->priv->items);
|
2004-06-18 05:17:01 +00:00
|
|
|
|
2004-09-29 05:29:31 +00:00
|
|
|
item = list ? list->data : NULL;
|
2010-12-12 10:59:41 +00:00
|
|
|
|
|
|
|
/* Give focus to the first cell initially */
|
|
|
|
gtk_icon_view_set_cell_data (icon_view, item);
|
|
|
|
gtk_cell_area_focus (icon_view->priv->cell_area, direction);
|
2004-06-18 05:17:01 +00:00
|
|
|
}
|
2005-05-02 20:28:37 +00:00
|
|
|
else
|
|
|
|
{
|
|
|
|
item = icon_view->priv->cursor_item;
|
|
|
|
step = count > 0 ? 1 : -1;
|
2010-12-12 10:59:41 +00:00
|
|
|
|
|
|
|
/* Save the current focus cell in case we hit the edge */
|
|
|
|
cell = gtk_cell_area_get_focus_cell (icon_view->priv->cell_area);
|
|
|
|
|
2005-05-02 20:28:37 +00:00
|
|
|
while (item)
|
|
|
|
{
|
2010-12-12 10:59:41 +00:00
|
|
|
gtk_icon_view_set_cell_data (icon_view, item);
|
|
|
|
|
|
|
|
if (gtk_cell_area_focus (icon_view->priv->cell_area, direction))
|
2005-05-02 20:28:37 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
item = find_item (icon_view, item, 0, step);
|
|
|
|
}
|
|
|
|
}
|
2004-06-18 05:17:01 +00:00
|
|
|
|
|
|
|
if (!item)
|
2006-11-16 12:56:30 +00:00
|
|
|
{
|
2010-05-30 06:15:40 +00:00
|
|
|
if (!gtk_widget_keynav_failed (GTK_WIDGET (icon_view), direction))
|
|
|
|
{
|
|
|
|
GtkWidget *toplevel = gtk_widget_get_toplevel (GTK_WIDGET (icon_view));
|
|
|
|
if (toplevel)
|
|
|
|
gtk_widget_child_focus (toplevel,
|
|
|
|
direction == GTK_DIR_LEFT ?
|
|
|
|
GTK_DIR_TAB_BACKWARD :
|
|
|
|
GTK_DIR_TAB_FORWARD);
|
2011-01-05 12:58:32 +00:00
|
|
|
|
2010-05-30 06:15:40 +00:00
|
|
|
}
|
|
|
|
|
2010-12-12 10:59:41 +00:00
|
|
|
gtk_cell_area_set_focus_cell (icon_view->priv->cell_area, cell);
|
2006-11-16 12:56:30 +00:00
|
|
|
return;
|
|
|
|
}
|
2004-06-18 05:17:01 +00:00
|
|
|
|
2004-07-04 15:56:55 +00:00
|
|
|
if (icon_view->priv->ctrl_pressed ||
|
|
|
|
!icon_view->priv->shift_pressed ||
|
|
|
|
!icon_view->priv->anchor_item ||
|
|
|
|
icon_view->priv->selection_mode != GTK_SELECTION_MULTIPLE)
|
|
|
|
icon_view->priv->anchor_item = item;
|
2004-06-18 05:17:01 +00:00
|
|
|
|
2010-12-12 10:59:41 +00:00
|
|
|
cell = gtk_cell_area_get_focus_cell (icon_view->priv->cell_area);
|
2005-05-02 20:28:37 +00:00
|
|
|
gtk_icon_view_set_cursor_item (icon_view, item, cell);
|
2004-06-21 03:41:04 +00:00
|
|
|
|
2004-07-04 15:56:55 +00:00
|
|
|
if (!icon_view->priv->ctrl_pressed &&
|
|
|
|
icon_view->priv->selection_mode != GTK_SELECTION_NONE)
|
2004-06-21 03:41:04 +00:00
|
|
|
{
|
2005-04-29 17:02:06 +00:00
|
|
|
dirty = gtk_icon_view_unselect_all_internal (icon_view);
|
2004-07-04 15:56:55 +00:00
|
|
|
dirty = gtk_icon_view_select_all_between (icon_view,
|
|
|
|
icon_view->priv->anchor_item,
|
2005-04-29 17:02:06 +00:00
|
|
|
item) || dirty;
|
2004-06-21 03:41:04 +00:00
|
|
|
}
|
|
|
|
|
2004-07-04 15:56:55 +00:00
|
|
|
gtk_icon_view_scroll_to_item (icon_view, item);
|
Fix the "selection_changed" signal to not get emitted twice in some cases.
2004-07-04 Anders Carlsson <andersca@gnome.org>
* configure.in:
* libegg/iconlist/eggiconlist.c: (egg_icon_list_expose),
(scroll_timeout), (egg_icon_list_motion),
(egg_icon_list_button_press), (egg_icon_list_update_rubberband),
(egg_icon_list_start_rubberbanding),
(egg_icon_list_stop_rubberbanding),
(egg_icon_list_unselect_all_internal),
(egg_icon_list_real_select_all),
(egg_icon_list_adjustment_changed), (egg_icon_list_item_free),
(egg_icon_list_select_item), (verify_items),
(egg_icon_list_row_changed), (egg_icon_list_row_inserted),
(egg_icon_list_row_deleted), (egg_icon_list_rows_reordered),
(egg_icon_list_select_all_between),
(egg_icon_list_move_cursor_up_down),
(egg_icon_list_move_cursor_page_up_down),
(egg_icon_list_move_cursor_left_right),
(egg_icon_list_move_cursor_start_end), (egg_icon_list_set_model),
(egg_icon_list_get_selected_items), (egg_icon_list_select_all),
(egg_icon_list_unselect_all):
* libegg/iconlist/eggiconlist.h:
* libegg/iconlist/testiconlist.c: (foreach_selected_remove):
Fix the "selection_changed" signal to not get emitted twice in some cases.
Also fix a bunch of issues reported by Jonathan.
2004-07-04 12:43:26 +00:00
|
|
|
|
|
|
|
if (dirty)
|
2004-07-04 15:56:55 +00:00
|
|
|
g_signal_emit (icon_view, icon_view_signals[SELECTION_CHANGED], 0);
|
2004-06-18 05:17:01 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2004-07-04 15:56:55 +00:00
|
|
|
gtk_icon_view_move_cursor_start_end (GtkIconView *icon_view,
|
2004-06-18 05:17:01 +00:00
|
|
|
gint count)
|
|
|
|
{
|
2004-07-04 15:56:55 +00:00
|
|
|
GtkIconViewItem *item;
|
2004-06-18 05:17:01 +00:00
|
|
|
GList *list;
|
Fix the "selection_changed" signal to not get emitted twice in some cases.
2004-07-04 Anders Carlsson <andersca@gnome.org>
* configure.in:
* libegg/iconlist/eggiconlist.c: (egg_icon_list_expose),
(scroll_timeout), (egg_icon_list_motion),
(egg_icon_list_button_press), (egg_icon_list_update_rubberband),
(egg_icon_list_start_rubberbanding),
(egg_icon_list_stop_rubberbanding),
(egg_icon_list_unselect_all_internal),
(egg_icon_list_real_select_all),
(egg_icon_list_adjustment_changed), (egg_icon_list_item_free),
(egg_icon_list_select_item), (verify_items),
(egg_icon_list_row_changed), (egg_icon_list_row_inserted),
(egg_icon_list_row_deleted), (egg_icon_list_rows_reordered),
(egg_icon_list_select_all_between),
(egg_icon_list_move_cursor_up_down),
(egg_icon_list_move_cursor_page_up_down),
(egg_icon_list_move_cursor_left_right),
(egg_icon_list_move_cursor_start_end), (egg_icon_list_set_model),
(egg_icon_list_get_selected_items), (egg_icon_list_select_all),
(egg_icon_list_unselect_all):
* libegg/iconlist/eggiconlist.h:
* libegg/iconlist/testiconlist.c: (foreach_selected_remove):
Fix the "selection_changed" signal to not get emitted twice in some cases.
Also fix a bunch of issues reported by Jonathan.
2004-07-04 12:43:26 +00:00
|
|
|
gboolean dirty = FALSE;
|
2004-06-18 05:17:01 +00:00
|
|
|
|
2010-03-01 03:21:41 +00:00
|
|
|
if (!gtk_widget_has_focus (GTK_WIDGET (icon_view)))
|
2004-06-18 05:17:01 +00:00
|
|
|
return;
|
|
|
|
|
|
|
|
if (count < 0)
|
2004-07-04 15:56:55 +00:00
|
|
|
list = icon_view->priv->items;
|
2004-06-18 05:17:01 +00:00
|
|
|
else
|
2004-07-04 15:56:55 +00:00
|
|
|
list = g_list_last (icon_view->priv->items);
|
2004-06-18 05:17:01 +00:00
|
|
|
|
2004-09-29 05:29:31 +00:00
|
|
|
item = list ? list->data : NULL;
|
2004-06-18 05:17:01 +00:00
|
|
|
|
2006-11-16 12:56:30 +00:00
|
|
|
if (item == icon_view->priv->cursor_item)
|
|
|
|
gtk_widget_error_bell (GTK_WIDGET (icon_view));
|
|
|
|
|
2004-06-18 05:17:01 +00:00
|
|
|
if (!item)
|
|
|
|
return;
|
|
|
|
|
2004-07-04 15:56:55 +00:00
|
|
|
if (icon_view->priv->ctrl_pressed ||
|
|
|
|
!icon_view->priv->shift_pressed ||
|
|
|
|
!icon_view->priv->anchor_item ||
|
|
|
|
icon_view->priv->selection_mode != GTK_SELECTION_MULTIPLE)
|
|
|
|
icon_view->priv->anchor_item = item;
|
2004-06-18 05:17:01 +00:00
|
|
|
|
2010-12-12 07:29:41 +00:00
|
|
|
gtk_icon_view_set_cursor_item (icon_view, item, NULL);
|
2004-06-21 03:41:04 +00:00
|
|
|
|
2004-07-04 15:56:55 +00:00
|
|
|
if (!icon_view->priv->ctrl_pressed &&
|
|
|
|
icon_view->priv->selection_mode != GTK_SELECTION_NONE)
|
2004-06-21 03:41:04 +00:00
|
|
|
{
|
2005-04-29 17:02:06 +00:00
|
|
|
dirty = gtk_icon_view_unselect_all_internal (icon_view);
|
2004-07-04 15:56:55 +00:00
|
|
|
dirty = gtk_icon_view_select_all_between (icon_view,
|
|
|
|
icon_view->priv->anchor_item,
|
2005-04-29 17:02:06 +00:00
|
|
|
item) || dirty;
|
2004-06-21 03:41:04 +00:00
|
|
|
}
|
|
|
|
|
2004-07-04 15:56:55 +00:00
|
|
|
gtk_icon_view_scroll_to_item (icon_view, item);
|
Fix the "selection_changed" signal to not get emitted twice in some cases.
2004-07-04 Anders Carlsson <andersca@gnome.org>
* configure.in:
* libegg/iconlist/eggiconlist.c: (egg_icon_list_expose),
(scroll_timeout), (egg_icon_list_motion),
(egg_icon_list_button_press), (egg_icon_list_update_rubberband),
(egg_icon_list_start_rubberbanding),
(egg_icon_list_stop_rubberbanding),
(egg_icon_list_unselect_all_internal),
(egg_icon_list_real_select_all),
(egg_icon_list_adjustment_changed), (egg_icon_list_item_free),
(egg_icon_list_select_item), (verify_items),
(egg_icon_list_row_changed), (egg_icon_list_row_inserted),
(egg_icon_list_row_deleted), (egg_icon_list_rows_reordered),
(egg_icon_list_select_all_between),
(egg_icon_list_move_cursor_up_down),
(egg_icon_list_move_cursor_page_up_down),
(egg_icon_list_move_cursor_left_right),
(egg_icon_list_move_cursor_start_end), (egg_icon_list_set_model),
(egg_icon_list_get_selected_items), (egg_icon_list_select_all),
(egg_icon_list_unselect_all):
* libegg/iconlist/eggiconlist.h:
* libegg/iconlist/testiconlist.c: (foreach_selected_remove):
Fix the "selection_changed" signal to not get emitted twice in some cases.
Also fix a bunch of issues reported by Jonathan.
2004-07-04 12:43:26 +00:00
|
|
|
|
|
|
|
if (dirty)
|
2004-07-04 15:56:55 +00:00
|
|
|
g_signal_emit (icon_view, icon_view_signals[SELECTION_CHANGED], 0);
|
2004-06-18 05:17:01 +00:00
|
|
|
}
|
|
|
|
|
2005-06-09 06:07:57 +00:00
|
|
|
/**
|
|
|
|
* gtk_icon_view_scroll_to_path:
|
|
|
|
* @icon_view: A #GtkIconView.
|
|
|
|
* @path: The path of the item to move to.
|
|
|
|
* @use_align: whether to use alignment arguments, or %FALSE.
|
|
|
|
* @row_align: The vertical alignment of the item specified by @path.
|
2005-09-19 18:55:02 +00:00
|
|
|
* @col_align: The horizontal alignment of the item specified by @path.
|
2005-06-09 06:07:57 +00:00
|
|
|
*
|
|
|
|
* Moves the alignments of @icon_view to the position specified by @path.
|
2006-03-20 03:16:43 +00:00
|
|
|
* @row_align determines where the row is placed, and @col_align determines
|
|
|
|
* where @column is placed. Both are expected to be between 0.0 and 1.0.
|
|
|
|
* 0.0 means left/top alignment, 1.0 means right/bottom alignment, 0.5 means
|
|
|
|
* center.
|
2005-06-09 06:07:57 +00:00
|
|
|
*
|
|
|
|
* If @use_align is %FALSE, then the alignment arguments are ignored, and the
|
|
|
|
* tree does the minimum amount of work to scroll the item onto the screen.
|
|
|
|
* This means that the item will be scrolled to the edge closest to its current
|
|
|
|
* position. If the item is currently visible on the screen, nothing is done.
|
|
|
|
*
|
2006-03-20 03:16:43 +00:00
|
|
|
* This function only works if the model is set, and @path is a valid row on
|
|
|
|
* the model. If the model changes before the @icon_view is realized, the
|
|
|
|
* centered path will be modified to reflect this change.
|
2005-06-09 06:07:57 +00:00
|
|
|
*
|
|
|
|
* Since: 2.8
|
|
|
|
**/
|
|
|
|
void
|
|
|
|
gtk_icon_view_scroll_to_path (GtkIconView *icon_view,
|
|
|
|
GtkTreePath *path,
|
|
|
|
gboolean use_align,
|
|
|
|
gfloat row_align,
|
|
|
|
gfloat col_align)
|
|
|
|
{
|
2005-08-15 16:46:52 +00:00
|
|
|
GtkIconViewItem *item = NULL;
|
2010-08-11 21:10:57 +00:00
|
|
|
GtkWidget *widget;
|
2005-06-09 06:07:57 +00:00
|
|
|
|
|
|
|
g_return_if_fail (GTK_IS_ICON_VIEW (icon_view));
|
|
|
|
g_return_if_fail (path != NULL);
|
|
|
|
g_return_if_fail (row_align >= 0.0 && row_align <= 1.0);
|
|
|
|
g_return_if_fail (col_align >= 0.0 && col_align <= 1.0);
|
2005-08-20 20:16:34 +00:00
|
|
|
|
2010-08-11 21:10:57 +00:00
|
|
|
widget = GTK_WIDGET (icon_view);
|
|
|
|
|
2006-03-02 19:52:26 +00:00
|
|
|
if (gtk_tree_path_get_depth (path) > 0)
|
|
|
|
item = g_list_nth_data (icon_view->priv->items,
|
2010-06-28 18:15:10 +00:00
|
|
|
gtk_tree_path_get_indices(path)[0]);
|
2006-03-02 19:52:26 +00:00
|
|
|
|
2010-12-13 08:41:50 +00:00
|
|
|
if (!item || item->cell_area.width < 0 ||
|
2010-08-11 21:10:57 +00:00
|
|
|
!gtk_widget_get_realized (widget))
|
2005-08-20 20:16:34 +00:00
|
|
|
{
|
|
|
|
if (icon_view->priv->scroll_to_path)
|
|
|
|
gtk_tree_row_reference_free (icon_view->priv->scroll_to_path);
|
|
|
|
|
|
|
|
icon_view->priv->scroll_to_path = NULL;
|
|
|
|
|
|
|
|
if (path)
|
|
|
|
icon_view->priv->scroll_to_path = gtk_tree_row_reference_new_proxy (G_OBJECT (icon_view), icon_view->priv->model, path);
|
|
|
|
|
|
|
|
icon_view->priv->scroll_to_use_align = use_align;
|
|
|
|
icon_view->priv->scroll_to_row_align = row_align;
|
|
|
|
icon_view->priv->scroll_to_col_align = col_align;
|
|
|
|
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2005-06-09 06:07:57 +00:00
|
|
|
if (use_align)
|
|
|
|
{
|
2010-08-11 21:10:57 +00:00
|
|
|
GtkAllocation allocation;
|
2005-09-13 19:57:42 +00:00
|
|
|
gint x, y;
|
2010-05-24 02:04:10 +00:00
|
|
|
gfloat offset;
|
2010-12-13 08:41:50 +00:00
|
|
|
GdkRectangle item_area =
|
|
|
|
{
|
|
|
|
item->cell_area.x - icon_view->priv->item_padding,
|
|
|
|
item->cell_area.y - icon_view->priv->item_padding,
|
|
|
|
item->cell_area.width + icon_view->priv->item_padding * 2,
|
|
|
|
item->cell_area.height + icon_view->priv->item_padding * 2
|
|
|
|
};
|
2005-06-09 06:07:57 +00:00
|
|
|
|
|
|
|
gdk_window_get_position (icon_view->priv->bin_window, &x, &y);
|
2010-08-11 21:10:57 +00:00
|
|
|
|
|
|
|
gtk_widget_get_allocation (widget, &allocation);
|
|
|
|
|
2010-12-13 08:41:50 +00:00
|
|
|
offset = y + item_area.y - row_align * (allocation.height - item_area.height);
|
2010-05-24 02:04:10 +00:00
|
|
|
|
|
|
|
gtk_adjustment_set_value (icon_view->priv->vadjustment,
|
2011-01-05 19:57:46 +00:00
|
|
|
gtk_adjustment_get_value (icon_view->priv->vadjustment) + offset);
|
2005-06-09 06:07:57 +00:00
|
|
|
|
2010-12-13 08:41:50 +00:00
|
|
|
offset = x + item_area.x - col_align * (allocation.width - item_area.width);
|
2010-05-24 02:04:10 +00:00
|
|
|
|
|
|
|
gtk_adjustment_set_value (icon_view->priv->hadjustment,
|
2011-01-05 19:57:46 +00:00
|
|
|
gtk_adjustment_get_value (icon_view->priv->hadjustment) + offset);
|
2005-06-09 06:07:57 +00:00
|
|
|
|
|
|
|
gtk_adjustment_changed (icon_view->priv->hadjustment);
|
|
|
|
gtk_adjustment_changed (icon_view->priv->vadjustment);
|
|
|
|
}
|
|
|
|
else
|
2005-08-20 20:16:34 +00:00
|
|
|
gtk_icon_view_scroll_to_item (icon_view, item);
|
2005-06-09 06:07:57 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2011-01-24 02:50:39 +00:00
|
|
|
static void
|
|
|
|
gtk_icon_view_scroll_to_item (GtkIconView *icon_view,
|
|
|
|
GtkIconViewItem *item)
|
2004-06-18 05:17:01 +00:00
|
|
|
{
|
2011-01-24 02:50:39 +00:00
|
|
|
GtkIconViewPrivate *priv = icon_view->priv;
|
2010-08-11 21:10:57 +00:00
|
|
|
GtkWidget *widget = GTK_WIDGET (icon_view);
|
2011-01-24 02:50:39 +00:00
|
|
|
GtkAdjustment *hadj, *vadj;
|
|
|
|
GtkAllocation allocation;
|
|
|
|
gint x, y;
|
|
|
|
GdkRectangle item_area;
|
|
|
|
|
|
|
|
item_area.x = item->cell_area.x - priv->item_padding;
|
|
|
|
item_area.y = item->cell_area.y - priv->item_padding;
|
|
|
|
item_area.width = item->cell_area.width + priv->item_padding * 2;
|
|
|
|
item_area.height = item->cell_area.height + priv->item_padding * 2;
|
2010-08-11 21:10:57 +00:00
|
|
|
|
2011-01-24 02:50:39 +00:00
|
|
|
gdk_window_get_position (icon_view->priv->bin_window, &x, &y);
|
2010-08-11 21:10:57 +00:00
|
|
|
gtk_widget_get_allocation (widget, &allocation);
|
|
|
|
|
2011-01-24 02:50:39 +00:00
|
|
|
hadj = icon_view->priv->hadjustment;
|
|
|
|
vadj = icon_view->priv->vadjustment;
|
|
|
|
|
2010-12-13 08:41:50 +00:00
|
|
|
if (y + item_area.y < 0)
|
2011-01-24 02:50:39 +00:00
|
|
|
gtk_adjustment_set_value (vadj,
|
|
|
|
gtk_adjustment_get_value (vadj)
|
|
|
|
+ y + item_area.y);
|
2010-12-13 08:41:50 +00:00
|
|
|
else if (y + item_area.y + item_area.height > allocation.height)
|
2011-01-24 02:50:39 +00:00
|
|
|
gtk_adjustment_set_value (vadj,
|
|
|
|
gtk_adjustment_get_value (vadj)
|
|
|
|
+ y + item_area.y + item_area.height - allocation.height);
|
2005-05-02 20:28:37 +00:00
|
|
|
|
2010-12-13 08:41:50 +00:00
|
|
|
if (x + item_area.x < 0)
|
2011-01-24 02:50:39 +00:00
|
|
|
gtk_adjustment_set_value (hadj,
|
|
|
|
gtk_adjustment_get_value (hadj)
|
|
|
|
+ x + item_area.x);
|
2010-12-13 08:41:50 +00:00
|
|
|
else if (x + item_area.x + item_area.width > allocation.width)
|
2011-01-24 02:50:39 +00:00
|
|
|
gtk_adjustment_set_value (hadj,
|
|
|
|
gtk_adjustment_get_value (hadj)
|
|
|
|
+ x + item_area.x + item_area.width - allocation.width);
|
2005-05-02 20:28:37 +00:00
|
|
|
|
2011-01-24 02:50:39 +00:00
|
|
|
gtk_adjustment_changed (hadj);
|
|
|
|
gtk_adjustment_changed (vadj);
|
2005-05-02 20:28:37 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/* GtkCellLayout implementation */
|
2011-01-31 22:34:37 +00:00
|
|
|
|
|
|
|
static void
|
|
|
|
gtk_icon_view_ensure_cell_area (GtkIconView *icon_view,
|
|
|
|
GtkCellArea *cell_area)
|
|
|
|
{
|
|
|
|
GtkIconViewPrivate *priv = icon_view->priv;
|
|
|
|
|
|
|
|
if (priv->cell_area)
|
|
|
|
return;
|
|
|
|
|
|
|
|
if (cell_area)
|
|
|
|
priv->cell_area = cell_area;
|
|
|
|
else
|
|
|
|
priv->cell_area = gtk_cell_area_box_new ();
|
|
|
|
|
|
|
|
g_object_ref_sink (priv->cell_area);
|
|
|
|
|
|
|
|
if (GTK_IS_ORIENTABLE (priv->cell_area))
|
|
|
|
gtk_orientable_set_orientation (GTK_ORIENTABLE (priv->cell_area), priv->item_orientation);
|
|
|
|
|
|
|
|
priv->cell_area_context = gtk_cell_area_create_context (priv->cell_area);
|
|
|
|
|
|
|
|
priv->add_editable_id =
|
|
|
|
g_signal_connect (priv->cell_area, "add-editable",
|
|
|
|
G_CALLBACK (gtk_icon_view_add_editable), icon_view);
|
|
|
|
priv->remove_editable_id =
|
|
|
|
g_signal_connect (priv->cell_area, "remove-editable",
|
|
|
|
G_CALLBACK (gtk_icon_view_remove_editable), icon_view);
|
|
|
|
priv->context_changed_id =
|
|
|
|
g_signal_connect (priv->cell_area_context, "notify",
|
|
|
|
G_CALLBACK (gtk_icon_view_context_changed), icon_view);
|
2011-02-23 11:50:50 +00:00
|
|
|
|
|
|
|
update_text_cell (icon_view);
|
|
|
|
update_pixbuf_cell (icon_view);
|
2011-01-31 22:34:37 +00:00
|
|
|
}
|
|
|
|
|
2010-12-12 07:29:41 +00:00
|
|
|
static GtkCellArea *
|
|
|
|
gtk_icon_view_cell_layout_get_area (GtkCellLayout *cell_layout)
|
2005-05-02 20:28:37 +00:00
|
|
|
{
|
2010-12-12 07:29:41 +00:00
|
|
|
GtkIconView *icon_view = GTK_ICON_VIEW (cell_layout);
|
2011-01-31 22:34:37 +00:00
|
|
|
GtkIconViewPrivate *priv = icon_view->priv;
|
|
|
|
|
|
|
|
if (G_UNLIKELY (!priv->cell_area))
|
|
|
|
gtk_icon_view_ensure_cell_area (icon_view, NULL);
|
2005-05-02 20:28:37 +00:00
|
|
|
|
2010-12-12 07:29:41 +00:00
|
|
|
return icon_view->priv->cell_area;
|
2005-05-02 20:28:37 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2011-01-31 22:34:37 +00:00
|
|
|
gtk_icon_view_set_cell_data (GtkIconView *icon_view,
|
2005-05-02 20:28:37 +00:00
|
|
|
GtkIconViewItem *item)
|
|
|
|
{
|
|
|
|
gboolean iters_persist;
|
|
|
|
GtkTreeIter iter;
|
2011-01-31 22:34:37 +00:00
|
|
|
|
2005-05-02 20:28:37 +00:00
|
|
|
iters_persist = gtk_tree_model_get_flags (icon_view->priv->model) & GTK_TREE_MODEL_ITERS_PERSIST;
|
|
|
|
|
|
|
|
if (!iters_persist)
|
|
|
|
{
|
|
|
|
GtkTreePath *path;
|
|
|
|
|
|
|
|
path = gtk_tree_path_new_from_indices (item->index, -1);
|
2006-12-29 04:39:51 +00:00
|
|
|
if (!gtk_tree_model_get_iter (icon_view->priv->model, &iter, path))
|
|
|
|
return;
|
2005-05-02 20:28:37 +00:00
|
|
|
gtk_tree_path_free (path);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
iter = item->iter;
|
|
|
|
|
2010-12-12 07:29:41 +00:00
|
|
|
gtk_cell_area_apply_attributes (icon_view->priv->cell_area,
|
|
|
|
icon_view->priv->model,
|
|
|
|
&iter, FALSE, FALSE);
|
2005-05-02 20:28:37 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2006-12-29 07:53:01 +00:00
|
|
|
|
Document functions and fix a few bugs.
2004-07-03 Anders Carlsson <andersca@gnome.org>
* libegg/iconlist/eggiconlist.c: (egg_icon_list_add_move_binding),
(egg_icon_list_real_move_cursor), (egg_icon_list_new),
(egg_icon_list_new_with_model), (egg_icon_list_get_path_at_pos),
(egg_icon_list_selected_foreach),
(egg_icon_list_set_selection_mode),
(egg_icon_list_get_selection_mode), (egg_icon_list_set_model),
(egg_icon_list_get_model), (egg_icon_list_set_text_column),
(egg_icon_list_get_text_column), (egg_icon_list_set_markup_column),
(egg_icon_list_get_markup_column),
(egg_icon_list_set_pixbuf_column),
(egg_icon_list_get_pixbuf_column), (egg_icon_list_select_path),
(egg_icon_list_unselect_path), (egg_icon_list_select_all),
(egg_icon_list_unselect_all), (egg_icon_list_path_is_selected),
(egg_icon_list_item_activated):
* libegg/iconlist/eggiconlist.h:
* libegg/iconlist/testiconlist.c: (foreach_selected_remove_func),
(foreach_selected_remove), (selection_changed), (main):
Document functions and fix a few bugs.
2004-07-03 08:01:34 +00:00
|
|
|
/* Public API */
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
2004-07-04 15:56:55 +00:00
|
|
|
* gtk_icon_view_new:
|
Document functions and fix a few bugs.
2004-07-03 Anders Carlsson <andersca@gnome.org>
* libegg/iconlist/eggiconlist.c: (egg_icon_list_add_move_binding),
(egg_icon_list_real_move_cursor), (egg_icon_list_new),
(egg_icon_list_new_with_model), (egg_icon_list_get_path_at_pos),
(egg_icon_list_selected_foreach),
(egg_icon_list_set_selection_mode),
(egg_icon_list_get_selection_mode), (egg_icon_list_set_model),
(egg_icon_list_get_model), (egg_icon_list_set_text_column),
(egg_icon_list_get_text_column), (egg_icon_list_set_markup_column),
(egg_icon_list_get_markup_column),
(egg_icon_list_set_pixbuf_column),
(egg_icon_list_get_pixbuf_column), (egg_icon_list_select_path),
(egg_icon_list_unselect_path), (egg_icon_list_select_all),
(egg_icon_list_unselect_all), (egg_icon_list_path_is_selected),
(egg_icon_list_item_activated):
* libegg/iconlist/eggiconlist.h:
* libegg/iconlist/testiconlist.c: (foreach_selected_remove_func),
(foreach_selected_remove), (selection_changed), (main):
Document functions and fix a few bugs.
2004-07-03 08:01:34 +00:00
|
|
|
*
|
2004-07-04 15:56:55 +00:00
|
|
|
* Creates a new #GtkIconView widget
|
Document functions and fix a few bugs.
2004-07-03 Anders Carlsson <andersca@gnome.org>
* libegg/iconlist/eggiconlist.c: (egg_icon_list_add_move_binding),
(egg_icon_list_real_move_cursor), (egg_icon_list_new),
(egg_icon_list_new_with_model), (egg_icon_list_get_path_at_pos),
(egg_icon_list_selected_foreach),
(egg_icon_list_set_selection_mode),
(egg_icon_list_get_selection_mode), (egg_icon_list_set_model),
(egg_icon_list_get_model), (egg_icon_list_set_text_column),
(egg_icon_list_get_text_column), (egg_icon_list_set_markup_column),
(egg_icon_list_get_markup_column),
(egg_icon_list_set_pixbuf_column),
(egg_icon_list_get_pixbuf_column), (egg_icon_list_select_path),
(egg_icon_list_unselect_path), (egg_icon_list_select_all),
(egg_icon_list_unselect_all), (egg_icon_list_path_is_selected),
(egg_icon_list_item_activated):
* libegg/iconlist/eggiconlist.h:
* libegg/iconlist/testiconlist.c: (foreach_selected_remove_func),
(foreach_selected_remove), (selection_changed), (main):
Document functions and fix a few bugs.
2004-07-03 08:01:34 +00:00
|
|
|
*
|
2004-07-04 15:56:55 +00:00
|
|
|
* Return value: A newly created #GtkIconView widget
|
2004-07-13 05:15:49 +00:00
|
|
|
*
|
|
|
|
* Since: 2.6
|
Document functions and fix a few bugs.
2004-07-03 Anders Carlsson <andersca@gnome.org>
* libegg/iconlist/eggiconlist.c: (egg_icon_list_add_move_binding),
(egg_icon_list_real_move_cursor), (egg_icon_list_new),
(egg_icon_list_new_with_model), (egg_icon_list_get_path_at_pos),
(egg_icon_list_selected_foreach),
(egg_icon_list_set_selection_mode),
(egg_icon_list_get_selection_mode), (egg_icon_list_set_model),
(egg_icon_list_get_model), (egg_icon_list_set_text_column),
(egg_icon_list_get_text_column), (egg_icon_list_set_markup_column),
(egg_icon_list_get_markup_column),
(egg_icon_list_set_pixbuf_column),
(egg_icon_list_get_pixbuf_column), (egg_icon_list_select_path),
(egg_icon_list_unselect_path), (egg_icon_list_select_all),
(egg_icon_list_unselect_all), (egg_icon_list_path_is_selected),
(egg_icon_list_item_activated):
* libegg/iconlist/eggiconlist.h:
* libegg/iconlist/testiconlist.c: (foreach_selected_remove_func),
(foreach_selected_remove), (selection_changed), (main):
Document functions and fix a few bugs.
2004-07-03 08:01:34 +00:00
|
|
|
**/
|
|
|
|
GtkWidget *
|
2004-07-04 15:56:55 +00:00
|
|
|
gtk_icon_view_new (void)
|
Document functions and fix a few bugs.
2004-07-03 Anders Carlsson <andersca@gnome.org>
* libegg/iconlist/eggiconlist.c: (egg_icon_list_add_move_binding),
(egg_icon_list_real_move_cursor), (egg_icon_list_new),
(egg_icon_list_new_with_model), (egg_icon_list_get_path_at_pos),
(egg_icon_list_selected_foreach),
(egg_icon_list_set_selection_mode),
(egg_icon_list_get_selection_mode), (egg_icon_list_set_model),
(egg_icon_list_get_model), (egg_icon_list_set_text_column),
(egg_icon_list_get_text_column), (egg_icon_list_set_markup_column),
(egg_icon_list_get_markup_column),
(egg_icon_list_set_pixbuf_column),
(egg_icon_list_get_pixbuf_column), (egg_icon_list_select_path),
(egg_icon_list_unselect_path), (egg_icon_list_select_all),
(egg_icon_list_unselect_all), (egg_icon_list_path_is_selected),
(egg_icon_list_item_activated):
* libegg/iconlist/eggiconlist.h:
* libegg/iconlist/testiconlist.c: (foreach_selected_remove_func),
(foreach_selected_remove), (selection_changed), (main):
Document functions and fix a few bugs.
2004-07-03 08:01:34 +00:00
|
|
|
{
|
2004-07-04 15:56:55 +00:00
|
|
|
return g_object_new (GTK_TYPE_ICON_VIEW, NULL);
|
Document functions and fix a few bugs.
2004-07-03 Anders Carlsson <andersca@gnome.org>
* libegg/iconlist/eggiconlist.c: (egg_icon_list_add_move_binding),
(egg_icon_list_real_move_cursor), (egg_icon_list_new),
(egg_icon_list_new_with_model), (egg_icon_list_get_path_at_pos),
(egg_icon_list_selected_foreach),
(egg_icon_list_set_selection_mode),
(egg_icon_list_get_selection_mode), (egg_icon_list_set_model),
(egg_icon_list_get_model), (egg_icon_list_set_text_column),
(egg_icon_list_get_text_column), (egg_icon_list_set_markup_column),
(egg_icon_list_get_markup_column),
(egg_icon_list_set_pixbuf_column),
(egg_icon_list_get_pixbuf_column), (egg_icon_list_select_path),
(egg_icon_list_unselect_path), (egg_icon_list_select_all),
(egg_icon_list_unselect_all), (egg_icon_list_path_is_selected),
(egg_icon_list_item_activated):
* libegg/iconlist/eggiconlist.h:
* libegg/iconlist/testiconlist.c: (foreach_selected_remove_func),
(foreach_selected_remove), (selection_changed), (main):
Document functions and fix a few bugs.
2004-07-03 08:01:34 +00:00
|
|
|
}
|
|
|
|
|
2010-12-13 06:54:02 +00:00
|
|
|
/**
|
|
|
|
* gtk_icon_view_new_with_area:
|
|
|
|
* @area: the #GtkCellArea to use to layout cells
|
|
|
|
*
|
|
|
|
* Creates a new #GtkIconView widget using the
|
|
|
|
* specified @area to layout cells inside the icons.
|
|
|
|
*
|
|
|
|
* Return value: A newly created #GtkIconView widget
|
|
|
|
*
|
|
|
|
* Since: 3.0
|
|
|
|
**/
|
|
|
|
GtkWidget *
|
|
|
|
gtk_icon_view_new_with_area (GtkCellArea *area)
|
|
|
|
{
|
|
|
|
return g_object_new (GTK_TYPE_ICON_VIEW, "cell-area", area, NULL);
|
|
|
|
}
|
|
|
|
|
Document functions and fix a few bugs.
2004-07-03 Anders Carlsson <andersca@gnome.org>
* libegg/iconlist/eggiconlist.c: (egg_icon_list_add_move_binding),
(egg_icon_list_real_move_cursor), (egg_icon_list_new),
(egg_icon_list_new_with_model), (egg_icon_list_get_path_at_pos),
(egg_icon_list_selected_foreach),
(egg_icon_list_set_selection_mode),
(egg_icon_list_get_selection_mode), (egg_icon_list_set_model),
(egg_icon_list_get_model), (egg_icon_list_set_text_column),
(egg_icon_list_get_text_column), (egg_icon_list_set_markup_column),
(egg_icon_list_get_markup_column),
(egg_icon_list_set_pixbuf_column),
(egg_icon_list_get_pixbuf_column), (egg_icon_list_select_path),
(egg_icon_list_unselect_path), (egg_icon_list_select_all),
(egg_icon_list_unselect_all), (egg_icon_list_path_is_selected),
(egg_icon_list_item_activated):
* libegg/iconlist/eggiconlist.h:
* libegg/iconlist/testiconlist.c: (foreach_selected_remove_func),
(foreach_selected_remove), (selection_changed), (main):
Document functions and fix a few bugs.
2004-07-03 08:01:34 +00:00
|
|
|
/**
|
2004-07-04 15:56:55 +00:00
|
|
|
* gtk_icon_view_new_with_model:
|
Document functions and fix a few bugs.
2004-07-03 Anders Carlsson <andersca@gnome.org>
* libegg/iconlist/eggiconlist.c: (egg_icon_list_add_move_binding),
(egg_icon_list_real_move_cursor), (egg_icon_list_new),
(egg_icon_list_new_with_model), (egg_icon_list_get_path_at_pos),
(egg_icon_list_selected_foreach),
(egg_icon_list_set_selection_mode),
(egg_icon_list_get_selection_mode), (egg_icon_list_set_model),
(egg_icon_list_get_model), (egg_icon_list_set_text_column),
(egg_icon_list_get_text_column), (egg_icon_list_set_markup_column),
(egg_icon_list_get_markup_column),
(egg_icon_list_set_pixbuf_column),
(egg_icon_list_get_pixbuf_column), (egg_icon_list_select_path),
(egg_icon_list_unselect_path), (egg_icon_list_select_all),
(egg_icon_list_unselect_all), (egg_icon_list_path_is_selected),
(egg_icon_list_item_activated):
* libegg/iconlist/eggiconlist.h:
* libegg/iconlist/testiconlist.c: (foreach_selected_remove_func),
(foreach_selected_remove), (selection_changed), (main):
Document functions and fix a few bugs.
2004-07-03 08:01:34 +00:00
|
|
|
* @model: The model.
|
|
|
|
*
|
2004-07-13 05:15:49 +00:00
|
|
|
* Creates a new #GtkIconView widget with the model @model.
|
Document functions and fix a few bugs.
2004-07-03 Anders Carlsson <andersca@gnome.org>
* libegg/iconlist/eggiconlist.c: (egg_icon_list_add_move_binding),
(egg_icon_list_real_move_cursor), (egg_icon_list_new),
(egg_icon_list_new_with_model), (egg_icon_list_get_path_at_pos),
(egg_icon_list_selected_foreach),
(egg_icon_list_set_selection_mode),
(egg_icon_list_get_selection_mode), (egg_icon_list_set_model),
(egg_icon_list_get_model), (egg_icon_list_set_text_column),
(egg_icon_list_get_text_column), (egg_icon_list_set_markup_column),
(egg_icon_list_get_markup_column),
(egg_icon_list_set_pixbuf_column),
(egg_icon_list_get_pixbuf_column), (egg_icon_list_select_path),
(egg_icon_list_unselect_path), (egg_icon_list_select_all),
(egg_icon_list_unselect_all), (egg_icon_list_path_is_selected),
(egg_icon_list_item_activated):
* libegg/iconlist/eggiconlist.h:
* libegg/iconlist/testiconlist.c: (foreach_selected_remove_func),
(foreach_selected_remove), (selection_changed), (main):
Document functions and fix a few bugs.
2004-07-03 08:01:34 +00:00
|
|
|
*
|
2004-07-04 15:56:55 +00:00
|
|
|
* Return value: A newly created #GtkIconView widget.
|
Document functions and fix a few bugs.
2004-07-03 Anders Carlsson <andersca@gnome.org>
* libegg/iconlist/eggiconlist.c: (egg_icon_list_add_move_binding),
(egg_icon_list_real_move_cursor), (egg_icon_list_new),
(egg_icon_list_new_with_model), (egg_icon_list_get_path_at_pos),
(egg_icon_list_selected_foreach),
(egg_icon_list_set_selection_mode),
(egg_icon_list_get_selection_mode), (egg_icon_list_set_model),
(egg_icon_list_get_model), (egg_icon_list_set_text_column),
(egg_icon_list_get_text_column), (egg_icon_list_set_markup_column),
(egg_icon_list_get_markup_column),
(egg_icon_list_set_pixbuf_column),
(egg_icon_list_get_pixbuf_column), (egg_icon_list_select_path),
(egg_icon_list_unselect_path), (egg_icon_list_select_all),
(egg_icon_list_unselect_all), (egg_icon_list_path_is_selected),
(egg_icon_list_item_activated):
* libegg/iconlist/eggiconlist.h:
* libegg/iconlist/testiconlist.c: (foreach_selected_remove_func),
(foreach_selected_remove), (selection_changed), (main):
Document functions and fix a few bugs.
2004-07-03 08:01:34 +00:00
|
|
|
*
|
|
|
|
* Since: 2.6
|
|
|
|
**/
|
|
|
|
GtkWidget *
|
2004-07-04 15:56:55 +00:00
|
|
|
gtk_icon_view_new_with_model (GtkTreeModel *model)
|
Document functions and fix a few bugs.
2004-07-03 Anders Carlsson <andersca@gnome.org>
* libegg/iconlist/eggiconlist.c: (egg_icon_list_add_move_binding),
(egg_icon_list_real_move_cursor), (egg_icon_list_new),
(egg_icon_list_new_with_model), (egg_icon_list_get_path_at_pos),
(egg_icon_list_selected_foreach),
(egg_icon_list_set_selection_mode),
(egg_icon_list_get_selection_mode), (egg_icon_list_set_model),
(egg_icon_list_get_model), (egg_icon_list_set_text_column),
(egg_icon_list_get_text_column), (egg_icon_list_set_markup_column),
(egg_icon_list_get_markup_column),
(egg_icon_list_set_pixbuf_column),
(egg_icon_list_get_pixbuf_column), (egg_icon_list_select_path),
(egg_icon_list_unselect_path), (egg_icon_list_select_all),
(egg_icon_list_unselect_all), (egg_icon_list_path_is_selected),
(egg_icon_list_item_activated):
* libegg/iconlist/eggiconlist.h:
* libegg/iconlist/testiconlist.c: (foreach_selected_remove_func),
(foreach_selected_remove), (selection_changed), (main):
Document functions and fix a few bugs.
2004-07-03 08:01:34 +00:00
|
|
|
{
|
2004-07-04 15:56:55 +00:00
|
|
|
return g_object_new (GTK_TYPE_ICON_VIEW, "model", model, NULL);
|
Document functions and fix a few bugs.
2004-07-03 Anders Carlsson <andersca@gnome.org>
* libegg/iconlist/eggiconlist.c: (egg_icon_list_add_move_binding),
(egg_icon_list_real_move_cursor), (egg_icon_list_new),
(egg_icon_list_new_with_model), (egg_icon_list_get_path_at_pos),
(egg_icon_list_selected_foreach),
(egg_icon_list_set_selection_mode),
(egg_icon_list_get_selection_mode), (egg_icon_list_set_model),
(egg_icon_list_get_model), (egg_icon_list_set_text_column),
(egg_icon_list_get_text_column), (egg_icon_list_set_markup_column),
(egg_icon_list_get_markup_column),
(egg_icon_list_set_pixbuf_column),
(egg_icon_list_get_pixbuf_column), (egg_icon_list_select_path),
(egg_icon_list_unselect_path), (egg_icon_list_select_all),
(egg_icon_list_unselect_all), (egg_icon_list_path_is_selected),
(egg_icon_list_item_activated):
* libegg/iconlist/eggiconlist.h:
* libegg/iconlist/testiconlist.c: (foreach_selected_remove_func),
(foreach_selected_remove), (selection_changed), (main):
Document functions and fix a few bugs.
2004-07-03 08:01:34 +00:00
|
|
|
}
|
|
|
|
|
2007-07-11 18:14:46 +00:00
|
|
|
/**
|
|
|
|
* gtk_icon_view_convert_widget_to_bin_window_coords:
|
2008-07-04 22:03:37 +00:00
|
|
|
* @icon_view: a #GtkIconView
|
2007-07-11 18:14:46 +00:00
|
|
|
* @wx: X coordinate relative to the widget
|
|
|
|
* @wy: Y coordinate relative to the widget
|
2011-01-18 09:10:30 +00:00
|
|
|
* @bx: (out): return location for bin_window X coordinate
|
|
|
|
* @by: (out): return location for bin_window Y coordinate
|
2007-07-11 18:14:46 +00:00
|
|
|
*
|
|
|
|
* Converts widget coordinates to coordinates for the bin_window,
|
|
|
|
* as expected by e.g. gtk_icon_view_get_path_at_pos().
|
|
|
|
*
|
|
|
|
* Since: 2.12
|
|
|
|
*/
|
|
|
|
void
|
|
|
|
gtk_icon_view_convert_widget_to_bin_window_coords (GtkIconView *icon_view,
|
|
|
|
gint wx,
|
|
|
|
gint wy,
|
|
|
|
gint *bx,
|
|
|
|
gint *by)
|
|
|
|
{
|
|
|
|
gint x, y;
|
|
|
|
|
|
|
|
g_return_if_fail (GTK_IS_ICON_VIEW (icon_view));
|
|
|
|
|
|
|
|
if (icon_view->priv->bin_window)
|
|
|
|
gdk_window_get_position (icon_view->priv->bin_window, &x, &y);
|
|
|
|
else
|
|
|
|
x = y = 0;
|
|
|
|
|
|
|
|
if (bx)
|
|
|
|
*bx = wx - x;
|
|
|
|
if (by)
|
|
|
|
*by = wy - y;
|
|
|
|
}
|
Document functions and fix a few bugs.
2004-07-03 Anders Carlsson <andersca@gnome.org>
* libegg/iconlist/eggiconlist.c: (egg_icon_list_add_move_binding),
(egg_icon_list_real_move_cursor), (egg_icon_list_new),
(egg_icon_list_new_with_model), (egg_icon_list_get_path_at_pos),
(egg_icon_list_selected_foreach),
(egg_icon_list_set_selection_mode),
(egg_icon_list_get_selection_mode), (egg_icon_list_set_model),
(egg_icon_list_get_model), (egg_icon_list_set_text_column),
(egg_icon_list_get_text_column), (egg_icon_list_set_markup_column),
(egg_icon_list_get_markup_column),
(egg_icon_list_set_pixbuf_column),
(egg_icon_list_get_pixbuf_column), (egg_icon_list_select_path),
(egg_icon_list_unselect_path), (egg_icon_list_select_all),
(egg_icon_list_unselect_all), (egg_icon_list_path_is_selected),
(egg_icon_list_item_activated):
* libegg/iconlist/eggiconlist.h:
* libegg/iconlist/testiconlist.c: (foreach_selected_remove_func),
(foreach_selected_remove), (selection_changed), (main):
Document functions and fix a few bugs.
2004-07-03 08:01:34 +00:00
|
|
|
|
|
|
|
/**
|
2004-07-04 15:56:55 +00:00
|
|
|
* gtk_icon_view_get_path_at_pos:
|
|
|
|
* @icon_view: A #GtkIconView.
|
2004-07-13 05:15:49 +00:00
|
|
|
* @x: The x position to be identified
|
Document functions and fix a few bugs.
2004-07-03 Anders Carlsson <andersca@gnome.org>
* libegg/iconlist/eggiconlist.c: (egg_icon_list_add_move_binding),
(egg_icon_list_real_move_cursor), (egg_icon_list_new),
(egg_icon_list_new_with_model), (egg_icon_list_get_path_at_pos),
(egg_icon_list_selected_foreach),
(egg_icon_list_set_selection_mode),
(egg_icon_list_get_selection_mode), (egg_icon_list_set_model),
(egg_icon_list_get_model), (egg_icon_list_set_text_column),
(egg_icon_list_get_text_column), (egg_icon_list_set_markup_column),
(egg_icon_list_get_markup_column),
(egg_icon_list_set_pixbuf_column),
(egg_icon_list_get_pixbuf_column), (egg_icon_list_select_path),
(egg_icon_list_unselect_path), (egg_icon_list_select_all),
(egg_icon_list_unselect_all), (egg_icon_list_path_is_selected),
(egg_icon_list_item_activated):
* libegg/iconlist/eggiconlist.h:
* libegg/iconlist/testiconlist.c: (foreach_selected_remove_func),
(foreach_selected_remove), (selection_changed), (main):
Document functions and fix a few bugs.
2004-07-03 08:01:34 +00:00
|
|
|
* @y: The y position to be identified
|
|
|
|
*
|
2007-07-11 18:14:46 +00:00
|
|
|
* Finds the path at the point (@x, @y), relative to bin_window coordinates.
|
2005-05-02 20:28:37 +00:00
|
|
|
* See gtk_icon_view_get_item_at_pos(), if you are also interested in
|
2007-07-11 18:14:46 +00:00
|
|
|
* the cell at the specified position.
|
|
|
|
* See gtk_icon_view_convert_widget_to_bin_window_coords() for converting
|
|
|
|
* widget coordinates to bin_window coordinates.
|
Document functions and fix a few bugs.
2004-07-03 Anders Carlsson <andersca@gnome.org>
* libegg/iconlist/eggiconlist.c: (egg_icon_list_add_move_binding),
(egg_icon_list_real_move_cursor), (egg_icon_list_new),
(egg_icon_list_new_with_model), (egg_icon_list_get_path_at_pos),
(egg_icon_list_selected_foreach),
(egg_icon_list_set_selection_mode),
(egg_icon_list_get_selection_mode), (egg_icon_list_set_model),
(egg_icon_list_get_model), (egg_icon_list_set_text_column),
(egg_icon_list_get_text_column), (egg_icon_list_set_markup_column),
(egg_icon_list_get_markup_column),
(egg_icon_list_set_pixbuf_column),
(egg_icon_list_get_pixbuf_column), (egg_icon_list_select_path),
(egg_icon_list_unselect_path), (egg_icon_list_select_all),
(egg_icon_list_unselect_all), (egg_icon_list_path_is_selected),
(egg_icon_list_item_activated):
* libegg/iconlist/eggiconlist.h:
* libegg/iconlist/testiconlist.c: (foreach_selected_remove_func),
(foreach_selected_remove), (selection_changed), (main):
Document functions and fix a few bugs.
2004-07-03 08:01:34 +00:00
|
|
|
*
|
|
|
|
* Return value: The #GtkTreePath corresponding to the icon or %NULL
|
2004-07-13 05:15:49 +00:00
|
|
|
* if no icon exists at that position.
|
Document functions and fix a few bugs.
2004-07-03 Anders Carlsson <andersca@gnome.org>
* libegg/iconlist/eggiconlist.c: (egg_icon_list_add_move_binding),
(egg_icon_list_real_move_cursor), (egg_icon_list_new),
(egg_icon_list_new_with_model), (egg_icon_list_get_path_at_pos),
(egg_icon_list_selected_foreach),
(egg_icon_list_set_selection_mode),
(egg_icon_list_get_selection_mode), (egg_icon_list_set_model),
(egg_icon_list_get_model), (egg_icon_list_set_text_column),
(egg_icon_list_get_text_column), (egg_icon_list_set_markup_column),
(egg_icon_list_get_markup_column),
(egg_icon_list_set_pixbuf_column),
(egg_icon_list_get_pixbuf_column), (egg_icon_list_select_path),
(egg_icon_list_unselect_path), (egg_icon_list_select_all),
(egg_icon_list_unselect_all), (egg_icon_list_path_is_selected),
(egg_icon_list_item_activated):
* libegg/iconlist/eggiconlist.h:
* libegg/iconlist/testiconlist.c: (foreach_selected_remove_func),
(foreach_selected_remove), (selection_changed), (main):
Document functions and fix a few bugs.
2004-07-03 08:01:34 +00:00
|
|
|
*
|
|
|
|
* Since: 2.6
|
|
|
|
**/
|
|
|
|
GtkTreePath *
|
2004-07-04 15:56:55 +00:00
|
|
|
gtk_icon_view_get_path_at_pos (GtkIconView *icon_view,
|
Document functions and fix a few bugs.
2004-07-03 Anders Carlsson <andersca@gnome.org>
* libegg/iconlist/eggiconlist.c: (egg_icon_list_add_move_binding),
(egg_icon_list_real_move_cursor), (egg_icon_list_new),
(egg_icon_list_new_with_model), (egg_icon_list_get_path_at_pos),
(egg_icon_list_selected_foreach),
(egg_icon_list_set_selection_mode),
(egg_icon_list_get_selection_mode), (egg_icon_list_set_model),
(egg_icon_list_get_model), (egg_icon_list_set_text_column),
(egg_icon_list_get_text_column), (egg_icon_list_set_markup_column),
(egg_icon_list_get_markup_column),
(egg_icon_list_set_pixbuf_column),
(egg_icon_list_get_pixbuf_column), (egg_icon_list_select_path),
(egg_icon_list_unselect_path), (egg_icon_list_select_all),
(egg_icon_list_unselect_all), (egg_icon_list_path_is_selected),
(egg_icon_list_item_activated):
* libegg/iconlist/eggiconlist.h:
* libegg/iconlist/testiconlist.c: (foreach_selected_remove_func),
(foreach_selected_remove), (selection_changed), (main):
Document functions and fix a few bugs.
2004-07-03 08:01:34 +00:00
|
|
|
gint x,
|
|
|
|
gint y)
|
|
|
|
{
|
2004-07-04 15:56:55 +00:00
|
|
|
GtkIconViewItem *item;
|
Document functions and fix a few bugs.
2004-07-03 Anders Carlsson <andersca@gnome.org>
* libegg/iconlist/eggiconlist.c: (egg_icon_list_add_move_binding),
(egg_icon_list_real_move_cursor), (egg_icon_list_new),
(egg_icon_list_new_with_model), (egg_icon_list_get_path_at_pos),
(egg_icon_list_selected_foreach),
(egg_icon_list_set_selection_mode),
(egg_icon_list_get_selection_mode), (egg_icon_list_set_model),
(egg_icon_list_get_model), (egg_icon_list_set_text_column),
(egg_icon_list_get_text_column), (egg_icon_list_set_markup_column),
(egg_icon_list_get_markup_column),
(egg_icon_list_set_pixbuf_column),
(egg_icon_list_get_pixbuf_column), (egg_icon_list_select_path),
(egg_icon_list_unselect_path), (egg_icon_list_select_all),
(egg_icon_list_unselect_all), (egg_icon_list_path_is_selected),
(egg_icon_list_item_activated):
* libegg/iconlist/eggiconlist.h:
* libegg/iconlist/testiconlist.c: (foreach_selected_remove_func),
(foreach_selected_remove), (selection_changed), (main):
Document functions and fix a few bugs.
2004-07-03 08:01:34 +00:00
|
|
|
GtkTreePath *path;
|
|
|
|
|
2004-07-04 15:56:55 +00:00
|
|
|
g_return_val_if_fail (GTK_IS_ICON_VIEW (icon_view), NULL);
|
Document functions and fix a few bugs.
2004-07-03 Anders Carlsson <andersca@gnome.org>
* libegg/iconlist/eggiconlist.c: (egg_icon_list_add_move_binding),
(egg_icon_list_real_move_cursor), (egg_icon_list_new),
(egg_icon_list_new_with_model), (egg_icon_list_get_path_at_pos),
(egg_icon_list_selected_foreach),
(egg_icon_list_set_selection_mode),
(egg_icon_list_get_selection_mode), (egg_icon_list_set_model),
(egg_icon_list_get_model), (egg_icon_list_set_text_column),
(egg_icon_list_get_text_column), (egg_icon_list_set_markup_column),
(egg_icon_list_get_markup_column),
(egg_icon_list_set_pixbuf_column),
(egg_icon_list_get_pixbuf_column), (egg_icon_list_select_path),
(egg_icon_list_unselect_path), (egg_icon_list_select_all),
(egg_icon_list_unselect_all), (egg_icon_list_path_is_selected),
(egg_icon_list_item_activated):
* libegg/iconlist/eggiconlist.h:
* libegg/iconlist/testiconlist.c: (foreach_selected_remove_func),
(foreach_selected_remove), (selection_changed), (main):
Document functions and fix a few bugs.
2004-07-03 08:01:34 +00:00
|
|
|
|
2005-05-06 04:14:32 +00:00
|
|
|
item = gtk_icon_view_get_item_at_coords (icon_view, x, y, TRUE, NULL);
|
Document functions and fix a few bugs.
2004-07-03 Anders Carlsson <andersca@gnome.org>
* libegg/iconlist/eggiconlist.c: (egg_icon_list_add_move_binding),
(egg_icon_list_real_move_cursor), (egg_icon_list_new),
(egg_icon_list_new_with_model), (egg_icon_list_get_path_at_pos),
(egg_icon_list_selected_foreach),
(egg_icon_list_set_selection_mode),
(egg_icon_list_get_selection_mode), (egg_icon_list_set_model),
(egg_icon_list_get_model), (egg_icon_list_set_text_column),
(egg_icon_list_get_text_column), (egg_icon_list_set_markup_column),
(egg_icon_list_get_markup_column),
(egg_icon_list_set_pixbuf_column),
(egg_icon_list_get_pixbuf_column), (egg_icon_list_select_path),
(egg_icon_list_unselect_path), (egg_icon_list_select_all),
(egg_icon_list_unselect_all), (egg_icon_list_path_is_selected),
(egg_icon_list_item_activated):
* libegg/iconlist/eggiconlist.h:
* libegg/iconlist/testiconlist.c: (foreach_selected_remove_func),
(foreach_selected_remove), (selection_changed), (main):
Document functions and fix a few bugs.
2004-07-03 08:01:34 +00:00
|
|
|
|
|
|
|
if (!item)
|
|
|
|
return NULL;
|
|
|
|
|
|
|
|
path = gtk_tree_path_new_from_indices (item->index, -1);
|
|
|
|
|
|
|
|
return path;
|
|
|
|
}
|
|
|
|
|
2005-05-02 20:28:37 +00:00
|
|
|
/**
|
|
|
|
* gtk_icon_view_get_item_at_pos:
|
|
|
|
* @icon_view: A #GtkIconView.
|
|
|
|
* @x: The x position to be identified
|
|
|
|
* @y: The y position to be identified
|
2011-01-18 09:10:30 +00:00
|
|
|
* @path: (out) (allow-none): Return location for the path, or %NULL
|
|
|
|
* @cell: (out) (allow-none): Return location for the renderer
|
|
|
|
* responsible for the cell at (@x, @y), or %NULL
|
2005-05-02 20:28:37 +00:00
|
|
|
*
|
2007-07-11 18:14:46 +00:00
|
|
|
* Finds the path at the point (@x, @y), relative to bin_window coordinates.
|
2005-05-02 20:28:37 +00:00
|
|
|
* In contrast to gtk_icon_view_get_path_at_pos(), this function also
|
|
|
|
* obtains the cell at the specified position. The returned path should
|
|
|
|
* be freed with gtk_tree_path_free().
|
2007-07-11 18:14:46 +00:00
|
|
|
* See gtk_icon_view_convert_widget_to_bin_window_coords() for converting
|
|
|
|
* widget coordinates to bin_window coordinates.
|
2005-05-02 20:28:37 +00:00
|
|
|
*
|
|
|
|
* Return value: %TRUE if an item exists at the specified position
|
|
|
|
*
|
|
|
|
* Since: 2.8
|
|
|
|
**/
|
|
|
|
gboolean
|
|
|
|
gtk_icon_view_get_item_at_pos (GtkIconView *icon_view,
|
|
|
|
gint x,
|
|
|
|
gint y,
|
|
|
|
GtkTreePath **path,
|
|
|
|
GtkCellRenderer **cell)
|
|
|
|
{
|
|
|
|
GtkIconViewItem *item;
|
2010-12-12 07:29:41 +00:00
|
|
|
GtkCellRenderer *renderer = NULL;
|
2005-05-02 20:28:37 +00:00
|
|
|
|
|
|
|
g_return_val_if_fail (GTK_IS_ICON_VIEW (icon_view), FALSE);
|
|
|
|
|
2010-12-12 07:29:41 +00:00
|
|
|
item = gtk_icon_view_get_item_at_coords (icon_view, x, y, TRUE, &renderer);
|
2005-05-02 20:28:37 +00:00
|
|
|
|
|
|
|
if (path != NULL)
|
|
|
|
{
|
|
|
|
if (item != NULL)
|
|
|
|
*path = gtk_tree_path_new_from_indices (item->index, -1);
|
|
|
|
else
|
|
|
|
*path = NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (cell != NULL)
|
2010-12-12 07:29:41 +00:00
|
|
|
*cell = renderer;
|
2005-05-02 20:28:37 +00:00
|
|
|
|
|
|
|
return (item != NULL);
|
|
|
|
}
|
|
|
|
|
2007-07-16 14:04:35 +00:00
|
|
|
/**
|
|
|
|
* gtk_icon_view_set_tooltip_item:
|
|
|
|
* @icon_view: a #GtkIconView
|
|
|
|
* @tooltip: a #GtkTooltip
|
|
|
|
* @path: a #GtkTreePath
|
|
|
|
*
|
|
|
|
* Sets the tip area of @tooltip to be the area covered by the item at @path.
|
2008-10-20 12:11:05 +00:00
|
|
|
* See also gtk_icon_view_set_tooltip_column() for a simpler alternative.
|
2007-07-16 14:04:35 +00:00
|
|
|
* See also gtk_tooltip_set_tip_area().
|
|
|
|
*
|
|
|
|
* Since: 2.12
|
|
|
|
*/
|
|
|
|
void
|
|
|
|
gtk_icon_view_set_tooltip_item (GtkIconView *icon_view,
|
|
|
|
GtkTooltip *tooltip,
|
|
|
|
GtkTreePath *path)
|
|
|
|
{
|
|
|
|
g_return_if_fail (GTK_IS_ICON_VIEW (icon_view));
|
|
|
|
g_return_if_fail (GTK_IS_TOOLTIP (tooltip));
|
|
|
|
|
|
|
|
gtk_icon_view_set_tooltip_cell (icon_view, tooltip, path, NULL);
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* gtk_icon_view_set_tooltip_cell:
|
|
|
|
* @icon_view: a #GtkIconView
|
|
|
|
* @tooltip: a #GtkTooltip
|
|
|
|
* @path: a #GtkTreePath
|
2010-02-19 16:53:17 +00:00
|
|
|
* @cell: (allow-none): a #GtkCellRenderer or %NULL
|
2007-07-16 14:04:35 +00:00
|
|
|
*
|
|
|
|
* 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().
|
|
|
|
*
|
2008-10-20 12:11:05 +00:00
|
|
|
* See also gtk_icon_view_set_tooltip_column() for a simpler alternative.
|
|
|
|
*
|
2007-07-16 14:04:35 +00:00
|
|
|
* Since: 2.12
|
|
|
|
*/
|
|
|
|
void
|
|
|
|
gtk_icon_view_set_tooltip_cell (GtkIconView *icon_view,
|
|
|
|
GtkTooltip *tooltip,
|
|
|
|
GtkTreePath *path,
|
|
|
|
GtkCellRenderer *cell)
|
|
|
|
{
|
|
|
|
GdkRectangle rect;
|
|
|
|
GtkIconViewItem *item = NULL;
|
2007-07-19 14:59:44 +00:00
|
|
|
gint x, y;
|
2007-07-16 14:04:35 +00:00
|
|
|
|
|
|
|
g_return_if_fail (GTK_IS_ICON_VIEW (icon_view));
|
|
|
|
g_return_if_fail (GTK_IS_TOOLTIP (tooltip));
|
|
|
|
g_return_if_fail (cell == NULL || GTK_IS_CELL_RENDERER (cell));
|
|
|
|
|
|
|
|
if (gtk_tree_path_get_depth (path) > 0)
|
|
|
|
item = g_list_nth_data (icon_view->priv->items,
|
2010-06-28 18:15:10 +00:00
|
|
|
gtk_tree_path_get_indices(path)[0]);
|
2007-07-16 14:04:35 +00:00
|
|
|
|
|
|
|
if (!item)
|
|
|
|
return;
|
|
|
|
|
|
|
|
if (cell)
|
|
|
|
{
|
2010-12-12 15:24:26 +00:00
|
|
|
GtkCellAreaContext *context;
|
2010-12-12 07:29:41 +00:00
|
|
|
|
2010-12-12 15:24:26 +00:00
|
|
|
context = g_ptr_array_index (icon_view->priv->row_contexts, item->row);
|
2010-12-12 07:29:41 +00:00
|
|
|
gtk_icon_view_set_cell_data (icon_view, item);
|
2010-12-12 15:24:26 +00:00
|
|
|
gtk_cell_area_get_cell_allocation (icon_view->priv->cell_area, context,
|
2010-12-12 07:29:41 +00:00
|
|
|
GTK_WIDGET (icon_view),
|
2010-12-13 08:41:50 +00:00
|
|
|
cell, (GdkRectangle *)item, &rect);
|
2007-07-16 14:04:35 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2010-12-13 08:41:50 +00:00
|
|
|
rect.x = item->cell_area.x - icon_view->priv->item_padding;
|
|
|
|
rect.y = item->cell_area.y - icon_view->priv->item_padding;
|
|
|
|
rect.width = item->cell_area.width + icon_view->priv->item_padding * 2;
|
|
|
|
rect.height = item->cell_area.height + icon_view->priv->item_padding * 2;
|
2007-07-16 14:04:35 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
if (icon_view->priv->bin_window)
|
|
|
|
{
|
|
|
|
gdk_window_get_position (icon_view->priv->bin_window, &x, &y);
|
|
|
|
rect.x += x;
|
|
|
|
rect.y += y;
|
|
|
|
}
|
|
|
|
|
|
|
|
gtk_tooltip_set_tip_area (tooltip, &rect);
|
|
|
|
}
|
2005-06-11 05:15:10 +00:00
|
|
|
|
2007-07-19 14:59:44 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* gtk_icon_view_get_tooltip_context:
|
|
|
|
* @icon_view: an #GtkIconView
|
2011-01-18 09:10:30 +00:00
|
|
|
* @x: (inout): the x coordinate (relative to widget coordinates)
|
|
|
|
* @y: (inout): the y coordinate (relative to widget coordinates)
|
2007-07-19 14:59:44 +00:00
|
|
|
* @keyboard_tip: whether this is a keyboard tooltip or not
|
2010-07-07 16:20:37 +00:00
|
|
|
* @model: (out) (allow-none): a pointer to receive a #GtkTreeModel or %NULL
|
|
|
|
* @path: (out) (allow-none): a pointer to receive a #GtkTreePath or %NULL
|
|
|
|
* @iter: (out) (allow-none): a pointer to receive a #GtkTreeIter or %NULL
|
2007-07-19 14:59:44 +00:00
|
|
|
*
|
|
|
|
* 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;
|
2007-07-20 02:36:12 +00:00
|
|
|
|
2007-07-19 14:59:44 +00:00
|
|
|
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.
|
|
|
|
*
|
2010-11-14 11:39:48 +00:00
|
|
|
* Note that the signal handler sets the text with gtk_tooltip_set_markup(),
|
|
|
|
* so &, <, etc have to be escaped in the text.
|
|
|
|
*
|
2007-07-19 14:59:44 +00:00
|
|
|
* 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");
|
|
|
|
}
|
|
|
|
|
2011-01-18 09:12:38 +00:00
|
|
|
/**
|
2007-07-19 14:59:44 +00:00
|
|
|
* 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.
|
|
|
|
*
|
2007-07-23 18:33:35 +00:00
|
|
|
* Since: 2.12
|
2007-07-19 14:59:44 +00:00
|
|
|
*/
|
|
|
|
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;
|
|
|
|
}
|
|
|
|
|
2005-06-11 05:15:10 +00:00
|
|
|
/**
|
|
|
|
* gtk_icon_view_get_visible_range:
|
|
|
|
* @icon_view: A #GtkIconView
|
2011-01-18 09:10:30 +00:00
|
|
|
* @start_path: (out) (allow-none): Return location for start of region,
|
|
|
|
* or %NULL
|
|
|
|
* @end_path: (out) (allow-none): Return location for end of region, or %NULL
|
2005-06-11 05:15:10 +00:00
|
|
|
*
|
|
|
|
* Sets @start_path and @end_path to be the first and last visible path.
|
|
|
|
* Note that there may be invisible paths in between.
|
|
|
|
*
|
2005-07-11 13:14:04 +00:00
|
|
|
* Both paths should be freed with gtk_tree_path_free() after use.
|
|
|
|
*
|
2005-06-11 05:15:10 +00:00
|
|
|
* Return value: %TRUE, if valid paths were placed in @start_path and @end_path
|
|
|
|
*
|
|
|
|
* Since: 2.8
|
|
|
|
**/
|
|
|
|
gboolean
|
|
|
|
gtk_icon_view_get_visible_range (GtkIconView *icon_view,
|
|
|
|
GtkTreePath **start_path,
|
|
|
|
GtkTreePath **end_path)
|
|
|
|
{
|
|
|
|
gint start_index = -1;
|
|
|
|
gint end_index = -1;
|
|
|
|
GList *icons;
|
|
|
|
|
|
|
|
g_return_val_if_fail (GTK_IS_ICON_VIEW (icon_view), FALSE);
|
|
|
|
|
|
|
|
if (icon_view->priv->hadjustment == NULL ||
|
|
|
|
icon_view->priv->vadjustment == NULL)
|
|
|
|
return FALSE;
|
|
|
|
|
|
|
|
if (start_path == NULL && end_path == NULL)
|
|
|
|
return FALSE;
|
|
|
|
|
|
|
|
for (icons = icon_view->priv->items; icons; icons = icons->next)
|
|
|
|
{
|
|
|
|
GtkIconViewItem *item = icons->data;
|
2010-12-13 08:41:50 +00:00
|
|
|
GdkRectangle *item_area = (GdkRectangle *)item;
|
|
|
|
|
|
|
|
if ((item_area->x + item_area->width >= (int)gtk_adjustment_get_value (icon_view->priv->hadjustment)) &&
|
|
|
|
(item_area->y + item_area->height >= (int)gtk_adjustment_get_value (icon_view->priv->vadjustment)) &&
|
|
|
|
(item_area->x <=
|
|
|
|
(int) (gtk_adjustment_get_value (icon_view->priv->hadjustment) +
|
|
|
|
gtk_adjustment_get_page_size (icon_view->priv->hadjustment))) &&
|
|
|
|
(item_area->y <=
|
|
|
|
(int) (gtk_adjustment_get_value (icon_view->priv->vadjustment) +
|
|
|
|
gtk_adjustment_get_page_size (icon_view->priv->vadjustment))))
|
2005-06-11 05:15:10 +00:00
|
|
|
{
|
|
|
|
if (start_index == -1)
|
|
|
|
start_index = item->index;
|
|
|
|
end_index = item->index;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (start_path && start_index != -1)
|
|
|
|
*start_path = gtk_tree_path_new_from_indices (start_index, -1);
|
|
|
|
if (end_path && end_index != -1)
|
|
|
|
*end_path = gtk_tree_path_new_from_indices (end_index, -1);
|
|
|
|
|
|
|
|
return start_index != -1;
|
|
|
|
}
|
|
|
|
|
Document functions and fix a few bugs.
2004-07-03 Anders Carlsson <andersca@gnome.org>
* libegg/iconlist/eggiconlist.c: (egg_icon_list_add_move_binding),
(egg_icon_list_real_move_cursor), (egg_icon_list_new),
(egg_icon_list_new_with_model), (egg_icon_list_get_path_at_pos),
(egg_icon_list_selected_foreach),
(egg_icon_list_set_selection_mode),
(egg_icon_list_get_selection_mode), (egg_icon_list_set_model),
(egg_icon_list_get_model), (egg_icon_list_set_text_column),
(egg_icon_list_get_text_column), (egg_icon_list_set_markup_column),
(egg_icon_list_get_markup_column),
(egg_icon_list_set_pixbuf_column),
(egg_icon_list_get_pixbuf_column), (egg_icon_list_select_path),
(egg_icon_list_unselect_path), (egg_icon_list_select_all),
(egg_icon_list_unselect_all), (egg_icon_list_path_is_selected),
(egg_icon_list_item_activated):
* libegg/iconlist/eggiconlist.h:
* libegg/iconlist/testiconlist.c: (foreach_selected_remove_func),
(foreach_selected_remove), (selection_changed), (main):
Document functions and fix a few bugs.
2004-07-03 08:01:34 +00:00
|
|
|
/**
|
2004-07-04 15:56:55 +00:00
|
|
|
* gtk_icon_view_selected_foreach:
|
|
|
|
* @icon_view: A #GtkIconView.
|
2010-09-21 04:18:11 +00:00
|
|
|
* @func: (scope call): The function to call for each selected icon.
|
Document functions and fix a few bugs.
2004-07-03 Anders Carlsson <andersca@gnome.org>
* libegg/iconlist/eggiconlist.c: (egg_icon_list_add_move_binding),
(egg_icon_list_real_move_cursor), (egg_icon_list_new),
(egg_icon_list_new_with_model), (egg_icon_list_get_path_at_pos),
(egg_icon_list_selected_foreach),
(egg_icon_list_set_selection_mode),
(egg_icon_list_get_selection_mode), (egg_icon_list_set_model),
(egg_icon_list_get_model), (egg_icon_list_set_text_column),
(egg_icon_list_get_text_column), (egg_icon_list_set_markup_column),
(egg_icon_list_get_markup_column),
(egg_icon_list_set_pixbuf_column),
(egg_icon_list_get_pixbuf_column), (egg_icon_list_select_path),
(egg_icon_list_unselect_path), (egg_icon_list_select_all),
(egg_icon_list_unselect_all), (egg_icon_list_path_is_selected),
(egg_icon_list_item_activated):
* libegg/iconlist/eggiconlist.h:
* libegg/iconlist/testiconlist.c: (foreach_selected_remove_func),
(foreach_selected_remove), (selection_changed), (main):
Document functions and fix a few bugs.
2004-07-03 08:01:34 +00:00
|
|
|
* @data: User data to pass to the function.
|
|
|
|
*
|
2004-07-13 05:15:49 +00:00
|
|
|
* Calls a function for each selected icon. Note that the model or
|
Document functions and fix a few bugs.
2004-07-03 Anders Carlsson <andersca@gnome.org>
* libegg/iconlist/eggiconlist.c: (egg_icon_list_add_move_binding),
(egg_icon_list_real_move_cursor), (egg_icon_list_new),
(egg_icon_list_new_with_model), (egg_icon_list_get_path_at_pos),
(egg_icon_list_selected_foreach),
(egg_icon_list_set_selection_mode),
(egg_icon_list_get_selection_mode), (egg_icon_list_set_model),
(egg_icon_list_get_model), (egg_icon_list_set_text_column),
(egg_icon_list_get_text_column), (egg_icon_list_set_markup_column),
(egg_icon_list_get_markup_column),
(egg_icon_list_set_pixbuf_column),
(egg_icon_list_get_pixbuf_column), (egg_icon_list_select_path),
(egg_icon_list_unselect_path), (egg_icon_list_select_all),
(egg_icon_list_unselect_all), (egg_icon_list_path_is_selected),
(egg_icon_list_item_activated):
* libegg/iconlist/eggiconlist.h:
* libegg/iconlist/testiconlist.c: (foreach_selected_remove_func),
(foreach_selected_remove), (selection_changed), (main):
Document functions and fix a few bugs.
2004-07-03 08:01:34 +00:00
|
|
|
* selection cannot be modified from within this function.
|
|
|
|
*
|
|
|
|
* Since: 2.6
|
|
|
|
**/
|
|
|
|
void
|
2004-07-04 15:56:55 +00:00
|
|
|
gtk_icon_view_selected_foreach (GtkIconView *icon_view,
|
|
|
|
GtkIconViewForeachFunc func,
|
Document functions and fix a few bugs.
2004-07-03 Anders Carlsson <andersca@gnome.org>
* libegg/iconlist/eggiconlist.c: (egg_icon_list_add_move_binding),
(egg_icon_list_real_move_cursor), (egg_icon_list_new),
(egg_icon_list_new_with_model), (egg_icon_list_get_path_at_pos),
(egg_icon_list_selected_foreach),
(egg_icon_list_set_selection_mode),
(egg_icon_list_get_selection_mode), (egg_icon_list_set_model),
(egg_icon_list_get_model), (egg_icon_list_set_text_column),
(egg_icon_list_get_text_column), (egg_icon_list_set_markup_column),
(egg_icon_list_get_markup_column),
(egg_icon_list_set_pixbuf_column),
(egg_icon_list_get_pixbuf_column), (egg_icon_list_select_path),
(egg_icon_list_unselect_path), (egg_icon_list_select_all),
(egg_icon_list_unselect_all), (egg_icon_list_path_is_selected),
(egg_icon_list_item_activated):
* libegg/iconlist/eggiconlist.h:
* libegg/iconlist/testiconlist.c: (foreach_selected_remove_func),
(foreach_selected_remove), (selection_changed), (main):
Document functions and fix a few bugs.
2004-07-03 08:01:34 +00:00
|
|
|
gpointer data)
|
|
|
|
{
|
|
|
|
GList *list;
|
|
|
|
|
2004-07-04 15:56:55 +00:00
|
|
|
for (list = icon_view->priv->items; list; list = list->next)
|
Document functions and fix a few bugs.
2004-07-03 Anders Carlsson <andersca@gnome.org>
* libegg/iconlist/eggiconlist.c: (egg_icon_list_add_move_binding),
(egg_icon_list_real_move_cursor), (egg_icon_list_new),
(egg_icon_list_new_with_model), (egg_icon_list_get_path_at_pos),
(egg_icon_list_selected_foreach),
(egg_icon_list_set_selection_mode),
(egg_icon_list_get_selection_mode), (egg_icon_list_set_model),
(egg_icon_list_get_model), (egg_icon_list_set_text_column),
(egg_icon_list_get_text_column), (egg_icon_list_set_markup_column),
(egg_icon_list_get_markup_column),
(egg_icon_list_set_pixbuf_column),
(egg_icon_list_get_pixbuf_column), (egg_icon_list_select_path),
(egg_icon_list_unselect_path), (egg_icon_list_select_all),
(egg_icon_list_unselect_all), (egg_icon_list_path_is_selected),
(egg_icon_list_item_activated):
* libegg/iconlist/eggiconlist.h:
* libegg/iconlist/testiconlist.c: (foreach_selected_remove_func),
(foreach_selected_remove), (selection_changed), (main):
Document functions and fix a few bugs.
2004-07-03 08:01:34 +00:00
|
|
|
{
|
2004-07-04 15:56:55 +00:00
|
|
|
GtkIconViewItem *item = list->data;
|
Document functions and fix a few bugs.
2004-07-03 Anders Carlsson <andersca@gnome.org>
* libegg/iconlist/eggiconlist.c: (egg_icon_list_add_move_binding),
(egg_icon_list_real_move_cursor), (egg_icon_list_new),
(egg_icon_list_new_with_model), (egg_icon_list_get_path_at_pos),
(egg_icon_list_selected_foreach),
(egg_icon_list_set_selection_mode),
(egg_icon_list_get_selection_mode), (egg_icon_list_set_model),
(egg_icon_list_get_model), (egg_icon_list_set_text_column),
(egg_icon_list_get_text_column), (egg_icon_list_set_markup_column),
(egg_icon_list_get_markup_column),
(egg_icon_list_set_pixbuf_column),
(egg_icon_list_get_pixbuf_column), (egg_icon_list_select_path),
(egg_icon_list_unselect_path), (egg_icon_list_select_all),
(egg_icon_list_unselect_all), (egg_icon_list_path_is_selected),
(egg_icon_list_item_activated):
* libegg/iconlist/eggiconlist.h:
* libegg/iconlist/testiconlist.c: (foreach_selected_remove_func),
(foreach_selected_remove), (selection_changed), (main):
Document functions and fix a few bugs.
2004-07-03 08:01:34 +00:00
|
|
|
GtkTreePath *path = gtk_tree_path_new_from_indices (item->index, -1);
|
|
|
|
|
|
|
|
if (item->selected)
|
2004-07-04 15:56:55 +00:00
|
|
|
(* func) (icon_view, path, data);
|
Document functions and fix a few bugs.
2004-07-03 Anders Carlsson <andersca@gnome.org>
* libegg/iconlist/eggiconlist.c: (egg_icon_list_add_move_binding),
(egg_icon_list_real_move_cursor), (egg_icon_list_new),
(egg_icon_list_new_with_model), (egg_icon_list_get_path_at_pos),
(egg_icon_list_selected_foreach),
(egg_icon_list_set_selection_mode),
(egg_icon_list_get_selection_mode), (egg_icon_list_set_model),
(egg_icon_list_get_model), (egg_icon_list_set_text_column),
(egg_icon_list_get_text_column), (egg_icon_list_set_markup_column),
(egg_icon_list_get_markup_column),
(egg_icon_list_set_pixbuf_column),
(egg_icon_list_get_pixbuf_column), (egg_icon_list_select_path),
(egg_icon_list_unselect_path), (egg_icon_list_select_all),
(egg_icon_list_unselect_all), (egg_icon_list_path_is_selected),
(egg_icon_list_item_activated):
* libegg/iconlist/eggiconlist.h:
* libegg/iconlist/testiconlist.c: (foreach_selected_remove_func),
(foreach_selected_remove), (selection_changed), (main):
Document functions and fix a few bugs.
2004-07-03 08:01:34 +00:00
|
|
|
|
|
|
|
gtk_tree_path_free (path);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2004-07-04 15:56:55 +00:00
|
|
|
* gtk_icon_view_set_selection_mode:
|
|
|
|
* @icon_view: A #GtkIconView.
|
Document functions and fix a few bugs.
2004-07-03 Anders Carlsson <andersca@gnome.org>
* libegg/iconlist/eggiconlist.c: (egg_icon_list_add_move_binding),
(egg_icon_list_real_move_cursor), (egg_icon_list_new),
(egg_icon_list_new_with_model), (egg_icon_list_get_path_at_pos),
(egg_icon_list_selected_foreach),
(egg_icon_list_set_selection_mode),
(egg_icon_list_get_selection_mode), (egg_icon_list_set_model),
(egg_icon_list_get_model), (egg_icon_list_set_text_column),
(egg_icon_list_get_text_column), (egg_icon_list_set_markup_column),
(egg_icon_list_get_markup_column),
(egg_icon_list_set_pixbuf_column),
(egg_icon_list_get_pixbuf_column), (egg_icon_list_select_path),
(egg_icon_list_unselect_path), (egg_icon_list_select_all),
(egg_icon_list_unselect_all), (egg_icon_list_path_is_selected),
(egg_icon_list_item_activated):
* libegg/iconlist/eggiconlist.h:
* libegg/iconlist/testiconlist.c: (foreach_selected_remove_func),
(foreach_selected_remove), (selection_changed), (main):
Document functions and fix a few bugs.
2004-07-03 08:01:34 +00:00
|
|
|
* @mode: The selection mode
|
|
|
|
*
|
2004-07-04 15:56:55 +00:00
|
|
|
* Sets the selection mode of the @icon_view.
|
Document functions and fix a few bugs.
2004-07-03 Anders Carlsson <andersca@gnome.org>
* libegg/iconlist/eggiconlist.c: (egg_icon_list_add_move_binding),
(egg_icon_list_real_move_cursor), (egg_icon_list_new),
(egg_icon_list_new_with_model), (egg_icon_list_get_path_at_pos),
(egg_icon_list_selected_foreach),
(egg_icon_list_set_selection_mode),
(egg_icon_list_get_selection_mode), (egg_icon_list_set_model),
(egg_icon_list_get_model), (egg_icon_list_set_text_column),
(egg_icon_list_get_text_column), (egg_icon_list_set_markup_column),
(egg_icon_list_get_markup_column),
(egg_icon_list_set_pixbuf_column),
(egg_icon_list_get_pixbuf_column), (egg_icon_list_select_path),
(egg_icon_list_unselect_path), (egg_icon_list_select_all),
(egg_icon_list_unselect_all), (egg_icon_list_path_is_selected),
(egg_icon_list_item_activated):
* libegg/iconlist/eggiconlist.h:
* libegg/iconlist/testiconlist.c: (foreach_selected_remove_func),
(foreach_selected_remove), (selection_changed), (main):
Document functions and fix a few bugs.
2004-07-03 08:01:34 +00:00
|
|
|
*
|
|
|
|
* Since: 2.6
|
|
|
|
**/
|
|
|
|
void
|
2004-07-04 15:56:55 +00:00
|
|
|
gtk_icon_view_set_selection_mode (GtkIconView *icon_view,
|
Document functions and fix a few bugs.
2004-07-03 Anders Carlsson <andersca@gnome.org>
* libegg/iconlist/eggiconlist.c: (egg_icon_list_add_move_binding),
(egg_icon_list_real_move_cursor), (egg_icon_list_new),
(egg_icon_list_new_with_model), (egg_icon_list_get_path_at_pos),
(egg_icon_list_selected_foreach),
(egg_icon_list_set_selection_mode),
(egg_icon_list_get_selection_mode), (egg_icon_list_set_model),
(egg_icon_list_get_model), (egg_icon_list_set_text_column),
(egg_icon_list_get_text_column), (egg_icon_list_set_markup_column),
(egg_icon_list_get_markup_column),
(egg_icon_list_set_pixbuf_column),
(egg_icon_list_get_pixbuf_column), (egg_icon_list_select_path),
(egg_icon_list_unselect_path), (egg_icon_list_select_all),
(egg_icon_list_unselect_all), (egg_icon_list_path_is_selected),
(egg_icon_list_item_activated):
* libegg/iconlist/eggiconlist.h:
* libegg/iconlist/testiconlist.c: (foreach_selected_remove_func),
(foreach_selected_remove), (selection_changed), (main):
Document functions and fix a few bugs.
2004-07-03 08:01:34 +00:00
|
|
|
GtkSelectionMode mode)
|
|
|
|
{
|
2004-07-04 15:56:55 +00:00
|
|
|
g_return_if_fail (GTK_IS_ICON_VIEW (icon_view));
|
Document functions and fix a few bugs.
2004-07-03 Anders Carlsson <andersca@gnome.org>
* libegg/iconlist/eggiconlist.c: (egg_icon_list_add_move_binding),
(egg_icon_list_real_move_cursor), (egg_icon_list_new),
(egg_icon_list_new_with_model), (egg_icon_list_get_path_at_pos),
(egg_icon_list_selected_foreach),
(egg_icon_list_set_selection_mode),
(egg_icon_list_get_selection_mode), (egg_icon_list_set_model),
(egg_icon_list_get_model), (egg_icon_list_set_text_column),
(egg_icon_list_get_text_column), (egg_icon_list_set_markup_column),
(egg_icon_list_get_markup_column),
(egg_icon_list_set_pixbuf_column),
(egg_icon_list_get_pixbuf_column), (egg_icon_list_select_path),
(egg_icon_list_unselect_path), (egg_icon_list_select_all),
(egg_icon_list_unselect_all), (egg_icon_list_path_is_selected),
(egg_icon_list_item_activated):
* libegg/iconlist/eggiconlist.h:
* libegg/iconlist/testiconlist.c: (foreach_selected_remove_func),
(foreach_selected_remove), (selection_changed), (main):
Document functions and fix a few bugs.
2004-07-03 08:01:34 +00:00
|
|
|
|
2004-07-04 15:56:55 +00:00
|
|
|
if (mode == icon_view->priv->selection_mode)
|
Document functions and fix a few bugs.
2004-07-03 Anders Carlsson <andersca@gnome.org>
* libegg/iconlist/eggiconlist.c: (egg_icon_list_add_move_binding),
(egg_icon_list_real_move_cursor), (egg_icon_list_new),
(egg_icon_list_new_with_model), (egg_icon_list_get_path_at_pos),
(egg_icon_list_selected_foreach),
(egg_icon_list_set_selection_mode),
(egg_icon_list_get_selection_mode), (egg_icon_list_set_model),
(egg_icon_list_get_model), (egg_icon_list_set_text_column),
(egg_icon_list_get_text_column), (egg_icon_list_set_markup_column),
(egg_icon_list_get_markup_column),
(egg_icon_list_set_pixbuf_column),
(egg_icon_list_get_pixbuf_column), (egg_icon_list_select_path),
(egg_icon_list_unselect_path), (egg_icon_list_select_all),
(egg_icon_list_unselect_all), (egg_icon_list_path_is_selected),
(egg_icon_list_item_activated):
* libegg/iconlist/eggiconlist.h:
* libegg/iconlist/testiconlist.c: (foreach_selected_remove_func),
(foreach_selected_remove), (selection_changed), (main):
Document functions and fix a few bugs.
2004-07-03 08:01:34 +00:00
|
|
|
return;
|
|
|
|
|
|
|
|
if (mode == GTK_SELECTION_NONE ||
|
2004-07-04 15:56:55 +00:00
|
|
|
icon_view->priv->selection_mode == GTK_SELECTION_MULTIPLE)
|
|
|
|
gtk_icon_view_unselect_all (icon_view);
|
Document functions and fix a few bugs.
2004-07-03 Anders Carlsson <andersca@gnome.org>
* libegg/iconlist/eggiconlist.c: (egg_icon_list_add_move_binding),
(egg_icon_list_real_move_cursor), (egg_icon_list_new),
(egg_icon_list_new_with_model), (egg_icon_list_get_path_at_pos),
(egg_icon_list_selected_foreach),
(egg_icon_list_set_selection_mode),
(egg_icon_list_get_selection_mode), (egg_icon_list_set_model),
(egg_icon_list_get_model), (egg_icon_list_set_text_column),
(egg_icon_list_get_text_column), (egg_icon_list_set_markup_column),
(egg_icon_list_get_markup_column),
(egg_icon_list_set_pixbuf_column),
(egg_icon_list_get_pixbuf_column), (egg_icon_list_select_path),
(egg_icon_list_unselect_path), (egg_icon_list_select_all),
(egg_icon_list_unselect_all), (egg_icon_list_path_is_selected),
(egg_icon_list_item_activated):
* libegg/iconlist/eggiconlist.h:
* libegg/iconlist/testiconlist.c: (foreach_selected_remove_func),
(foreach_selected_remove), (selection_changed), (main):
Document functions and fix a few bugs.
2004-07-03 08:01:34 +00:00
|
|
|
|
2004-07-04 15:56:55 +00:00
|
|
|
icon_view->priv->selection_mode = mode;
|
Document functions and fix a few bugs.
2004-07-03 Anders Carlsson <andersca@gnome.org>
* libegg/iconlist/eggiconlist.c: (egg_icon_list_add_move_binding),
(egg_icon_list_real_move_cursor), (egg_icon_list_new),
(egg_icon_list_new_with_model), (egg_icon_list_get_path_at_pos),
(egg_icon_list_selected_foreach),
(egg_icon_list_set_selection_mode),
(egg_icon_list_get_selection_mode), (egg_icon_list_set_model),
(egg_icon_list_get_model), (egg_icon_list_set_text_column),
(egg_icon_list_get_text_column), (egg_icon_list_set_markup_column),
(egg_icon_list_get_markup_column),
(egg_icon_list_set_pixbuf_column),
(egg_icon_list_get_pixbuf_column), (egg_icon_list_select_path),
(egg_icon_list_unselect_path), (egg_icon_list_select_all),
(egg_icon_list_unselect_all), (egg_icon_list_path_is_selected),
(egg_icon_list_item_activated):
* libegg/iconlist/eggiconlist.h:
* libegg/iconlist/testiconlist.c: (foreach_selected_remove_func),
(foreach_selected_remove), (selection_changed), (main):
Document functions and fix a few bugs.
2004-07-03 08:01:34 +00:00
|
|
|
|
2005-03-26 05:49:15 +00:00
|
|
|
g_object_notify (G_OBJECT (icon_view), "selection-mode");
|
Document functions and fix a few bugs.
2004-07-03 Anders Carlsson <andersca@gnome.org>
* libegg/iconlist/eggiconlist.c: (egg_icon_list_add_move_binding),
(egg_icon_list_real_move_cursor), (egg_icon_list_new),
(egg_icon_list_new_with_model), (egg_icon_list_get_path_at_pos),
(egg_icon_list_selected_foreach),
(egg_icon_list_set_selection_mode),
(egg_icon_list_get_selection_mode), (egg_icon_list_set_model),
(egg_icon_list_get_model), (egg_icon_list_set_text_column),
(egg_icon_list_get_text_column), (egg_icon_list_set_markup_column),
(egg_icon_list_get_markup_column),
(egg_icon_list_set_pixbuf_column),
(egg_icon_list_get_pixbuf_column), (egg_icon_list_select_path),
(egg_icon_list_unselect_path), (egg_icon_list_select_all),
(egg_icon_list_unselect_all), (egg_icon_list_path_is_selected),
(egg_icon_list_item_activated):
* libegg/iconlist/eggiconlist.h:
* libegg/iconlist/testiconlist.c: (foreach_selected_remove_func),
(foreach_selected_remove), (selection_changed), (main):
Document functions and fix a few bugs.
2004-07-03 08:01:34 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2004-07-04 15:56:55 +00:00
|
|
|
* gtk_icon_view_get_selection_mode:
|
|
|
|
* @icon_view: A #GtkIconView.
|
Document functions and fix a few bugs.
2004-07-03 Anders Carlsson <andersca@gnome.org>
* libegg/iconlist/eggiconlist.c: (egg_icon_list_add_move_binding),
(egg_icon_list_real_move_cursor), (egg_icon_list_new),
(egg_icon_list_new_with_model), (egg_icon_list_get_path_at_pos),
(egg_icon_list_selected_foreach),
(egg_icon_list_set_selection_mode),
(egg_icon_list_get_selection_mode), (egg_icon_list_set_model),
(egg_icon_list_get_model), (egg_icon_list_set_text_column),
(egg_icon_list_get_text_column), (egg_icon_list_set_markup_column),
(egg_icon_list_get_markup_column),
(egg_icon_list_set_pixbuf_column),
(egg_icon_list_get_pixbuf_column), (egg_icon_list_select_path),
(egg_icon_list_unselect_path), (egg_icon_list_select_all),
(egg_icon_list_unselect_all), (egg_icon_list_path_is_selected),
(egg_icon_list_item_activated):
* libegg/iconlist/eggiconlist.h:
* libegg/iconlist/testiconlist.c: (foreach_selected_remove_func),
(foreach_selected_remove), (selection_changed), (main):
Document functions and fix a few bugs.
2004-07-03 08:01:34 +00:00
|
|
|
*
|
2004-07-13 05:15:49 +00:00
|
|
|
* Gets the selection mode of the @icon_view.
|
Document functions and fix a few bugs.
2004-07-03 Anders Carlsson <andersca@gnome.org>
* libegg/iconlist/eggiconlist.c: (egg_icon_list_add_move_binding),
(egg_icon_list_real_move_cursor), (egg_icon_list_new),
(egg_icon_list_new_with_model), (egg_icon_list_get_path_at_pos),
(egg_icon_list_selected_foreach),
(egg_icon_list_set_selection_mode),
(egg_icon_list_get_selection_mode), (egg_icon_list_set_model),
(egg_icon_list_get_model), (egg_icon_list_set_text_column),
(egg_icon_list_get_text_column), (egg_icon_list_set_markup_column),
(egg_icon_list_get_markup_column),
(egg_icon_list_set_pixbuf_column),
(egg_icon_list_get_pixbuf_column), (egg_icon_list_select_path),
(egg_icon_list_unselect_path), (egg_icon_list_select_all),
(egg_icon_list_unselect_all), (egg_icon_list_path_is_selected),
(egg_icon_list_item_activated):
* libegg/iconlist/eggiconlist.h:
* libegg/iconlist/testiconlist.c: (foreach_selected_remove_func),
(foreach_selected_remove), (selection_changed), (main):
Document functions and fix a few bugs.
2004-07-03 08:01:34 +00:00
|
|
|
*
|
|
|
|
* Return value: the current selection mode
|
|
|
|
*
|
|
|
|
* Since: 2.6
|
|
|
|
**/
|
|
|
|
GtkSelectionMode
|
2004-07-04 15:56:55 +00:00
|
|
|
gtk_icon_view_get_selection_mode (GtkIconView *icon_view)
|
Document functions and fix a few bugs.
2004-07-03 Anders Carlsson <andersca@gnome.org>
* libegg/iconlist/eggiconlist.c: (egg_icon_list_add_move_binding),
(egg_icon_list_real_move_cursor), (egg_icon_list_new),
(egg_icon_list_new_with_model), (egg_icon_list_get_path_at_pos),
(egg_icon_list_selected_foreach),
(egg_icon_list_set_selection_mode),
(egg_icon_list_get_selection_mode), (egg_icon_list_set_model),
(egg_icon_list_get_model), (egg_icon_list_set_text_column),
(egg_icon_list_get_text_column), (egg_icon_list_set_markup_column),
(egg_icon_list_get_markup_column),
(egg_icon_list_set_pixbuf_column),
(egg_icon_list_get_pixbuf_column), (egg_icon_list_select_path),
(egg_icon_list_unselect_path), (egg_icon_list_select_all),
(egg_icon_list_unselect_all), (egg_icon_list_path_is_selected),
(egg_icon_list_item_activated):
* libegg/iconlist/eggiconlist.h:
* libegg/iconlist/testiconlist.c: (foreach_selected_remove_func),
(foreach_selected_remove), (selection_changed), (main):
Document functions and fix a few bugs.
2004-07-03 08:01:34 +00:00
|
|
|
{
|
2004-07-04 15:56:55 +00:00
|
|
|
g_return_val_if_fail (GTK_IS_ICON_VIEW (icon_view), GTK_SELECTION_SINGLE);
|
Document functions and fix a few bugs.
2004-07-03 Anders Carlsson <andersca@gnome.org>
* libegg/iconlist/eggiconlist.c: (egg_icon_list_add_move_binding),
(egg_icon_list_real_move_cursor), (egg_icon_list_new),
(egg_icon_list_new_with_model), (egg_icon_list_get_path_at_pos),
(egg_icon_list_selected_foreach),
(egg_icon_list_set_selection_mode),
(egg_icon_list_get_selection_mode), (egg_icon_list_set_model),
(egg_icon_list_get_model), (egg_icon_list_set_text_column),
(egg_icon_list_get_text_column), (egg_icon_list_set_markup_column),
(egg_icon_list_get_markup_column),
(egg_icon_list_set_pixbuf_column),
(egg_icon_list_get_pixbuf_column), (egg_icon_list_select_path),
(egg_icon_list_unselect_path), (egg_icon_list_select_all),
(egg_icon_list_unselect_all), (egg_icon_list_path_is_selected),
(egg_icon_list_item_activated):
* libegg/iconlist/eggiconlist.h:
* libegg/iconlist/testiconlist.c: (foreach_selected_remove_func),
(foreach_selected_remove), (selection_changed), (main):
Document functions and fix a few bugs.
2004-07-03 08:01:34 +00:00
|
|
|
|
2004-07-04 15:56:55 +00:00
|
|
|
return icon_view->priv->selection_mode;
|
Document functions and fix a few bugs.
2004-07-03 Anders Carlsson <andersca@gnome.org>
* libegg/iconlist/eggiconlist.c: (egg_icon_list_add_move_binding),
(egg_icon_list_real_move_cursor), (egg_icon_list_new),
(egg_icon_list_new_with_model), (egg_icon_list_get_path_at_pos),
(egg_icon_list_selected_foreach),
(egg_icon_list_set_selection_mode),
(egg_icon_list_get_selection_mode), (egg_icon_list_set_model),
(egg_icon_list_get_model), (egg_icon_list_set_text_column),
(egg_icon_list_get_text_column), (egg_icon_list_set_markup_column),
(egg_icon_list_get_markup_column),
(egg_icon_list_set_pixbuf_column),
(egg_icon_list_get_pixbuf_column), (egg_icon_list_select_path),
(egg_icon_list_unselect_path), (egg_icon_list_select_all),
(egg_icon_list_unselect_all), (egg_icon_list_path_is_selected),
(egg_icon_list_item_activated):
* libegg/iconlist/eggiconlist.h:
* libegg/iconlist/testiconlist.c: (foreach_selected_remove_func),
(foreach_selected_remove), (selection_changed), (main):
Document functions and fix a few bugs.
2004-07-03 08:01:34 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2004-07-04 15:56:55 +00:00
|
|
|
* gtk_icon_view_set_model:
|
|
|
|
* @icon_view: A #GtkIconView.
|
2009-12-10 10:23:40 +00:00
|
|
|
* @model: (allow-none): The model.
|
Document functions and fix a few bugs.
2004-07-03 Anders Carlsson <andersca@gnome.org>
* libegg/iconlist/eggiconlist.c: (egg_icon_list_add_move_binding),
(egg_icon_list_real_move_cursor), (egg_icon_list_new),
(egg_icon_list_new_with_model), (egg_icon_list_get_path_at_pos),
(egg_icon_list_selected_foreach),
(egg_icon_list_set_selection_mode),
(egg_icon_list_get_selection_mode), (egg_icon_list_set_model),
(egg_icon_list_get_model), (egg_icon_list_set_text_column),
(egg_icon_list_get_text_column), (egg_icon_list_set_markup_column),
(egg_icon_list_get_markup_column),
(egg_icon_list_set_pixbuf_column),
(egg_icon_list_get_pixbuf_column), (egg_icon_list_select_path),
(egg_icon_list_unselect_path), (egg_icon_list_select_all),
(egg_icon_list_unselect_all), (egg_icon_list_path_is_selected),
(egg_icon_list_item_activated):
* libegg/iconlist/eggiconlist.h:
* libegg/iconlist/testiconlist.c: (foreach_selected_remove_func),
(foreach_selected_remove), (selection_changed), (main):
Document functions and fix a few bugs.
2004-07-03 08:01:34 +00:00
|
|
|
*
|
2009-12-10 10:23:40 +00:00
|
|
|
* Sets the model for a #GtkIconView.
|
|
|
|
* If the @icon_view already has a model set, it will remove
|
2004-07-13 05:15:49 +00:00
|
|
|
* it before setting the new model. If @model is %NULL, then
|
Document functions and fix a few bugs.
2004-07-03 Anders Carlsson <andersca@gnome.org>
* libegg/iconlist/eggiconlist.c: (egg_icon_list_add_move_binding),
(egg_icon_list_real_move_cursor), (egg_icon_list_new),
(egg_icon_list_new_with_model), (egg_icon_list_get_path_at_pos),
(egg_icon_list_selected_foreach),
(egg_icon_list_set_selection_mode),
(egg_icon_list_get_selection_mode), (egg_icon_list_set_model),
(egg_icon_list_get_model), (egg_icon_list_set_text_column),
(egg_icon_list_get_text_column), (egg_icon_list_set_markup_column),
(egg_icon_list_get_markup_column),
(egg_icon_list_set_pixbuf_column),
(egg_icon_list_get_pixbuf_column), (egg_icon_list_select_path),
(egg_icon_list_unselect_path), (egg_icon_list_select_all),
(egg_icon_list_unselect_all), (egg_icon_list_path_is_selected),
(egg_icon_list_item_activated):
* libegg/iconlist/eggiconlist.h:
* libegg/iconlist/testiconlist.c: (foreach_selected_remove_func),
(foreach_selected_remove), (selection_changed), (main):
Document functions and fix a few bugs.
2004-07-03 08:01:34 +00:00
|
|
|
* it will unset the old model.
|
|
|
|
*
|
|
|
|
* Since: 2.6
|
|
|
|
**/
|
|
|
|
void
|
2004-07-04 15:56:55 +00:00
|
|
|
gtk_icon_view_set_model (GtkIconView *icon_view,
|
Document functions and fix a few bugs.
2004-07-03 Anders Carlsson <andersca@gnome.org>
* libegg/iconlist/eggiconlist.c: (egg_icon_list_add_move_binding),
(egg_icon_list_real_move_cursor), (egg_icon_list_new),
(egg_icon_list_new_with_model), (egg_icon_list_get_path_at_pos),
(egg_icon_list_selected_foreach),
(egg_icon_list_set_selection_mode),
(egg_icon_list_get_selection_mode), (egg_icon_list_set_model),
(egg_icon_list_get_model), (egg_icon_list_set_text_column),
(egg_icon_list_get_text_column), (egg_icon_list_set_markup_column),
(egg_icon_list_get_markup_column),
(egg_icon_list_set_pixbuf_column),
(egg_icon_list_get_pixbuf_column), (egg_icon_list_select_path),
(egg_icon_list_unselect_path), (egg_icon_list_select_all),
(egg_icon_list_unselect_all), (egg_icon_list_path_is_selected),
(egg_icon_list_item_activated):
* libegg/iconlist/eggiconlist.h:
* libegg/iconlist/testiconlist.c: (foreach_selected_remove_func),
(foreach_selected_remove), (selection_changed), (main):
Document functions and fix a few bugs.
2004-07-03 08:01:34 +00:00
|
|
|
GtkTreeModel *model)
|
|
|
|
{
|
2004-07-04 15:56:55 +00:00
|
|
|
g_return_if_fail (GTK_IS_ICON_VIEW (icon_view));
|
2004-10-04 03:33:59 +00:00
|
|
|
g_return_if_fail (model == NULL || GTK_IS_TREE_MODEL (model));
|
Document functions and fix a few bugs.
2004-07-03 Anders Carlsson <andersca@gnome.org>
* libegg/iconlist/eggiconlist.c: (egg_icon_list_add_move_binding),
(egg_icon_list_real_move_cursor), (egg_icon_list_new),
(egg_icon_list_new_with_model), (egg_icon_list_get_path_at_pos),
(egg_icon_list_selected_foreach),
(egg_icon_list_set_selection_mode),
(egg_icon_list_get_selection_mode), (egg_icon_list_set_model),
(egg_icon_list_get_model), (egg_icon_list_set_text_column),
(egg_icon_list_get_text_column), (egg_icon_list_set_markup_column),
(egg_icon_list_get_markup_column),
(egg_icon_list_set_pixbuf_column),
(egg_icon_list_get_pixbuf_column), (egg_icon_list_select_path),
(egg_icon_list_unselect_path), (egg_icon_list_select_all),
(egg_icon_list_unselect_all), (egg_icon_list_path_is_selected),
(egg_icon_list_item_activated):
* libegg/iconlist/eggiconlist.h:
* libegg/iconlist/testiconlist.c: (foreach_selected_remove_func),
(foreach_selected_remove), (selection_changed), (main):
Document functions and fix a few bugs.
2004-07-03 08:01:34 +00:00
|
|
|
|
2004-07-04 15:56:55 +00:00
|
|
|
if (icon_view->priv->model == model)
|
Document functions and fix a few bugs.
2004-07-03 Anders Carlsson <andersca@gnome.org>
* libegg/iconlist/eggiconlist.c: (egg_icon_list_add_move_binding),
(egg_icon_list_real_move_cursor), (egg_icon_list_new),
(egg_icon_list_new_with_model), (egg_icon_list_get_path_at_pos),
(egg_icon_list_selected_foreach),
(egg_icon_list_set_selection_mode),
(egg_icon_list_get_selection_mode), (egg_icon_list_set_model),
(egg_icon_list_get_model), (egg_icon_list_set_text_column),
(egg_icon_list_get_text_column), (egg_icon_list_set_markup_column),
(egg_icon_list_get_markup_column),
(egg_icon_list_set_pixbuf_column),
(egg_icon_list_get_pixbuf_column), (egg_icon_list_select_path),
(egg_icon_list_unselect_path), (egg_icon_list_select_all),
(egg_icon_list_unselect_all), (egg_icon_list_path_is_selected),
(egg_icon_list_item_activated):
* libegg/iconlist/eggiconlist.h:
* libegg/iconlist/testiconlist.c: (foreach_selected_remove_func),
(foreach_selected_remove), (selection_changed), (main):
Document functions and fix a few bugs.
2004-07-03 08:01:34 +00:00
|
|
|
return;
|
|
|
|
|
2005-08-20 20:16:34 +00:00
|
|
|
if (icon_view->priv->scroll_to_path)
|
|
|
|
{
|
|
|
|
gtk_tree_row_reference_free (icon_view->priv->scroll_to_path);
|
|
|
|
icon_view->priv->scroll_to_path = NULL;
|
|
|
|
}
|
|
|
|
|
2010-12-21 12:28:46 +00:00
|
|
|
/* The area can be NULL while disposing */
|
|
|
|
if (icon_view->priv->cell_area)
|
|
|
|
gtk_cell_area_stop_editing (icon_view->priv->cell_area, TRUE);
|
2005-05-02 20:28:37 +00:00
|
|
|
|
Document functions and fix a few bugs.
2004-07-03 Anders Carlsson <andersca@gnome.org>
* libegg/iconlist/eggiconlist.c: (egg_icon_list_add_move_binding),
(egg_icon_list_real_move_cursor), (egg_icon_list_new),
(egg_icon_list_new_with_model), (egg_icon_list_get_path_at_pos),
(egg_icon_list_selected_foreach),
(egg_icon_list_set_selection_mode),
(egg_icon_list_get_selection_mode), (egg_icon_list_set_model),
(egg_icon_list_get_model), (egg_icon_list_set_text_column),
(egg_icon_list_get_text_column), (egg_icon_list_set_markup_column),
(egg_icon_list_get_markup_column),
(egg_icon_list_set_pixbuf_column),
(egg_icon_list_get_pixbuf_column), (egg_icon_list_select_path),
(egg_icon_list_unselect_path), (egg_icon_list_select_all),
(egg_icon_list_unselect_all), (egg_icon_list_path_is_selected),
(egg_icon_list_item_activated):
* libegg/iconlist/eggiconlist.h:
* libegg/iconlist/testiconlist.c: (foreach_selected_remove_func),
(foreach_selected_remove), (selection_changed), (main):
Document functions and fix a few bugs.
2004-07-03 08:01:34 +00:00
|
|
|
if (model)
|
|
|
|
{
|
2004-11-26 05:51:32 +00:00
|
|
|
GType column_type;
|
Document functions and fix a few bugs.
2004-07-03 Anders Carlsson <andersca@gnome.org>
* libegg/iconlist/eggiconlist.c: (egg_icon_list_add_move_binding),
(egg_icon_list_real_move_cursor), (egg_icon_list_new),
(egg_icon_list_new_with_model), (egg_icon_list_get_path_at_pos),
(egg_icon_list_selected_foreach),
(egg_icon_list_set_selection_mode),
(egg_icon_list_get_selection_mode), (egg_icon_list_set_model),
(egg_icon_list_get_model), (egg_icon_list_set_text_column),
(egg_icon_list_get_text_column), (egg_icon_list_set_markup_column),
(egg_icon_list_get_markup_column),
(egg_icon_list_set_pixbuf_column),
(egg_icon_list_get_pixbuf_column), (egg_icon_list_select_path),
(egg_icon_list_unselect_path), (egg_icon_list_select_all),
(egg_icon_list_unselect_all), (egg_icon_list_path_is_selected),
(egg_icon_list_item_activated):
* libegg/iconlist/eggiconlist.h:
* libegg/iconlist/testiconlist.c: (foreach_selected_remove_func),
(foreach_selected_remove), (selection_changed), (main):
Document functions and fix a few bugs.
2004-07-03 08:01:34 +00:00
|
|
|
|
2004-07-04 15:56:55 +00:00
|
|
|
if (icon_view->priv->pixbuf_column != -1)
|
Document functions and fix a few bugs.
2004-07-03 Anders Carlsson <andersca@gnome.org>
* libegg/iconlist/eggiconlist.c: (egg_icon_list_add_move_binding),
(egg_icon_list_real_move_cursor), (egg_icon_list_new),
(egg_icon_list_new_with_model), (egg_icon_list_get_path_at_pos),
(egg_icon_list_selected_foreach),
(egg_icon_list_set_selection_mode),
(egg_icon_list_get_selection_mode), (egg_icon_list_set_model),
(egg_icon_list_get_model), (egg_icon_list_set_text_column),
(egg_icon_list_get_text_column), (egg_icon_list_set_markup_column),
(egg_icon_list_get_markup_column),
(egg_icon_list_set_pixbuf_column),
(egg_icon_list_get_pixbuf_column), (egg_icon_list_select_path),
(egg_icon_list_unselect_path), (egg_icon_list_select_all),
(egg_icon_list_unselect_all), (egg_icon_list_path_is_selected),
(egg_icon_list_item_activated):
* libegg/iconlist/eggiconlist.h:
* libegg/iconlist/testiconlist.c: (foreach_selected_remove_func),
(foreach_selected_remove), (selection_changed), (main):
Document functions and fix a few bugs.
2004-07-03 08:01:34 +00:00
|
|
|
{
|
2004-11-26 05:51:32 +00:00
|
|
|
column_type = gtk_tree_model_get_column_type (model,
|
|
|
|
icon_view->priv->pixbuf_column);
|
Document functions and fix a few bugs.
2004-07-03 Anders Carlsson <andersca@gnome.org>
* libegg/iconlist/eggiconlist.c: (egg_icon_list_add_move_binding),
(egg_icon_list_real_move_cursor), (egg_icon_list_new),
(egg_icon_list_new_with_model), (egg_icon_list_get_path_at_pos),
(egg_icon_list_selected_foreach),
(egg_icon_list_set_selection_mode),
(egg_icon_list_get_selection_mode), (egg_icon_list_set_model),
(egg_icon_list_get_model), (egg_icon_list_set_text_column),
(egg_icon_list_get_text_column), (egg_icon_list_set_markup_column),
(egg_icon_list_get_markup_column),
(egg_icon_list_set_pixbuf_column),
(egg_icon_list_get_pixbuf_column), (egg_icon_list_select_path),
(egg_icon_list_unselect_path), (egg_icon_list_select_all),
(egg_icon_list_unselect_all), (egg_icon_list_path_is_selected),
(egg_icon_list_item_activated):
* libegg/iconlist/eggiconlist.h:
* libegg/iconlist/testiconlist.c: (foreach_selected_remove_func),
(foreach_selected_remove), (selection_changed), (main):
Document functions and fix a few bugs.
2004-07-03 08:01:34 +00:00
|
|
|
|
2004-11-26 05:51:32 +00:00
|
|
|
g_return_if_fail (column_type == GDK_TYPE_PIXBUF);
|
Document functions and fix a few bugs.
2004-07-03 Anders Carlsson <andersca@gnome.org>
* libegg/iconlist/eggiconlist.c: (egg_icon_list_add_move_binding),
(egg_icon_list_real_move_cursor), (egg_icon_list_new),
(egg_icon_list_new_with_model), (egg_icon_list_get_path_at_pos),
(egg_icon_list_selected_foreach),
(egg_icon_list_set_selection_mode),
(egg_icon_list_get_selection_mode), (egg_icon_list_set_model),
(egg_icon_list_get_model), (egg_icon_list_set_text_column),
(egg_icon_list_get_text_column), (egg_icon_list_set_markup_column),
(egg_icon_list_get_markup_column),
(egg_icon_list_set_pixbuf_column),
(egg_icon_list_get_pixbuf_column), (egg_icon_list_select_path),
(egg_icon_list_unselect_path), (egg_icon_list_select_all),
(egg_icon_list_unselect_all), (egg_icon_list_path_is_selected),
(egg_icon_list_item_activated):
* libegg/iconlist/eggiconlist.h:
* libegg/iconlist/testiconlist.c: (foreach_selected_remove_func),
(foreach_selected_remove), (selection_changed), (main):
Document functions and fix a few bugs.
2004-07-03 08:01:34 +00:00
|
|
|
}
|
|
|
|
|
2004-07-04 15:56:55 +00:00
|
|
|
if (icon_view->priv->text_column != -1)
|
Document functions and fix a few bugs.
2004-07-03 Anders Carlsson <andersca@gnome.org>
* libegg/iconlist/eggiconlist.c: (egg_icon_list_add_move_binding),
(egg_icon_list_real_move_cursor), (egg_icon_list_new),
(egg_icon_list_new_with_model), (egg_icon_list_get_path_at_pos),
(egg_icon_list_selected_foreach),
(egg_icon_list_set_selection_mode),
(egg_icon_list_get_selection_mode), (egg_icon_list_set_model),
(egg_icon_list_get_model), (egg_icon_list_set_text_column),
(egg_icon_list_get_text_column), (egg_icon_list_set_markup_column),
(egg_icon_list_get_markup_column),
(egg_icon_list_set_pixbuf_column),
(egg_icon_list_get_pixbuf_column), (egg_icon_list_select_path),
(egg_icon_list_unselect_path), (egg_icon_list_select_all),
(egg_icon_list_unselect_all), (egg_icon_list_path_is_selected),
(egg_icon_list_item_activated):
* libegg/iconlist/eggiconlist.h:
* libegg/iconlist/testiconlist.c: (foreach_selected_remove_func),
(foreach_selected_remove), (selection_changed), (main):
Document functions and fix a few bugs.
2004-07-03 08:01:34 +00:00
|
|
|
{
|
2004-11-26 05:51:32 +00:00
|
|
|
column_type = gtk_tree_model_get_column_type (model,
|
|
|
|
icon_view->priv->text_column);
|
Document functions and fix a few bugs.
2004-07-03 Anders Carlsson <andersca@gnome.org>
* libegg/iconlist/eggiconlist.c: (egg_icon_list_add_move_binding),
(egg_icon_list_real_move_cursor), (egg_icon_list_new),
(egg_icon_list_new_with_model), (egg_icon_list_get_path_at_pos),
(egg_icon_list_selected_foreach),
(egg_icon_list_set_selection_mode),
(egg_icon_list_get_selection_mode), (egg_icon_list_set_model),
(egg_icon_list_get_model), (egg_icon_list_set_text_column),
(egg_icon_list_get_text_column), (egg_icon_list_set_markup_column),
(egg_icon_list_get_markup_column),
(egg_icon_list_set_pixbuf_column),
(egg_icon_list_get_pixbuf_column), (egg_icon_list_select_path),
(egg_icon_list_unselect_path), (egg_icon_list_select_all),
(egg_icon_list_unselect_all), (egg_icon_list_path_is_selected),
(egg_icon_list_item_activated):
* libegg/iconlist/eggiconlist.h:
* libegg/iconlist/testiconlist.c: (foreach_selected_remove_func),
(foreach_selected_remove), (selection_changed), (main):
Document functions and fix a few bugs.
2004-07-03 08:01:34 +00:00
|
|
|
|
2004-11-26 05:51:32 +00:00
|
|
|
g_return_if_fail (column_type == G_TYPE_STRING);
|
|
|
|
}
|
|
|
|
|
|
|
|
if (icon_view->priv->markup_column != -1)
|
|
|
|
{
|
|
|
|
column_type = gtk_tree_model_get_column_type (model,
|
|
|
|
icon_view->priv->markup_column);
|
|
|
|
|
|
|
|
g_return_if_fail (column_type == G_TYPE_STRING);
|
Document functions and fix a few bugs.
2004-07-03 Anders Carlsson <andersca@gnome.org>
* libegg/iconlist/eggiconlist.c: (egg_icon_list_add_move_binding),
(egg_icon_list_real_move_cursor), (egg_icon_list_new),
(egg_icon_list_new_with_model), (egg_icon_list_get_path_at_pos),
(egg_icon_list_selected_foreach),
(egg_icon_list_set_selection_mode),
(egg_icon_list_get_selection_mode), (egg_icon_list_set_model),
(egg_icon_list_get_model), (egg_icon_list_set_text_column),
(egg_icon_list_get_text_column), (egg_icon_list_set_markup_column),
(egg_icon_list_get_markup_column),
(egg_icon_list_set_pixbuf_column),
(egg_icon_list_get_pixbuf_column), (egg_icon_list_select_path),
(egg_icon_list_unselect_path), (egg_icon_list_select_all),
(egg_icon_list_unselect_all), (egg_icon_list_path_is_selected),
(egg_icon_list_item_activated):
* libegg/iconlist/eggiconlist.h:
* libegg/iconlist/testiconlist.c: (foreach_selected_remove_func),
(foreach_selected_remove), (selection_changed), (main):
Document functions and fix a few bugs.
2004-07-03 08:01:34 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
2004-07-04 15:56:55 +00:00
|
|
|
if (icon_view->priv->model)
|
Document functions and fix a few bugs.
2004-07-03 Anders Carlsson <andersca@gnome.org>
* libegg/iconlist/eggiconlist.c: (egg_icon_list_add_move_binding),
(egg_icon_list_real_move_cursor), (egg_icon_list_new),
(egg_icon_list_new_with_model), (egg_icon_list_get_path_at_pos),
(egg_icon_list_selected_foreach),
(egg_icon_list_set_selection_mode),
(egg_icon_list_get_selection_mode), (egg_icon_list_set_model),
(egg_icon_list_get_model), (egg_icon_list_set_text_column),
(egg_icon_list_get_text_column), (egg_icon_list_set_markup_column),
(egg_icon_list_get_markup_column),
(egg_icon_list_set_pixbuf_column),
(egg_icon_list_get_pixbuf_column), (egg_icon_list_select_path),
(egg_icon_list_unselect_path), (egg_icon_list_select_all),
(egg_icon_list_unselect_all), (egg_icon_list_path_is_selected),
(egg_icon_list_item_activated):
* libegg/iconlist/eggiconlist.h:
* libegg/iconlist/testiconlist.c: (foreach_selected_remove_func),
(foreach_selected_remove), (selection_changed), (main):
Document functions and fix a few bugs.
2004-07-03 08:01:34 +00:00
|
|
|
{
|
2004-07-04 15:56:55 +00:00
|
|
|
g_signal_handlers_disconnect_by_func (icon_view->priv->model,
|
|
|
|
gtk_icon_view_row_changed,
|
|
|
|
icon_view);
|
|
|
|
g_signal_handlers_disconnect_by_func (icon_view->priv->model,
|
|
|
|
gtk_icon_view_row_inserted,
|
|
|
|
icon_view);
|
|
|
|
g_signal_handlers_disconnect_by_func (icon_view->priv->model,
|
|
|
|
gtk_icon_view_row_deleted,
|
|
|
|
icon_view);
|
|
|
|
g_signal_handlers_disconnect_by_func (icon_view->priv->model,
|
|
|
|
gtk_icon_view_rows_reordered,
|
|
|
|
icon_view);
|
Document functions and fix a few bugs.
2004-07-03 Anders Carlsson <andersca@gnome.org>
* libegg/iconlist/eggiconlist.c: (egg_icon_list_add_move_binding),
(egg_icon_list_real_move_cursor), (egg_icon_list_new),
(egg_icon_list_new_with_model), (egg_icon_list_get_path_at_pos),
(egg_icon_list_selected_foreach),
(egg_icon_list_set_selection_mode),
(egg_icon_list_get_selection_mode), (egg_icon_list_set_model),
(egg_icon_list_get_model), (egg_icon_list_set_text_column),
(egg_icon_list_get_text_column), (egg_icon_list_set_markup_column),
(egg_icon_list_get_markup_column),
(egg_icon_list_set_pixbuf_column),
(egg_icon_list_get_pixbuf_column), (egg_icon_list_select_path),
(egg_icon_list_unselect_path), (egg_icon_list_select_all),
(egg_icon_list_unselect_all), (egg_icon_list_path_is_selected),
(egg_icon_list_item_activated):
* libegg/iconlist/eggiconlist.h:
* libegg/iconlist/testiconlist.c: (foreach_selected_remove_func),
(foreach_selected_remove), (selection_changed), (main):
Document functions and fix a few bugs.
2004-07-03 08:01:34 +00:00
|
|
|
|
2004-07-04 15:56:55 +00:00
|
|
|
g_object_unref (icon_view->priv->model);
|
Document functions and fix a few bugs.
2004-07-03 Anders Carlsson <andersca@gnome.org>
* libegg/iconlist/eggiconlist.c: (egg_icon_list_add_move_binding),
(egg_icon_list_real_move_cursor), (egg_icon_list_new),
(egg_icon_list_new_with_model), (egg_icon_list_get_path_at_pos),
(egg_icon_list_selected_foreach),
(egg_icon_list_set_selection_mode),
(egg_icon_list_get_selection_mode), (egg_icon_list_set_model),
(egg_icon_list_get_model), (egg_icon_list_set_text_column),
(egg_icon_list_get_text_column), (egg_icon_list_set_markup_column),
(egg_icon_list_get_markup_column),
(egg_icon_list_set_pixbuf_column),
(egg_icon_list_get_pixbuf_column), (egg_icon_list_select_path),
(egg_icon_list_unselect_path), (egg_icon_list_select_all),
(egg_icon_list_unselect_all), (egg_icon_list_path_is_selected),
(egg_icon_list_item_activated):
* libegg/iconlist/eggiconlist.h:
* libegg/iconlist/testiconlist.c: (foreach_selected_remove_func),
(foreach_selected_remove), (selection_changed), (main):
Document functions and fix a few bugs.
2004-07-03 08:01:34 +00:00
|
|
|
|
2004-07-04 15:56:55 +00:00
|
|
|
g_list_foreach (icon_view->priv->items, (GFunc)gtk_icon_view_item_free, NULL);
|
|
|
|
g_list_free (icon_view->priv->items);
|
|
|
|
icon_view->priv->items = NULL;
|
2004-10-04 03:33:59 +00:00
|
|
|
icon_view->priv->anchor_item = NULL;
|
|
|
|
icon_view->priv->cursor_item = NULL;
|
|
|
|
icon_view->priv->last_single_clicked = NULL;
|
2005-03-09 16:09:22 +00:00
|
|
|
icon_view->priv->width = 0;
|
|
|
|
icon_view->priv->height = 0;
|
Document functions and fix a few bugs.
2004-07-03 Anders Carlsson <andersca@gnome.org>
* libegg/iconlist/eggiconlist.c: (egg_icon_list_add_move_binding),
(egg_icon_list_real_move_cursor), (egg_icon_list_new),
(egg_icon_list_new_with_model), (egg_icon_list_get_path_at_pos),
(egg_icon_list_selected_foreach),
(egg_icon_list_set_selection_mode),
(egg_icon_list_get_selection_mode), (egg_icon_list_set_model),
(egg_icon_list_get_model), (egg_icon_list_set_text_column),
(egg_icon_list_get_text_column), (egg_icon_list_set_markup_column),
(egg_icon_list_get_markup_column),
(egg_icon_list_set_pixbuf_column),
(egg_icon_list_get_pixbuf_column), (egg_icon_list_select_path),
(egg_icon_list_unselect_path), (egg_icon_list_select_all),
(egg_icon_list_unselect_all), (egg_icon_list_path_is_selected),
(egg_icon_list_item_activated):
* libegg/iconlist/eggiconlist.h:
* libegg/iconlist/testiconlist.c: (foreach_selected_remove_func),
(foreach_selected_remove), (selection_changed), (main):
Document functions and fix a few bugs.
2004-07-03 08:01:34 +00:00
|
|
|
}
|
|
|
|
|
2004-07-04 15:56:55 +00:00
|
|
|
icon_view->priv->model = model;
|
Document functions and fix a few bugs.
2004-07-03 Anders Carlsson <andersca@gnome.org>
* libegg/iconlist/eggiconlist.c: (egg_icon_list_add_move_binding),
(egg_icon_list_real_move_cursor), (egg_icon_list_new),
(egg_icon_list_new_with_model), (egg_icon_list_get_path_at_pos),
(egg_icon_list_selected_foreach),
(egg_icon_list_set_selection_mode),
(egg_icon_list_get_selection_mode), (egg_icon_list_set_model),
(egg_icon_list_get_model), (egg_icon_list_set_text_column),
(egg_icon_list_get_text_column), (egg_icon_list_set_markup_column),
(egg_icon_list_get_markup_column),
(egg_icon_list_set_pixbuf_column),
(egg_icon_list_get_pixbuf_column), (egg_icon_list_select_path),
(egg_icon_list_unselect_path), (egg_icon_list_select_all),
(egg_icon_list_unselect_all), (egg_icon_list_path_is_selected),
(egg_icon_list_item_activated):
* libegg/iconlist/eggiconlist.h:
* libegg/iconlist/testiconlist.c: (foreach_selected_remove_func),
(foreach_selected_remove), (selection_changed), (main):
Document functions and fix a few bugs.
2004-07-03 08:01:34 +00:00
|
|
|
|
2004-07-04 15:56:55 +00:00
|
|
|
if (icon_view->priv->model)
|
Document functions and fix a few bugs.
2004-07-03 Anders Carlsson <andersca@gnome.org>
* libegg/iconlist/eggiconlist.c: (egg_icon_list_add_move_binding),
(egg_icon_list_real_move_cursor), (egg_icon_list_new),
(egg_icon_list_new_with_model), (egg_icon_list_get_path_at_pos),
(egg_icon_list_selected_foreach),
(egg_icon_list_set_selection_mode),
(egg_icon_list_get_selection_mode), (egg_icon_list_set_model),
(egg_icon_list_get_model), (egg_icon_list_set_text_column),
(egg_icon_list_get_text_column), (egg_icon_list_set_markup_column),
(egg_icon_list_get_markup_column),
(egg_icon_list_set_pixbuf_column),
(egg_icon_list_get_pixbuf_column), (egg_icon_list_select_path),
(egg_icon_list_unselect_path), (egg_icon_list_select_all),
(egg_icon_list_unselect_all), (egg_icon_list_path_is_selected),
(egg_icon_list_item_activated):
* libegg/iconlist/eggiconlist.h:
* libegg/iconlist/testiconlist.c: (foreach_selected_remove_func),
(foreach_selected_remove), (selection_changed), (main):
Document functions and fix a few bugs.
2004-07-03 08:01:34 +00:00
|
|
|
{
|
2004-07-04 15:56:55 +00:00
|
|
|
g_object_ref (icon_view->priv->model);
|
|
|
|
g_signal_connect (icon_view->priv->model,
|
2008-08-11 12:54:57 +00:00
|
|
|
"row-changed",
|
2004-07-04 15:56:55 +00:00
|
|
|
G_CALLBACK (gtk_icon_view_row_changed),
|
|
|
|
icon_view);
|
|
|
|
g_signal_connect (icon_view->priv->model,
|
2008-08-11 12:54:57 +00:00
|
|
|
"row-inserted",
|
2004-07-04 15:56:55 +00:00
|
|
|
G_CALLBACK (gtk_icon_view_row_inserted),
|
|
|
|
icon_view);
|
|
|
|
g_signal_connect (icon_view->priv->model,
|
2008-08-11 12:54:57 +00:00
|
|
|
"row-deleted",
|
2004-07-04 15:56:55 +00:00
|
|
|
G_CALLBACK (gtk_icon_view_row_deleted),
|
|
|
|
icon_view);
|
|
|
|
g_signal_connect (icon_view->priv->model,
|
2008-08-11 12:54:57 +00:00
|
|
|
"rows-reordered",
|
2004-07-04 15:56:55 +00:00
|
|
|
G_CALLBACK (gtk_icon_view_rows_reordered),
|
|
|
|
icon_view);
|
Document functions and fix a few bugs.
2004-07-03 Anders Carlsson <andersca@gnome.org>
* libegg/iconlist/eggiconlist.c: (egg_icon_list_add_move_binding),
(egg_icon_list_real_move_cursor), (egg_icon_list_new),
(egg_icon_list_new_with_model), (egg_icon_list_get_path_at_pos),
(egg_icon_list_selected_foreach),
(egg_icon_list_set_selection_mode),
(egg_icon_list_get_selection_mode), (egg_icon_list_set_model),
(egg_icon_list_get_model), (egg_icon_list_set_text_column),
(egg_icon_list_get_text_column), (egg_icon_list_set_markup_column),
(egg_icon_list_get_markup_column),
(egg_icon_list_set_pixbuf_column),
(egg_icon_list_get_pixbuf_column), (egg_icon_list_select_path),
(egg_icon_list_unselect_path), (egg_icon_list_select_all),
(egg_icon_list_unselect_all), (egg_icon_list_path_is_selected),
(egg_icon_list_item_activated):
* libegg/iconlist/eggiconlist.h:
* libegg/iconlist/testiconlist.c: (foreach_selected_remove_func),
(foreach_selected_remove), (selection_changed), (main):
Document functions and fix a few bugs.
2004-07-03 08:01:34 +00:00
|
|
|
|
2004-07-04 15:56:55 +00:00
|
|
|
gtk_icon_view_build_items (icon_view);
|
2004-07-03 10:04:14 +00:00
|
|
|
|
2005-03-09 16:09:22 +00:00
|
|
|
gtk_icon_view_queue_layout (icon_view);
|
|
|
|
}
|
2004-11-26 06:17:49 +00:00
|
|
|
|
2004-07-04 15:56:55 +00:00
|
|
|
g_object_notify (G_OBJECT (icon_view), "model");
|
2005-03-09 16:09:22 +00:00
|
|
|
|
2010-03-02 06:16:02 +00:00
|
|
|
if (gtk_widget_get_realized (GTK_WIDGET (icon_view)))
|
2005-03-09 16:09:22 +00:00
|
|
|
gtk_widget_queue_resize (GTK_WIDGET (icon_view));
|
Document functions and fix a few bugs.
2004-07-03 Anders Carlsson <andersca@gnome.org>
* libegg/iconlist/eggiconlist.c: (egg_icon_list_add_move_binding),
(egg_icon_list_real_move_cursor), (egg_icon_list_new),
(egg_icon_list_new_with_model), (egg_icon_list_get_path_at_pos),
(egg_icon_list_selected_foreach),
(egg_icon_list_set_selection_mode),
(egg_icon_list_get_selection_mode), (egg_icon_list_set_model),
(egg_icon_list_get_model), (egg_icon_list_set_text_column),
(egg_icon_list_get_text_column), (egg_icon_list_set_markup_column),
(egg_icon_list_get_markup_column),
(egg_icon_list_set_pixbuf_column),
(egg_icon_list_get_pixbuf_column), (egg_icon_list_select_path),
(egg_icon_list_unselect_path), (egg_icon_list_select_all),
(egg_icon_list_unselect_all), (egg_icon_list_path_is_selected),
(egg_icon_list_item_activated):
* libegg/iconlist/eggiconlist.h:
* libegg/iconlist/testiconlist.c: (foreach_selected_remove_func),
(foreach_selected_remove), (selection_changed), (main):
Document functions and fix a few bugs.
2004-07-03 08:01:34 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2004-07-04 15:56:55 +00:00
|
|
|
* gtk_icon_view_get_model:
|
|
|
|
* @icon_view: a #GtkIconView
|
Document functions and fix a few bugs.
2004-07-03 Anders Carlsson <andersca@gnome.org>
* libegg/iconlist/eggiconlist.c: (egg_icon_list_add_move_binding),
(egg_icon_list_real_move_cursor), (egg_icon_list_new),
(egg_icon_list_new_with_model), (egg_icon_list_get_path_at_pos),
(egg_icon_list_selected_foreach),
(egg_icon_list_set_selection_mode),
(egg_icon_list_get_selection_mode), (egg_icon_list_set_model),
(egg_icon_list_get_model), (egg_icon_list_set_text_column),
(egg_icon_list_get_text_column), (egg_icon_list_set_markup_column),
(egg_icon_list_get_markup_column),
(egg_icon_list_set_pixbuf_column),
(egg_icon_list_get_pixbuf_column), (egg_icon_list_select_path),
(egg_icon_list_unselect_path), (egg_icon_list_select_all),
(egg_icon_list_unselect_all), (egg_icon_list_path_is_selected),
(egg_icon_list_item_activated):
* libegg/iconlist/eggiconlist.h:
* libegg/iconlist/testiconlist.c: (foreach_selected_remove_func),
(foreach_selected_remove), (selection_changed), (main):
Document functions and fix a few bugs.
2004-07-03 08:01:34 +00:00
|
|
|
*
|
2004-07-04 15:56:55 +00:00
|
|
|
* Returns the model the #GtkIconView is based on. Returns %NULL if the
|
Document functions and fix a few bugs.
2004-07-03 Anders Carlsson <andersca@gnome.org>
* libegg/iconlist/eggiconlist.c: (egg_icon_list_add_move_binding),
(egg_icon_list_real_move_cursor), (egg_icon_list_new),
(egg_icon_list_new_with_model), (egg_icon_list_get_path_at_pos),
(egg_icon_list_selected_foreach),
(egg_icon_list_set_selection_mode),
(egg_icon_list_get_selection_mode), (egg_icon_list_set_model),
(egg_icon_list_get_model), (egg_icon_list_set_text_column),
(egg_icon_list_get_text_column), (egg_icon_list_set_markup_column),
(egg_icon_list_get_markup_column),
(egg_icon_list_set_pixbuf_column),
(egg_icon_list_get_pixbuf_column), (egg_icon_list_select_path),
(egg_icon_list_unselect_path), (egg_icon_list_select_all),
(egg_icon_list_unselect_all), (egg_icon_list_path_is_selected),
(egg_icon_list_item_activated):
* libegg/iconlist/eggiconlist.h:
* libegg/iconlist/testiconlist.c: (foreach_selected_remove_func),
(foreach_selected_remove), (selection_changed), (main):
Document functions and fix a few bugs.
2004-07-03 08:01:34 +00:00
|
|
|
* model is unset.
|
|
|
|
*
|
2010-09-21 04:18:11 +00:00
|
|
|
* Return value: (transfer none): A #GtkTreeModel, or %NULL if none is
|
|
|
|
* currently being used.
|
Document functions and fix a few bugs.
2004-07-03 Anders Carlsson <andersca@gnome.org>
* libegg/iconlist/eggiconlist.c: (egg_icon_list_add_move_binding),
(egg_icon_list_real_move_cursor), (egg_icon_list_new),
(egg_icon_list_new_with_model), (egg_icon_list_get_path_at_pos),
(egg_icon_list_selected_foreach),
(egg_icon_list_set_selection_mode),
(egg_icon_list_get_selection_mode), (egg_icon_list_set_model),
(egg_icon_list_get_model), (egg_icon_list_set_text_column),
(egg_icon_list_get_text_column), (egg_icon_list_set_markup_column),
(egg_icon_list_get_markup_column),
(egg_icon_list_set_pixbuf_column),
(egg_icon_list_get_pixbuf_column), (egg_icon_list_select_path),
(egg_icon_list_unselect_path), (egg_icon_list_select_all),
(egg_icon_list_unselect_all), (egg_icon_list_path_is_selected),
(egg_icon_list_item_activated):
* libegg/iconlist/eggiconlist.h:
* libegg/iconlist/testiconlist.c: (foreach_selected_remove_func),
(foreach_selected_remove), (selection_changed), (main):
Document functions and fix a few bugs.
2004-07-03 08:01:34 +00:00
|
|
|
*
|
|
|
|
* Since: 2.6
|
|
|
|
**/
|
|
|
|
GtkTreeModel *
|
2004-07-04 15:56:55 +00:00
|
|
|
gtk_icon_view_get_model (GtkIconView *icon_view)
|
Document functions and fix a few bugs.
2004-07-03 Anders Carlsson <andersca@gnome.org>
* libegg/iconlist/eggiconlist.c: (egg_icon_list_add_move_binding),
(egg_icon_list_real_move_cursor), (egg_icon_list_new),
(egg_icon_list_new_with_model), (egg_icon_list_get_path_at_pos),
(egg_icon_list_selected_foreach),
(egg_icon_list_set_selection_mode),
(egg_icon_list_get_selection_mode), (egg_icon_list_set_model),
(egg_icon_list_get_model), (egg_icon_list_set_text_column),
(egg_icon_list_get_text_column), (egg_icon_list_set_markup_column),
(egg_icon_list_get_markup_column),
(egg_icon_list_set_pixbuf_column),
(egg_icon_list_get_pixbuf_column), (egg_icon_list_select_path),
(egg_icon_list_unselect_path), (egg_icon_list_select_all),
(egg_icon_list_unselect_all), (egg_icon_list_path_is_selected),
(egg_icon_list_item_activated):
* libegg/iconlist/eggiconlist.h:
* libegg/iconlist/testiconlist.c: (foreach_selected_remove_func),
(foreach_selected_remove), (selection_changed), (main):
Document functions and fix a few bugs.
2004-07-03 08:01:34 +00:00
|
|
|
{
|
2004-07-04 15:56:55 +00:00
|
|
|
g_return_val_if_fail (GTK_IS_ICON_VIEW (icon_view), NULL);
|
Document functions and fix a few bugs.
2004-07-03 Anders Carlsson <andersca@gnome.org>
* libegg/iconlist/eggiconlist.c: (egg_icon_list_add_move_binding),
(egg_icon_list_real_move_cursor), (egg_icon_list_new),
(egg_icon_list_new_with_model), (egg_icon_list_get_path_at_pos),
(egg_icon_list_selected_foreach),
(egg_icon_list_set_selection_mode),
(egg_icon_list_get_selection_mode), (egg_icon_list_set_model),
(egg_icon_list_get_model), (egg_icon_list_set_text_column),
(egg_icon_list_get_text_column), (egg_icon_list_set_markup_column),
(egg_icon_list_get_markup_column),
(egg_icon_list_set_pixbuf_column),
(egg_icon_list_get_pixbuf_column), (egg_icon_list_select_path),
(egg_icon_list_unselect_path), (egg_icon_list_select_all),
(egg_icon_list_unselect_all), (egg_icon_list_path_is_selected),
(egg_icon_list_item_activated):
* libegg/iconlist/eggiconlist.h:
* libegg/iconlist/testiconlist.c: (foreach_selected_remove_func),
(foreach_selected_remove), (selection_changed), (main):
Document functions and fix a few bugs.
2004-07-03 08:01:34 +00:00
|
|
|
|
2004-07-04 15:56:55 +00:00
|
|
|
return icon_view->priv->model;
|
Document functions and fix a few bugs.
2004-07-03 Anders Carlsson <andersca@gnome.org>
* libegg/iconlist/eggiconlist.c: (egg_icon_list_add_move_binding),
(egg_icon_list_real_move_cursor), (egg_icon_list_new),
(egg_icon_list_new_with_model), (egg_icon_list_get_path_at_pos),
(egg_icon_list_selected_foreach),
(egg_icon_list_set_selection_mode),
(egg_icon_list_get_selection_mode), (egg_icon_list_set_model),
(egg_icon_list_get_model), (egg_icon_list_set_text_column),
(egg_icon_list_get_text_column), (egg_icon_list_set_markup_column),
(egg_icon_list_get_markup_column),
(egg_icon_list_set_pixbuf_column),
(egg_icon_list_get_pixbuf_column), (egg_icon_list_select_path),
(egg_icon_list_unselect_path), (egg_icon_list_select_all),
(egg_icon_list_unselect_all), (egg_icon_list_path_is_selected),
(egg_icon_list_item_activated):
* libegg/iconlist/eggiconlist.h:
* libegg/iconlist/testiconlist.c: (foreach_selected_remove_func),
(foreach_selected_remove), (selection_changed), (main):
Document functions and fix a few bugs.
2004-07-03 08:01:34 +00:00
|
|
|
}
|
|
|
|
|
2005-05-02 20:28:37 +00:00
|
|
|
static void
|
|
|
|
update_text_cell (GtkIconView *icon_view)
|
|
|
|
{
|
2011-02-23 11:50:50 +00:00
|
|
|
if (!icon_view->priv->cell_area)
|
|
|
|
return;
|
|
|
|
|
2005-05-02 20:28:37 +00:00
|
|
|
if (icon_view->priv->text_column == -1 &&
|
|
|
|
icon_view->priv->markup_column == -1)
|
|
|
|
{
|
2010-12-12 10:59:41 +00:00
|
|
|
if (icon_view->priv->text_cell != NULL)
|
2005-05-02 20:28:37 +00:00
|
|
|
{
|
2010-12-12 10:59:41 +00:00
|
|
|
gtk_cell_area_remove (icon_view->priv->cell_area,
|
|
|
|
icon_view->priv->text_cell);
|
|
|
|
icon_view->priv->text_cell = NULL;
|
2005-05-02 20:28:37 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2010-12-12 10:59:41 +00:00
|
|
|
if (icon_view->priv->text_cell == NULL)
|
2005-05-02 20:28:37 +00:00
|
|
|
{
|
2010-12-12 10:59:41 +00:00
|
|
|
icon_view->priv->text_cell = gtk_cell_renderer_text_new ();
|
|
|
|
|
|
|
|
gtk_cell_layout_pack_end (GTK_CELL_LAYOUT (icon_view), icon_view->priv->text_cell, FALSE);
|
2005-05-02 20:28:37 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
if (icon_view->priv->markup_column != -1)
|
|
|
|
gtk_cell_layout_set_attributes (GTK_CELL_LAYOUT (icon_view),
|
2010-12-12 10:59:41 +00:00
|
|
|
icon_view->priv->text_cell,
|
2005-05-02 20:28:37 +00:00
|
|
|
"markup", icon_view->priv->markup_column,
|
|
|
|
NULL);
|
|
|
|
else
|
|
|
|
gtk_cell_layout_set_attributes (GTK_CELL_LAYOUT (icon_view),
|
2010-12-12 10:59:41 +00:00
|
|
|
icon_view->priv->text_cell,
|
2005-05-02 20:28:37 +00:00
|
|
|
"text", icon_view->priv->text_column,
|
|
|
|
NULL);
|
|
|
|
|
2010-09-02 03:03:48 +00:00
|
|
|
if (icon_view->priv->item_orientation == GTK_ORIENTATION_VERTICAL)
|
2010-12-12 10:59:41 +00:00
|
|
|
g_object_set (icon_view->priv->text_cell,
|
2006-12-29 04:39:51 +00:00
|
|
|
"alignment", PANGO_ALIGN_CENTER,
|
2007-06-12 17:07:48 +00:00
|
|
|
"wrap-mode", PANGO_WRAP_WORD_CHAR,
|
2010-12-02 14:52:22 +00:00
|
|
|
"xalign", 0.5,
|
2005-05-02 20:28:37 +00:00
|
|
|
"yalign", 0.0,
|
|
|
|
NULL);
|
|
|
|
else
|
2010-12-12 10:59:41 +00:00
|
|
|
g_object_set (icon_view->priv->text_cell,
|
2006-12-29 04:39:51 +00:00
|
|
|
"alignment", PANGO_ALIGN_LEFT,
|
2007-06-12 17:07:48 +00:00
|
|
|
"wrap-mode", PANGO_WRAP_WORD_CHAR,
|
2005-05-02 20:28:37 +00:00
|
|
|
"xalign", 0.0,
|
2010-12-02 14:52:22 +00:00
|
|
|
"yalign", 0.5,
|
2005-05-02 20:28:37 +00:00
|
|
|
NULL);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
update_pixbuf_cell (GtkIconView *icon_view)
|
|
|
|
{
|
2011-02-23 11:50:50 +00:00
|
|
|
if (!icon_view->priv->cell_area)
|
|
|
|
return;
|
|
|
|
|
2005-05-02 20:28:37 +00:00
|
|
|
if (icon_view->priv->pixbuf_column == -1)
|
|
|
|
{
|
2010-12-12 10:59:41 +00:00
|
|
|
if (icon_view->priv->pixbuf_cell != NULL)
|
2005-05-02 20:28:37 +00:00
|
|
|
{
|
2010-12-12 10:59:41 +00:00
|
|
|
gtk_cell_area_remove (icon_view->priv->cell_area,
|
|
|
|
icon_view->priv->pixbuf_cell);
|
2005-11-28 15:32:44 +00:00
|
|
|
|
2010-12-12 10:59:41 +00:00
|
|
|
icon_view->priv->pixbuf_cell = NULL;
|
2005-05-02 20:28:37 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2010-12-12 10:59:41 +00:00
|
|
|
if (icon_view->priv->pixbuf_cell == NULL)
|
2005-05-02 20:28:37 +00:00
|
|
|
{
|
2010-12-12 10:59:41 +00:00
|
|
|
icon_view->priv->pixbuf_cell = gtk_cell_renderer_pixbuf_new ();
|
2005-05-02 20:28:37 +00:00
|
|
|
|
2010-12-12 10:59:41 +00:00
|
|
|
gtk_cell_layout_pack_start (GTK_CELL_LAYOUT (icon_view), icon_view->priv->pixbuf_cell, FALSE);
|
2005-05-02 20:28:37 +00:00
|
|
|
}
|
|
|
|
|
2010-12-12 10:59:41 +00:00
|
|
|
gtk_cell_layout_set_attributes (GTK_CELL_LAYOUT (icon_view),
|
|
|
|
icon_view->priv->pixbuf_cell,
|
|
|
|
"pixbuf", icon_view->priv->pixbuf_column,
|
|
|
|
NULL);
|
2005-05-02 20:28:37 +00:00
|
|
|
|
2010-12-12 10:59:41 +00:00
|
|
|
if (icon_view->priv->item_orientation == GTK_ORIENTATION_VERTICAL)
|
|
|
|
g_object_set (icon_view->priv->pixbuf_cell,
|
|
|
|
"xalign", 0.5,
|
|
|
|
"yalign", 1.0,
|
|
|
|
NULL);
|
|
|
|
else
|
|
|
|
g_object_set (icon_view->priv->pixbuf_cell,
|
|
|
|
"xalign", 0.0,
|
|
|
|
"yalign", 0.0,
|
|
|
|
NULL);
|
2005-05-02 20:28:37 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
Document functions and fix a few bugs.
2004-07-03 Anders Carlsson <andersca@gnome.org>
* libegg/iconlist/eggiconlist.c: (egg_icon_list_add_move_binding),
(egg_icon_list_real_move_cursor), (egg_icon_list_new),
(egg_icon_list_new_with_model), (egg_icon_list_get_path_at_pos),
(egg_icon_list_selected_foreach),
(egg_icon_list_set_selection_mode),
(egg_icon_list_get_selection_mode), (egg_icon_list_set_model),
(egg_icon_list_get_model), (egg_icon_list_set_text_column),
(egg_icon_list_get_text_column), (egg_icon_list_set_markup_column),
(egg_icon_list_get_markup_column),
(egg_icon_list_set_pixbuf_column),
(egg_icon_list_get_pixbuf_column), (egg_icon_list_select_path),
(egg_icon_list_unselect_path), (egg_icon_list_select_all),
(egg_icon_list_unselect_all), (egg_icon_list_path_is_selected),
(egg_icon_list_item_activated):
* libegg/iconlist/eggiconlist.h:
* libegg/iconlist/testiconlist.c: (foreach_selected_remove_func),
(foreach_selected_remove), (selection_changed), (main):
Document functions and fix a few bugs.
2004-07-03 08:01:34 +00:00
|
|
|
/**
|
2004-07-04 15:56:55 +00:00
|
|
|
* gtk_icon_view_set_text_column:
|
|
|
|
* @icon_view: A #GtkIconView.
|
2007-01-27 04:36:08 +00:00
|
|
|
* @column: A column in the currently used model, or -1 to display no text
|
Document functions and fix a few bugs.
2004-07-03 Anders Carlsson <andersca@gnome.org>
* libegg/iconlist/eggiconlist.c: (egg_icon_list_add_move_binding),
(egg_icon_list_real_move_cursor), (egg_icon_list_new),
(egg_icon_list_new_with_model), (egg_icon_list_get_path_at_pos),
(egg_icon_list_selected_foreach),
(egg_icon_list_set_selection_mode),
(egg_icon_list_get_selection_mode), (egg_icon_list_set_model),
(egg_icon_list_get_model), (egg_icon_list_set_text_column),
(egg_icon_list_get_text_column), (egg_icon_list_set_markup_column),
(egg_icon_list_get_markup_column),
(egg_icon_list_set_pixbuf_column),
(egg_icon_list_get_pixbuf_column), (egg_icon_list_select_path),
(egg_icon_list_unselect_path), (egg_icon_list_select_all),
(egg_icon_list_unselect_all), (egg_icon_list_path_is_selected),
(egg_icon_list_item_activated):
* libegg/iconlist/eggiconlist.h:
* libegg/iconlist/testiconlist.c: (foreach_selected_remove_func),
(foreach_selected_remove), (selection_changed), (main):
Document functions and fix a few bugs.
2004-07-03 08:01:34 +00:00
|
|
|
*
|
2004-07-04 15:56:55 +00:00
|
|
|
* Sets the column with text for @icon_view to be @column. The text
|
Document functions and fix a few bugs.
2004-07-03 Anders Carlsson <andersca@gnome.org>
* libegg/iconlist/eggiconlist.c: (egg_icon_list_add_move_binding),
(egg_icon_list_real_move_cursor), (egg_icon_list_new),
(egg_icon_list_new_with_model), (egg_icon_list_get_path_at_pos),
(egg_icon_list_selected_foreach),
(egg_icon_list_set_selection_mode),
(egg_icon_list_get_selection_mode), (egg_icon_list_set_model),
(egg_icon_list_get_model), (egg_icon_list_set_text_column),
(egg_icon_list_get_text_column), (egg_icon_list_set_markup_column),
(egg_icon_list_get_markup_column),
(egg_icon_list_set_pixbuf_column),
(egg_icon_list_get_pixbuf_column), (egg_icon_list_select_path),
(egg_icon_list_unselect_path), (egg_icon_list_select_all),
(egg_icon_list_unselect_all), (egg_icon_list_path_is_selected),
(egg_icon_list_item_activated):
* libegg/iconlist/eggiconlist.h:
* libegg/iconlist/testiconlist.c: (foreach_selected_remove_func),
(foreach_selected_remove), (selection_changed), (main):
Document functions and fix a few bugs.
2004-07-03 08:01:34 +00:00
|
|
|
* column must be of type #G_TYPE_STRING.
|
|
|
|
*
|
|
|
|
* Since: 2.6
|
|
|
|
**/
|
|
|
|
void
|
2004-07-04 15:56:55 +00:00
|
|
|
gtk_icon_view_set_text_column (GtkIconView *icon_view,
|
2004-07-13 05:15:49 +00:00
|
|
|
gint column)
|
Document functions and fix a few bugs.
2004-07-03 Anders Carlsson <andersca@gnome.org>
* libegg/iconlist/eggiconlist.c: (egg_icon_list_add_move_binding),
(egg_icon_list_real_move_cursor), (egg_icon_list_new),
(egg_icon_list_new_with_model), (egg_icon_list_get_path_at_pos),
(egg_icon_list_selected_foreach),
(egg_icon_list_set_selection_mode),
(egg_icon_list_get_selection_mode), (egg_icon_list_set_model),
(egg_icon_list_get_model), (egg_icon_list_set_text_column),
(egg_icon_list_get_text_column), (egg_icon_list_set_markup_column),
(egg_icon_list_get_markup_column),
(egg_icon_list_set_pixbuf_column),
(egg_icon_list_get_pixbuf_column), (egg_icon_list_select_path),
(egg_icon_list_unselect_path), (egg_icon_list_select_all),
(egg_icon_list_unselect_all), (egg_icon_list_path_is_selected),
(egg_icon_list_item_activated):
* libegg/iconlist/eggiconlist.h:
* libegg/iconlist/testiconlist.c: (foreach_selected_remove_func),
(foreach_selected_remove), (selection_changed), (main):
Document functions and fix a few bugs.
2004-07-03 08:01:34 +00:00
|
|
|
{
|
2004-07-04 15:56:55 +00:00
|
|
|
if (column == icon_view->priv->text_column)
|
Document functions and fix a few bugs.
2004-07-03 Anders Carlsson <andersca@gnome.org>
* libegg/iconlist/eggiconlist.c: (egg_icon_list_add_move_binding),
(egg_icon_list_real_move_cursor), (egg_icon_list_new),
(egg_icon_list_new_with_model), (egg_icon_list_get_path_at_pos),
(egg_icon_list_selected_foreach),
(egg_icon_list_set_selection_mode),
(egg_icon_list_get_selection_mode), (egg_icon_list_set_model),
(egg_icon_list_get_model), (egg_icon_list_set_text_column),
(egg_icon_list_get_text_column), (egg_icon_list_set_markup_column),
(egg_icon_list_get_markup_column),
(egg_icon_list_set_pixbuf_column),
(egg_icon_list_get_pixbuf_column), (egg_icon_list_select_path),
(egg_icon_list_unselect_path), (egg_icon_list_select_all),
(egg_icon_list_unselect_all), (egg_icon_list_path_is_selected),
(egg_icon_list_item_activated):
* libegg/iconlist/eggiconlist.h:
* libegg/iconlist/testiconlist.c: (foreach_selected_remove_func),
(foreach_selected_remove), (selection_changed), (main):
Document functions and fix a few bugs.
2004-07-03 08:01:34 +00:00
|
|
|
return;
|
|
|
|
|
|
|
|
if (column == -1)
|
2004-07-04 15:56:55 +00:00
|
|
|
icon_view->priv->text_column = -1;
|
Document functions and fix a few bugs.
2004-07-03 Anders Carlsson <andersca@gnome.org>
* libegg/iconlist/eggiconlist.c: (egg_icon_list_add_move_binding),
(egg_icon_list_real_move_cursor), (egg_icon_list_new),
(egg_icon_list_new_with_model), (egg_icon_list_get_path_at_pos),
(egg_icon_list_selected_foreach),
(egg_icon_list_set_selection_mode),
(egg_icon_list_get_selection_mode), (egg_icon_list_set_model),
(egg_icon_list_get_model), (egg_icon_list_set_text_column),
(egg_icon_list_get_text_column), (egg_icon_list_set_markup_column),
(egg_icon_list_get_markup_column),
(egg_icon_list_set_pixbuf_column),
(egg_icon_list_get_pixbuf_column), (egg_icon_list_select_path),
(egg_icon_list_unselect_path), (egg_icon_list_select_all),
(egg_icon_list_unselect_all), (egg_icon_list_path_is_selected),
(egg_icon_list_item_activated):
* libegg/iconlist/eggiconlist.h:
* libegg/iconlist/testiconlist.c: (foreach_selected_remove_func),
(foreach_selected_remove), (selection_changed), (main):
Document functions and fix a few bugs.
2004-07-03 08:01:34 +00:00
|
|
|
else
|
|
|
|
{
|
2004-07-04 15:56:55 +00:00
|
|
|
if (icon_view->priv->model != NULL)
|
Document functions and fix a few bugs.
2004-07-03 Anders Carlsson <andersca@gnome.org>
* libegg/iconlist/eggiconlist.c: (egg_icon_list_add_move_binding),
(egg_icon_list_real_move_cursor), (egg_icon_list_new),
(egg_icon_list_new_with_model), (egg_icon_list_get_path_at_pos),
(egg_icon_list_selected_foreach),
(egg_icon_list_set_selection_mode),
(egg_icon_list_get_selection_mode), (egg_icon_list_set_model),
(egg_icon_list_get_model), (egg_icon_list_set_text_column),
(egg_icon_list_get_text_column), (egg_icon_list_set_markup_column),
(egg_icon_list_get_markup_column),
(egg_icon_list_set_pixbuf_column),
(egg_icon_list_get_pixbuf_column), (egg_icon_list_select_path),
(egg_icon_list_unselect_path), (egg_icon_list_select_all),
(egg_icon_list_unselect_all), (egg_icon_list_path_is_selected),
(egg_icon_list_item_activated):
* libegg/iconlist/eggiconlist.h:
* libegg/iconlist/testiconlist.c: (foreach_selected_remove_func),
(foreach_selected_remove), (selection_changed), (main):
Document functions and fix a few bugs.
2004-07-03 08:01:34 +00:00
|
|
|
{
|
|
|
|
GType column_type;
|
|
|
|
|
2004-07-04 15:56:55 +00:00
|
|
|
column_type = gtk_tree_model_get_column_type (icon_view->priv->model, column);
|
Document functions and fix a few bugs.
2004-07-03 Anders Carlsson <andersca@gnome.org>
* libegg/iconlist/eggiconlist.c: (egg_icon_list_add_move_binding),
(egg_icon_list_real_move_cursor), (egg_icon_list_new),
(egg_icon_list_new_with_model), (egg_icon_list_get_path_at_pos),
(egg_icon_list_selected_foreach),
(egg_icon_list_set_selection_mode),
(egg_icon_list_get_selection_mode), (egg_icon_list_set_model),
(egg_icon_list_get_model), (egg_icon_list_set_text_column),
(egg_icon_list_get_text_column), (egg_icon_list_set_markup_column),
(egg_icon_list_get_markup_column),
(egg_icon_list_set_pixbuf_column),
(egg_icon_list_get_pixbuf_column), (egg_icon_list_select_path),
(egg_icon_list_unselect_path), (egg_icon_list_select_all),
(egg_icon_list_unselect_all), (egg_icon_list_path_is_selected),
(egg_icon_list_item_activated):
* libegg/iconlist/eggiconlist.h:
* libegg/iconlist/testiconlist.c: (foreach_selected_remove_func),
(foreach_selected_remove), (selection_changed), (main):
Document functions and fix a few bugs.
2004-07-03 08:01:34 +00:00
|
|
|
|
|
|
|
g_return_if_fail (column_type == G_TYPE_STRING);
|
|
|
|
}
|
|
|
|
|
2004-07-04 15:56:55 +00:00
|
|
|
icon_view->priv->text_column = column;
|
Document functions and fix a few bugs.
2004-07-03 Anders Carlsson <andersca@gnome.org>
* libegg/iconlist/eggiconlist.c: (egg_icon_list_add_move_binding),
(egg_icon_list_real_move_cursor), (egg_icon_list_new),
(egg_icon_list_new_with_model), (egg_icon_list_get_path_at_pos),
(egg_icon_list_selected_foreach),
(egg_icon_list_set_selection_mode),
(egg_icon_list_get_selection_mode), (egg_icon_list_set_model),
(egg_icon_list_get_model), (egg_icon_list_set_text_column),
(egg_icon_list_get_text_column), (egg_icon_list_set_markup_column),
(egg_icon_list_get_markup_column),
(egg_icon_list_set_pixbuf_column),
(egg_icon_list_get_pixbuf_column), (egg_icon_list_select_path),
(egg_icon_list_unselect_path), (egg_icon_list_select_all),
(egg_icon_list_unselect_all), (egg_icon_list_path_is_selected),
(egg_icon_list_item_activated):
* libegg/iconlist/eggiconlist.h:
* libegg/iconlist/testiconlist.c: (foreach_selected_remove_func),
(foreach_selected_remove), (selection_changed), (main):
Document functions and fix a few bugs.
2004-07-03 08:01:34 +00:00
|
|
|
}
|
|
|
|
|
2011-02-23 11:50:50 +00:00
|
|
|
if (icon_view->priv->cell_area)
|
|
|
|
gtk_cell_area_stop_editing (icon_view->priv->cell_area, TRUE);
|
2005-05-02 20:28:37 +00:00
|
|
|
|
|
|
|
update_text_cell (icon_view);
|
|
|
|
|
2004-07-04 15:56:55 +00:00
|
|
|
gtk_icon_view_invalidate_sizes (icon_view);
|
Document functions and fix a few bugs.
2004-07-03 Anders Carlsson <andersca@gnome.org>
* libegg/iconlist/eggiconlist.c: (egg_icon_list_add_move_binding),
(egg_icon_list_real_move_cursor), (egg_icon_list_new),
(egg_icon_list_new_with_model), (egg_icon_list_get_path_at_pos),
(egg_icon_list_selected_foreach),
(egg_icon_list_set_selection_mode),
(egg_icon_list_get_selection_mode), (egg_icon_list_set_model),
(egg_icon_list_get_model), (egg_icon_list_set_text_column),
(egg_icon_list_get_text_column), (egg_icon_list_set_markup_column),
(egg_icon_list_get_markup_column),
(egg_icon_list_set_pixbuf_column),
(egg_icon_list_get_pixbuf_column), (egg_icon_list_select_path),
(egg_icon_list_unselect_path), (egg_icon_list_select_all),
(egg_icon_list_unselect_all), (egg_icon_list_path_is_selected),
(egg_icon_list_item_activated):
* libegg/iconlist/eggiconlist.h:
* libegg/iconlist/testiconlist.c: (foreach_selected_remove_func),
(foreach_selected_remove), (selection_changed), (main):
Document functions and fix a few bugs.
2004-07-03 08:01:34 +00:00
|
|
|
|
2005-03-26 05:49:15 +00:00
|
|
|
g_object_notify (G_OBJECT (icon_view), "text-column");
|
Document functions and fix a few bugs.
2004-07-03 Anders Carlsson <andersca@gnome.org>
* libegg/iconlist/eggiconlist.c: (egg_icon_list_add_move_binding),
(egg_icon_list_real_move_cursor), (egg_icon_list_new),
(egg_icon_list_new_with_model), (egg_icon_list_get_path_at_pos),
(egg_icon_list_selected_foreach),
(egg_icon_list_set_selection_mode),
(egg_icon_list_get_selection_mode), (egg_icon_list_set_model),
(egg_icon_list_get_model), (egg_icon_list_set_text_column),
(egg_icon_list_get_text_column), (egg_icon_list_set_markup_column),
(egg_icon_list_get_markup_column),
(egg_icon_list_set_pixbuf_column),
(egg_icon_list_get_pixbuf_column), (egg_icon_list_select_path),
(egg_icon_list_unselect_path), (egg_icon_list_select_all),
(egg_icon_list_unselect_all), (egg_icon_list_path_is_selected),
(egg_icon_list_item_activated):
* libegg/iconlist/eggiconlist.h:
* libegg/iconlist/testiconlist.c: (foreach_selected_remove_func),
(foreach_selected_remove), (selection_changed), (main):
Document functions and fix a few bugs.
2004-07-03 08:01:34 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2004-07-04 15:56:55 +00:00
|
|
|
* gtk_icon_view_get_text_column:
|
|
|
|
* @icon_view: A #GtkIconView.
|
Document functions and fix a few bugs.
2004-07-03 Anders Carlsson <andersca@gnome.org>
* libegg/iconlist/eggiconlist.c: (egg_icon_list_add_move_binding),
(egg_icon_list_real_move_cursor), (egg_icon_list_new),
(egg_icon_list_new_with_model), (egg_icon_list_get_path_at_pos),
(egg_icon_list_selected_foreach),
(egg_icon_list_set_selection_mode),
(egg_icon_list_get_selection_mode), (egg_icon_list_set_model),
(egg_icon_list_get_model), (egg_icon_list_set_text_column),
(egg_icon_list_get_text_column), (egg_icon_list_set_markup_column),
(egg_icon_list_get_markup_column),
(egg_icon_list_set_pixbuf_column),
(egg_icon_list_get_pixbuf_column), (egg_icon_list_select_path),
(egg_icon_list_unselect_path), (egg_icon_list_select_all),
(egg_icon_list_unselect_all), (egg_icon_list_path_is_selected),
(egg_icon_list_item_activated):
* libegg/iconlist/eggiconlist.h:
* libegg/iconlist/testiconlist.c: (foreach_selected_remove_func),
(foreach_selected_remove), (selection_changed), (main):
Document functions and fix a few bugs.
2004-07-03 08:01:34 +00:00
|
|
|
*
|
2004-07-04 15:56:55 +00:00
|
|
|
* Returns the column with text for @icon_view.
|
Document functions and fix a few bugs.
2004-07-03 Anders Carlsson <andersca@gnome.org>
* libegg/iconlist/eggiconlist.c: (egg_icon_list_add_move_binding),
(egg_icon_list_real_move_cursor), (egg_icon_list_new),
(egg_icon_list_new_with_model), (egg_icon_list_get_path_at_pos),
(egg_icon_list_selected_foreach),
(egg_icon_list_set_selection_mode),
(egg_icon_list_get_selection_mode), (egg_icon_list_set_model),
(egg_icon_list_get_model), (egg_icon_list_set_text_column),
(egg_icon_list_get_text_column), (egg_icon_list_set_markup_column),
(egg_icon_list_get_markup_column),
(egg_icon_list_set_pixbuf_column),
(egg_icon_list_get_pixbuf_column), (egg_icon_list_select_path),
(egg_icon_list_unselect_path), (egg_icon_list_select_all),
(egg_icon_list_unselect_all), (egg_icon_list_path_is_selected),
(egg_icon_list_item_activated):
* libegg/iconlist/eggiconlist.h:
* libegg/iconlist/testiconlist.c: (foreach_selected_remove_func),
(foreach_selected_remove), (selection_changed), (main):
Document functions and fix a few bugs.
2004-07-03 08:01:34 +00:00
|
|
|
*
|
|
|
|
* Returns: the text column, or -1 if it's unset.
|
|
|
|
*
|
|
|
|
* Since: 2.6
|
|
|
|
*/
|
|
|
|
gint
|
2004-07-04 15:56:55 +00:00
|
|
|
gtk_icon_view_get_text_column (GtkIconView *icon_view)
|
Document functions and fix a few bugs.
2004-07-03 Anders Carlsson <andersca@gnome.org>
* libegg/iconlist/eggiconlist.c: (egg_icon_list_add_move_binding),
(egg_icon_list_real_move_cursor), (egg_icon_list_new),
(egg_icon_list_new_with_model), (egg_icon_list_get_path_at_pos),
(egg_icon_list_selected_foreach),
(egg_icon_list_set_selection_mode),
(egg_icon_list_get_selection_mode), (egg_icon_list_set_model),
(egg_icon_list_get_model), (egg_icon_list_set_text_column),
(egg_icon_list_get_text_column), (egg_icon_list_set_markup_column),
(egg_icon_list_get_markup_column),
(egg_icon_list_set_pixbuf_column),
(egg_icon_list_get_pixbuf_column), (egg_icon_list_select_path),
(egg_icon_list_unselect_path), (egg_icon_list_select_all),
(egg_icon_list_unselect_all), (egg_icon_list_path_is_selected),
(egg_icon_list_item_activated):
* libegg/iconlist/eggiconlist.h:
* libegg/iconlist/testiconlist.c: (foreach_selected_remove_func),
(foreach_selected_remove), (selection_changed), (main):
Document functions and fix a few bugs.
2004-07-03 08:01:34 +00:00
|
|
|
{
|
2004-07-04 15:56:55 +00:00
|
|
|
g_return_val_if_fail (GTK_IS_ICON_VIEW (icon_view), -1);
|
Document functions and fix a few bugs.
2004-07-03 Anders Carlsson <andersca@gnome.org>
* libegg/iconlist/eggiconlist.c: (egg_icon_list_add_move_binding),
(egg_icon_list_real_move_cursor), (egg_icon_list_new),
(egg_icon_list_new_with_model), (egg_icon_list_get_path_at_pos),
(egg_icon_list_selected_foreach),
(egg_icon_list_set_selection_mode),
(egg_icon_list_get_selection_mode), (egg_icon_list_set_model),
(egg_icon_list_get_model), (egg_icon_list_set_text_column),
(egg_icon_list_get_text_column), (egg_icon_list_set_markup_column),
(egg_icon_list_get_markup_column),
(egg_icon_list_set_pixbuf_column),
(egg_icon_list_get_pixbuf_column), (egg_icon_list_select_path),
(egg_icon_list_unselect_path), (egg_icon_list_select_all),
(egg_icon_list_unselect_all), (egg_icon_list_path_is_selected),
(egg_icon_list_item_activated):
* libegg/iconlist/eggiconlist.h:
* libegg/iconlist/testiconlist.c: (foreach_selected_remove_func),
(foreach_selected_remove), (selection_changed), (main):
Document functions and fix a few bugs.
2004-07-03 08:01:34 +00:00
|
|
|
|
2004-07-04 15:56:55 +00:00
|
|
|
return icon_view->priv->text_column;
|
Document functions and fix a few bugs.
2004-07-03 Anders Carlsson <andersca@gnome.org>
* libegg/iconlist/eggiconlist.c: (egg_icon_list_add_move_binding),
(egg_icon_list_real_move_cursor), (egg_icon_list_new),
(egg_icon_list_new_with_model), (egg_icon_list_get_path_at_pos),
(egg_icon_list_selected_foreach),
(egg_icon_list_set_selection_mode),
(egg_icon_list_get_selection_mode), (egg_icon_list_set_model),
(egg_icon_list_get_model), (egg_icon_list_set_text_column),
(egg_icon_list_get_text_column), (egg_icon_list_set_markup_column),
(egg_icon_list_get_markup_column),
(egg_icon_list_set_pixbuf_column),
(egg_icon_list_get_pixbuf_column), (egg_icon_list_select_path),
(egg_icon_list_unselect_path), (egg_icon_list_select_all),
(egg_icon_list_unselect_all), (egg_icon_list_path_is_selected),
(egg_icon_list_item_activated):
* libegg/iconlist/eggiconlist.h:
* libegg/iconlist/testiconlist.c: (foreach_selected_remove_func),
(foreach_selected_remove), (selection_changed), (main):
Document functions and fix a few bugs.
2004-07-03 08:01:34 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2004-07-04 15:56:55 +00:00
|
|
|
* gtk_icon_view_set_markup_column:
|
|
|
|
* @icon_view: A #GtkIconView.
|
2007-01-27 04:36:08 +00:00
|
|
|
* @column: A column in the currently used model, or -1 to display no text
|
Document functions and fix a few bugs.
2004-07-03 Anders Carlsson <andersca@gnome.org>
* libegg/iconlist/eggiconlist.c: (egg_icon_list_add_move_binding),
(egg_icon_list_real_move_cursor), (egg_icon_list_new),
(egg_icon_list_new_with_model), (egg_icon_list_get_path_at_pos),
(egg_icon_list_selected_foreach),
(egg_icon_list_set_selection_mode),
(egg_icon_list_get_selection_mode), (egg_icon_list_set_model),
(egg_icon_list_get_model), (egg_icon_list_set_text_column),
(egg_icon_list_get_text_column), (egg_icon_list_set_markup_column),
(egg_icon_list_get_markup_column),
(egg_icon_list_set_pixbuf_column),
(egg_icon_list_get_pixbuf_column), (egg_icon_list_select_path),
(egg_icon_list_unselect_path), (egg_icon_list_select_all),
(egg_icon_list_unselect_all), (egg_icon_list_path_is_selected),
(egg_icon_list_item_activated):
* libegg/iconlist/eggiconlist.h:
* libegg/iconlist/testiconlist.c: (foreach_selected_remove_func),
(foreach_selected_remove), (selection_changed), (main):
Document functions and fix a few bugs.
2004-07-03 08:01:34 +00:00
|
|
|
*
|
2004-07-04 15:56:55 +00:00
|
|
|
* Sets the column with markup information for @icon_view to be
|
Document functions and fix a few bugs.
2004-07-03 Anders Carlsson <andersca@gnome.org>
* libegg/iconlist/eggiconlist.c: (egg_icon_list_add_move_binding),
(egg_icon_list_real_move_cursor), (egg_icon_list_new),
(egg_icon_list_new_with_model), (egg_icon_list_get_path_at_pos),
(egg_icon_list_selected_foreach),
(egg_icon_list_set_selection_mode),
(egg_icon_list_get_selection_mode), (egg_icon_list_set_model),
(egg_icon_list_get_model), (egg_icon_list_set_text_column),
(egg_icon_list_get_text_column), (egg_icon_list_set_markup_column),
(egg_icon_list_get_markup_column),
(egg_icon_list_set_pixbuf_column),
(egg_icon_list_get_pixbuf_column), (egg_icon_list_select_path),
(egg_icon_list_unselect_path), (egg_icon_list_select_all),
(egg_icon_list_unselect_all), (egg_icon_list_path_is_selected),
(egg_icon_list_item_activated):
* libegg/iconlist/eggiconlist.h:
* libegg/iconlist/testiconlist.c: (foreach_selected_remove_func),
(foreach_selected_remove), (selection_changed), (main):
Document functions and fix a few bugs.
2004-07-03 08:01:34 +00:00
|
|
|
* @column. The markup column must be of type #G_TYPE_STRING.
|
|
|
|
* If the markup column is set to something, it overrides
|
2004-07-13 05:15:49 +00:00
|
|
|
* the text column set by gtk_icon_view_set_text_column().
|
Document functions and fix a few bugs.
2004-07-03 Anders Carlsson <andersca@gnome.org>
* libegg/iconlist/eggiconlist.c: (egg_icon_list_add_move_binding),
(egg_icon_list_real_move_cursor), (egg_icon_list_new),
(egg_icon_list_new_with_model), (egg_icon_list_get_path_at_pos),
(egg_icon_list_selected_foreach),
(egg_icon_list_set_selection_mode),
(egg_icon_list_get_selection_mode), (egg_icon_list_set_model),
(egg_icon_list_get_model), (egg_icon_list_set_text_column),
(egg_icon_list_get_text_column), (egg_icon_list_set_markup_column),
(egg_icon_list_get_markup_column),
(egg_icon_list_set_pixbuf_column),
(egg_icon_list_get_pixbuf_column), (egg_icon_list_select_path),
(egg_icon_list_unselect_path), (egg_icon_list_select_all),
(egg_icon_list_unselect_all), (egg_icon_list_path_is_selected),
(egg_icon_list_item_activated):
* libegg/iconlist/eggiconlist.h:
* libegg/iconlist/testiconlist.c: (foreach_selected_remove_func),
(foreach_selected_remove), (selection_changed), (main):
Document functions and fix a few bugs.
2004-07-03 08:01:34 +00:00
|
|
|
*
|
|
|
|
* Since: 2.6
|
|
|
|
**/
|
|
|
|
void
|
2004-07-04 15:56:55 +00:00
|
|
|
gtk_icon_view_set_markup_column (GtkIconView *icon_view,
|
2004-07-05 11:34:29 +00:00
|
|
|
gint column)
|
Document functions and fix a few bugs.
2004-07-03 Anders Carlsson <andersca@gnome.org>
* libegg/iconlist/eggiconlist.c: (egg_icon_list_add_move_binding),
(egg_icon_list_real_move_cursor), (egg_icon_list_new),
(egg_icon_list_new_with_model), (egg_icon_list_get_path_at_pos),
(egg_icon_list_selected_foreach),
(egg_icon_list_set_selection_mode),
(egg_icon_list_get_selection_mode), (egg_icon_list_set_model),
(egg_icon_list_get_model), (egg_icon_list_set_text_column),
(egg_icon_list_get_text_column), (egg_icon_list_set_markup_column),
(egg_icon_list_get_markup_column),
(egg_icon_list_set_pixbuf_column),
(egg_icon_list_get_pixbuf_column), (egg_icon_list_select_path),
(egg_icon_list_unselect_path), (egg_icon_list_select_all),
(egg_icon_list_unselect_all), (egg_icon_list_path_is_selected),
(egg_icon_list_item_activated):
* libegg/iconlist/eggiconlist.h:
* libegg/iconlist/testiconlist.c: (foreach_selected_remove_func),
(foreach_selected_remove), (selection_changed), (main):
Document functions and fix a few bugs.
2004-07-03 08:01:34 +00:00
|
|
|
{
|
2004-07-04 15:56:55 +00:00
|
|
|
if (column == icon_view->priv->markup_column)
|
Document functions and fix a few bugs.
2004-07-03 Anders Carlsson <andersca@gnome.org>
* libegg/iconlist/eggiconlist.c: (egg_icon_list_add_move_binding),
(egg_icon_list_real_move_cursor), (egg_icon_list_new),
(egg_icon_list_new_with_model), (egg_icon_list_get_path_at_pos),
(egg_icon_list_selected_foreach),
(egg_icon_list_set_selection_mode),
(egg_icon_list_get_selection_mode), (egg_icon_list_set_model),
(egg_icon_list_get_model), (egg_icon_list_set_text_column),
(egg_icon_list_get_text_column), (egg_icon_list_set_markup_column),
(egg_icon_list_get_markup_column),
(egg_icon_list_set_pixbuf_column),
(egg_icon_list_get_pixbuf_column), (egg_icon_list_select_path),
(egg_icon_list_unselect_path), (egg_icon_list_select_all),
(egg_icon_list_unselect_all), (egg_icon_list_path_is_selected),
(egg_icon_list_item_activated):
* libegg/iconlist/eggiconlist.h:
* libegg/iconlist/testiconlist.c: (foreach_selected_remove_func),
(foreach_selected_remove), (selection_changed), (main):
Document functions and fix a few bugs.
2004-07-03 08:01:34 +00:00
|
|
|
return;
|
|
|
|
|
|
|
|
if (column == -1)
|
2004-07-04 15:56:55 +00:00
|
|
|
icon_view->priv->markup_column = -1;
|
Document functions and fix a few bugs.
2004-07-03 Anders Carlsson <andersca@gnome.org>
* libegg/iconlist/eggiconlist.c: (egg_icon_list_add_move_binding),
(egg_icon_list_real_move_cursor), (egg_icon_list_new),
(egg_icon_list_new_with_model), (egg_icon_list_get_path_at_pos),
(egg_icon_list_selected_foreach),
(egg_icon_list_set_selection_mode),
(egg_icon_list_get_selection_mode), (egg_icon_list_set_model),
(egg_icon_list_get_model), (egg_icon_list_set_text_column),
(egg_icon_list_get_text_column), (egg_icon_list_set_markup_column),
(egg_icon_list_get_markup_column),
(egg_icon_list_set_pixbuf_column),
(egg_icon_list_get_pixbuf_column), (egg_icon_list_select_path),
(egg_icon_list_unselect_path), (egg_icon_list_select_all),
(egg_icon_list_unselect_all), (egg_icon_list_path_is_selected),
(egg_icon_list_item_activated):
* libegg/iconlist/eggiconlist.h:
* libegg/iconlist/testiconlist.c: (foreach_selected_remove_func),
(foreach_selected_remove), (selection_changed), (main):
Document functions and fix a few bugs.
2004-07-03 08:01:34 +00:00
|
|
|
else
|
|
|
|
{
|
2004-07-04 15:56:55 +00:00
|
|
|
if (icon_view->priv->model != NULL)
|
Document functions and fix a few bugs.
2004-07-03 Anders Carlsson <andersca@gnome.org>
* libegg/iconlist/eggiconlist.c: (egg_icon_list_add_move_binding),
(egg_icon_list_real_move_cursor), (egg_icon_list_new),
(egg_icon_list_new_with_model), (egg_icon_list_get_path_at_pos),
(egg_icon_list_selected_foreach),
(egg_icon_list_set_selection_mode),
(egg_icon_list_get_selection_mode), (egg_icon_list_set_model),
(egg_icon_list_get_model), (egg_icon_list_set_text_column),
(egg_icon_list_get_text_column), (egg_icon_list_set_markup_column),
(egg_icon_list_get_markup_column),
(egg_icon_list_set_pixbuf_column),
(egg_icon_list_get_pixbuf_column), (egg_icon_list_select_path),
(egg_icon_list_unselect_path), (egg_icon_list_select_all),
(egg_icon_list_unselect_all), (egg_icon_list_path_is_selected),
(egg_icon_list_item_activated):
* libegg/iconlist/eggiconlist.h:
* libegg/iconlist/testiconlist.c: (foreach_selected_remove_func),
(foreach_selected_remove), (selection_changed), (main):
Document functions and fix a few bugs.
2004-07-03 08:01:34 +00:00
|
|
|
{
|
|
|
|
GType column_type;
|
|
|
|
|
2004-07-04 15:56:55 +00:00
|
|
|
column_type = gtk_tree_model_get_column_type (icon_view->priv->model, column);
|
Document functions and fix a few bugs.
2004-07-03 Anders Carlsson <andersca@gnome.org>
* libegg/iconlist/eggiconlist.c: (egg_icon_list_add_move_binding),
(egg_icon_list_real_move_cursor), (egg_icon_list_new),
(egg_icon_list_new_with_model), (egg_icon_list_get_path_at_pos),
(egg_icon_list_selected_foreach),
(egg_icon_list_set_selection_mode),
(egg_icon_list_get_selection_mode), (egg_icon_list_set_model),
(egg_icon_list_get_model), (egg_icon_list_set_text_column),
(egg_icon_list_get_text_column), (egg_icon_list_set_markup_column),
(egg_icon_list_get_markup_column),
(egg_icon_list_set_pixbuf_column),
(egg_icon_list_get_pixbuf_column), (egg_icon_list_select_path),
(egg_icon_list_unselect_path), (egg_icon_list_select_all),
(egg_icon_list_unselect_all), (egg_icon_list_path_is_selected),
(egg_icon_list_item_activated):
* libegg/iconlist/eggiconlist.h:
* libegg/iconlist/testiconlist.c: (foreach_selected_remove_func),
(foreach_selected_remove), (selection_changed), (main):
Document functions and fix a few bugs.
2004-07-03 08:01:34 +00:00
|
|
|
|
|
|
|
g_return_if_fail (column_type == G_TYPE_STRING);
|
|
|
|
}
|
|
|
|
|
2004-07-04 15:56:55 +00:00
|
|
|
icon_view->priv->markup_column = column;
|
Document functions and fix a few bugs.
2004-07-03 Anders Carlsson <andersca@gnome.org>
* libegg/iconlist/eggiconlist.c: (egg_icon_list_add_move_binding),
(egg_icon_list_real_move_cursor), (egg_icon_list_new),
(egg_icon_list_new_with_model), (egg_icon_list_get_path_at_pos),
(egg_icon_list_selected_foreach),
(egg_icon_list_set_selection_mode),
(egg_icon_list_get_selection_mode), (egg_icon_list_set_model),
(egg_icon_list_get_model), (egg_icon_list_set_text_column),
(egg_icon_list_get_text_column), (egg_icon_list_set_markup_column),
(egg_icon_list_get_markup_column),
(egg_icon_list_set_pixbuf_column),
(egg_icon_list_get_pixbuf_column), (egg_icon_list_select_path),
(egg_icon_list_unselect_path), (egg_icon_list_select_all),
(egg_icon_list_unselect_all), (egg_icon_list_path_is_selected),
(egg_icon_list_item_activated):
* libegg/iconlist/eggiconlist.h:
* libegg/iconlist/testiconlist.c: (foreach_selected_remove_func),
(foreach_selected_remove), (selection_changed), (main):
Document functions and fix a few bugs.
2004-07-03 08:01:34 +00:00
|
|
|
}
|
|
|
|
|
2011-02-23 11:50:50 +00:00
|
|
|
if (icon_view->priv->cell_area)
|
|
|
|
gtk_cell_area_stop_editing (icon_view->priv->cell_area, TRUE);
|
2005-05-02 20:28:37 +00:00
|
|
|
|
|
|
|
update_text_cell (icon_view);
|
|
|
|
|
2004-07-04 15:56:55 +00:00
|
|
|
gtk_icon_view_invalidate_sizes (icon_view);
|
Document functions and fix a few bugs.
2004-07-03 Anders Carlsson <andersca@gnome.org>
* libegg/iconlist/eggiconlist.c: (egg_icon_list_add_move_binding),
(egg_icon_list_real_move_cursor), (egg_icon_list_new),
(egg_icon_list_new_with_model), (egg_icon_list_get_path_at_pos),
(egg_icon_list_selected_foreach),
(egg_icon_list_set_selection_mode),
(egg_icon_list_get_selection_mode), (egg_icon_list_set_model),
(egg_icon_list_get_model), (egg_icon_list_set_text_column),
(egg_icon_list_get_text_column), (egg_icon_list_set_markup_column),
(egg_icon_list_get_markup_column),
(egg_icon_list_set_pixbuf_column),
(egg_icon_list_get_pixbuf_column), (egg_icon_list_select_path),
(egg_icon_list_unselect_path), (egg_icon_list_select_all),
(egg_icon_list_unselect_all), (egg_icon_list_path_is_selected),
(egg_icon_list_item_activated):
* libegg/iconlist/eggiconlist.h:
* libegg/iconlist/testiconlist.c: (foreach_selected_remove_func),
(foreach_selected_remove), (selection_changed), (main):
Document functions and fix a few bugs.
2004-07-03 08:01:34 +00:00
|
|
|
|
2005-03-26 05:49:15 +00:00
|
|
|
g_object_notify (G_OBJECT (icon_view), "markup-column");
|
Document functions and fix a few bugs.
2004-07-03 Anders Carlsson <andersca@gnome.org>
* libegg/iconlist/eggiconlist.c: (egg_icon_list_add_move_binding),
(egg_icon_list_real_move_cursor), (egg_icon_list_new),
(egg_icon_list_new_with_model), (egg_icon_list_get_path_at_pos),
(egg_icon_list_selected_foreach),
(egg_icon_list_set_selection_mode),
(egg_icon_list_get_selection_mode), (egg_icon_list_set_model),
(egg_icon_list_get_model), (egg_icon_list_set_text_column),
(egg_icon_list_get_text_column), (egg_icon_list_set_markup_column),
(egg_icon_list_get_markup_column),
(egg_icon_list_set_pixbuf_column),
(egg_icon_list_get_pixbuf_column), (egg_icon_list_select_path),
(egg_icon_list_unselect_path), (egg_icon_list_select_all),
(egg_icon_list_unselect_all), (egg_icon_list_path_is_selected),
(egg_icon_list_item_activated):
* libegg/iconlist/eggiconlist.h:
* libegg/iconlist/testiconlist.c: (foreach_selected_remove_func),
(foreach_selected_remove), (selection_changed), (main):
Document functions and fix a few bugs.
2004-07-03 08:01:34 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2004-07-04 15:56:55 +00:00
|
|
|
* gtk_icon_view_get_markup_column:
|
|
|
|
* @icon_view: A #GtkIconView.
|
Document functions and fix a few bugs.
2004-07-03 Anders Carlsson <andersca@gnome.org>
* libegg/iconlist/eggiconlist.c: (egg_icon_list_add_move_binding),
(egg_icon_list_real_move_cursor), (egg_icon_list_new),
(egg_icon_list_new_with_model), (egg_icon_list_get_path_at_pos),
(egg_icon_list_selected_foreach),
(egg_icon_list_set_selection_mode),
(egg_icon_list_get_selection_mode), (egg_icon_list_set_model),
(egg_icon_list_get_model), (egg_icon_list_set_text_column),
(egg_icon_list_get_text_column), (egg_icon_list_set_markup_column),
(egg_icon_list_get_markup_column),
(egg_icon_list_set_pixbuf_column),
(egg_icon_list_get_pixbuf_column), (egg_icon_list_select_path),
(egg_icon_list_unselect_path), (egg_icon_list_select_all),
(egg_icon_list_unselect_all), (egg_icon_list_path_is_selected),
(egg_icon_list_item_activated):
* libegg/iconlist/eggiconlist.h:
* libegg/iconlist/testiconlist.c: (foreach_selected_remove_func),
(foreach_selected_remove), (selection_changed), (main):
Document functions and fix a few bugs.
2004-07-03 08:01:34 +00:00
|
|
|
*
|
2004-07-04 15:56:55 +00:00
|
|
|
* Returns the column with markup text for @icon_view.
|
Document functions and fix a few bugs.
2004-07-03 Anders Carlsson <andersca@gnome.org>
* libegg/iconlist/eggiconlist.c: (egg_icon_list_add_move_binding),
(egg_icon_list_real_move_cursor), (egg_icon_list_new),
(egg_icon_list_new_with_model), (egg_icon_list_get_path_at_pos),
(egg_icon_list_selected_foreach),
(egg_icon_list_set_selection_mode),
(egg_icon_list_get_selection_mode), (egg_icon_list_set_model),
(egg_icon_list_get_model), (egg_icon_list_set_text_column),
(egg_icon_list_get_text_column), (egg_icon_list_set_markup_column),
(egg_icon_list_get_markup_column),
(egg_icon_list_set_pixbuf_column),
(egg_icon_list_get_pixbuf_column), (egg_icon_list_select_path),
(egg_icon_list_unselect_path), (egg_icon_list_select_all),
(egg_icon_list_unselect_all), (egg_icon_list_path_is_selected),
(egg_icon_list_item_activated):
* libegg/iconlist/eggiconlist.h:
* libegg/iconlist/testiconlist.c: (foreach_selected_remove_func),
(foreach_selected_remove), (selection_changed), (main):
Document functions and fix a few bugs.
2004-07-03 08:01:34 +00:00
|
|
|
*
|
|
|
|
* Returns: the markup column, or -1 if it's unset.
|
|
|
|
*
|
|
|
|
* Since: 2.6
|
|
|
|
*/
|
|
|
|
gint
|
2004-07-04 15:56:55 +00:00
|
|
|
gtk_icon_view_get_markup_column (GtkIconView *icon_view)
|
Document functions and fix a few bugs.
2004-07-03 Anders Carlsson <andersca@gnome.org>
* libegg/iconlist/eggiconlist.c: (egg_icon_list_add_move_binding),
(egg_icon_list_real_move_cursor), (egg_icon_list_new),
(egg_icon_list_new_with_model), (egg_icon_list_get_path_at_pos),
(egg_icon_list_selected_foreach),
(egg_icon_list_set_selection_mode),
(egg_icon_list_get_selection_mode), (egg_icon_list_set_model),
(egg_icon_list_get_model), (egg_icon_list_set_text_column),
(egg_icon_list_get_text_column), (egg_icon_list_set_markup_column),
(egg_icon_list_get_markup_column),
(egg_icon_list_set_pixbuf_column),
(egg_icon_list_get_pixbuf_column), (egg_icon_list_select_path),
(egg_icon_list_unselect_path), (egg_icon_list_select_all),
(egg_icon_list_unselect_all), (egg_icon_list_path_is_selected),
(egg_icon_list_item_activated):
* libegg/iconlist/eggiconlist.h:
* libegg/iconlist/testiconlist.c: (foreach_selected_remove_func),
(foreach_selected_remove), (selection_changed), (main):
Document functions and fix a few bugs.
2004-07-03 08:01:34 +00:00
|
|
|
{
|
2004-07-04 15:56:55 +00:00
|
|
|
g_return_val_if_fail (GTK_IS_ICON_VIEW (icon_view), -1);
|
Document functions and fix a few bugs.
2004-07-03 Anders Carlsson <andersca@gnome.org>
* libegg/iconlist/eggiconlist.c: (egg_icon_list_add_move_binding),
(egg_icon_list_real_move_cursor), (egg_icon_list_new),
(egg_icon_list_new_with_model), (egg_icon_list_get_path_at_pos),
(egg_icon_list_selected_foreach),
(egg_icon_list_set_selection_mode),
(egg_icon_list_get_selection_mode), (egg_icon_list_set_model),
(egg_icon_list_get_model), (egg_icon_list_set_text_column),
(egg_icon_list_get_text_column), (egg_icon_list_set_markup_column),
(egg_icon_list_get_markup_column),
(egg_icon_list_set_pixbuf_column),
(egg_icon_list_get_pixbuf_column), (egg_icon_list_select_path),
(egg_icon_list_unselect_path), (egg_icon_list_select_all),
(egg_icon_list_unselect_all), (egg_icon_list_path_is_selected),
(egg_icon_list_item_activated):
* libegg/iconlist/eggiconlist.h:
* libegg/iconlist/testiconlist.c: (foreach_selected_remove_func),
(foreach_selected_remove), (selection_changed), (main):
Document functions and fix a few bugs.
2004-07-03 08:01:34 +00:00
|
|
|
|
2004-07-04 15:56:55 +00:00
|
|
|
return icon_view->priv->markup_column;
|
Document functions and fix a few bugs.
2004-07-03 Anders Carlsson <andersca@gnome.org>
* libegg/iconlist/eggiconlist.c: (egg_icon_list_add_move_binding),
(egg_icon_list_real_move_cursor), (egg_icon_list_new),
(egg_icon_list_new_with_model), (egg_icon_list_get_path_at_pos),
(egg_icon_list_selected_foreach),
(egg_icon_list_set_selection_mode),
(egg_icon_list_get_selection_mode), (egg_icon_list_set_model),
(egg_icon_list_get_model), (egg_icon_list_set_text_column),
(egg_icon_list_get_text_column), (egg_icon_list_set_markup_column),
(egg_icon_list_get_markup_column),
(egg_icon_list_set_pixbuf_column),
(egg_icon_list_get_pixbuf_column), (egg_icon_list_select_path),
(egg_icon_list_unselect_path), (egg_icon_list_select_all),
(egg_icon_list_unselect_all), (egg_icon_list_path_is_selected),
(egg_icon_list_item_activated):
* libegg/iconlist/eggiconlist.h:
* libegg/iconlist/testiconlist.c: (foreach_selected_remove_func),
(foreach_selected_remove), (selection_changed), (main):
Document functions and fix a few bugs.
2004-07-03 08:01:34 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2004-07-04 15:56:55 +00:00
|
|
|
* gtk_icon_view_set_pixbuf_column:
|
|
|
|
* @icon_view: A #GtkIconView.
|
2007-01-27 04:36:08 +00:00
|
|
|
* @column: A column in the currently used model, or -1 to disable
|
Document functions and fix a few bugs.
2004-07-03 Anders Carlsson <andersca@gnome.org>
* libegg/iconlist/eggiconlist.c: (egg_icon_list_add_move_binding),
(egg_icon_list_real_move_cursor), (egg_icon_list_new),
(egg_icon_list_new_with_model), (egg_icon_list_get_path_at_pos),
(egg_icon_list_selected_foreach),
(egg_icon_list_set_selection_mode),
(egg_icon_list_get_selection_mode), (egg_icon_list_set_model),
(egg_icon_list_get_model), (egg_icon_list_set_text_column),
(egg_icon_list_get_text_column), (egg_icon_list_set_markup_column),
(egg_icon_list_get_markup_column),
(egg_icon_list_set_pixbuf_column),
(egg_icon_list_get_pixbuf_column), (egg_icon_list_select_path),
(egg_icon_list_unselect_path), (egg_icon_list_select_all),
(egg_icon_list_unselect_all), (egg_icon_list_path_is_selected),
(egg_icon_list_item_activated):
* libegg/iconlist/eggiconlist.h:
* libegg/iconlist/testiconlist.c: (foreach_selected_remove_func),
(foreach_selected_remove), (selection_changed), (main):
Document functions and fix a few bugs.
2004-07-03 08:01:34 +00:00
|
|
|
*
|
2004-07-04 15:56:55 +00:00
|
|
|
* Sets the column with pixbufs for @icon_view to be @column. The pixbuf
|
Document functions and fix a few bugs.
2004-07-03 Anders Carlsson <andersca@gnome.org>
* libegg/iconlist/eggiconlist.c: (egg_icon_list_add_move_binding),
(egg_icon_list_real_move_cursor), (egg_icon_list_new),
(egg_icon_list_new_with_model), (egg_icon_list_get_path_at_pos),
(egg_icon_list_selected_foreach),
(egg_icon_list_set_selection_mode),
(egg_icon_list_get_selection_mode), (egg_icon_list_set_model),
(egg_icon_list_get_model), (egg_icon_list_set_text_column),
(egg_icon_list_get_text_column), (egg_icon_list_set_markup_column),
(egg_icon_list_get_markup_column),
(egg_icon_list_set_pixbuf_column),
(egg_icon_list_get_pixbuf_column), (egg_icon_list_select_path),
(egg_icon_list_unselect_path), (egg_icon_list_select_all),
(egg_icon_list_unselect_all), (egg_icon_list_path_is_selected),
(egg_icon_list_item_activated):
* libegg/iconlist/eggiconlist.h:
* libegg/iconlist/testiconlist.c: (foreach_selected_remove_func),
(foreach_selected_remove), (selection_changed), (main):
Document functions and fix a few bugs.
2004-07-03 08:01:34 +00:00
|
|
|
* column must be of type #GDK_TYPE_PIXBUF
|
|
|
|
*
|
|
|
|
* Since: 2.6
|
|
|
|
**/
|
|
|
|
void
|
2004-07-04 15:56:55 +00:00
|
|
|
gtk_icon_view_set_pixbuf_column (GtkIconView *icon_view,
|
2004-07-13 05:15:49 +00:00
|
|
|
gint column)
|
Document functions and fix a few bugs.
2004-07-03 Anders Carlsson <andersca@gnome.org>
* libegg/iconlist/eggiconlist.c: (egg_icon_list_add_move_binding),
(egg_icon_list_real_move_cursor), (egg_icon_list_new),
(egg_icon_list_new_with_model), (egg_icon_list_get_path_at_pos),
(egg_icon_list_selected_foreach),
(egg_icon_list_set_selection_mode),
(egg_icon_list_get_selection_mode), (egg_icon_list_set_model),
(egg_icon_list_get_model), (egg_icon_list_set_text_column),
(egg_icon_list_get_text_column), (egg_icon_list_set_markup_column),
(egg_icon_list_get_markup_column),
(egg_icon_list_set_pixbuf_column),
(egg_icon_list_get_pixbuf_column), (egg_icon_list_select_path),
(egg_icon_list_unselect_path), (egg_icon_list_select_all),
(egg_icon_list_unselect_all), (egg_icon_list_path_is_selected),
(egg_icon_list_item_activated):
* libegg/iconlist/eggiconlist.h:
* libegg/iconlist/testiconlist.c: (foreach_selected_remove_func),
(foreach_selected_remove), (selection_changed), (main):
Document functions and fix a few bugs.
2004-07-03 08:01:34 +00:00
|
|
|
{
|
2004-07-04 15:56:55 +00:00
|
|
|
if (column == icon_view->priv->pixbuf_column)
|
Document functions and fix a few bugs.
2004-07-03 Anders Carlsson <andersca@gnome.org>
* libegg/iconlist/eggiconlist.c: (egg_icon_list_add_move_binding),
(egg_icon_list_real_move_cursor), (egg_icon_list_new),
(egg_icon_list_new_with_model), (egg_icon_list_get_path_at_pos),
(egg_icon_list_selected_foreach),
(egg_icon_list_set_selection_mode),
(egg_icon_list_get_selection_mode), (egg_icon_list_set_model),
(egg_icon_list_get_model), (egg_icon_list_set_text_column),
(egg_icon_list_get_text_column), (egg_icon_list_set_markup_column),
(egg_icon_list_get_markup_column),
(egg_icon_list_set_pixbuf_column),
(egg_icon_list_get_pixbuf_column), (egg_icon_list_select_path),
(egg_icon_list_unselect_path), (egg_icon_list_select_all),
(egg_icon_list_unselect_all), (egg_icon_list_path_is_selected),
(egg_icon_list_item_activated):
* libegg/iconlist/eggiconlist.h:
* libegg/iconlist/testiconlist.c: (foreach_selected_remove_func),
(foreach_selected_remove), (selection_changed), (main):
Document functions and fix a few bugs.
2004-07-03 08:01:34 +00:00
|
|
|
return;
|
|
|
|
|
|
|
|
if (column == -1)
|
2004-07-04 15:56:55 +00:00
|
|
|
icon_view->priv->pixbuf_column = -1;
|
Document functions and fix a few bugs.
2004-07-03 Anders Carlsson <andersca@gnome.org>
* libegg/iconlist/eggiconlist.c: (egg_icon_list_add_move_binding),
(egg_icon_list_real_move_cursor), (egg_icon_list_new),
(egg_icon_list_new_with_model), (egg_icon_list_get_path_at_pos),
(egg_icon_list_selected_foreach),
(egg_icon_list_set_selection_mode),
(egg_icon_list_get_selection_mode), (egg_icon_list_set_model),
(egg_icon_list_get_model), (egg_icon_list_set_text_column),
(egg_icon_list_get_text_column), (egg_icon_list_set_markup_column),
(egg_icon_list_get_markup_column),
(egg_icon_list_set_pixbuf_column),
(egg_icon_list_get_pixbuf_column), (egg_icon_list_select_path),
(egg_icon_list_unselect_path), (egg_icon_list_select_all),
(egg_icon_list_unselect_all), (egg_icon_list_path_is_selected),
(egg_icon_list_item_activated):
* libegg/iconlist/eggiconlist.h:
* libegg/iconlist/testiconlist.c: (foreach_selected_remove_func),
(foreach_selected_remove), (selection_changed), (main):
Document functions and fix a few bugs.
2004-07-03 08:01:34 +00:00
|
|
|
else
|
|
|
|
{
|
2004-07-04 15:56:55 +00:00
|
|
|
if (icon_view->priv->model != NULL)
|
Document functions and fix a few bugs.
2004-07-03 Anders Carlsson <andersca@gnome.org>
* libegg/iconlist/eggiconlist.c: (egg_icon_list_add_move_binding),
(egg_icon_list_real_move_cursor), (egg_icon_list_new),
(egg_icon_list_new_with_model), (egg_icon_list_get_path_at_pos),
(egg_icon_list_selected_foreach),
(egg_icon_list_set_selection_mode),
(egg_icon_list_get_selection_mode), (egg_icon_list_set_model),
(egg_icon_list_get_model), (egg_icon_list_set_text_column),
(egg_icon_list_get_text_column), (egg_icon_list_set_markup_column),
(egg_icon_list_get_markup_column),
(egg_icon_list_set_pixbuf_column),
(egg_icon_list_get_pixbuf_column), (egg_icon_list_select_path),
(egg_icon_list_unselect_path), (egg_icon_list_select_all),
(egg_icon_list_unselect_all), (egg_icon_list_path_is_selected),
(egg_icon_list_item_activated):
* libegg/iconlist/eggiconlist.h:
* libegg/iconlist/testiconlist.c: (foreach_selected_remove_func),
(foreach_selected_remove), (selection_changed), (main):
Document functions and fix a few bugs.
2004-07-03 08:01:34 +00:00
|
|
|
{
|
|
|
|
GType column_type;
|
|
|
|
|
2004-07-04 15:56:55 +00:00
|
|
|
column_type = gtk_tree_model_get_column_type (icon_view->priv->model, column);
|
Document functions and fix a few bugs.
2004-07-03 Anders Carlsson <andersca@gnome.org>
* libegg/iconlist/eggiconlist.c: (egg_icon_list_add_move_binding),
(egg_icon_list_real_move_cursor), (egg_icon_list_new),
(egg_icon_list_new_with_model), (egg_icon_list_get_path_at_pos),
(egg_icon_list_selected_foreach),
(egg_icon_list_set_selection_mode),
(egg_icon_list_get_selection_mode), (egg_icon_list_set_model),
(egg_icon_list_get_model), (egg_icon_list_set_text_column),
(egg_icon_list_get_text_column), (egg_icon_list_set_markup_column),
(egg_icon_list_get_markup_column),
(egg_icon_list_set_pixbuf_column),
(egg_icon_list_get_pixbuf_column), (egg_icon_list_select_path),
(egg_icon_list_unselect_path), (egg_icon_list_select_all),
(egg_icon_list_unselect_all), (egg_icon_list_path_is_selected),
(egg_icon_list_item_activated):
* libegg/iconlist/eggiconlist.h:
* libegg/iconlist/testiconlist.c: (foreach_selected_remove_func),
(foreach_selected_remove), (selection_changed), (main):
Document functions and fix a few bugs.
2004-07-03 08:01:34 +00:00
|
|
|
|
|
|
|
g_return_if_fail (column_type == GDK_TYPE_PIXBUF);
|
|
|
|
}
|
|
|
|
|
2004-07-04 15:56:55 +00:00
|
|
|
icon_view->priv->pixbuf_column = column;
|
Document functions and fix a few bugs.
2004-07-03 Anders Carlsson <andersca@gnome.org>
* libegg/iconlist/eggiconlist.c: (egg_icon_list_add_move_binding),
(egg_icon_list_real_move_cursor), (egg_icon_list_new),
(egg_icon_list_new_with_model), (egg_icon_list_get_path_at_pos),
(egg_icon_list_selected_foreach),
(egg_icon_list_set_selection_mode),
(egg_icon_list_get_selection_mode), (egg_icon_list_set_model),
(egg_icon_list_get_model), (egg_icon_list_set_text_column),
(egg_icon_list_get_text_column), (egg_icon_list_set_markup_column),
(egg_icon_list_get_markup_column),
(egg_icon_list_set_pixbuf_column),
(egg_icon_list_get_pixbuf_column), (egg_icon_list_select_path),
(egg_icon_list_unselect_path), (egg_icon_list_select_all),
(egg_icon_list_unselect_all), (egg_icon_list_path_is_selected),
(egg_icon_list_item_activated):
* libegg/iconlist/eggiconlist.h:
* libegg/iconlist/testiconlist.c: (foreach_selected_remove_func),
(foreach_selected_remove), (selection_changed), (main):
Document functions and fix a few bugs.
2004-07-03 08:01:34 +00:00
|
|
|
}
|
|
|
|
|
2011-02-23 11:50:50 +00:00
|
|
|
if (icon_view->priv->cell_area)
|
|
|
|
gtk_cell_area_stop_editing (icon_view->priv->cell_area, TRUE);
|
2005-05-02 20:28:37 +00:00
|
|
|
|
|
|
|
update_pixbuf_cell (icon_view);
|
|
|
|
|
2004-07-04 15:56:55 +00:00
|
|
|
gtk_icon_view_invalidate_sizes (icon_view);
|
Document functions and fix a few bugs.
2004-07-03 Anders Carlsson <andersca@gnome.org>
* libegg/iconlist/eggiconlist.c: (egg_icon_list_add_move_binding),
(egg_icon_list_real_move_cursor), (egg_icon_list_new),
(egg_icon_list_new_with_model), (egg_icon_list_get_path_at_pos),
(egg_icon_list_selected_foreach),
(egg_icon_list_set_selection_mode),
(egg_icon_list_get_selection_mode), (egg_icon_list_set_model),
(egg_icon_list_get_model), (egg_icon_list_set_text_column),
(egg_icon_list_get_text_column), (egg_icon_list_set_markup_column),
(egg_icon_list_get_markup_column),
(egg_icon_list_set_pixbuf_column),
(egg_icon_list_get_pixbuf_column), (egg_icon_list_select_path),
(egg_icon_list_unselect_path), (egg_icon_list_select_all),
(egg_icon_list_unselect_all), (egg_icon_list_path_is_selected),
(egg_icon_list_item_activated):
* libegg/iconlist/eggiconlist.h:
* libegg/iconlist/testiconlist.c: (foreach_selected_remove_func),
(foreach_selected_remove), (selection_changed), (main):
Document functions and fix a few bugs.
2004-07-03 08:01:34 +00:00
|
|
|
|
2005-03-26 05:49:15 +00:00
|
|
|
g_object_notify (G_OBJECT (icon_view), "pixbuf-column");
|
Document functions and fix a few bugs.
2004-07-03 Anders Carlsson <andersca@gnome.org>
* libegg/iconlist/eggiconlist.c: (egg_icon_list_add_move_binding),
(egg_icon_list_real_move_cursor), (egg_icon_list_new),
(egg_icon_list_new_with_model), (egg_icon_list_get_path_at_pos),
(egg_icon_list_selected_foreach),
(egg_icon_list_set_selection_mode),
(egg_icon_list_get_selection_mode), (egg_icon_list_set_model),
(egg_icon_list_get_model), (egg_icon_list_set_text_column),
(egg_icon_list_get_text_column), (egg_icon_list_set_markup_column),
(egg_icon_list_get_markup_column),
(egg_icon_list_set_pixbuf_column),
(egg_icon_list_get_pixbuf_column), (egg_icon_list_select_path),
(egg_icon_list_unselect_path), (egg_icon_list_select_all),
(egg_icon_list_unselect_all), (egg_icon_list_path_is_selected),
(egg_icon_list_item_activated):
* libegg/iconlist/eggiconlist.h:
* libegg/iconlist/testiconlist.c: (foreach_selected_remove_func),
(foreach_selected_remove), (selection_changed), (main):
Document functions and fix a few bugs.
2004-07-03 08:01:34 +00:00
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2004-07-04 15:56:55 +00:00
|
|
|
* gtk_icon_view_get_pixbuf_column:
|
|
|
|
* @icon_view: A #GtkIconView.
|
Document functions and fix a few bugs.
2004-07-03 Anders Carlsson <andersca@gnome.org>
* libegg/iconlist/eggiconlist.c: (egg_icon_list_add_move_binding),
(egg_icon_list_real_move_cursor), (egg_icon_list_new),
(egg_icon_list_new_with_model), (egg_icon_list_get_path_at_pos),
(egg_icon_list_selected_foreach),
(egg_icon_list_set_selection_mode),
(egg_icon_list_get_selection_mode), (egg_icon_list_set_model),
(egg_icon_list_get_model), (egg_icon_list_set_text_column),
(egg_icon_list_get_text_column), (egg_icon_list_set_markup_column),
(egg_icon_list_get_markup_column),
(egg_icon_list_set_pixbuf_column),
(egg_icon_list_get_pixbuf_column), (egg_icon_list_select_path),
(egg_icon_list_unselect_path), (egg_icon_list_select_all),
(egg_icon_list_unselect_all), (egg_icon_list_path_is_selected),
(egg_icon_list_item_activated):
* libegg/iconlist/eggiconlist.h:
* libegg/iconlist/testiconlist.c: (foreach_selected_remove_func),
(foreach_selected_remove), (selection_changed), (main):
Document functions and fix a few bugs.
2004-07-03 08:01:34 +00:00
|
|
|
*
|
2004-07-04 15:56:55 +00:00
|
|
|
* Returns the column with pixbufs for @icon_view.
|
Document functions and fix a few bugs.
2004-07-03 Anders Carlsson <andersca@gnome.org>
* libegg/iconlist/eggiconlist.c: (egg_icon_list_add_move_binding),
(egg_icon_list_real_move_cursor), (egg_icon_list_new),
(egg_icon_list_new_with_model), (egg_icon_list_get_path_at_pos),
(egg_icon_list_selected_foreach),
(egg_icon_list_set_selection_mode),
(egg_icon_list_get_selection_mode), (egg_icon_list_set_model),
(egg_icon_list_get_model), (egg_icon_list_set_text_column),
(egg_icon_list_get_text_column), (egg_icon_list_set_markup_column),
(egg_icon_list_get_markup_column),
(egg_icon_list_set_pixbuf_column),
(egg_icon_list_get_pixbuf_column), (egg_icon_list_select_path),
(egg_icon_list_unselect_path), (egg_icon_list_select_all),
(egg_icon_list_unselect_all), (egg_icon_list_path_is_selected),
(egg_icon_list_item_activated):
* libegg/iconlist/eggiconlist.h:
* libegg/iconlist/testiconlist.c: (foreach_selected_remove_func),
(foreach_selected_remove), (selection_changed), (main):
Document functions and fix a few bugs.
2004-07-03 08:01:34 +00:00
|
|
|
*
|
|
|
|
* Returns: the pixbuf column, or -1 if it's unset.
|
|
|
|
*
|
|
|
|
* Since: 2.6
|
|
|
|
*/
|
|
|
|
gint
|
2004-07-04 15:56:55 +00:00
|
|
|
gtk_icon_view_get_pixbuf_column (GtkIconView *icon_view)
|
Document functions and fix a few bugs.
2004-07-03 Anders Carlsson <andersca@gnome.org>
* libegg/iconlist/eggiconlist.c: (egg_icon_list_add_move_binding),
(egg_icon_list_real_move_cursor), (egg_icon_list_new),
(egg_icon_list_new_with_model), (egg_icon_list_get_path_at_pos),
(egg_icon_list_selected_foreach),
(egg_icon_list_set_selection_mode),
(egg_icon_list_get_selection_mode), (egg_icon_list_set_model),
(egg_icon_list_get_model), (egg_icon_list_set_text_column),
(egg_icon_list_get_text_column), (egg_icon_list_set_markup_column),
(egg_icon_list_get_markup_column),
(egg_icon_list_set_pixbuf_column),
(egg_icon_list_get_pixbuf_column), (egg_icon_list_select_path),
(egg_icon_list_unselect_path), (egg_icon_list_select_all),
(egg_icon_list_unselect_all), (egg_icon_list_path_is_selected),
(egg_icon_list_item_activated):
* libegg/iconlist/eggiconlist.h:
* libegg/iconlist/testiconlist.c: (foreach_selected_remove_func),
(foreach_selected_remove), (selection_changed), (main):
Document functions and fix a few bugs.
2004-07-03 08:01:34 +00:00
|
|
|
{
|
2004-07-04 15:56:55 +00:00
|
|
|
g_return_val_if_fail (GTK_IS_ICON_VIEW (icon_view), -1);
|
Document functions and fix a few bugs.
2004-07-03 Anders Carlsson <andersca@gnome.org>
* libegg/iconlist/eggiconlist.c: (egg_icon_list_add_move_binding),
(egg_icon_list_real_move_cursor), (egg_icon_list_new),
(egg_icon_list_new_with_model), (egg_icon_list_get_path_at_pos),
(egg_icon_list_selected_foreach),
(egg_icon_list_set_selection_mode),
(egg_icon_list_get_selection_mode), (egg_icon_list_set_model),
(egg_icon_list_get_model), (egg_icon_list_set_text_column),
(egg_icon_list_get_text_column), (egg_icon_list_set_markup_column),
(egg_icon_list_get_markup_column),
(egg_icon_list_set_pixbuf_column),
(egg_icon_list_get_pixbuf_column), (egg_icon_list_select_path),
(egg_icon_list_unselect_path), (egg_icon_list_select_all),
(egg_icon_list_unselect_all), (egg_icon_list_path_is_selected),
(egg_icon_list_item_activated):
* libegg/iconlist/eggiconlist.h:
* libegg/iconlist/testiconlist.c: (foreach_selected_remove_func),
(foreach_selected_remove), (selection_changed), (main):
Document functions and fix a few bugs.
2004-07-03 08:01:34 +00:00
|
|
|
|
2004-07-04 15:56:55 +00:00
|
|
|
return icon_view->priv->pixbuf_column;
|
Document functions and fix a few bugs.
2004-07-03 Anders Carlsson <andersca@gnome.org>
* libegg/iconlist/eggiconlist.c: (egg_icon_list_add_move_binding),
(egg_icon_list_real_move_cursor), (egg_icon_list_new),
(egg_icon_list_new_with_model), (egg_icon_list_get_path_at_pos),
(egg_icon_list_selected_foreach),
(egg_icon_list_set_selection_mode),
(egg_icon_list_get_selection_mode), (egg_icon_list_set_model),
(egg_icon_list_get_model), (egg_icon_list_set_text_column),
(egg_icon_list_get_text_column), (egg_icon_list_set_markup_column),
(egg_icon_list_get_markup_column),
(egg_icon_list_set_pixbuf_column),
(egg_icon_list_get_pixbuf_column), (egg_icon_list_select_path),
(egg_icon_list_unselect_path), (egg_icon_list_select_all),
(egg_icon_list_unselect_all), (egg_icon_list_path_is_selected),
(egg_icon_list_item_activated):
* libegg/iconlist/eggiconlist.h:
* libegg/iconlist/testiconlist.c: (foreach_selected_remove_func),
(foreach_selected_remove), (selection_changed), (main):
Document functions and fix a few bugs.
2004-07-03 08:01:34 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2004-07-04 15:56:55 +00:00
|
|
|
* gtk_icon_view_select_path:
|
|
|
|
* @icon_view: A #GtkIconView.
|
Document functions and fix a few bugs.
2004-07-03 Anders Carlsson <andersca@gnome.org>
* libegg/iconlist/eggiconlist.c: (egg_icon_list_add_move_binding),
(egg_icon_list_real_move_cursor), (egg_icon_list_new),
(egg_icon_list_new_with_model), (egg_icon_list_get_path_at_pos),
(egg_icon_list_selected_foreach),
(egg_icon_list_set_selection_mode),
(egg_icon_list_get_selection_mode), (egg_icon_list_set_model),
(egg_icon_list_get_model), (egg_icon_list_set_text_column),
(egg_icon_list_get_text_column), (egg_icon_list_set_markup_column),
(egg_icon_list_get_markup_column),
(egg_icon_list_set_pixbuf_column),
(egg_icon_list_get_pixbuf_column), (egg_icon_list_select_path),
(egg_icon_list_unselect_path), (egg_icon_list_select_all),
(egg_icon_list_unselect_all), (egg_icon_list_path_is_selected),
(egg_icon_list_item_activated):
* libegg/iconlist/eggiconlist.h:
* libegg/iconlist/testiconlist.c: (foreach_selected_remove_func),
(foreach_selected_remove), (selection_changed), (main):
Document functions and fix a few bugs.
2004-07-03 08:01:34 +00:00
|
|
|
* @path: The #GtkTreePath to be selected.
|
|
|
|
*
|
|
|
|
* Selects the row at @path.
|
2004-07-13 05:15:49 +00:00
|
|
|
*
|
|
|
|
* Since: 2.6
|
Document functions and fix a few bugs.
2004-07-03 Anders Carlsson <andersca@gnome.org>
* libegg/iconlist/eggiconlist.c: (egg_icon_list_add_move_binding),
(egg_icon_list_real_move_cursor), (egg_icon_list_new),
(egg_icon_list_new_with_model), (egg_icon_list_get_path_at_pos),
(egg_icon_list_selected_foreach),
(egg_icon_list_set_selection_mode),
(egg_icon_list_get_selection_mode), (egg_icon_list_set_model),
(egg_icon_list_get_model), (egg_icon_list_set_text_column),
(egg_icon_list_get_text_column), (egg_icon_list_set_markup_column),
(egg_icon_list_get_markup_column),
(egg_icon_list_set_pixbuf_column),
(egg_icon_list_get_pixbuf_column), (egg_icon_list_select_path),
(egg_icon_list_unselect_path), (egg_icon_list_select_all),
(egg_icon_list_unselect_all), (egg_icon_list_path_is_selected),
(egg_icon_list_item_activated):
* libegg/iconlist/eggiconlist.h:
* libegg/iconlist/testiconlist.c: (foreach_selected_remove_func),
(foreach_selected_remove), (selection_changed), (main):
Document functions and fix a few bugs.
2004-07-03 08:01:34 +00:00
|
|
|
**/
|
|
|
|
void
|
2004-07-04 15:56:55 +00:00
|
|
|
gtk_icon_view_select_path (GtkIconView *icon_view,
|
Document functions and fix a few bugs.
2004-07-03 Anders Carlsson <andersca@gnome.org>
* libegg/iconlist/eggiconlist.c: (egg_icon_list_add_move_binding),
(egg_icon_list_real_move_cursor), (egg_icon_list_new),
(egg_icon_list_new_with_model), (egg_icon_list_get_path_at_pos),
(egg_icon_list_selected_foreach),
(egg_icon_list_set_selection_mode),
(egg_icon_list_get_selection_mode), (egg_icon_list_set_model),
(egg_icon_list_get_model), (egg_icon_list_set_text_column),
(egg_icon_list_get_text_column), (egg_icon_list_set_markup_column),
(egg_icon_list_get_markup_column),
(egg_icon_list_set_pixbuf_column),
(egg_icon_list_get_pixbuf_column), (egg_icon_list_select_path),
(egg_icon_list_unselect_path), (egg_icon_list_select_all),
(egg_icon_list_unselect_all), (egg_icon_list_path_is_selected),
(egg_icon_list_item_activated):
* libegg/iconlist/eggiconlist.h:
* libegg/iconlist/testiconlist.c: (foreach_selected_remove_func),
(foreach_selected_remove), (selection_changed), (main):
Document functions and fix a few bugs.
2004-07-03 08:01:34 +00:00
|
|
|
GtkTreePath *path)
|
|
|
|
{
|
2005-08-15 16:46:52 +00:00
|
|
|
GtkIconViewItem *item = NULL;
|
2005-04-29 14:56:37 +00:00
|
|
|
|
2004-07-04 15:56:55 +00:00
|
|
|
g_return_if_fail (GTK_IS_ICON_VIEW (icon_view));
|
|
|
|
g_return_if_fail (icon_view->priv->model != NULL);
|
Document functions and fix a few bugs.
2004-07-03 Anders Carlsson <andersca@gnome.org>
* libegg/iconlist/eggiconlist.c: (egg_icon_list_add_move_binding),
(egg_icon_list_real_move_cursor), (egg_icon_list_new),
(egg_icon_list_new_with_model), (egg_icon_list_get_path_at_pos),
(egg_icon_list_selected_foreach),
(egg_icon_list_set_selection_mode),
(egg_icon_list_get_selection_mode), (egg_icon_list_set_model),
(egg_icon_list_get_model), (egg_icon_list_set_text_column),
(egg_icon_list_get_text_column), (egg_icon_list_set_markup_column),
(egg_icon_list_get_markup_column),
(egg_icon_list_set_pixbuf_column),
(egg_icon_list_get_pixbuf_column), (egg_icon_list_select_path),
(egg_icon_list_unselect_path), (egg_icon_list_select_all),
(egg_icon_list_unselect_all), (egg_icon_list_path_is_selected),
(egg_icon_list_item_activated):
* libegg/iconlist/eggiconlist.h:
* libegg/iconlist/testiconlist.c: (foreach_selected_remove_func),
(foreach_selected_remove), (selection_changed), (main):
Document functions and fix a few bugs.
2004-07-03 08:01:34 +00:00
|
|
|
g_return_if_fail (path != NULL);
|
|
|
|
|
2005-08-15 16:46:52 +00:00
|
|
|
if (gtk_tree_path_get_depth (path) > 0)
|
|
|
|
item = g_list_nth_data (icon_view->priv->items,
|
2010-06-28 18:15:10 +00:00
|
|
|
gtk_tree_path_get_indices(path)[0]);
|
Document functions and fix a few bugs.
2004-07-03 Anders Carlsson <andersca@gnome.org>
* libegg/iconlist/eggiconlist.c: (egg_icon_list_add_move_binding),
(egg_icon_list_real_move_cursor), (egg_icon_list_new),
(egg_icon_list_new_with_model), (egg_icon_list_get_path_at_pos),
(egg_icon_list_selected_foreach),
(egg_icon_list_set_selection_mode),
(egg_icon_list_get_selection_mode), (egg_icon_list_set_model),
(egg_icon_list_get_model), (egg_icon_list_set_text_column),
(egg_icon_list_get_text_column), (egg_icon_list_set_markup_column),
(egg_icon_list_get_markup_column),
(egg_icon_list_set_pixbuf_column),
(egg_icon_list_get_pixbuf_column), (egg_icon_list_select_path),
(egg_icon_list_unselect_path), (egg_icon_list_select_all),
(egg_icon_list_unselect_all), (egg_icon_list_path_is_selected),
(egg_icon_list_item_activated):
* libegg/iconlist/eggiconlist.h:
* libegg/iconlist/testiconlist.c: (foreach_selected_remove_func),
(foreach_selected_remove), (selection_changed), (main):
Document functions and fix a few bugs.
2004-07-03 08:01:34 +00:00
|
|
|
|
2005-08-15 16:46:52 +00:00
|
|
|
if (item)
|
|
|
|
gtk_icon_view_select_item (icon_view, item);
|
Document functions and fix a few bugs.
2004-07-03 Anders Carlsson <andersca@gnome.org>
* libegg/iconlist/eggiconlist.c: (egg_icon_list_add_move_binding),
(egg_icon_list_real_move_cursor), (egg_icon_list_new),
(egg_icon_list_new_with_model), (egg_icon_list_get_path_at_pos),
(egg_icon_list_selected_foreach),
(egg_icon_list_set_selection_mode),
(egg_icon_list_get_selection_mode), (egg_icon_list_set_model),
(egg_icon_list_get_model), (egg_icon_list_set_text_column),
(egg_icon_list_get_text_column), (egg_icon_list_set_markup_column),
(egg_icon_list_get_markup_column),
(egg_icon_list_set_pixbuf_column),
(egg_icon_list_get_pixbuf_column), (egg_icon_list_select_path),
(egg_icon_list_unselect_path), (egg_icon_list_select_all),
(egg_icon_list_unselect_all), (egg_icon_list_path_is_selected),
(egg_icon_list_item_activated):
* libegg/iconlist/eggiconlist.h:
* libegg/iconlist/testiconlist.c: (foreach_selected_remove_func),
(foreach_selected_remove), (selection_changed), (main):
Document functions and fix a few bugs.
2004-07-03 08:01:34 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2004-07-04 15:56:55 +00:00
|
|
|
* gtk_icon_view_unselect_path:
|
|
|
|
* @icon_view: A #GtkIconView.
|
Document functions and fix a few bugs.
2004-07-03 Anders Carlsson <andersca@gnome.org>
* libegg/iconlist/eggiconlist.c: (egg_icon_list_add_move_binding),
(egg_icon_list_real_move_cursor), (egg_icon_list_new),
(egg_icon_list_new_with_model), (egg_icon_list_get_path_at_pos),
(egg_icon_list_selected_foreach),
(egg_icon_list_set_selection_mode),
(egg_icon_list_get_selection_mode), (egg_icon_list_set_model),
(egg_icon_list_get_model), (egg_icon_list_set_text_column),
(egg_icon_list_get_text_column), (egg_icon_list_set_markup_column),
(egg_icon_list_get_markup_column),
(egg_icon_list_set_pixbuf_column),
(egg_icon_list_get_pixbuf_column), (egg_icon_list_select_path),
(egg_icon_list_unselect_path), (egg_icon_list_select_all),
(egg_icon_list_unselect_all), (egg_icon_list_path_is_selected),
(egg_icon_list_item_activated):
* libegg/iconlist/eggiconlist.h:
* libegg/iconlist/testiconlist.c: (foreach_selected_remove_func),
(foreach_selected_remove), (selection_changed), (main):
Document functions and fix a few bugs.
2004-07-03 08:01:34 +00:00
|
|
|
* @path: The #GtkTreePath to be unselected.
|
|
|
|
*
|
|
|
|
* Unselects the row at @path.
|
2004-07-13 05:15:49 +00:00
|
|
|
*
|
|
|
|
* Since: 2.6
|
Document functions and fix a few bugs.
2004-07-03 Anders Carlsson <andersca@gnome.org>
* libegg/iconlist/eggiconlist.c: (egg_icon_list_add_move_binding),
(egg_icon_list_real_move_cursor), (egg_icon_list_new),
(egg_icon_list_new_with_model), (egg_icon_list_get_path_at_pos),
(egg_icon_list_selected_foreach),
(egg_icon_list_set_selection_mode),
(egg_icon_list_get_selection_mode), (egg_icon_list_set_model),
(egg_icon_list_get_model), (egg_icon_list_set_text_column),
(egg_icon_list_get_text_column), (egg_icon_list_set_markup_column),
(egg_icon_list_get_markup_column),
(egg_icon_list_set_pixbuf_column),
(egg_icon_list_get_pixbuf_column), (egg_icon_list_select_path),
(egg_icon_list_unselect_path), (egg_icon_list_select_all),
(egg_icon_list_unselect_all), (egg_icon_list_path_is_selected),
(egg_icon_list_item_activated):
* libegg/iconlist/eggiconlist.h:
* libegg/iconlist/testiconlist.c: (foreach_selected_remove_func),
(foreach_selected_remove), (selection_changed), (main):
Document functions and fix a few bugs.
2004-07-03 08:01:34 +00:00
|
|
|
**/
|
|
|
|
void
|
2004-07-04 15:56:55 +00:00
|
|
|
gtk_icon_view_unselect_path (GtkIconView *icon_view,
|
Document functions and fix a few bugs.
2004-07-03 Anders Carlsson <andersca@gnome.org>
* libegg/iconlist/eggiconlist.c: (egg_icon_list_add_move_binding),
(egg_icon_list_real_move_cursor), (egg_icon_list_new),
(egg_icon_list_new_with_model), (egg_icon_list_get_path_at_pos),
(egg_icon_list_selected_foreach),
(egg_icon_list_set_selection_mode),
(egg_icon_list_get_selection_mode), (egg_icon_list_set_model),
(egg_icon_list_get_model), (egg_icon_list_set_text_column),
(egg_icon_list_get_text_column), (egg_icon_list_set_markup_column),
(egg_icon_list_get_markup_column),
(egg_icon_list_set_pixbuf_column),
(egg_icon_list_get_pixbuf_column), (egg_icon_list_select_path),
(egg_icon_list_unselect_path), (egg_icon_list_select_all),
(egg_icon_list_unselect_all), (egg_icon_list_path_is_selected),
(egg_icon_list_item_activated):
* libegg/iconlist/eggiconlist.h:
* libegg/iconlist/testiconlist.c: (foreach_selected_remove_func),
(foreach_selected_remove), (selection_changed), (main):
Document functions and fix a few bugs.
2004-07-03 08:01:34 +00:00
|
|
|
GtkTreePath *path)
|
|
|
|
{
|
2004-07-04 15:56:55 +00:00
|
|
|
GtkIconViewItem *item;
|
Document functions and fix a few bugs.
2004-07-03 Anders Carlsson <andersca@gnome.org>
* libegg/iconlist/eggiconlist.c: (egg_icon_list_add_move_binding),
(egg_icon_list_real_move_cursor), (egg_icon_list_new),
(egg_icon_list_new_with_model), (egg_icon_list_get_path_at_pos),
(egg_icon_list_selected_foreach),
(egg_icon_list_set_selection_mode),
(egg_icon_list_get_selection_mode), (egg_icon_list_set_model),
(egg_icon_list_get_model), (egg_icon_list_set_text_column),
(egg_icon_list_get_text_column), (egg_icon_list_set_markup_column),
(egg_icon_list_get_markup_column),
(egg_icon_list_set_pixbuf_column),
(egg_icon_list_get_pixbuf_column), (egg_icon_list_select_path),
(egg_icon_list_unselect_path), (egg_icon_list_select_all),
(egg_icon_list_unselect_all), (egg_icon_list_path_is_selected),
(egg_icon_list_item_activated):
* libegg/iconlist/eggiconlist.h:
* libegg/iconlist/testiconlist.c: (foreach_selected_remove_func),
(foreach_selected_remove), (selection_changed), (main):
Document functions and fix a few bugs.
2004-07-03 08:01:34 +00:00
|
|
|
|
2004-07-04 15:56:55 +00:00
|
|
|
g_return_if_fail (GTK_IS_ICON_VIEW (icon_view));
|
|
|
|
g_return_if_fail (icon_view->priv->model != NULL);
|
Document functions and fix a few bugs.
2004-07-03 Anders Carlsson <andersca@gnome.org>
* libegg/iconlist/eggiconlist.c: (egg_icon_list_add_move_binding),
(egg_icon_list_real_move_cursor), (egg_icon_list_new),
(egg_icon_list_new_with_model), (egg_icon_list_get_path_at_pos),
(egg_icon_list_selected_foreach),
(egg_icon_list_set_selection_mode),
(egg_icon_list_get_selection_mode), (egg_icon_list_set_model),
(egg_icon_list_get_model), (egg_icon_list_set_text_column),
(egg_icon_list_get_text_column), (egg_icon_list_set_markup_column),
(egg_icon_list_get_markup_column),
(egg_icon_list_set_pixbuf_column),
(egg_icon_list_get_pixbuf_column), (egg_icon_list_select_path),
(egg_icon_list_unselect_path), (egg_icon_list_select_all),
(egg_icon_list_unselect_all), (egg_icon_list_path_is_selected),
(egg_icon_list_item_activated):
* libegg/iconlist/eggiconlist.h:
* libegg/iconlist/testiconlist.c: (foreach_selected_remove_func),
(foreach_selected_remove), (selection_changed), (main):
Document functions and fix a few bugs.
2004-07-03 08:01:34 +00:00
|
|
|
g_return_if_fail (path != NULL);
|
|
|
|
|
2005-09-19 18:36:04 +00:00
|
|
|
item = g_list_nth_data (icon_view->priv->items,
|
2010-06-28 18:15:10 +00:00
|
|
|
gtk_tree_path_get_indices(path)[0]);
|
Document functions and fix a few bugs.
2004-07-03 Anders Carlsson <andersca@gnome.org>
* libegg/iconlist/eggiconlist.c: (egg_icon_list_add_move_binding),
(egg_icon_list_real_move_cursor), (egg_icon_list_new),
(egg_icon_list_new_with_model), (egg_icon_list_get_path_at_pos),
(egg_icon_list_selected_foreach),
(egg_icon_list_set_selection_mode),
(egg_icon_list_get_selection_mode), (egg_icon_list_set_model),
(egg_icon_list_get_model), (egg_icon_list_set_text_column),
(egg_icon_list_get_text_column), (egg_icon_list_set_markup_column),
(egg_icon_list_get_markup_column),
(egg_icon_list_set_pixbuf_column),
(egg_icon_list_get_pixbuf_column), (egg_icon_list_select_path),
(egg_icon_list_unselect_path), (egg_icon_list_select_all),
(egg_icon_list_unselect_all), (egg_icon_list_path_is_selected),
(egg_icon_list_item_activated):
* libegg/iconlist/eggiconlist.h:
* libegg/iconlist/testiconlist.c: (foreach_selected_remove_func),
(foreach_selected_remove), (selection_changed), (main):
Document functions and fix a few bugs.
2004-07-03 08:01:34 +00:00
|
|
|
|
|
|
|
if (!item)
|
|
|
|
return;
|
|
|
|
|
2004-07-04 15:56:55 +00:00
|
|
|
gtk_icon_view_unselect_item (icon_view, item);
|
Document functions and fix a few bugs.
2004-07-03 Anders Carlsson <andersca@gnome.org>
* libegg/iconlist/eggiconlist.c: (egg_icon_list_add_move_binding),
(egg_icon_list_real_move_cursor), (egg_icon_list_new),
(egg_icon_list_new_with_model), (egg_icon_list_get_path_at_pos),
(egg_icon_list_selected_foreach),
(egg_icon_list_set_selection_mode),
(egg_icon_list_get_selection_mode), (egg_icon_list_set_model),
(egg_icon_list_get_model), (egg_icon_list_set_text_column),
(egg_icon_list_get_text_column), (egg_icon_list_set_markup_column),
(egg_icon_list_get_markup_column),
(egg_icon_list_set_pixbuf_column),
(egg_icon_list_get_pixbuf_column), (egg_icon_list_select_path),
(egg_icon_list_unselect_path), (egg_icon_list_select_all),
(egg_icon_list_unselect_all), (egg_icon_list_path_is_selected),
(egg_icon_list_item_activated):
* libegg/iconlist/eggiconlist.h:
* libegg/iconlist/testiconlist.c: (foreach_selected_remove_func),
(foreach_selected_remove), (selection_changed), (main):
Document functions and fix a few bugs.
2004-07-03 08:01:34 +00:00
|
|
|
}
|
|
|
|
|
Fix the "selection_changed" signal to not get emitted twice in some cases.
2004-07-04 Anders Carlsson <andersca@gnome.org>
* configure.in:
* libegg/iconlist/eggiconlist.c: (egg_icon_list_expose),
(scroll_timeout), (egg_icon_list_motion),
(egg_icon_list_button_press), (egg_icon_list_update_rubberband),
(egg_icon_list_start_rubberbanding),
(egg_icon_list_stop_rubberbanding),
(egg_icon_list_unselect_all_internal),
(egg_icon_list_real_select_all),
(egg_icon_list_adjustment_changed), (egg_icon_list_item_free),
(egg_icon_list_select_item), (verify_items),
(egg_icon_list_row_changed), (egg_icon_list_row_inserted),
(egg_icon_list_row_deleted), (egg_icon_list_rows_reordered),
(egg_icon_list_select_all_between),
(egg_icon_list_move_cursor_up_down),
(egg_icon_list_move_cursor_page_up_down),
(egg_icon_list_move_cursor_left_right),
(egg_icon_list_move_cursor_start_end), (egg_icon_list_set_model),
(egg_icon_list_get_selected_items), (egg_icon_list_select_all),
(egg_icon_list_unselect_all):
* libegg/iconlist/eggiconlist.h:
* libegg/iconlist/testiconlist.c: (foreach_selected_remove):
Fix the "selection_changed" signal to not get emitted twice in some cases.
Also fix a bunch of issues reported by Jonathan.
2004-07-04 12:43:26 +00:00
|
|
|
/**
|
2004-07-04 15:56:55 +00:00
|
|
|
* gtk_icon_view_get_selected_items:
|
|
|
|
* @icon_view: A #GtkIconView.
|
Fix the "selection_changed" signal to not get emitted twice in some cases.
2004-07-04 Anders Carlsson <andersca@gnome.org>
* configure.in:
* libegg/iconlist/eggiconlist.c: (egg_icon_list_expose),
(scroll_timeout), (egg_icon_list_motion),
(egg_icon_list_button_press), (egg_icon_list_update_rubberband),
(egg_icon_list_start_rubberbanding),
(egg_icon_list_stop_rubberbanding),
(egg_icon_list_unselect_all_internal),
(egg_icon_list_real_select_all),
(egg_icon_list_adjustment_changed), (egg_icon_list_item_free),
(egg_icon_list_select_item), (verify_items),
(egg_icon_list_row_changed), (egg_icon_list_row_inserted),
(egg_icon_list_row_deleted), (egg_icon_list_rows_reordered),
(egg_icon_list_select_all_between),
(egg_icon_list_move_cursor_up_down),
(egg_icon_list_move_cursor_page_up_down),
(egg_icon_list_move_cursor_left_right),
(egg_icon_list_move_cursor_start_end), (egg_icon_list_set_model),
(egg_icon_list_get_selected_items), (egg_icon_list_select_all),
(egg_icon_list_unselect_all):
* libegg/iconlist/eggiconlist.h:
* libegg/iconlist/testiconlist.c: (foreach_selected_remove):
Fix the "selection_changed" signal to not get emitted twice in some cases.
Also fix a bunch of issues reported by Jonathan.
2004-07-04 12:43:26 +00:00
|
|
|
*
|
2004-11-09 19:49:13 +00:00
|
|
|
* Creates a list of paths of all selected items. Additionally, if you are
|
Fix the "selection_changed" signal to not get emitted twice in some cases.
2004-07-04 Anders Carlsson <andersca@gnome.org>
* configure.in:
* libegg/iconlist/eggiconlist.c: (egg_icon_list_expose),
(scroll_timeout), (egg_icon_list_motion),
(egg_icon_list_button_press), (egg_icon_list_update_rubberband),
(egg_icon_list_start_rubberbanding),
(egg_icon_list_stop_rubberbanding),
(egg_icon_list_unselect_all_internal),
(egg_icon_list_real_select_all),
(egg_icon_list_adjustment_changed), (egg_icon_list_item_free),
(egg_icon_list_select_item), (verify_items),
(egg_icon_list_row_changed), (egg_icon_list_row_inserted),
(egg_icon_list_row_deleted), (egg_icon_list_rows_reordered),
(egg_icon_list_select_all_between),
(egg_icon_list_move_cursor_up_down),
(egg_icon_list_move_cursor_page_up_down),
(egg_icon_list_move_cursor_left_right),
(egg_icon_list_move_cursor_start_end), (egg_icon_list_set_model),
(egg_icon_list_get_selected_items), (egg_icon_list_select_all),
(egg_icon_list_unselect_all):
* libegg/iconlist/eggiconlist.h:
* libegg/iconlist/testiconlist.c: (foreach_selected_remove):
Fix the "selection_changed" signal to not get emitted twice in some cases.
Also fix a bunch of issues reported by Jonathan.
2004-07-04 12:43:26 +00:00
|
|
|
* planning on modifying the model after calling this function, you may
|
|
|
|
* want to convert the returned list into a list of #GtkTreeRowReference<!-- -->s.
|
|
|
|
* To do this, you can use gtk_tree_row_reference_new().
|
|
|
|
*
|
|
|
|
* To free the return value, use:
|
2007-11-25 06:51:19 +00:00
|
|
|
* |[
|
2009-12-08 04:45:50 +00:00
|
|
|
* g_list_foreach (list, (GFunc)gtk_tree_path_free, NULL);
|
Fix the "selection_changed" signal to not get emitted twice in some cases.
2004-07-04 Anders Carlsson <andersca@gnome.org>
* configure.in:
* libegg/iconlist/eggiconlist.c: (egg_icon_list_expose),
(scroll_timeout), (egg_icon_list_motion),
(egg_icon_list_button_press), (egg_icon_list_update_rubberband),
(egg_icon_list_start_rubberbanding),
(egg_icon_list_stop_rubberbanding),
(egg_icon_list_unselect_all_internal),
(egg_icon_list_real_select_all),
(egg_icon_list_adjustment_changed), (egg_icon_list_item_free),
(egg_icon_list_select_item), (verify_items),
(egg_icon_list_row_changed), (egg_icon_list_row_inserted),
(egg_icon_list_row_deleted), (egg_icon_list_rows_reordered),
(egg_icon_list_select_all_between),
(egg_icon_list_move_cursor_up_down),
(egg_icon_list_move_cursor_page_up_down),
(egg_icon_list_move_cursor_left_right),
(egg_icon_list_move_cursor_start_end), (egg_icon_list_set_model),
(egg_icon_list_get_selected_items), (egg_icon_list_select_all),
(egg_icon_list_unselect_all):
* libegg/iconlist/eggiconlist.h:
* libegg/iconlist/testiconlist.c: (foreach_selected_remove):
Fix the "selection_changed" signal to not get emitted twice in some cases.
Also fix a bunch of issues reported by Jonathan.
2004-07-04 12:43:26 +00:00
|
|
|
* g_list_free (list);
|
2007-11-25 06:51:19 +00:00
|
|
|
* ]|
|
Fix the "selection_changed" signal to not get emitted twice in some cases.
2004-07-04 Anders Carlsson <andersca@gnome.org>
* configure.in:
* libegg/iconlist/eggiconlist.c: (egg_icon_list_expose),
(scroll_timeout), (egg_icon_list_motion),
(egg_icon_list_button_press), (egg_icon_list_update_rubberband),
(egg_icon_list_start_rubberbanding),
(egg_icon_list_stop_rubberbanding),
(egg_icon_list_unselect_all_internal),
(egg_icon_list_real_select_all),
(egg_icon_list_adjustment_changed), (egg_icon_list_item_free),
(egg_icon_list_select_item), (verify_items),
(egg_icon_list_row_changed), (egg_icon_list_row_inserted),
(egg_icon_list_row_deleted), (egg_icon_list_rows_reordered),
(egg_icon_list_select_all_between),
(egg_icon_list_move_cursor_up_down),
(egg_icon_list_move_cursor_page_up_down),
(egg_icon_list_move_cursor_left_right),
(egg_icon_list_move_cursor_start_end), (egg_icon_list_set_model),
(egg_icon_list_get_selected_items), (egg_icon_list_select_all),
(egg_icon_list_unselect_all):
* libegg/iconlist/eggiconlist.h:
* libegg/iconlist/testiconlist.c: (foreach_selected_remove):
Fix the "selection_changed" signal to not get emitted twice in some cases.
Also fix a bunch of issues reported by Jonathan.
2004-07-04 12:43:26 +00:00
|
|
|
*
|
2009-12-10 10:23:40 +00:00
|
|
|
* Return value: (element-type GtkTreePath) (transfer full): A #GList containing a #GtkTreePath for each selected row.
|
Fix the "selection_changed" signal to not get emitted twice in some cases.
2004-07-04 Anders Carlsson <andersca@gnome.org>
* configure.in:
* libegg/iconlist/eggiconlist.c: (egg_icon_list_expose),
(scroll_timeout), (egg_icon_list_motion),
(egg_icon_list_button_press), (egg_icon_list_update_rubberband),
(egg_icon_list_start_rubberbanding),
(egg_icon_list_stop_rubberbanding),
(egg_icon_list_unselect_all_internal),
(egg_icon_list_real_select_all),
(egg_icon_list_adjustment_changed), (egg_icon_list_item_free),
(egg_icon_list_select_item), (verify_items),
(egg_icon_list_row_changed), (egg_icon_list_row_inserted),
(egg_icon_list_row_deleted), (egg_icon_list_rows_reordered),
(egg_icon_list_select_all_between),
(egg_icon_list_move_cursor_up_down),
(egg_icon_list_move_cursor_page_up_down),
(egg_icon_list_move_cursor_left_right),
(egg_icon_list_move_cursor_start_end), (egg_icon_list_set_model),
(egg_icon_list_get_selected_items), (egg_icon_list_select_all),
(egg_icon_list_unselect_all):
* libegg/iconlist/eggiconlist.h:
* libegg/iconlist/testiconlist.c: (foreach_selected_remove):
Fix the "selection_changed" signal to not get emitted twice in some cases.
Also fix a bunch of issues reported by Jonathan.
2004-07-04 12:43:26 +00:00
|
|
|
*
|
|
|
|
* Since: 2.6
|
|
|
|
**/
|
|
|
|
GList *
|
2004-07-04 15:56:55 +00:00
|
|
|
gtk_icon_view_get_selected_items (GtkIconView *icon_view)
|
Fix the "selection_changed" signal to not get emitted twice in some cases.
2004-07-04 Anders Carlsson <andersca@gnome.org>
* configure.in:
* libegg/iconlist/eggiconlist.c: (egg_icon_list_expose),
(scroll_timeout), (egg_icon_list_motion),
(egg_icon_list_button_press), (egg_icon_list_update_rubberband),
(egg_icon_list_start_rubberbanding),
(egg_icon_list_stop_rubberbanding),
(egg_icon_list_unselect_all_internal),
(egg_icon_list_real_select_all),
(egg_icon_list_adjustment_changed), (egg_icon_list_item_free),
(egg_icon_list_select_item), (verify_items),
(egg_icon_list_row_changed), (egg_icon_list_row_inserted),
(egg_icon_list_row_deleted), (egg_icon_list_rows_reordered),
(egg_icon_list_select_all_between),
(egg_icon_list_move_cursor_up_down),
(egg_icon_list_move_cursor_page_up_down),
(egg_icon_list_move_cursor_left_right),
(egg_icon_list_move_cursor_start_end), (egg_icon_list_set_model),
(egg_icon_list_get_selected_items), (egg_icon_list_select_all),
(egg_icon_list_unselect_all):
* libegg/iconlist/eggiconlist.h:
* libegg/iconlist/testiconlist.c: (foreach_selected_remove):
Fix the "selection_changed" signal to not get emitted twice in some cases.
Also fix a bunch of issues reported by Jonathan.
2004-07-04 12:43:26 +00:00
|
|
|
{
|
|
|
|
GList *list;
|
|
|
|
GList *selected = NULL;
|
|
|
|
|
2004-07-04 15:56:55 +00:00
|
|
|
g_return_val_if_fail (GTK_IS_ICON_VIEW (icon_view), NULL);
|
Fix the "selection_changed" signal to not get emitted twice in some cases.
2004-07-04 Anders Carlsson <andersca@gnome.org>
* configure.in:
* libegg/iconlist/eggiconlist.c: (egg_icon_list_expose),
(scroll_timeout), (egg_icon_list_motion),
(egg_icon_list_button_press), (egg_icon_list_update_rubberband),
(egg_icon_list_start_rubberbanding),
(egg_icon_list_stop_rubberbanding),
(egg_icon_list_unselect_all_internal),
(egg_icon_list_real_select_all),
(egg_icon_list_adjustment_changed), (egg_icon_list_item_free),
(egg_icon_list_select_item), (verify_items),
(egg_icon_list_row_changed), (egg_icon_list_row_inserted),
(egg_icon_list_row_deleted), (egg_icon_list_rows_reordered),
(egg_icon_list_select_all_between),
(egg_icon_list_move_cursor_up_down),
(egg_icon_list_move_cursor_page_up_down),
(egg_icon_list_move_cursor_left_right),
(egg_icon_list_move_cursor_start_end), (egg_icon_list_set_model),
(egg_icon_list_get_selected_items), (egg_icon_list_select_all),
(egg_icon_list_unselect_all):
* libegg/iconlist/eggiconlist.h:
* libegg/iconlist/testiconlist.c: (foreach_selected_remove):
Fix the "selection_changed" signal to not get emitted twice in some cases.
Also fix a bunch of issues reported by Jonathan.
2004-07-04 12:43:26 +00:00
|
|
|
|
2004-07-04 15:56:55 +00:00
|
|
|
for (list = icon_view->priv->items; list != NULL; list = list->next)
|
Fix the "selection_changed" signal to not get emitted twice in some cases.
2004-07-04 Anders Carlsson <andersca@gnome.org>
* configure.in:
* libegg/iconlist/eggiconlist.c: (egg_icon_list_expose),
(scroll_timeout), (egg_icon_list_motion),
(egg_icon_list_button_press), (egg_icon_list_update_rubberband),
(egg_icon_list_start_rubberbanding),
(egg_icon_list_stop_rubberbanding),
(egg_icon_list_unselect_all_internal),
(egg_icon_list_real_select_all),
(egg_icon_list_adjustment_changed), (egg_icon_list_item_free),
(egg_icon_list_select_item), (verify_items),
(egg_icon_list_row_changed), (egg_icon_list_row_inserted),
(egg_icon_list_row_deleted), (egg_icon_list_rows_reordered),
(egg_icon_list_select_all_between),
(egg_icon_list_move_cursor_up_down),
(egg_icon_list_move_cursor_page_up_down),
(egg_icon_list_move_cursor_left_right),
(egg_icon_list_move_cursor_start_end), (egg_icon_list_set_model),
(egg_icon_list_get_selected_items), (egg_icon_list_select_all),
(egg_icon_list_unselect_all):
* libegg/iconlist/eggiconlist.h:
* libegg/iconlist/testiconlist.c: (foreach_selected_remove):
Fix the "selection_changed" signal to not get emitted twice in some cases.
Also fix a bunch of issues reported by Jonathan.
2004-07-04 12:43:26 +00:00
|
|
|
{
|
2004-07-04 15:56:55 +00:00
|
|
|
GtkIconViewItem *item = list->data;
|
Fix the "selection_changed" signal to not get emitted twice in some cases.
2004-07-04 Anders Carlsson <andersca@gnome.org>
* configure.in:
* libegg/iconlist/eggiconlist.c: (egg_icon_list_expose),
(scroll_timeout), (egg_icon_list_motion),
(egg_icon_list_button_press), (egg_icon_list_update_rubberband),
(egg_icon_list_start_rubberbanding),
(egg_icon_list_stop_rubberbanding),
(egg_icon_list_unselect_all_internal),
(egg_icon_list_real_select_all),
(egg_icon_list_adjustment_changed), (egg_icon_list_item_free),
(egg_icon_list_select_item), (verify_items),
(egg_icon_list_row_changed), (egg_icon_list_row_inserted),
(egg_icon_list_row_deleted), (egg_icon_list_rows_reordered),
(egg_icon_list_select_all_between),
(egg_icon_list_move_cursor_up_down),
(egg_icon_list_move_cursor_page_up_down),
(egg_icon_list_move_cursor_left_right),
(egg_icon_list_move_cursor_start_end), (egg_icon_list_set_model),
(egg_icon_list_get_selected_items), (egg_icon_list_select_all),
(egg_icon_list_unselect_all):
* libegg/iconlist/eggiconlist.h:
* libegg/iconlist/testiconlist.c: (foreach_selected_remove):
Fix the "selection_changed" signal to not get emitted twice in some cases.
Also fix a bunch of issues reported by Jonathan.
2004-07-04 12:43:26 +00:00
|
|
|
|
|
|
|
if (item->selected)
|
|
|
|
{
|
|
|
|
GtkTreePath *path = gtk_tree_path_new_from_indices (item->index, -1);
|
|
|
|
|
|
|
|
selected = g_list_prepend (selected, path);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return selected;
|
|
|
|
}
|
|
|
|
|
Document functions and fix a few bugs.
2004-07-03 Anders Carlsson <andersca@gnome.org>
* libegg/iconlist/eggiconlist.c: (egg_icon_list_add_move_binding),
(egg_icon_list_real_move_cursor), (egg_icon_list_new),
(egg_icon_list_new_with_model), (egg_icon_list_get_path_at_pos),
(egg_icon_list_selected_foreach),
(egg_icon_list_set_selection_mode),
(egg_icon_list_get_selection_mode), (egg_icon_list_set_model),
(egg_icon_list_get_model), (egg_icon_list_set_text_column),
(egg_icon_list_get_text_column), (egg_icon_list_set_markup_column),
(egg_icon_list_get_markup_column),
(egg_icon_list_set_pixbuf_column),
(egg_icon_list_get_pixbuf_column), (egg_icon_list_select_path),
(egg_icon_list_unselect_path), (egg_icon_list_select_all),
(egg_icon_list_unselect_all), (egg_icon_list_path_is_selected),
(egg_icon_list_item_activated):
* libegg/iconlist/eggiconlist.h:
* libegg/iconlist/testiconlist.c: (foreach_selected_remove_func),
(foreach_selected_remove), (selection_changed), (main):
Document functions and fix a few bugs.
2004-07-03 08:01:34 +00:00
|
|
|
/**
|
2004-07-04 15:56:55 +00:00
|
|
|
* gtk_icon_view_select_all:
|
|
|
|
* @icon_view: A #GtkIconView.
|
Document functions and fix a few bugs.
2004-07-03 Anders Carlsson <andersca@gnome.org>
* libegg/iconlist/eggiconlist.c: (egg_icon_list_add_move_binding),
(egg_icon_list_real_move_cursor), (egg_icon_list_new),
(egg_icon_list_new_with_model), (egg_icon_list_get_path_at_pos),
(egg_icon_list_selected_foreach),
(egg_icon_list_set_selection_mode),
(egg_icon_list_get_selection_mode), (egg_icon_list_set_model),
(egg_icon_list_get_model), (egg_icon_list_set_text_column),
(egg_icon_list_get_text_column), (egg_icon_list_set_markup_column),
(egg_icon_list_get_markup_column),
(egg_icon_list_set_pixbuf_column),
(egg_icon_list_get_pixbuf_column), (egg_icon_list_select_path),
(egg_icon_list_unselect_path), (egg_icon_list_select_all),
(egg_icon_list_unselect_all), (egg_icon_list_path_is_selected),
(egg_icon_list_item_activated):
* libegg/iconlist/eggiconlist.h:
* libegg/iconlist/testiconlist.c: (foreach_selected_remove_func),
(foreach_selected_remove), (selection_changed), (main):
Document functions and fix a few bugs.
2004-07-03 08:01:34 +00:00
|
|
|
*
|
2004-07-04 15:56:55 +00:00
|
|
|
* Selects all the icons. @icon_view must has its selection mode set
|
Document functions and fix a few bugs.
2004-07-03 Anders Carlsson <andersca@gnome.org>
* libegg/iconlist/eggiconlist.c: (egg_icon_list_add_move_binding),
(egg_icon_list_real_move_cursor), (egg_icon_list_new),
(egg_icon_list_new_with_model), (egg_icon_list_get_path_at_pos),
(egg_icon_list_selected_foreach),
(egg_icon_list_set_selection_mode),
(egg_icon_list_get_selection_mode), (egg_icon_list_set_model),
(egg_icon_list_get_model), (egg_icon_list_set_text_column),
(egg_icon_list_get_text_column), (egg_icon_list_set_markup_column),
(egg_icon_list_get_markup_column),
(egg_icon_list_set_pixbuf_column),
(egg_icon_list_get_pixbuf_column), (egg_icon_list_select_path),
(egg_icon_list_unselect_path), (egg_icon_list_select_all),
(egg_icon_list_unselect_all), (egg_icon_list_path_is_selected),
(egg_icon_list_item_activated):
* libegg/iconlist/eggiconlist.h:
* libegg/iconlist/testiconlist.c: (foreach_selected_remove_func),
(foreach_selected_remove), (selection_changed), (main):
Document functions and fix a few bugs.
2004-07-03 08:01:34 +00:00
|
|
|
* to #GTK_SELECTION_MULTIPLE.
|
2004-07-04 20:35:35 +00:00
|
|
|
*
|
|
|
|
* Since: 2.6
|
Document functions and fix a few bugs.
2004-07-03 Anders Carlsson <andersca@gnome.org>
* libegg/iconlist/eggiconlist.c: (egg_icon_list_add_move_binding),
(egg_icon_list_real_move_cursor), (egg_icon_list_new),
(egg_icon_list_new_with_model), (egg_icon_list_get_path_at_pos),
(egg_icon_list_selected_foreach),
(egg_icon_list_set_selection_mode),
(egg_icon_list_get_selection_mode), (egg_icon_list_set_model),
(egg_icon_list_get_model), (egg_icon_list_set_text_column),
(egg_icon_list_get_text_column), (egg_icon_list_set_markup_column),
(egg_icon_list_get_markup_column),
(egg_icon_list_set_pixbuf_column),
(egg_icon_list_get_pixbuf_column), (egg_icon_list_select_path),
(egg_icon_list_unselect_path), (egg_icon_list_select_all),
(egg_icon_list_unselect_all), (egg_icon_list_path_is_selected),
(egg_icon_list_item_activated):
* libegg/iconlist/eggiconlist.h:
* libegg/iconlist/testiconlist.c: (foreach_selected_remove_func),
(foreach_selected_remove), (selection_changed), (main):
Document functions and fix a few bugs.
2004-07-03 08:01:34 +00:00
|
|
|
**/
|
|
|
|
void
|
2004-07-04 15:56:55 +00:00
|
|
|
gtk_icon_view_select_all (GtkIconView *icon_view)
|
Document functions and fix a few bugs.
2004-07-03 Anders Carlsson <andersca@gnome.org>
* libegg/iconlist/eggiconlist.c: (egg_icon_list_add_move_binding),
(egg_icon_list_real_move_cursor), (egg_icon_list_new),
(egg_icon_list_new_with_model), (egg_icon_list_get_path_at_pos),
(egg_icon_list_selected_foreach),
(egg_icon_list_set_selection_mode),
(egg_icon_list_get_selection_mode), (egg_icon_list_set_model),
(egg_icon_list_get_model), (egg_icon_list_set_text_column),
(egg_icon_list_get_text_column), (egg_icon_list_set_markup_column),
(egg_icon_list_get_markup_column),
(egg_icon_list_set_pixbuf_column),
(egg_icon_list_get_pixbuf_column), (egg_icon_list_select_path),
(egg_icon_list_unselect_path), (egg_icon_list_select_all),
(egg_icon_list_unselect_all), (egg_icon_list_path_is_selected),
(egg_icon_list_item_activated):
* libegg/iconlist/eggiconlist.h:
* libegg/iconlist/testiconlist.c: (foreach_selected_remove_func),
(foreach_selected_remove), (selection_changed), (main):
Document functions and fix a few bugs.
2004-07-03 08:01:34 +00:00
|
|
|
{
|
|
|
|
GList *items;
|
|
|
|
gboolean dirty = FALSE;
|
|
|
|
|
2004-07-04 15:56:55 +00:00
|
|
|
g_return_if_fail (GTK_IS_ICON_VIEW (icon_view));
|
Document functions and fix a few bugs.
2004-07-03 Anders Carlsson <andersca@gnome.org>
* libegg/iconlist/eggiconlist.c: (egg_icon_list_add_move_binding),
(egg_icon_list_real_move_cursor), (egg_icon_list_new),
(egg_icon_list_new_with_model), (egg_icon_list_get_path_at_pos),
(egg_icon_list_selected_foreach),
(egg_icon_list_set_selection_mode),
(egg_icon_list_get_selection_mode), (egg_icon_list_set_model),
(egg_icon_list_get_model), (egg_icon_list_set_text_column),
(egg_icon_list_get_text_column), (egg_icon_list_set_markup_column),
(egg_icon_list_get_markup_column),
(egg_icon_list_set_pixbuf_column),
(egg_icon_list_get_pixbuf_column), (egg_icon_list_select_path),
(egg_icon_list_unselect_path), (egg_icon_list_select_all),
(egg_icon_list_unselect_all), (egg_icon_list_path_is_selected),
(egg_icon_list_item_activated):
* libegg/iconlist/eggiconlist.h:
* libegg/iconlist/testiconlist.c: (foreach_selected_remove_func),
(foreach_selected_remove), (selection_changed), (main):
Document functions and fix a few bugs.
2004-07-03 08:01:34 +00:00
|
|
|
|
2004-07-04 15:56:55 +00:00
|
|
|
if (icon_view->priv->selection_mode != GTK_SELECTION_MULTIPLE)
|
Fix the "selection_changed" signal to not get emitted twice in some cases.
2004-07-04 Anders Carlsson <andersca@gnome.org>
* configure.in:
* libegg/iconlist/eggiconlist.c: (egg_icon_list_expose),
(scroll_timeout), (egg_icon_list_motion),
(egg_icon_list_button_press), (egg_icon_list_update_rubberband),
(egg_icon_list_start_rubberbanding),
(egg_icon_list_stop_rubberbanding),
(egg_icon_list_unselect_all_internal),
(egg_icon_list_real_select_all),
(egg_icon_list_adjustment_changed), (egg_icon_list_item_free),
(egg_icon_list_select_item), (verify_items),
(egg_icon_list_row_changed), (egg_icon_list_row_inserted),
(egg_icon_list_row_deleted), (egg_icon_list_rows_reordered),
(egg_icon_list_select_all_between),
(egg_icon_list_move_cursor_up_down),
(egg_icon_list_move_cursor_page_up_down),
(egg_icon_list_move_cursor_left_right),
(egg_icon_list_move_cursor_start_end), (egg_icon_list_set_model),
(egg_icon_list_get_selected_items), (egg_icon_list_select_all),
(egg_icon_list_unselect_all):
* libegg/iconlist/eggiconlist.h:
* libegg/iconlist/testiconlist.c: (foreach_selected_remove):
Fix the "selection_changed" signal to not get emitted twice in some cases.
Also fix a bunch of issues reported by Jonathan.
2004-07-04 12:43:26 +00:00
|
|
|
return;
|
|
|
|
|
2004-07-04 15:56:55 +00:00
|
|
|
for (items = icon_view->priv->items; items; items = items->next)
|
Document functions and fix a few bugs.
2004-07-03 Anders Carlsson <andersca@gnome.org>
* libegg/iconlist/eggiconlist.c: (egg_icon_list_add_move_binding),
(egg_icon_list_real_move_cursor), (egg_icon_list_new),
(egg_icon_list_new_with_model), (egg_icon_list_get_path_at_pos),
(egg_icon_list_selected_foreach),
(egg_icon_list_set_selection_mode),
(egg_icon_list_get_selection_mode), (egg_icon_list_set_model),
(egg_icon_list_get_model), (egg_icon_list_set_text_column),
(egg_icon_list_get_text_column), (egg_icon_list_set_markup_column),
(egg_icon_list_get_markup_column),
(egg_icon_list_set_pixbuf_column),
(egg_icon_list_get_pixbuf_column), (egg_icon_list_select_path),
(egg_icon_list_unselect_path), (egg_icon_list_select_all),
(egg_icon_list_unselect_all), (egg_icon_list_path_is_selected),
(egg_icon_list_item_activated):
* libegg/iconlist/eggiconlist.h:
* libegg/iconlist/testiconlist.c: (foreach_selected_remove_func),
(foreach_selected_remove), (selection_changed), (main):
Document functions and fix a few bugs.
2004-07-03 08:01:34 +00:00
|
|
|
{
|
2004-07-04 15:56:55 +00:00
|
|
|
GtkIconViewItem *item = items->data;
|
Document functions and fix a few bugs.
2004-07-03 Anders Carlsson <andersca@gnome.org>
* libegg/iconlist/eggiconlist.c: (egg_icon_list_add_move_binding),
(egg_icon_list_real_move_cursor), (egg_icon_list_new),
(egg_icon_list_new_with_model), (egg_icon_list_get_path_at_pos),
(egg_icon_list_selected_foreach),
(egg_icon_list_set_selection_mode),
(egg_icon_list_get_selection_mode), (egg_icon_list_set_model),
(egg_icon_list_get_model), (egg_icon_list_set_text_column),
(egg_icon_list_get_text_column), (egg_icon_list_set_markup_column),
(egg_icon_list_get_markup_column),
(egg_icon_list_set_pixbuf_column),
(egg_icon_list_get_pixbuf_column), (egg_icon_list_select_path),
(egg_icon_list_unselect_path), (egg_icon_list_select_all),
(egg_icon_list_unselect_all), (egg_icon_list_path_is_selected),
(egg_icon_list_item_activated):
* libegg/iconlist/eggiconlist.h:
* libegg/iconlist/testiconlist.c: (foreach_selected_remove_func),
(foreach_selected_remove), (selection_changed), (main):
Document functions and fix a few bugs.
2004-07-03 08:01:34 +00:00
|
|
|
|
|
|
|
if (!item->selected)
|
|
|
|
{
|
|
|
|
dirty = TRUE;
|
|
|
|
item->selected = TRUE;
|
2004-07-04 15:56:55 +00:00
|
|
|
gtk_icon_view_queue_draw_item (icon_view, item);
|
Document functions and fix a few bugs.
2004-07-03 Anders Carlsson <andersca@gnome.org>
* libegg/iconlist/eggiconlist.c: (egg_icon_list_add_move_binding),
(egg_icon_list_real_move_cursor), (egg_icon_list_new),
(egg_icon_list_new_with_model), (egg_icon_list_get_path_at_pos),
(egg_icon_list_selected_foreach),
(egg_icon_list_set_selection_mode),
(egg_icon_list_get_selection_mode), (egg_icon_list_set_model),
(egg_icon_list_get_model), (egg_icon_list_set_text_column),
(egg_icon_list_get_text_column), (egg_icon_list_set_markup_column),
(egg_icon_list_get_markup_column),
(egg_icon_list_set_pixbuf_column),
(egg_icon_list_get_pixbuf_column), (egg_icon_list_select_path),
(egg_icon_list_unselect_path), (egg_icon_list_select_all),
(egg_icon_list_unselect_all), (egg_icon_list_path_is_selected),
(egg_icon_list_item_activated):
* libegg/iconlist/eggiconlist.h:
* libegg/iconlist/testiconlist.c: (foreach_selected_remove_func),
(foreach_selected_remove), (selection_changed), (main):
Document functions and fix a few bugs.
2004-07-03 08:01:34 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (dirty)
|
2004-07-04 15:56:55 +00:00
|
|
|
g_signal_emit (icon_view, icon_view_signals[SELECTION_CHANGED], 0);
|
Document functions and fix a few bugs.
2004-07-03 Anders Carlsson <andersca@gnome.org>
* libegg/iconlist/eggiconlist.c: (egg_icon_list_add_move_binding),
(egg_icon_list_real_move_cursor), (egg_icon_list_new),
(egg_icon_list_new_with_model), (egg_icon_list_get_path_at_pos),
(egg_icon_list_selected_foreach),
(egg_icon_list_set_selection_mode),
(egg_icon_list_get_selection_mode), (egg_icon_list_set_model),
(egg_icon_list_get_model), (egg_icon_list_set_text_column),
(egg_icon_list_get_text_column), (egg_icon_list_set_markup_column),
(egg_icon_list_get_markup_column),
(egg_icon_list_set_pixbuf_column),
(egg_icon_list_get_pixbuf_column), (egg_icon_list_select_path),
(egg_icon_list_unselect_path), (egg_icon_list_select_all),
(egg_icon_list_unselect_all), (egg_icon_list_path_is_selected),
(egg_icon_list_item_activated):
* libegg/iconlist/eggiconlist.h:
* libegg/iconlist/testiconlist.c: (foreach_selected_remove_func),
(foreach_selected_remove), (selection_changed), (main):
Document functions and fix a few bugs.
2004-07-03 08:01:34 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2004-07-04 15:56:55 +00:00
|
|
|
* gtk_icon_view_unselect_all:
|
|
|
|
* @icon_view: A #GtkIconView.
|
Document functions and fix a few bugs.
2004-07-03 Anders Carlsson <andersca@gnome.org>
* libegg/iconlist/eggiconlist.c: (egg_icon_list_add_move_binding),
(egg_icon_list_real_move_cursor), (egg_icon_list_new),
(egg_icon_list_new_with_model), (egg_icon_list_get_path_at_pos),
(egg_icon_list_selected_foreach),
(egg_icon_list_set_selection_mode),
(egg_icon_list_get_selection_mode), (egg_icon_list_set_model),
(egg_icon_list_get_model), (egg_icon_list_set_text_column),
(egg_icon_list_get_text_column), (egg_icon_list_set_markup_column),
(egg_icon_list_get_markup_column),
(egg_icon_list_set_pixbuf_column),
(egg_icon_list_get_pixbuf_column), (egg_icon_list_select_path),
(egg_icon_list_unselect_path), (egg_icon_list_select_all),
(egg_icon_list_unselect_all), (egg_icon_list_path_is_selected),
(egg_icon_list_item_activated):
* libegg/iconlist/eggiconlist.h:
* libegg/iconlist/testiconlist.c: (foreach_selected_remove_func),
(foreach_selected_remove), (selection_changed), (main):
Document functions and fix a few bugs.
2004-07-03 08:01:34 +00:00
|
|
|
*
|
|
|
|
* Unselects all the icons.
|
2004-07-04 20:35:35 +00:00
|
|
|
*
|
|
|
|
* Since: 2.6
|
Document functions and fix a few bugs.
2004-07-03 Anders Carlsson <andersca@gnome.org>
* libegg/iconlist/eggiconlist.c: (egg_icon_list_add_move_binding),
(egg_icon_list_real_move_cursor), (egg_icon_list_new),
(egg_icon_list_new_with_model), (egg_icon_list_get_path_at_pos),
(egg_icon_list_selected_foreach),
(egg_icon_list_set_selection_mode),
(egg_icon_list_get_selection_mode), (egg_icon_list_set_model),
(egg_icon_list_get_model), (egg_icon_list_set_text_column),
(egg_icon_list_get_text_column), (egg_icon_list_set_markup_column),
(egg_icon_list_get_markup_column),
(egg_icon_list_set_pixbuf_column),
(egg_icon_list_get_pixbuf_column), (egg_icon_list_select_path),
(egg_icon_list_unselect_path), (egg_icon_list_select_all),
(egg_icon_list_unselect_all), (egg_icon_list_path_is_selected),
(egg_icon_list_item_activated):
* libegg/iconlist/eggiconlist.h:
* libegg/iconlist/testiconlist.c: (foreach_selected_remove_func),
(foreach_selected_remove), (selection_changed), (main):
Document functions and fix a few bugs.
2004-07-03 08:01:34 +00:00
|
|
|
**/
|
|
|
|
void
|
2004-07-04 15:56:55 +00:00
|
|
|
gtk_icon_view_unselect_all (GtkIconView *icon_view)
|
Document functions and fix a few bugs.
2004-07-03 Anders Carlsson <andersca@gnome.org>
* libegg/iconlist/eggiconlist.c: (egg_icon_list_add_move_binding),
(egg_icon_list_real_move_cursor), (egg_icon_list_new),
(egg_icon_list_new_with_model), (egg_icon_list_get_path_at_pos),
(egg_icon_list_selected_foreach),
(egg_icon_list_set_selection_mode),
(egg_icon_list_get_selection_mode), (egg_icon_list_set_model),
(egg_icon_list_get_model), (egg_icon_list_set_text_column),
(egg_icon_list_get_text_column), (egg_icon_list_set_markup_column),
(egg_icon_list_get_markup_column),
(egg_icon_list_set_pixbuf_column),
(egg_icon_list_get_pixbuf_column), (egg_icon_list_select_path),
(egg_icon_list_unselect_path), (egg_icon_list_select_all),
(egg_icon_list_unselect_all), (egg_icon_list_path_is_selected),
(egg_icon_list_item_activated):
* libegg/iconlist/eggiconlist.h:
* libegg/iconlist/testiconlist.c: (foreach_selected_remove_func),
(foreach_selected_remove), (selection_changed), (main):
Document functions and fix a few bugs.
2004-07-03 08:01:34 +00:00
|
|
|
{
|
Fix the "selection_changed" signal to not get emitted twice in some cases.
2004-07-04 Anders Carlsson <andersca@gnome.org>
* configure.in:
* libegg/iconlist/eggiconlist.c: (egg_icon_list_expose),
(scroll_timeout), (egg_icon_list_motion),
(egg_icon_list_button_press), (egg_icon_list_update_rubberband),
(egg_icon_list_start_rubberbanding),
(egg_icon_list_stop_rubberbanding),
(egg_icon_list_unselect_all_internal),
(egg_icon_list_real_select_all),
(egg_icon_list_adjustment_changed), (egg_icon_list_item_free),
(egg_icon_list_select_item), (verify_items),
(egg_icon_list_row_changed), (egg_icon_list_row_inserted),
(egg_icon_list_row_deleted), (egg_icon_list_rows_reordered),
(egg_icon_list_select_all_between),
(egg_icon_list_move_cursor_up_down),
(egg_icon_list_move_cursor_page_up_down),
(egg_icon_list_move_cursor_left_right),
(egg_icon_list_move_cursor_start_end), (egg_icon_list_set_model),
(egg_icon_list_get_selected_items), (egg_icon_list_select_all),
(egg_icon_list_unselect_all):
* libegg/iconlist/eggiconlist.h:
* libegg/iconlist/testiconlist.c: (foreach_selected_remove):
Fix the "selection_changed" signal to not get emitted twice in some cases.
Also fix a bunch of issues reported by Jonathan.
2004-07-04 12:43:26 +00:00
|
|
|
gboolean dirty = FALSE;
|
|
|
|
|
2004-07-04 15:56:55 +00:00
|
|
|
g_return_if_fail (GTK_IS_ICON_VIEW (icon_view));
|
Document functions and fix a few bugs.
2004-07-03 Anders Carlsson <andersca@gnome.org>
* libegg/iconlist/eggiconlist.c: (egg_icon_list_add_move_binding),
(egg_icon_list_real_move_cursor), (egg_icon_list_new),
(egg_icon_list_new_with_model), (egg_icon_list_get_path_at_pos),
(egg_icon_list_selected_foreach),
(egg_icon_list_set_selection_mode),
(egg_icon_list_get_selection_mode), (egg_icon_list_set_model),
(egg_icon_list_get_model), (egg_icon_list_set_text_column),
(egg_icon_list_get_text_column), (egg_icon_list_set_markup_column),
(egg_icon_list_get_markup_column),
(egg_icon_list_set_pixbuf_column),
(egg_icon_list_get_pixbuf_column), (egg_icon_list_select_path),
(egg_icon_list_unselect_path), (egg_icon_list_select_all),
(egg_icon_list_unselect_all), (egg_icon_list_path_is_selected),
(egg_icon_list_item_activated):
* libegg/iconlist/eggiconlist.h:
* libegg/iconlist/testiconlist.c: (foreach_selected_remove_func),
(foreach_selected_remove), (selection_changed), (main):
Document functions and fix a few bugs.
2004-07-03 08:01:34 +00:00
|
|
|
|
2004-08-04 20:32:26 +00:00
|
|
|
if (icon_view->priv->selection_mode == GTK_SELECTION_BROWSE)
|
|
|
|
return;
|
|
|
|
|
2004-07-04 15:56:55 +00:00
|
|
|
dirty = gtk_icon_view_unselect_all_internal (icon_view);
|
Fix the "selection_changed" signal to not get emitted twice in some cases.
2004-07-04 Anders Carlsson <andersca@gnome.org>
* configure.in:
* libegg/iconlist/eggiconlist.c: (egg_icon_list_expose),
(scroll_timeout), (egg_icon_list_motion),
(egg_icon_list_button_press), (egg_icon_list_update_rubberband),
(egg_icon_list_start_rubberbanding),
(egg_icon_list_stop_rubberbanding),
(egg_icon_list_unselect_all_internal),
(egg_icon_list_real_select_all),
(egg_icon_list_adjustment_changed), (egg_icon_list_item_free),
(egg_icon_list_select_item), (verify_items),
(egg_icon_list_row_changed), (egg_icon_list_row_inserted),
(egg_icon_list_row_deleted), (egg_icon_list_rows_reordered),
(egg_icon_list_select_all_between),
(egg_icon_list_move_cursor_up_down),
(egg_icon_list_move_cursor_page_up_down),
(egg_icon_list_move_cursor_left_right),
(egg_icon_list_move_cursor_start_end), (egg_icon_list_set_model),
(egg_icon_list_get_selected_items), (egg_icon_list_select_all),
(egg_icon_list_unselect_all):
* libegg/iconlist/eggiconlist.h:
* libegg/iconlist/testiconlist.c: (foreach_selected_remove):
Fix the "selection_changed" signal to not get emitted twice in some cases.
Also fix a bunch of issues reported by Jonathan.
2004-07-04 12:43:26 +00:00
|
|
|
|
|
|
|
if (dirty)
|
2004-07-04 15:56:55 +00:00
|
|
|
g_signal_emit (icon_view, icon_view_signals[SELECTION_CHANGED], 0);
|
Document functions and fix a few bugs.
2004-07-03 Anders Carlsson <andersca@gnome.org>
* libegg/iconlist/eggiconlist.c: (egg_icon_list_add_move_binding),
(egg_icon_list_real_move_cursor), (egg_icon_list_new),
(egg_icon_list_new_with_model), (egg_icon_list_get_path_at_pos),
(egg_icon_list_selected_foreach),
(egg_icon_list_set_selection_mode),
(egg_icon_list_get_selection_mode), (egg_icon_list_set_model),
(egg_icon_list_get_model), (egg_icon_list_set_text_column),
(egg_icon_list_get_text_column), (egg_icon_list_set_markup_column),
(egg_icon_list_get_markup_column),
(egg_icon_list_set_pixbuf_column),
(egg_icon_list_get_pixbuf_column), (egg_icon_list_select_path),
(egg_icon_list_unselect_path), (egg_icon_list_select_all),
(egg_icon_list_unselect_all), (egg_icon_list_path_is_selected),
(egg_icon_list_item_activated):
* libegg/iconlist/eggiconlist.h:
* libegg/iconlist/testiconlist.c: (foreach_selected_remove_func),
(foreach_selected_remove), (selection_changed), (main):
Document functions and fix a few bugs.
2004-07-03 08:01:34 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2004-07-04 15:56:55 +00:00
|
|
|
* gtk_icon_view_path_is_selected:
|
|
|
|
* @icon_view: A #GtkIconView.
|
Document functions and fix a few bugs.
2004-07-03 Anders Carlsson <andersca@gnome.org>
* libegg/iconlist/eggiconlist.c: (egg_icon_list_add_move_binding),
(egg_icon_list_real_move_cursor), (egg_icon_list_new),
(egg_icon_list_new_with_model), (egg_icon_list_get_path_at_pos),
(egg_icon_list_selected_foreach),
(egg_icon_list_set_selection_mode),
(egg_icon_list_get_selection_mode), (egg_icon_list_set_model),
(egg_icon_list_get_model), (egg_icon_list_set_text_column),
(egg_icon_list_get_text_column), (egg_icon_list_set_markup_column),
(egg_icon_list_get_markup_column),
(egg_icon_list_set_pixbuf_column),
(egg_icon_list_get_pixbuf_column), (egg_icon_list_select_path),
(egg_icon_list_unselect_path), (egg_icon_list_select_all),
(egg_icon_list_unselect_all), (egg_icon_list_path_is_selected),
(egg_icon_list_item_activated):
* libegg/iconlist/eggiconlist.h:
* libegg/iconlist/testiconlist.c: (foreach_selected_remove_func),
(foreach_selected_remove), (selection_changed), (main):
Document functions and fix a few bugs.
2004-07-03 08:01:34 +00:00
|
|
|
* @path: A #GtkTreePath to check selection on.
|
|
|
|
*
|
|
|
|
* Returns %TRUE if the icon pointed to by @path is currently
|
2006-12-14 12:28:31 +00:00
|
|
|
* selected. If @path does not point to a valid location, %FALSE is returned.
|
Document functions and fix a few bugs.
2004-07-03 Anders Carlsson <andersca@gnome.org>
* libegg/iconlist/eggiconlist.c: (egg_icon_list_add_move_binding),
(egg_icon_list_real_move_cursor), (egg_icon_list_new),
(egg_icon_list_new_with_model), (egg_icon_list_get_path_at_pos),
(egg_icon_list_selected_foreach),
(egg_icon_list_set_selection_mode),
(egg_icon_list_get_selection_mode), (egg_icon_list_set_model),
(egg_icon_list_get_model), (egg_icon_list_set_text_column),
(egg_icon_list_get_text_column), (egg_icon_list_set_markup_column),
(egg_icon_list_get_markup_column),
(egg_icon_list_set_pixbuf_column),
(egg_icon_list_get_pixbuf_column), (egg_icon_list_select_path),
(egg_icon_list_unselect_path), (egg_icon_list_select_all),
(egg_icon_list_unselect_all), (egg_icon_list_path_is_selected),
(egg_icon_list_item_activated):
* libegg/iconlist/eggiconlist.h:
* libegg/iconlist/testiconlist.c: (foreach_selected_remove_func),
(foreach_selected_remove), (selection_changed), (main):
Document functions and fix a few bugs.
2004-07-03 08:01:34 +00:00
|
|
|
*
|
|
|
|
* Return value: %TRUE if @path is selected.
|
2004-07-04 20:35:35 +00:00
|
|
|
*
|
|
|
|
* Since: 2.6
|
Document functions and fix a few bugs.
2004-07-03 Anders Carlsson <andersca@gnome.org>
* libegg/iconlist/eggiconlist.c: (egg_icon_list_add_move_binding),
(egg_icon_list_real_move_cursor), (egg_icon_list_new),
(egg_icon_list_new_with_model), (egg_icon_list_get_path_at_pos),
(egg_icon_list_selected_foreach),
(egg_icon_list_set_selection_mode),
(egg_icon_list_get_selection_mode), (egg_icon_list_set_model),
(egg_icon_list_get_model), (egg_icon_list_set_text_column),
(egg_icon_list_get_text_column), (egg_icon_list_set_markup_column),
(egg_icon_list_get_markup_column),
(egg_icon_list_set_pixbuf_column),
(egg_icon_list_get_pixbuf_column), (egg_icon_list_select_path),
(egg_icon_list_unselect_path), (egg_icon_list_select_all),
(egg_icon_list_unselect_all), (egg_icon_list_path_is_selected),
(egg_icon_list_item_activated):
* libegg/iconlist/eggiconlist.h:
* libegg/iconlist/testiconlist.c: (foreach_selected_remove_func),
(foreach_selected_remove), (selection_changed), (main):
Document functions and fix a few bugs.
2004-07-03 08:01:34 +00:00
|
|
|
**/
|
|
|
|
gboolean
|
2004-07-04 15:56:55 +00:00
|
|
|
gtk_icon_view_path_is_selected (GtkIconView *icon_view,
|
Document functions and fix a few bugs.
2004-07-03 Anders Carlsson <andersca@gnome.org>
* libegg/iconlist/eggiconlist.c: (egg_icon_list_add_move_binding),
(egg_icon_list_real_move_cursor), (egg_icon_list_new),
(egg_icon_list_new_with_model), (egg_icon_list_get_path_at_pos),
(egg_icon_list_selected_foreach),
(egg_icon_list_set_selection_mode),
(egg_icon_list_get_selection_mode), (egg_icon_list_set_model),
(egg_icon_list_get_model), (egg_icon_list_set_text_column),
(egg_icon_list_get_text_column), (egg_icon_list_set_markup_column),
(egg_icon_list_get_markup_column),
(egg_icon_list_set_pixbuf_column),
(egg_icon_list_get_pixbuf_column), (egg_icon_list_select_path),
(egg_icon_list_unselect_path), (egg_icon_list_select_all),
(egg_icon_list_unselect_all), (egg_icon_list_path_is_selected),
(egg_icon_list_item_activated):
* libegg/iconlist/eggiconlist.h:
* libegg/iconlist/testiconlist.c: (foreach_selected_remove_func),
(foreach_selected_remove), (selection_changed), (main):
Document functions and fix a few bugs.
2004-07-03 08:01:34 +00:00
|
|
|
GtkTreePath *path)
|
|
|
|
{
|
2004-07-04 15:56:55 +00:00
|
|
|
GtkIconViewItem *item;
|
Document functions and fix a few bugs.
2004-07-03 Anders Carlsson <andersca@gnome.org>
* libegg/iconlist/eggiconlist.c: (egg_icon_list_add_move_binding),
(egg_icon_list_real_move_cursor), (egg_icon_list_new),
(egg_icon_list_new_with_model), (egg_icon_list_get_path_at_pos),
(egg_icon_list_selected_foreach),
(egg_icon_list_set_selection_mode),
(egg_icon_list_get_selection_mode), (egg_icon_list_set_model),
(egg_icon_list_get_model), (egg_icon_list_set_text_column),
(egg_icon_list_get_text_column), (egg_icon_list_set_markup_column),
(egg_icon_list_get_markup_column),
(egg_icon_list_set_pixbuf_column),
(egg_icon_list_get_pixbuf_column), (egg_icon_list_select_path),
(egg_icon_list_unselect_path), (egg_icon_list_select_all),
(egg_icon_list_unselect_all), (egg_icon_list_path_is_selected),
(egg_icon_list_item_activated):
* libegg/iconlist/eggiconlist.h:
* libegg/iconlist/testiconlist.c: (foreach_selected_remove_func),
(foreach_selected_remove), (selection_changed), (main):
Document functions and fix a few bugs.
2004-07-03 08:01:34 +00:00
|
|
|
|
2004-07-04 15:56:55 +00:00
|
|
|
g_return_val_if_fail (GTK_IS_ICON_VIEW (icon_view), FALSE);
|
|
|
|
g_return_val_if_fail (icon_view->priv->model != NULL, FALSE);
|
Document functions and fix a few bugs.
2004-07-03 Anders Carlsson <andersca@gnome.org>
* libegg/iconlist/eggiconlist.c: (egg_icon_list_add_move_binding),
(egg_icon_list_real_move_cursor), (egg_icon_list_new),
(egg_icon_list_new_with_model), (egg_icon_list_get_path_at_pos),
(egg_icon_list_selected_foreach),
(egg_icon_list_set_selection_mode),
(egg_icon_list_get_selection_mode), (egg_icon_list_set_model),
(egg_icon_list_get_model), (egg_icon_list_set_text_column),
(egg_icon_list_get_text_column), (egg_icon_list_set_markup_column),
(egg_icon_list_get_markup_column),
(egg_icon_list_set_pixbuf_column),
(egg_icon_list_get_pixbuf_column), (egg_icon_list_select_path),
(egg_icon_list_unselect_path), (egg_icon_list_select_all),
(egg_icon_list_unselect_all), (egg_icon_list_path_is_selected),
(egg_icon_list_item_activated):
* libegg/iconlist/eggiconlist.h:
* libegg/iconlist/testiconlist.c: (foreach_selected_remove_func),
(foreach_selected_remove), (selection_changed), (main):
Document functions and fix a few bugs.
2004-07-03 08:01:34 +00:00
|
|
|
g_return_val_if_fail (path != NULL, FALSE);
|
|
|
|
|
2005-09-19 18:36:04 +00:00
|
|
|
item = g_list_nth_data (icon_view->priv->items,
|
2010-06-28 18:15:10 +00:00
|
|
|
gtk_tree_path_get_indices(path)[0]);
|
Document functions and fix a few bugs.
2004-07-03 Anders Carlsson <andersca@gnome.org>
* libegg/iconlist/eggiconlist.c: (egg_icon_list_add_move_binding),
(egg_icon_list_real_move_cursor), (egg_icon_list_new),
(egg_icon_list_new_with_model), (egg_icon_list_get_path_at_pos),
(egg_icon_list_selected_foreach),
(egg_icon_list_set_selection_mode),
(egg_icon_list_get_selection_mode), (egg_icon_list_set_model),
(egg_icon_list_get_model), (egg_icon_list_set_text_column),
(egg_icon_list_get_text_column), (egg_icon_list_set_markup_column),
(egg_icon_list_get_markup_column),
(egg_icon_list_set_pixbuf_column),
(egg_icon_list_get_pixbuf_column), (egg_icon_list_select_path),
(egg_icon_list_unselect_path), (egg_icon_list_select_all),
(egg_icon_list_unselect_all), (egg_icon_list_path_is_selected),
(egg_icon_list_item_activated):
* libegg/iconlist/eggiconlist.h:
* libegg/iconlist/testiconlist.c: (foreach_selected_remove_func),
(foreach_selected_remove), (selection_changed), (main):
Document functions and fix a few bugs.
2004-07-03 08:01:34 +00:00
|
|
|
|
|
|
|
if (!item)
|
|
|
|
return FALSE;
|
|
|
|
|
|
|
|
return item->selected;
|
|
|
|
}
|
|
|
|
|
2010-05-30 06:15:40 +00:00
|
|
|
/**
|
|
|
|
* gtk_icon_view_get_item_row:
|
|
|
|
* @icon_view: a #GtkIconView
|
|
|
|
* @path: the #GtkTreePath of the item
|
|
|
|
*
|
|
|
|
* Gets the row in which the item @path is currently
|
|
|
|
* displayed. Row numbers start at 0.
|
|
|
|
*
|
|
|
|
* Returns: The row in which the item is displayed
|
|
|
|
*
|
|
|
|
* Since: 2.22
|
|
|
|
*/
|
|
|
|
gint
|
|
|
|
gtk_icon_view_get_item_row (GtkIconView *icon_view,
|
|
|
|
GtkTreePath *path)
|
|
|
|
{
|
|
|
|
GtkIconViewItem *item;
|
|
|
|
|
2010-09-19 05:58:46 +00:00
|
|
|
g_return_val_if_fail (GTK_IS_ICON_VIEW (icon_view), -1);
|
|
|
|
g_return_val_if_fail (icon_view->priv->model != NULL, -1);
|
|
|
|
g_return_val_if_fail (path != NULL, -1);
|
2010-05-30 06:15:40 +00:00
|
|
|
|
|
|
|
item = g_list_nth_data (icon_view->priv->items,
|
2010-06-28 18:15:10 +00:00
|
|
|
gtk_tree_path_get_indices(path)[0]);
|
2010-05-30 06:15:40 +00:00
|
|
|
|
|
|
|
if (!item)
|
|
|
|
return -1;
|
|
|
|
|
|
|
|
return item->row;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* gtk_icon_view_get_item_column:
|
|
|
|
* @icon_view: a #GtkIconView
|
|
|
|
* @path: the #GtkTreePath of the item
|
|
|
|
*
|
|
|
|
* Gets the column in which the item @path is currently
|
|
|
|
* displayed. Column numbers start at 0.
|
|
|
|
*
|
|
|
|
* Returns: The column in which the item is displayed
|
|
|
|
*
|
|
|
|
* Since: 2.22
|
|
|
|
*/
|
|
|
|
gint
|
|
|
|
gtk_icon_view_get_item_column (GtkIconView *icon_view,
|
|
|
|
GtkTreePath *path)
|
|
|
|
{
|
|
|
|
GtkIconViewItem *item;
|
|
|
|
|
2010-09-19 05:58:46 +00:00
|
|
|
g_return_val_if_fail (GTK_IS_ICON_VIEW (icon_view), -1);
|
|
|
|
g_return_val_if_fail (icon_view->priv->model != NULL, -1);
|
|
|
|
g_return_val_if_fail (path != NULL, -1);
|
2010-05-30 06:15:40 +00:00
|
|
|
|
|
|
|
item = g_list_nth_data (icon_view->priv->items,
|
2010-06-28 18:15:10 +00:00
|
|
|
gtk_tree_path_get_indices(path)[0]);
|
2010-05-30 06:15:40 +00:00
|
|
|
|
|
|
|
if (!item)
|
|
|
|
return -1;
|
|
|
|
|
|
|
|
return item->col;
|
|
|
|
}
|
|
|
|
|
Document functions and fix a few bugs.
2004-07-03 Anders Carlsson <andersca@gnome.org>
* libegg/iconlist/eggiconlist.c: (egg_icon_list_add_move_binding),
(egg_icon_list_real_move_cursor), (egg_icon_list_new),
(egg_icon_list_new_with_model), (egg_icon_list_get_path_at_pos),
(egg_icon_list_selected_foreach),
(egg_icon_list_set_selection_mode),
(egg_icon_list_get_selection_mode), (egg_icon_list_set_model),
(egg_icon_list_get_model), (egg_icon_list_set_text_column),
(egg_icon_list_get_text_column), (egg_icon_list_set_markup_column),
(egg_icon_list_get_markup_column),
(egg_icon_list_set_pixbuf_column),
(egg_icon_list_get_pixbuf_column), (egg_icon_list_select_path),
(egg_icon_list_unselect_path), (egg_icon_list_select_all),
(egg_icon_list_unselect_all), (egg_icon_list_path_is_selected),
(egg_icon_list_item_activated):
* libegg/iconlist/eggiconlist.h:
* libegg/iconlist/testiconlist.c: (foreach_selected_remove_func),
(foreach_selected_remove), (selection_changed), (main):
Document functions and fix a few bugs.
2004-07-03 08:01:34 +00:00
|
|
|
/**
|
2004-07-04 15:56:55 +00:00
|
|
|
* gtk_icon_view_item_activated:
|
|
|
|
* @icon_view: A #GtkIconView
|
Document functions and fix a few bugs.
2004-07-03 Anders Carlsson <andersca@gnome.org>
* libegg/iconlist/eggiconlist.c: (egg_icon_list_add_move_binding),
(egg_icon_list_real_move_cursor), (egg_icon_list_new),
(egg_icon_list_new_with_model), (egg_icon_list_get_path_at_pos),
(egg_icon_list_selected_foreach),
(egg_icon_list_set_selection_mode),
(egg_icon_list_get_selection_mode), (egg_icon_list_set_model),
(egg_icon_list_get_model), (egg_icon_list_set_text_column),
(egg_icon_list_get_text_column), (egg_icon_list_set_markup_column),
(egg_icon_list_get_markup_column),
(egg_icon_list_set_pixbuf_column),
(egg_icon_list_get_pixbuf_column), (egg_icon_list_select_path),
(egg_icon_list_unselect_path), (egg_icon_list_select_all),
(egg_icon_list_unselect_all), (egg_icon_list_path_is_selected),
(egg_icon_list_item_activated):
* libegg/iconlist/eggiconlist.h:
* libegg/iconlist/testiconlist.c: (foreach_selected_remove_func),
(foreach_selected_remove), (selection_changed), (main):
Document functions and fix a few bugs.
2004-07-03 08:01:34 +00:00
|
|
|
* @path: The #GtkTreePath to be activated
|
|
|
|
*
|
|
|
|
* Activates the item determined by @path.
|
2004-07-04 20:35:35 +00:00
|
|
|
*
|
|
|
|
* Since: 2.6
|
Document functions and fix a few bugs.
2004-07-03 Anders Carlsson <andersca@gnome.org>
* libegg/iconlist/eggiconlist.c: (egg_icon_list_add_move_binding),
(egg_icon_list_real_move_cursor), (egg_icon_list_new),
(egg_icon_list_new_with_model), (egg_icon_list_get_path_at_pos),
(egg_icon_list_selected_foreach),
(egg_icon_list_set_selection_mode),
(egg_icon_list_get_selection_mode), (egg_icon_list_set_model),
(egg_icon_list_get_model), (egg_icon_list_set_text_column),
(egg_icon_list_get_text_column), (egg_icon_list_set_markup_column),
(egg_icon_list_get_markup_column),
(egg_icon_list_set_pixbuf_column),
(egg_icon_list_get_pixbuf_column), (egg_icon_list_select_path),
(egg_icon_list_unselect_path), (egg_icon_list_select_all),
(egg_icon_list_unselect_all), (egg_icon_list_path_is_selected),
(egg_icon_list_item_activated):
* libegg/iconlist/eggiconlist.h:
* libegg/iconlist/testiconlist.c: (foreach_selected_remove_func),
(foreach_selected_remove), (selection_changed), (main):
Document functions and fix a few bugs.
2004-07-03 08:01:34 +00:00
|
|
|
**/
|
|
|
|
void
|
2004-07-04 15:56:55 +00:00
|
|
|
gtk_icon_view_item_activated (GtkIconView *icon_view,
|
Document functions and fix a few bugs.
2004-07-03 Anders Carlsson <andersca@gnome.org>
* libegg/iconlist/eggiconlist.c: (egg_icon_list_add_move_binding),
(egg_icon_list_real_move_cursor), (egg_icon_list_new),
(egg_icon_list_new_with_model), (egg_icon_list_get_path_at_pos),
(egg_icon_list_selected_foreach),
(egg_icon_list_set_selection_mode),
(egg_icon_list_get_selection_mode), (egg_icon_list_set_model),
(egg_icon_list_get_model), (egg_icon_list_set_text_column),
(egg_icon_list_get_text_column), (egg_icon_list_set_markup_column),
(egg_icon_list_get_markup_column),
(egg_icon_list_set_pixbuf_column),
(egg_icon_list_get_pixbuf_column), (egg_icon_list_select_path),
(egg_icon_list_unselect_path), (egg_icon_list_select_all),
(egg_icon_list_unselect_all), (egg_icon_list_path_is_selected),
(egg_icon_list_item_activated):
* libegg/iconlist/eggiconlist.h:
* libegg/iconlist/testiconlist.c: (foreach_selected_remove_func),
(foreach_selected_remove), (selection_changed), (main):
Document functions and fix a few bugs.
2004-07-03 08:01:34 +00:00
|
|
|
GtkTreePath *path)
|
|
|
|
{
|
2004-07-04 20:35:35 +00:00
|
|
|
g_return_if_fail (GTK_IS_ICON_VIEW (icon_view));
|
|
|
|
g_return_if_fail (path != NULL);
|
|
|
|
|
2004-08-18 15:45:13 +00:00
|
|
|
g_signal_emit (icon_view, icon_view_signals[ITEM_ACTIVATED], 0, path);
|
Document functions and fix a few bugs.
2004-07-03 Anders Carlsson <andersca@gnome.org>
* libegg/iconlist/eggiconlist.c: (egg_icon_list_add_move_binding),
(egg_icon_list_real_move_cursor), (egg_icon_list_new),
(egg_icon_list_new_with_model), (egg_icon_list_get_path_at_pos),
(egg_icon_list_selected_foreach),
(egg_icon_list_set_selection_mode),
(egg_icon_list_get_selection_mode), (egg_icon_list_set_model),
(egg_icon_list_get_model), (egg_icon_list_set_text_column),
(egg_icon_list_get_text_column), (egg_icon_list_set_markup_column),
(egg_icon_list_get_markup_column),
(egg_icon_list_set_pixbuf_column),
(egg_icon_list_get_pixbuf_column), (egg_icon_list_select_path),
(egg_icon_list_unselect_path), (egg_icon_list_select_all),
(egg_icon_list_unselect_all), (egg_icon_list_path_is_selected),
(egg_icon_list_item_activated):
* libegg/iconlist/eggiconlist.h:
* libegg/iconlist/testiconlist.c: (foreach_selected_remove_func),
(foreach_selected_remove), (selection_changed), (main):
Document functions and fix a few bugs.
2004-07-03 08:01:34 +00:00
|
|
|
}
|
2004-07-18 03:39:50 +00:00
|
|
|
|
|
|
|
/**
|
2010-09-02 03:03:48 +00:00
|
|
|
* gtk_icon_view_set_item_orientation:
|
2004-07-18 03:39:50 +00:00
|
|
|
* @icon_view: a #GtkIconView
|
|
|
|
* @orientation: the relative position of texts and icons
|
|
|
|
*
|
2010-09-02 03:03:48 +00:00
|
|
|
* Sets the ::item-orientation property which determines whether the labels
|
2004-07-18 03:39:50 +00:00
|
|
|
* are drawn beside the icons instead of below.
|
|
|
|
*
|
|
|
|
* Since: 2.6
|
|
|
|
**/
|
|
|
|
void
|
2010-09-02 03:03:48 +00:00
|
|
|
gtk_icon_view_set_item_orientation (GtkIconView *icon_view,
|
|
|
|
GtkOrientation orientation)
|
2004-07-18 03:39:50 +00:00
|
|
|
{
|
|
|
|
g_return_if_fail (GTK_IS_ICON_VIEW (icon_view));
|
|
|
|
|
2010-09-02 03:03:48 +00:00
|
|
|
if (icon_view->priv->item_orientation != orientation)
|
2004-07-18 03:39:50 +00:00
|
|
|
{
|
2010-09-02 03:03:48 +00:00
|
|
|
icon_view->priv->item_orientation = orientation;
|
2004-07-18 03:39:50 +00:00
|
|
|
|
2011-02-23 11:50:50 +00:00
|
|
|
if (icon_view->priv->cell_area)
|
|
|
|
{
|
|
|
|
if (GTK_IS_ORIENTABLE (icon_view->priv->cell_area))
|
|
|
|
gtk_orientable_set_orientation (GTK_ORIENTABLE (icon_view->priv->cell_area),
|
|
|
|
icon_view->priv->item_orientation);
|
|
|
|
|
|
|
|
gtk_cell_area_stop_editing (icon_view->priv->cell_area, TRUE);
|
|
|
|
}
|
2010-12-12 10:59:41 +00:00
|
|
|
|
2004-07-18 03:39:50 +00:00
|
|
|
gtk_icon_view_invalidate_sizes (icon_view);
|
2005-05-02 20:28:37 +00:00
|
|
|
|
|
|
|
update_text_cell (icon_view);
|
|
|
|
update_pixbuf_cell (icon_view);
|
2004-07-18 03:39:50 +00:00
|
|
|
|
2010-09-02 03:03:48 +00:00
|
|
|
g_object_notify (G_OBJECT (icon_view), "item-orientation");
|
2004-07-18 03:39:50 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2010-09-02 03:03:48 +00:00
|
|
|
* gtk_icon_view_get_item_orientation:
|
2004-07-18 03:39:50 +00:00
|
|
|
* @icon_view: a #GtkIconView
|
|
|
|
*
|
2010-09-02 03:03:48 +00:00
|
|
|
* Returns the value of the ::item-orientation property which determines
|
2004-07-18 03:39:50 +00:00
|
|
|
* whether the labels are drawn beside the icons instead of below.
|
|
|
|
*
|
|
|
|
* Return value: the relative position of texts and icons
|
|
|
|
*
|
|
|
|
* Since: 2.6
|
|
|
|
**/
|
|
|
|
GtkOrientation
|
2010-09-02 03:03:48 +00:00
|
|
|
gtk_icon_view_get_item_orientation (GtkIconView *icon_view)
|
2004-07-18 03:39:50 +00:00
|
|
|
{
|
|
|
|
g_return_val_if_fail (GTK_IS_ICON_VIEW (icon_view),
|
|
|
|
GTK_ORIENTATION_VERTICAL);
|
|
|
|
|
2010-09-02 03:03:48 +00:00
|
|
|
return icon_view->priv->item_orientation;
|
2004-07-18 03:39:50 +00:00
|
|
|
}
|
2004-08-12 05:37:10 +00:00
|
|
|
|
2005-03-17 03:23:23 +00:00
|
|
|
/**
|
|
|
|
* gtk_icon_view_set_columns:
|
|
|
|
* @icon_view: a #GtkIconView
|
|
|
|
* @columns: the number of columns
|
|
|
|
*
|
|
|
|
* Sets the ::columns property which determines in how
|
|
|
|
* many columns the icons are arranged. If @columns is
|
|
|
|
* -1, the number of columns will be chosen automatically
|
|
|
|
* to fill the available area.
|
|
|
|
*
|
|
|
|
* Since: 2.6
|
|
|
|
*/
|
|
|
|
void
|
|
|
|
gtk_icon_view_set_columns (GtkIconView *icon_view,
|
|
|
|
gint columns)
|
2004-12-14 06:39:45 +00:00
|
|
|
{
|
|
|
|
g_return_if_fail (GTK_IS_ICON_VIEW (icon_view));
|
|
|
|
|
|
|
|
if (icon_view->priv->columns != columns)
|
|
|
|
{
|
|
|
|
icon_view->priv->columns = columns;
|
|
|
|
|
2011-02-25 05:53:12 +00:00
|
|
|
if (icon_view->priv->cell_area)
|
|
|
|
gtk_cell_area_stop_editing (icon_view->priv->cell_area, TRUE);
|
|
|
|
|
2004-12-14 06:39:45 +00:00
|
|
|
gtk_icon_view_queue_layout (icon_view);
|
|
|
|
|
|
|
|
g_object_notify (G_OBJECT (icon_view), "columns");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2005-03-17 03:23:23 +00:00
|
|
|
/**
|
|
|
|
* gtk_icon_view_get_columns:
|
|
|
|
* @icon_view: a #GtkIconView
|
|
|
|
*
|
|
|
|
* Returns the value of the ::columns property.
|
|
|
|
*
|
|
|
|
* Return value: the number of columns, or -1
|
|
|
|
*
|
|
|
|
* Since: 2.6
|
|
|
|
*/
|
2004-12-14 06:39:45 +00:00
|
|
|
gint
|
|
|
|
gtk_icon_view_get_columns (GtkIconView *icon_view)
|
|
|
|
{
|
|
|
|
g_return_val_if_fail (GTK_IS_ICON_VIEW (icon_view), -1);
|
|
|
|
|
|
|
|
return icon_view->priv->columns;
|
|
|
|
}
|
|
|
|
|
2005-03-17 03:23:23 +00:00
|
|
|
/**
|
|
|
|
* gtk_icon_view_set_item_width:
|
|
|
|
* @icon_view: a #GtkIconView
|
|
|
|
* @item_width: the width for each item
|
|
|
|
*
|
|
|
|
* Sets the ::item-width property which specifies the width
|
|
|
|
* to use for each item. If it is set to -1, the icon view will
|
|
|
|
* automatically determine a suitable item size.
|
|
|
|
*
|
|
|
|
* Since: 2.6
|
|
|
|
*/
|
|
|
|
void
|
|
|
|
gtk_icon_view_set_item_width (GtkIconView *icon_view,
|
|
|
|
gint item_width)
|
2004-12-14 06:39:45 +00:00
|
|
|
{
|
|
|
|
g_return_if_fail (GTK_IS_ICON_VIEW (icon_view));
|
|
|
|
|
|
|
|
if (icon_view->priv->item_width != item_width)
|
|
|
|
{
|
|
|
|
icon_view->priv->item_width = item_width;
|
2005-05-02 20:28:37 +00:00
|
|
|
|
2011-02-23 11:50:50 +00:00
|
|
|
if (icon_view->priv->cell_area)
|
|
|
|
gtk_cell_area_stop_editing (icon_view->priv->cell_area, TRUE);
|
|
|
|
|
2004-12-14 06:39:45 +00:00
|
|
|
gtk_icon_view_invalidate_sizes (icon_view);
|
|
|
|
|
2005-05-02 20:28:37 +00:00
|
|
|
update_text_cell (icon_view);
|
|
|
|
|
2004-12-14 06:39:45 +00:00
|
|
|
g_object_notify (G_OBJECT (icon_view), "item-width");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2005-03-17 03:23:23 +00:00
|
|
|
/**
|
|
|
|
* gtk_icon_view_get_item_width:
|
|
|
|
* @icon_view: a #GtkIconView
|
|
|
|
*
|
|
|
|
* Returns the value of the ::item-width property.
|
|
|
|
*
|
|
|
|
* Return value: the width of a single item, or -1
|
|
|
|
*
|
|
|
|
* Since: 2.6
|
|
|
|
*/
|
2004-12-14 06:39:45 +00:00
|
|
|
gint
|
|
|
|
gtk_icon_view_get_item_width (GtkIconView *icon_view)
|
|
|
|
{
|
|
|
|
g_return_val_if_fail (GTK_IS_ICON_VIEW (icon_view), -1);
|
|
|
|
|
|
|
|
return icon_view->priv->item_width;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2005-03-17 03:23:23 +00:00
|
|
|
/**
|
2005-03-31 17:04:25 +00:00
|
|
|
* gtk_icon_view_set_spacing:
|
2005-03-17 03:23:23 +00:00
|
|
|
* @icon_view: a #GtkIconView
|
|
|
|
* @spacing: the spacing
|
|
|
|
*
|
|
|
|
* Sets the ::spacing property which specifies the space
|
|
|
|
* which is inserted between the cells (i.e. the icon and
|
|
|
|
* the text) of an item.
|
|
|
|
*
|
|
|
|
* Since: 2.6
|
|
|
|
*/
|
|
|
|
void
|
|
|
|
gtk_icon_view_set_spacing (GtkIconView *icon_view,
|
|
|
|
gint spacing)
|
2004-12-14 06:39:45 +00:00
|
|
|
{
|
|
|
|
g_return_if_fail (GTK_IS_ICON_VIEW (icon_view));
|
|
|
|
|
|
|
|
if (icon_view->priv->spacing != spacing)
|
|
|
|
{
|
|
|
|
icon_view->priv->spacing = spacing;
|
|
|
|
|
2011-02-23 11:50:50 +00:00
|
|
|
if (icon_view->priv->cell_area)
|
|
|
|
gtk_cell_area_stop_editing (icon_view->priv->cell_area, TRUE);
|
|
|
|
|
2004-12-14 06:39:45 +00:00
|
|
|
gtk_icon_view_invalidate_sizes (icon_view);
|
2011-02-23 11:50:50 +00:00
|
|
|
|
2004-12-14 06:39:45 +00:00
|
|
|
g_object_notify (G_OBJECT (icon_view), "spacing");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2005-03-17 03:23:23 +00:00
|
|
|
/**
|
|
|
|
* gtk_icon_view_get_spacing:
|
|
|
|
* @icon_view: a #GtkIconView
|
|
|
|
*
|
|
|
|
* Returns the value of the ::spacing property.
|
|
|
|
*
|
|
|
|
* Return value: the space between cells
|
|
|
|
*
|
|
|
|
* Since: 2.6
|
|
|
|
*/
|
2004-12-14 06:39:45 +00:00
|
|
|
gint
|
|
|
|
gtk_icon_view_get_spacing (GtkIconView *icon_view)
|
|
|
|
{
|
|
|
|
g_return_val_if_fail (GTK_IS_ICON_VIEW (icon_view), -1);
|
|
|
|
|
|
|
|
return icon_view->priv->spacing;
|
|
|
|
}
|
|
|
|
|
2005-03-17 03:23:23 +00:00
|
|
|
/**
|
|
|
|
* gtk_icon_view_set_row_spacing:
|
|
|
|
* @icon_view: a #GtkIconView
|
2005-03-31 17:04:25 +00:00
|
|
|
* @row_spacing: the row spacing
|
2005-03-17 03:23:23 +00:00
|
|
|
*
|
|
|
|
* Sets the ::row-spacing property which specifies the space
|
|
|
|
* which is inserted between the rows of the icon view.
|
|
|
|
*
|
|
|
|
* Since: 2.6
|
|
|
|
*/
|
|
|
|
void
|
|
|
|
gtk_icon_view_set_row_spacing (GtkIconView *icon_view,
|
|
|
|
gint row_spacing)
|
2004-12-14 06:39:45 +00:00
|
|
|
{
|
|
|
|
g_return_if_fail (GTK_IS_ICON_VIEW (icon_view));
|
|
|
|
|
|
|
|
if (icon_view->priv->row_spacing != row_spacing)
|
|
|
|
{
|
|
|
|
icon_view->priv->row_spacing = row_spacing;
|
|
|
|
|
2011-02-23 11:50:50 +00:00
|
|
|
if (icon_view->priv->cell_area)
|
|
|
|
gtk_cell_area_stop_editing (icon_view->priv->cell_area, TRUE);
|
|
|
|
|
2004-12-14 06:39:45 +00:00
|
|
|
gtk_icon_view_invalidate_sizes (icon_view);
|
2011-02-23 11:50:50 +00:00
|
|
|
|
2004-12-14 06:39:45 +00:00
|
|
|
g_object_notify (G_OBJECT (icon_view), "row-spacing");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2005-03-17 03:23:23 +00:00
|
|
|
/**
|
|
|
|
* gtk_icon_view_get_row_spacing:
|
|
|
|
* @icon_view: a #GtkIconView
|
|
|
|
*
|
|
|
|
* Returns the value of the ::row-spacing property.
|
|
|
|
*
|
|
|
|
* Return value: the space between rows
|
|
|
|
*
|
|
|
|
* Since: 2.6
|
|
|
|
*/
|
2004-12-14 06:39:45 +00:00
|
|
|
gint
|
|
|
|
gtk_icon_view_get_row_spacing (GtkIconView *icon_view)
|
|
|
|
{
|
|
|
|
g_return_val_if_fail (GTK_IS_ICON_VIEW (icon_view), -1);
|
|
|
|
|
|
|
|
return icon_view->priv->row_spacing;
|
|
|
|
}
|
|
|
|
|
2005-03-17 03:23:23 +00:00
|
|
|
/**
|
|
|
|
* gtk_icon_view_set_column_spacing:
|
|
|
|
* @icon_view: a #GtkIconView
|
2005-03-31 17:04:25 +00:00
|
|
|
* @column_spacing: the column spacing
|
2005-03-17 03:23:23 +00:00
|
|
|
*
|
|
|
|
* Sets the ::column-spacing property which specifies the space
|
|
|
|
* which is inserted between the columns of the icon view.
|
|
|
|
*
|
|
|
|
* Since: 2.6
|
|
|
|
*/
|
|
|
|
void
|
|
|
|
gtk_icon_view_set_column_spacing (GtkIconView *icon_view,
|
|
|
|
gint column_spacing)
|
2004-12-14 06:39:45 +00:00
|
|
|
{
|
|
|
|
g_return_if_fail (GTK_IS_ICON_VIEW (icon_view));
|
|
|
|
|
|
|
|
if (icon_view->priv->column_spacing != column_spacing)
|
|
|
|
{
|
|
|
|
icon_view->priv->column_spacing = column_spacing;
|
|
|
|
|
2011-02-23 11:50:50 +00:00
|
|
|
if (icon_view->priv->cell_area)
|
|
|
|
gtk_cell_area_stop_editing (icon_view->priv->cell_area, TRUE);
|
|
|
|
|
2004-12-14 06:39:45 +00:00
|
|
|
gtk_icon_view_invalidate_sizes (icon_view);
|
2011-02-23 11:50:50 +00:00
|
|
|
|
2004-12-14 06:39:45 +00:00
|
|
|
g_object_notify (G_OBJECT (icon_view), "column-spacing");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2005-03-17 03:23:23 +00:00
|
|
|
/**
|
|
|
|
* gtk_icon_view_get_column_spacing:
|
|
|
|
* @icon_view: a #GtkIconView
|
|
|
|
*
|
|
|
|
* Returns the value of the ::column-spacing property.
|
|
|
|
*
|
|
|
|
* Return value: the space between columns
|
|
|
|
*
|
|
|
|
* Since: 2.6
|
|
|
|
*/
|
2004-12-14 06:39:45 +00:00
|
|
|
gint
|
|
|
|
gtk_icon_view_get_column_spacing (GtkIconView *icon_view)
|
|
|
|
{
|
|
|
|
g_return_val_if_fail (GTK_IS_ICON_VIEW (icon_view), -1);
|
|
|
|
|
|
|
|
return icon_view->priv->column_spacing;
|
|
|
|
}
|
|
|
|
|
2005-03-17 03:23:23 +00:00
|
|
|
/**
|
2005-06-10 04:25:33 +00:00
|
|
|
* gtk_icon_view_set_margin:
|
2005-03-17 03:23:23 +00:00
|
|
|
* @icon_view: a #GtkIconView
|
2005-06-10 04:57:18 +00:00
|
|
|
* @margin: the margin
|
2005-03-17 03:23:23 +00:00
|
|
|
*
|
|
|
|
* Sets the ::margin property which specifies the space
|
|
|
|
* which is inserted at the top, bottom, left and right
|
|
|
|
* of the icon view.
|
|
|
|
*
|
|
|
|
* Since: 2.6
|
|
|
|
*/
|
|
|
|
void
|
|
|
|
gtk_icon_view_set_margin (GtkIconView *icon_view,
|
|
|
|
gint margin)
|
2004-12-14 06:39:45 +00:00
|
|
|
{
|
|
|
|
g_return_if_fail (GTK_IS_ICON_VIEW (icon_view));
|
|
|
|
|
|
|
|
if (icon_view->priv->margin != margin)
|
|
|
|
{
|
|
|
|
icon_view->priv->margin = margin;
|
|
|
|
|
2011-02-23 11:50:50 +00:00
|
|
|
if (icon_view->priv->cell_area)
|
|
|
|
gtk_cell_area_stop_editing (icon_view->priv->cell_area, TRUE);
|
|
|
|
|
2004-12-14 06:39:45 +00:00
|
|
|
gtk_icon_view_invalidate_sizes (icon_view);
|
2011-02-23 11:50:50 +00:00
|
|
|
|
2004-12-14 06:39:45 +00:00
|
|
|
g_object_notify (G_OBJECT (icon_view), "margin");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2005-03-17 03:23:23 +00:00
|
|
|
/**
|
|
|
|
* gtk_icon_view_get_margin:
|
|
|
|
* @icon_view: a #GtkIconView
|
|
|
|
*
|
|
|
|
* Returns the value of the ::margin property.
|
|
|
|
*
|
|
|
|
* Return value: the space at the borders
|
|
|
|
*
|
|
|
|
* Since: 2.6
|
|
|
|
*/
|
2004-12-14 06:39:45 +00:00
|
|
|
gint
|
|
|
|
gtk_icon_view_get_margin (GtkIconView *icon_view)
|
|
|
|
{
|
|
|
|
g_return_val_if_fail (GTK_IS_ICON_VIEW (icon_view), -1);
|
|
|
|
|
|
|
|
return icon_view->priv->margin;
|
|
|
|
}
|
|
|
|
|
2009-08-07 03:56:30 +00:00
|
|
|
/**
|
|
|
|
* gtk_icon_view_set_item_padding:
|
|
|
|
* @icon_view: a #GtkIconView
|
2009-11-27 05:45:22 +00:00
|
|
|
* @item_padding: the item padding
|
|
|
|
*
|
|
|
|
* Sets the #GtkIconView:item-padding property which specifies the padding
|
2009-08-07 03:56:30 +00:00
|
|
|
* around each of the icon view's items.
|
|
|
|
*
|
|
|
|
* Since: 2.18
|
|
|
|
*/
|
2009-11-27 05:45:22 +00:00
|
|
|
void
|
2009-08-07 03:56:30 +00:00
|
|
|
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;
|
|
|
|
|
2011-02-23 11:50:50 +00:00
|
|
|
if (icon_view->priv->cell_area)
|
|
|
|
gtk_cell_area_stop_editing (icon_view->priv->cell_area, TRUE);
|
|
|
|
|
2009-08-07 03:56:30 +00:00
|
|
|
gtk_icon_view_invalidate_sizes (icon_view);
|
2011-02-23 11:50:50 +00:00
|
|
|
|
2009-08-07 03:56:30 +00:00
|
|
|
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;
|
|
|
|
}
|
2005-05-06 04:14:32 +00:00
|
|
|
|
|
|
|
/* Get/set whether drag_motion requested the drag data and
|
|
|
|
* drag_data_received should thus not actually insert the data,
|
|
|
|
* since the data doesn't result from a drop.
|
|
|
|
*/
|
|
|
|
static void
|
|
|
|
set_status_pending (GdkDragContext *context,
|
|
|
|
GdkDragAction suggested_action)
|
|
|
|
{
|
|
|
|
g_object_set_data (G_OBJECT (context),
|
2005-09-01 05:11:46 +00:00
|
|
|
I_("gtk-icon-view-status-pending"),
|
2005-05-06 04:14:32 +00:00
|
|
|
GINT_TO_POINTER (suggested_action));
|
|
|
|
}
|
|
|
|
|
|
|
|
static GdkDragAction
|
|
|
|
get_status_pending (GdkDragContext *context)
|
|
|
|
{
|
|
|
|
return GPOINTER_TO_INT (g_object_get_data (G_OBJECT (context),
|
|
|
|
"gtk-icon-view-status-pending"));
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
unset_reorderable (GtkIconView *icon_view)
|
|
|
|
{
|
|
|
|
if (icon_view->priv->reorderable)
|
|
|
|
{
|
|
|
|
icon_view->priv->reorderable = FALSE;
|
|
|
|
g_object_notify (G_OBJECT (icon_view), "reorderable");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
set_source_row (GdkDragContext *context,
|
|
|
|
GtkTreeModel *model,
|
|
|
|
GtkTreePath *source_row)
|
|
|
|
{
|
|
|
|
if (source_row)
|
|
|
|
g_object_set_data_full (G_OBJECT (context),
|
2005-09-01 05:11:46 +00:00
|
|
|
I_("gtk-icon-view-source-row"),
|
2005-05-06 04:14:32 +00:00
|
|
|
gtk_tree_row_reference_new (model, source_row),
|
|
|
|
(GDestroyNotify) gtk_tree_row_reference_free);
|
|
|
|
else
|
|
|
|
g_object_set_data_full (G_OBJECT (context),
|
2005-09-01 05:11:46 +00:00
|
|
|
I_("gtk-icon-view-source-row"),
|
2005-05-06 04:14:32 +00:00
|
|
|
NULL, NULL);
|
|
|
|
}
|
|
|
|
|
|
|
|
static GtkTreePath*
|
|
|
|
get_source_row (GdkDragContext *context)
|
|
|
|
{
|
|
|
|
GtkTreeRowReference *ref;
|
|
|
|
|
|
|
|
ref = g_object_get_data (G_OBJECT (context), "gtk-icon-view-source-row");
|
|
|
|
|
|
|
|
if (ref)
|
|
|
|
return gtk_tree_row_reference_get_path (ref);
|
|
|
|
else
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
typedef struct
|
|
|
|
{
|
|
|
|
GtkTreeRowReference *dest_row;
|
|
|
|
gboolean empty_view_drop;
|
|
|
|
gboolean drop_append_mode;
|
|
|
|
} DestRow;
|
|
|
|
|
|
|
|
static void
|
|
|
|
dest_row_free (gpointer data)
|
|
|
|
{
|
|
|
|
DestRow *dr = (DestRow *)data;
|
|
|
|
|
|
|
|
gtk_tree_row_reference_free (dr->dest_row);
|
|
|
|
g_free (dr);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
set_dest_row (GdkDragContext *context,
|
|
|
|
GtkTreeModel *model,
|
|
|
|
GtkTreePath *dest_row,
|
|
|
|
gboolean empty_view_drop,
|
|
|
|
gboolean drop_append_mode)
|
|
|
|
{
|
|
|
|
DestRow *dr;
|
|
|
|
|
|
|
|
if (!dest_row)
|
|
|
|
{
|
|
|
|
g_object_set_data_full (G_OBJECT (context),
|
2005-09-01 05:11:46 +00:00
|
|
|
I_("gtk-icon-view-dest-row"),
|
2005-05-06 04:14:32 +00:00
|
|
|
NULL, NULL);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
dr = g_new0 (DestRow, 1);
|
|
|
|
|
|
|
|
dr->dest_row = gtk_tree_row_reference_new (model, dest_row);
|
|
|
|
dr->empty_view_drop = empty_view_drop;
|
|
|
|
dr->drop_append_mode = drop_append_mode;
|
|
|
|
g_object_set_data_full (G_OBJECT (context),
|
2005-09-01 05:11:46 +00:00
|
|
|
I_("gtk-icon-view-dest-row"),
|
2005-05-06 04:14:32 +00:00
|
|
|
dr, (GDestroyNotify) dest_row_free);
|
|
|
|
}
|
|
|
|
|
|
|
|
static GtkTreePath*
|
|
|
|
get_dest_row (GdkDragContext *context)
|
|
|
|
{
|
|
|
|
DestRow *dr;
|
|
|
|
|
|
|
|
dr = g_object_get_data (G_OBJECT (context), "gtk-icon-view-dest-row");
|
|
|
|
|
|
|
|
if (dr)
|
|
|
|
{
|
|
|
|
GtkTreePath *path = NULL;
|
|
|
|
|
|
|
|
if (dr->dest_row)
|
|
|
|
path = gtk_tree_row_reference_get_path (dr->dest_row);
|
|
|
|
else if (dr->empty_view_drop)
|
|
|
|
path = gtk_tree_path_new_from_indices (0, -1);
|
|
|
|
else
|
|
|
|
path = NULL;
|
|
|
|
|
|
|
|
if (path && dr->drop_append_mode)
|
|
|
|
gtk_tree_path_next (path);
|
|
|
|
|
|
|
|
return path;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static gboolean
|
|
|
|
check_model_dnd (GtkTreeModel *model,
|
|
|
|
GType required_iface,
|
|
|
|
const gchar *signal)
|
|
|
|
{
|
|
|
|
if (model == NULL || !G_TYPE_CHECK_INSTANCE_TYPE ((model), required_iface))
|
|
|
|
{
|
|
|
|
g_warning ("You must override the default '%s' handler "
|
|
|
|
"on GtkIconView when using models that don't support "
|
|
|
|
"the %s interface and enabling drag-and-drop. The simplest way to do this "
|
|
|
|
"is to connect to '%s' and call "
|
|
|
|
"g_signal_stop_emission_by_name() in your signal handler to prevent "
|
|
|
|
"the default handler from running. Look at the source code "
|
|
|
|
"for the default handler in gtkiconview.c to get an idea what "
|
|
|
|
"your handler should do. (gtkiconview.c is in the GTK+ source "
|
|
|
|
"code.) If you're using GTK+ from a language other than C, "
|
|
|
|
"there may be a more natural way to override default handlers, e.g. via derivation.",
|
|
|
|
signal, g_type_name (required_iface), signal);
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
remove_scroll_timeout (GtkIconView *icon_view)
|
|
|
|
{
|
|
|
|
if (icon_view->priv->scroll_timeout_id != 0)
|
|
|
|
{
|
|
|
|
g_source_remove (icon_view->priv->scroll_timeout_id);
|
|
|
|
|
|
|
|
icon_view->priv->scroll_timeout_id = 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
gtk_icon_view_autoscroll (GtkIconView *icon_view)
|
|
|
|
{
|
2010-08-11 21:10:57 +00:00
|
|
|
GdkWindow *window;
|
2005-05-06 04:14:32 +00:00
|
|
|
gint px, py, x, y, width, height;
|
|
|
|
gint hoffset, voffset;
|
|
|
|
|
2010-08-11 21:10:57 +00:00
|
|
|
window = gtk_widget_get_window (GTK_WIDGET (icon_view));
|
|
|
|
|
|
|
|
gdk_window_get_pointer (window, &px, &py, NULL);
|
2010-12-05 13:36:59 +00:00
|
|
|
gdk_window_get_geometry (window, &x, &y, &width, &height);
|
2005-05-06 04:14:32 +00:00
|
|
|
|
|
|
|
/* see if we are near the edge. */
|
|
|
|
voffset = py - (y + 2 * SCROLL_EDGE_SIZE);
|
|
|
|
if (voffset > 0)
|
|
|
|
voffset = MAX (py - (y + height - 2 * SCROLL_EDGE_SIZE), 0);
|
|
|
|
|
|
|
|
hoffset = px - (x + 2 * SCROLL_EDGE_SIZE);
|
|
|
|
if (hoffset > 0)
|
|
|
|
hoffset = MAX (px - (x + width - 2 * SCROLL_EDGE_SIZE), 0);
|
|
|
|
|
|
|
|
if (voffset != 0)
|
2010-05-24 02:04:10 +00:00
|
|
|
gtk_adjustment_set_value (icon_view->priv->vadjustment,
|
2011-01-05 19:57:46 +00:00
|
|
|
gtk_adjustment_get_value (icon_view->priv->vadjustment) + voffset);
|
2010-05-24 02:04:10 +00:00
|
|
|
|
2005-05-06 04:14:32 +00:00
|
|
|
if (hoffset != 0)
|
2010-05-24 02:04:10 +00:00
|
|
|
gtk_adjustment_set_value (icon_view->priv->hadjustment,
|
2011-01-05 19:57:46 +00:00
|
|
|
gtk_adjustment_get_value (icon_view->priv->hadjustment) + hoffset);
|
2005-05-06 04:14:32 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static gboolean
|
|
|
|
drag_scroll_timeout (gpointer data)
|
|
|
|
{
|
|
|
|
GtkIconView *icon_view = GTK_ICON_VIEW (data);
|
|
|
|
|
|
|
|
gtk_icon_view_autoscroll (icon_view);
|
|
|
|
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static gboolean
|
|
|
|
set_destination (GtkIconView *icon_view,
|
|
|
|
GdkDragContext *context,
|
|
|
|
gint x,
|
|
|
|
gint y,
|
|
|
|
GdkDragAction *suggested_action,
|
|
|
|
GdkAtom *target)
|
|
|
|
{
|
|
|
|
GtkWidget *widget;
|
|
|
|
GtkTreePath *path = NULL;
|
|
|
|
GtkIconViewDropPosition pos;
|
|
|
|
GtkIconViewDropPosition old_pos;
|
|
|
|
GtkTreePath *old_dest_path = NULL;
|
|
|
|
gboolean can_drop = FALSE;
|
|
|
|
|
|
|
|
widget = GTK_WIDGET (icon_view);
|
|
|
|
|
|
|
|
*suggested_action = 0;
|
|
|
|
*target = GDK_NONE;
|
|
|
|
|
|
|
|
if (!icon_view->priv->dest_set)
|
|
|
|
{
|
|
|
|
/* someone unset us as a drag dest, note that if
|
|
|
|
* we return FALSE drag_leave isn't called
|
|
|
|
*/
|
|
|
|
|
|
|
|
gtk_icon_view_set_drag_dest_item (icon_view,
|
|
|
|
NULL,
|
|
|
|
GTK_ICON_VIEW_DROP_LEFT);
|
|
|
|
|
|
|
|
remove_scroll_timeout (GTK_ICON_VIEW (widget));
|
|
|
|
|
|
|
|
return FALSE; /* no longer a drop site */
|
|
|
|
}
|
|
|
|
|
2008-11-03 18:40:56 +00:00
|
|
|
*target = gtk_drag_dest_find_target (widget, context,
|
|
|
|
gtk_drag_dest_get_target_list (widget));
|
2005-05-06 04:14:32 +00:00
|
|
|
if (*target == GDK_NONE)
|
|
|
|
return FALSE;
|
|
|
|
|
|
|
|
if (!gtk_icon_view_get_dest_item_at_pos (icon_view, x, y, &path, &pos))
|
|
|
|
{
|
|
|
|
gint n_children;
|
|
|
|
GtkTreeModel *model;
|
|
|
|
|
|
|
|
/* the row got dropped on empty space, let's setup a special case
|
|
|
|
*/
|
|
|
|
|
|
|
|
if (path)
|
|
|
|
gtk_tree_path_free (path);
|
|
|
|
|
|
|
|
model = gtk_icon_view_get_model (icon_view);
|
|
|
|
|
|
|
|
n_children = gtk_tree_model_iter_n_children (model, NULL);
|
|
|
|
if (n_children)
|
|
|
|
{
|
|
|
|
pos = GTK_ICON_VIEW_DROP_BELOW;
|
|
|
|
path = gtk_tree_path_new_from_indices (n_children - 1, -1);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
pos = GTK_ICON_VIEW_DROP_ABOVE;
|
|
|
|
path = gtk_tree_path_new_from_indices (0, -1);
|
|
|
|
}
|
|
|
|
|
|
|
|
can_drop = TRUE;
|
|
|
|
|
|
|
|
goto out;
|
|
|
|
}
|
|
|
|
|
|
|
|
g_assert (path);
|
|
|
|
|
|
|
|
gtk_icon_view_get_drag_dest_item (icon_view,
|
|
|
|
&old_dest_path,
|
|
|
|
&old_pos);
|
|
|
|
|
|
|
|
if (old_dest_path)
|
|
|
|
gtk_tree_path_free (old_dest_path);
|
|
|
|
|
|
|
|
if (TRUE /* FIXME if the location droppable predicate */)
|
|
|
|
{
|
|
|
|
can_drop = TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
out:
|
|
|
|
if (can_drop)
|
|
|
|
{
|
|
|
|
GtkWidget *source_widget;
|
|
|
|
|
2010-12-10 05:59:07 +00:00
|
|
|
*suggested_action = gdk_drag_context_get_suggested_action (context);
|
2005-05-06 04:14:32 +00:00
|
|
|
source_widget = gtk_drag_get_source_widget (context);
|
|
|
|
|
|
|
|
if (source_widget == widget)
|
|
|
|
{
|
|
|
|
/* Default to MOVE, unless the user has
|
|
|
|
* pressed ctrl or shift to affect available actions
|
|
|
|
*/
|
2010-12-10 05:59:07 +00:00
|
|
|
if ((gdk_drag_context_get_actions (context) & GDK_ACTION_MOVE) != 0)
|
2005-05-06 04:14:32 +00:00
|
|
|
*suggested_action = GDK_ACTION_MOVE;
|
|
|
|
}
|
|
|
|
|
|
|
|
gtk_icon_view_set_drag_dest_item (GTK_ICON_VIEW (widget),
|
|
|
|
path, pos);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
/* can't drop here */
|
|
|
|
gtk_icon_view_set_drag_dest_item (GTK_ICON_VIEW (widget),
|
|
|
|
NULL,
|
|
|
|
GTK_ICON_VIEW_DROP_LEFT);
|
|
|
|
}
|
|
|
|
|
|
|
|
if (path)
|
|
|
|
gtk_tree_path_free (path);
|
|
|
|
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
static GtkTreePath*
|
|
|
|
get_logical_destination (GtkIconView *icon_view,
|
|
|
|
gboolean *drop_append_mode)
|
|
|
|
{
|
|
|
|
/* adjust path to point to the row the drop goes in front of */
|
|
|
|
GtkTreePath *path = NULL;
|
|
|
|
GtkIconViewDropPosition pos;
|
|
|
|
|
|
|
|
*drop_append_mode = FALSE;
|
|
|
|
|
|
|
|
gtk_icon_view_get_drag_dest_item (icon_view, &path, &pos);
|
|
|
|
|
|
|
|
if (path == NULL)
|
|
|
|
return NULL;
|
|
|
|
|
|
|
|
if (pos == GTK_ICON_VIEW_DROP_RIGHT ||
|
|
|
|
pos == GTK_ICON_VIEW_DROP_BELOW)
|
|
|
|
{
|
|
|
|
GtkTreeIter iter;
|
|
|
|
GtkTreeModel *model = icon_view->priv->model;
|
|
|
|
|
|
|
|
if (!gtk_tree_model_get_iter (model, &iter, path) ||
|
|
|
|
!gtk_tree_model_iter_next (model, &iter))
|
|
|
|
*drop_append_mode = TRUE;
|
|
|
|
else
|
|
|
|
{
|
|
|
|
*drop_append_mode = FALSE;
|
|
|
|
gtk_tree_path_next (path);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return path;
|
|
|
|
}
|
|
|
|
|
|
|
|
static gboolean
|
|
|
|
gtk_icon_view_maybe_begin_drag (GtkIconView *icon_view,
|
|
|
|
GdkEventMotion *event)
|
|
|
|
{
|
2008-11-03 18:40:56 +00:00
|
|
|
GtkWidget *widget = GTK_WIDGET (icon_view);
|
2005-05-06 04:14:32 +00:00
|
|
|
GdkDragContext *context;
|
|
|
|
GtkTreePath *path = NULL;
|
|
|
|
gint button;
|
|
|
|
GtkTreeModel *model;
|
|
|
|
gboolean retval = FALSE;
|
|
|
|
|
|
|
|
if (!icon_view->priv->source_set)
|
|
|
|
goto out;
|
|
|
|
|
|
|
|
if (icon_view->priv->pressed_button < 0)
|
|
|
|
goto out;
|
|
|
|
|
|
|
|
if (!gtk_drag_check_threshold (GTK_WIDGET (icon_view),
|
|
|
|
icon_view->priv->press_start_x,
|
|
|
|
icon_view->priv->press_start_y,
|
|
|
|
event->x, event->y))
|
|
|
|
goto out;
|
|
|
|
|
|
|
|
model = gtk_icon_view_get_model (icon_view);
|
|
|
|
|
|
|
|
if (model == NULL)
|
|
|
|
goto out;
|
|
|
|
|
|
|
|
button = icon_view->priv->pressed_button;
|
|
|
|
icon_view->priv->pressed_button = -1;
|
|
|
|
|
|
|
|
path = gtk_icon_view_get_path_at_pos (icon_view,
|
|
|
|
icon_view->priv->press_start_x,
|
|
|
|
icon_view->priv->press_start_y);
|
|
|
|
|
|
|
|
if (path == NULL)
|
|
|
|
goto out;
|
|
|
|
|
|
|
|
if (!GTK_IS_TREE_DRAG_SOURCE (model) ||
|
|
|
|
!gtk_tree_drag_source_row_draggable (GTK_TREE_DRAG_SOURCE (model),
|
|
|
|
path))
|
|
|
|
goto out;
|
|
|
|
|
|
|
|
/* FIXME Check whether we're a start button, if not return FALSE and
|
|
|
|
* free path
|
|
|
|
*/
|
|
|
|
|
|
|
|
/* Now we can begin the drag */
|
|
|
|
|
|
|
|
retval = TRUE;
|
|
|
|
|
2008-11-03 18:40:56 +00:00
|
|
|
context = gtk_drag_begin (widget,
|
|
|
|
gtk_drag_source_get_target_list (widget),
|
2005-05-06 04:14:32 +00:00
|
|
|
icon_view->priv->source_actions,
|
|
|
|
button,
|
|
|
|
(GdkEvent*)event);
|
|
|
|
|
|
|
|
set_source_row (context, model, path);
|
|
|
|
|
|
|
|
out:
|
|
|
|
if (path)
|
|
|
|
gtk_tree_path_free (path);
|
|
|
|
|
|
|
|
return retval;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Source side drag signals */
|
|
|
|
static void
|
|
|
|
gtk_icon_view_drag_begin (GtkWidget *widget,
|
|
|
|
GdkDragContext *context)
|
|
|
|
{
|
|
|
|
GtkIconView *icon_view;
|
|
|
|
GtkIconViewItem *item;
|
2010-08-24 14:03:09 +00:00
|
|
|
cairo_surface_t *icon;
|
2005-05-06 04:14:32 +00:00
|
|
|
gint x, y;
|
|
|
|
GtkTreePath *path;
|
|
|
|
|
|
|
|
icon_view = GTK_ICON_VIEW (widget);
|
|
|
|
|
|
|
|
/* if the user uses a custom DnD impl, we don't set the icon here */
|
|
|
|
if (!icon_view->priv->dest_set && !icon_view->priv->source_set)
|
|
|
|
return;
|
|
|
|
|
|
|
|
item = gtk_icon_view_get_item_at_coords (icon_view,
|
|
|
|
icon_view->priv->press_start_x,
|
|
|
|
icon_view->priv->press_start_y,
|
|
|
|
TRUE,
|
|
|
|
NULL);
|
|
|
|
|
|
|
|
g_return_if_fail (item != NULL);
|
|
|
|
|
2010-12-13 08:41:50 +00:00
|
|
|
x = icon_view->priv->press_start_x - item->cell_area.x + 1;
|
|
|
|
y = icon_view->priv->press_start_y - item->cell_area.y + 1;
|
2005-05-06 04:14:32 +00:00
|
|
|
|
|
|
|
path = gtk_tree_path_new_from_indices (item->index, -1);
|
|
|
|
icon = gtk_icon_view_create_drag_icon (icon_view, path);
|
|
|
|
gtk_tree_path_free (path);
|
|
|
|
|
2010-08-24 14:03:09 +00:00
|
|
|
cairo_surface_set_device_offset (icon, -x, -y);
|
2005-05-06 04:14:32 +00:00
|
|
|
|
2010-08-24 14:03:09 +00:00
|
|
|
gtk_drag_set_icon_surface (context, icon);
|
|
|
|
|
|
|
|
cairo_surface_destroy (icon);
|
2005-05-06 04:14:32 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
gtk_icon_view_drag_end (GtkWidget *widget,
|
|
|
|
GdkDragContext *context)
|
|
|
|
{
|
|
|
|
/* do nothing */
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
gtk_icon_view_drag_data_get (GtkWidget *widget,
|
|
|
|
GdkDragContext *context,
|
|
|
|
GtkSelectionData *selection_data,
|
|
|
|
guint info,
|
|
|
|
guint time)
|
|
|
|
{
|
|
|
|
GtkIconView *icon_view;
|
|
|
|
GtkTreeModel *model;
|
|
|
|
GtkTreePath *source_row;
|
|
|
|
|
|
|
|
icon_view = GTK_ICON_VIEW (widget);
|
|
|
|
model = gtk_icon_view_get_model (icon_view);
|
|
|
|
|
|
|
|
if (model == NULL)
|
|
|
|
return;
|
|
|
|
|
2008-09-04 00:12:06 +00:00
|
|
|
if (!icon_view->priv->source_set)
|
2005-05-06 04:14:32 +00:00
|
|
|
return;
|
|
|
|
|
|
|
|
source_row = get_source_row (context);
|
|
|
|
|
|
|
|
if (source_row == NULL)
|
|
|
|
return;
|
|
|
|
|
|
|
|
/* We can implement the GTK_TREE_MODEL_ROW target generically for
|
|
|
|
* any model; for DragSource models there are some other targets
|
|
|
|
* we also support.
|
|
|
|
*/
|
|
|
|
|
|
|
|
if (GTK_IS_TREE_DRAG_SOURCE (model) &&
|
|
|
|
gtk_tree_drag_source_drag_data_get (GTK_TREE_DRAG_SOURCE (model),
|
|
|
|
source_row,
|
|
|
|
selection_data))
|
|
|
|
goto done;
|
|
|
|
|
|
|
|
/* If drag_data_get does nothing, try providing row data. */
|
2010-12-15 23:55:04 +00:00
|
|
|
if (gtk_selection_data_get_target (selection_data) == gdk_atom_intern_static_string ("GTK_TREE_MODEL_ROW"))
|
2005-05-06 04:14:32 +00:00
|
|
|
gtk_tree_set_row_drag_data (selection_data,
|
|
|
|
model,
|
|
|
|
source_row);
|
|
|
|
|
|
|
|
done:
|
|
|
|
gtk_tree_path_free (source_row);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
gtk_icon_view_drag_data_delete (GtkWidget *widget,
|
|
|
|
GdkDragContext *context)
|
|
|
|
{
|
|
|
|
GtkTreeModel *model;
|
|
|
|
GtkIconView *icon_view;
|
|
|
|
GtkTreePath *source_row;
|
|
|
|
|
|
|
|
icon_view = GTK_ICON_VIEW (widget);
|
|
|
|
model = gtk_icon_view_get_model (icon_view);
|
|
|
|
|
2008-08-12 14:37:03 +00:00
|
|
|
if (!check_model_dnd (model, GTK_TYPE_TREE_DRAG_SOURCE, "drag-data-delete"))
|
2005-05-06 04:14:32 +00:00
|
|
|
return;
|
|
|
|
|
2008-09-04 00:12:06 +00:00
|
|
|
if (!icon_view->priv->source_set)
|
2005-05-06 04:14:32 +00:00
|
|
|
return;
|
|
|
|
|
|
|
|
source_row = get_source_row (context);
|
|
|
|
|
|
|
|
if (source_row == NULL)
|
|
|
|
return;
|
|
|
|
|
|
|
|
gtk_tree_drag_source_drag_data_delete (GTK_TREE_DRAG_SOURCE (model),
|
|
|
|
source_row);
|
|
|
|
|
|
|
|
gtk_tree_path_free (source_row);
|
|
|
|
|
|
|
|
set_source_row (context, NULL, NULL);
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Target side drag signals */
|
|
|
|
static void
|
|
|
|
gtk_icon_view_drag_leave (GtkWidget *widget,
|
|
|
|
GdkDragContext *context,
|
|
|
|
guint time)
|
|
|
|
{
|
|
|
|
GtkIconView *icon_view;
|
|
|
|
|
|
|
|
icon_view = GTK_ICON_VIEW (widget);
|
|
|
|
|
|
|
|
/* unset any highlight row */
|
|
|
|
gtk_icon_view_set_drag_dest_item (icon_view,
|
|
|
|
NULL,
|
|
|
|
GTK_ICON_VIEW_DROP_LEFT);
|
|
|
|
|
|
|
|
remove_scroll_timeout (icon_view);
|
|
|
|
}
|
|
|
|
|
|
|
|
static gboolean
|
|
|
|
gtk_icon_view_drag_motion (GtkWidget *widget,
|
|
|
|
GdkDragContext *context,
|
|
|
|
gint x,
|
|
|
|
gint y,
|
|
|
|
guint time)
|
|
|
|
{
|
|
|
|
GtkTreePath *path = NULL;
|
|
|
|
GtkIconViewDropPosition pos;
|
|
|
|
GtkIconView *icon_view;
|
|
|
|
GdkDragAction suggested_action = 0;
|
|
|
|
GdkAtom target;
|
|
|
|
gboolean empty;
|
|
|
|
|
|
|
|
icon_view = GTK_ICON_VIEW (widget);
|
|
|
|
|
|
|
|
if (!set_destination (icon_view, context, x, y, &suggested_action, &target))
|
|
|
|
return FALSE;
|
|
|
|
|
|
|
|
gtk_icon_view_get_drag_dest_item (icon_view, &path, &pos);
|
|
|
|
|
|
|
|
/* we only know this *after* set_desination_row */
|
|
|
|
empty = icon_view->priv->empty_view_drop;
|
|
|
|
|
|
|
|
if (path == NULL && !empty)
|
|
|
|
{
|
|
|
|
/* Can't drop here. */
|
|
|
|
gdk_drag_status (context, 0, time);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
if (icon_view->priv->scroll_timeout_id == 0)
|
|
|
|
{
|
|
|
|
icon_view->priv->scroll_timeout_id =
|
2006-12-22 19:10:43 +00:00
|
|
|
gdk_threads_add_timeout (50, drag_scroll_timeout, icon_view);
|
2005-05-06 04:14:32 +00:00
|
|
|
}
|
|
|
|
|
2005-09-11 05:48:27 +00:00
|
|
|
if (target == gdk_atom_intern_static_string ("GTK_TREE_MODEL_ROW"))
|
2005-05-06 04:14:32 +00:00
|
|
|
{
|
|
|
|
/* Request data so we can use the source row when
|
|
|
|
* determining whether to accept the drop
|
|
|
|
*/
|
|
|
|
set_status_pending (context, suggested_action);
|
|
|
|
gtk_drag_get_data (widget, context, target, time);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
set_status_pending (context, 0);
|
|
|
|
gdk_drag_status (context, suggested_action, time);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (path)
|
|
|
|
gtk_tree_path_free (path);
|
|
|
|
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
static gboolean
|
|
|
|
gtk_icon_view_drag_drop (GtkWidget *widget,
|
|
|
|
GdkDragContext *context,
|
|
|
|
gint x,
|
|
|
|
gint y,
|
|
|
|
guint time)
|
|
|
|
{
|
|
|
|
GtkIconView *icon_view;
|
|
|
|
GtkTreePath *path;
|
|
|
|
GdkDragAction suggested_action = 0;
|
|
|
|
GdkAtom target = GDK_NONE;
|
|
|
|
GtkTreeModel *model;
|
|
|
|
gboolean drop_append_mode;
|
|
|
|
|
|
|
|
icon_view = GTK_ICON_VIEW (widget);
|
|
|
|
model = gtk_icon_view_get_model (icon_view);
|
|
|
|
|
|
|
|
remove_scroll_timeout (GTK_ICON_VIEW (widget));
|
|
|
|
|
|
|
|
if (!icon_view->priv->dest_set)
|
|
|
|
return FALSE;
|
|
|
|
|
2008-08-12 14:37:03 +00:00
|
|
|
if (!check_model_dnd (model, GTK_TYPE_TREE_DRAG_DEST, "drag-drop"))
|
2005-05-06 04:14:32 +00:00
|
|
|
return FALSE;
|
|
|
|
|
|
|
|
if (!set_destination (icon_view, context, x, y, &suggested_action, &target))
|
|
|
|
return FALSE;
|
|
|
|
|
|
|
|
path = get_logical_destination (icon_view, &drop_append_mode);
|
|
|
|
|
|
|
|
if (target != GDK_NONE && path != NULL)
|
|
|
|
{
|
|
|
|
/* in case a motion had requested drag data, change things so we
|
|
|
|
* treat drag data receives as a drop.
|
|
|
|
*/
|
|
|
|
set_status_pending (context, 0);
|
|
|
|
set_dest_row (context, model, path,
|
|
|
|
icon_view->priv->empty_view_drop, drop_append_mode);
|
|
|
|
}
|
|
|
|
|
|
|
|
if (path)
|
|
|
|
gtk_tree_path_free (path);
|
|
|
|
|
|
|
|
/* Unset this thing */
|
|
|
|
gtk_icon_view_set_drag_dest_item (icon_view, NULL, GTK_ICON_VIEW_DROP_LEFT);
|
|
|
|
|
|
|
|
if (target != GDK_NONE)
|
|
|
|
{
|
|
|
|
gtk_drag_get_data (widget, context, target, time);
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
gtk_icon_view_drag_data_received (GtkWidget *widget,
|
|
|
|
GdkDragContext *context,
|
|
|
|
gint x,
|
|
|
|
gint y,
|
|
|
|
GtkSelectionData *selection_data,
|
|
|
|
guint info,
|
|
|
|
guint time)
|
|
|
|
{
|
|
|
|
GtkTreePath *path;
|
|
|
|
gboolean accepted = FALSE;
|
|
|
|
GtkTreeModel *model;
|
|
|
|
GtkIconView *icon_view;
|
|
|
|
GtkTreePath *dest_row;
|
|
|
|
GdkDragAction suggested_action;
|
|
|
|
gboolean drop_append_mode;
|
|
|
|
|
|
|
|
icon_view = GTK_ICON_VIEW (widget);
|
|
|
|
model = gtk_icon_view_get_model (icon_view);
|
|
|
|
|
2008-08-12 14:37:03 +00:00
|
|
|
if (!check_model_dnd (model, GTK_TYPE_TREE_DRAG_DEST, "drag-data-received"))
|
2005-05-06 04:14:32 +00:00
|
|
|
return;
|
|
|
|
|
|
|
|
if (!icon_view->priv->dest_set)
|
|
|
|
return;
|
|
|
|
|
|
|
|
suggested_action = get_status_pending (context);
|
|
|
|
|
|
|
|
if (suggested_action)
|
|
|
|
{
|
|
|
|
/* We are getting this data due to a request in drag_motion,
|
|
|
|
* rather than due to a request in drag_drop, so we are just
|
|
|
|
* supposed to call drag_status, not actually paste in the
|
|
|
|
* data.
|
|
|
|
*/
|
|
|
|
path = get_logical_destination (icon_view, &drop_append_mode);
|
|
|
|
|
|
|
|
if (path == NULL)
|
|
|
|
suggested_action = 0;
|
|
|
|
|
|
|
|
if (suggested_action)
|
|
|
|
{
|
|
|
|
if (!gtk_tree_drag_dest_row_drop_possible (GTK_TREE_DRAG_DEST (model),
|
|
|
|
path,
|
|
|
|
selection_data))
|
|
|
|
suggested_action = 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
gdk_drag_status (context, suggested_action, time);
|
|
|
|
|
|
|
|
if (path)
|
|
|
|
gtk_tree_path_free (path);
|
|
|
|
|
|
|
|
/* If you can't drop, remove user drop indicator until the next motion */
|
|
|
|
if (suggested_action == 0)
|
|
|
|
gtk_icon_view_set_drag_dest_item (icon_view,
|
|
|
|
NULL,
|
|
|
|
GTK_ICON_VIEW_DROP_LEFT);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
dest_row = get_dest_row (context);
|
|
|
|
|
|
|
|
if (dest_row == NULL)
|
|
|
|
return;
|
|
|
|
|
2010-12-15 23:55:04 +00:00
|
|
|
if (gtk_selection_data_get_length (selection_data) >= 0)
|
2005-05-06 04:14:32 +00:00
|
|
|
{
|
|
|
|
if (gtk_tree_drag_dest_drag_data_received (GTK_TREE_DRAG_DEST (model),
|
|
|
|
dest_row,
|
|
|
|
selection_data))
|
|
|
|
accepted = TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
gtk_drag_finish (context,
|
|
|
|
accepted,
|
2010-12-10 05:59:07 +00:00
|
|
|
(gdk_drag_context_get_selected_action (context) == GDK_ACTION_MOVE),
|
2005-05-06 04:14:32 +00:00
|
|
|
time);
|
|
|
|
|
|
|
|
gtk_tree_path_free (dest_row);
|
|
|
|
|
|
|
|
/* drop dest_row */
|
|
|
|
set_dest_row (context, NULL, NULL, FALSE, FALSE);
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Drag-and-Drop support */
|
|
|
|
/**
|
|
|
|
* gtk_icon_view_enable_model_drag_source:
|
|
|
|
* @icon_view: a #GtkIconTreeView
|
|
|
|
* @start_button_mask: Mask of allowed buttons to start drag
|
2011-01-17 15:00:52 +00:00
|
|
|
* @targets: (array length=n_targets): the table of targets that the drag will
|
|
|
|
* support
|
2005-05-06 04:14:32 +00:00
|
|
|
* @n_targets: the number of items in @targets
|
|
|
|
* @actions: the bitmask of possible actions for a drag from this
|
|
|
|
* widget
|
2009-01-24 22:22:35 +00:00
|
|
|
*
|
|
|
|
* Turns @icon_view into a drag source for automatic DND. Calling this
|
|
|
|
* method sets #GtkIconView:reorderable to %FALSE.
|
2005-05-06 04:14:32 +00:00
|
|
|
*
|
|
|
|
* Since: 2.8
|
|
|
|
**/
|
|
|
|
void
|
|
|
|
gtk_icon_view_enable_model_drag_source (GtkIconView *icon_view,
|
|
|
|
GdkModifierType start_button_mask,
|
|
|
|
const GtkTargetEntry *targets,
|
|
|
|
gint n_targets,
|
|
|
|
GdkDragAction actions)
|
|
|
|
{
|
|
|
|
g_return_if_fail (GTK_IS_ICON_VIEW (icon_view));
|
|
|
|
|
2008-11-03 18:40:56 +00:00
|
|
|
gtk_drag_source_set (GTK_WIDGET (icon_view), 0, targets, n_targets, actions);
|
2005-05-06 04:14:32 +00:00
|
|
|
|
|
|
|
icon_view->priv->start_button_mask = start_button_mask;
|
|
|
|
icon_view->priv->source_actions = actions;
|
|
|
|
|
|
|
|
icon_view->priv->source_set = TRUE;
|
|
|
|
|
|
|
|
unset_reorderable (icon_view);
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* gtk_icon_view_enable_model_drag_dest:
|
|
|
|
* @icon_view: a #GtkIconView
|
2011-01-17 15:00:52 +00:00
|
|
|
* @targets: (array length=n_targets): the table of targets that the drag will
|
|
|
|
* support
|
2005-05-06 04:14:32 +00:00
|
|
|
* @n_targets: the number of items in @targets
|
2006-06-20 04:35:29 +00:00
|
|
|
* @actions: the bitmask of possible actions for a drag to this
|
2005-05-06 04:14:32 +00:00
|
|
|
* widget
|
2009-01-24 22:22:35 +00:00
|
|
|
*
|
|
|
|
* Turns @icon_view into a drop destination for automatic DND. Calling this
|
|
|
|
* method sets #GtkIconView:reorderable to %FALSE.
|
2005-05-06 04:14:32 +00:00
|
|
|
*
|
|
|
|
* Since: 2.8
|
|
|
|
**/
|
|
|
|
void
|
|
|
|
gtk_icon_view_enable_model_drag_dest (GtkIconView *icon_view,
|
|
|
|
const GtkTargetEntry *targets,
|
|
|
|
gint n_targets,
|
|
|
|
GdkDragAction actions)
|
|
|
|
{
|
|
|
|
g_return_if_fail (GTK_IS_ICON_VIEW (icon_view));
|
|
|
|
|
2008-11-03 18:40:56 +00:00
|
|
|
gtk_drag_dest_set (GTK_WIDGET (icon_view), 0, targets, n_targets, actions);
|
2005-05-06 04:14:32 +00:00
|
|
|
|
|
|
|
icon_view->priv->dest_actions = actions;
|
|
|
|
|
|
|
|
icon_view->priv->dest_set = TRUE;
|
|
|
|
|
|
|
|
unset_reorderable (icon_view);
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* gtk_icon_view_unset_model_drag_source:
|
|
|
|
* @icon_view: a #GtkIconView
|
|
|
|
*
|
2009-01-24 22:42:05 +00:00
|
|
|
* Undoes the effect of gtk_icon_view_enable_model_drag_source(). Calling this
|
|
|
|
* method sets #GtkIconView:reorderable to %FALSE.
|
2005-05-06 04:14:32 +00:00
|
|
|
*
|
|
|
|
* Since: 2.8
|
|
|
|
**/
|
|
|
|
void
|
|
|
|
gtk_icon_view_unset_model_drag_source (GtkIconView *icon_view)
|
|
|
|
{
|
|
|
|
g_return_if_fail (GTK_IS_ICON_VIEW (icon_view));
|
|
|
|
|
|
|
|
if (icon_view->priv->source_set)
|
|
|
|
{
|
|
|
|
gtk_drag_source_unset (GTK_WIDGET (icon_view));
|
2008-11-03 18:40:56 +00:00
|
|
|
icon_view->priv->source_set = FALSE;
|
2005-05-06 04:14:32 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
unset_reorderable (icon_view);
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* gtk_icon_view_unset_model_drag_dest:
|
|
|
|
* @icon_view: a #GtkIconView
|
|
|
|
*
|
2009-01-24 22:42:05 +00:00
|
|
|
* Undoes the effect of gtk_icon_view_enable_model_drag_dest(). Calling this
|
|
|
|
* method sets #GtkIconView:reorderable to %FALSE.
|
2005-05-06 04:14:32 +00:00
|
|
|
*
|
|
|
|
* Since: 2.8
|
|
|
|
**/
|
|
|
|
void
|
|
|
|
gtk_icon_view_unset_model_drag_dest (GtkIconView *icon_view)
|
|
|
|
{
|
|
|
|
g_return_if_fail (GTK_IS_ICON_VIEW (icon_view));
|
|
|
|
|
|
|
|
if (icon_view->priv->dest_set)
|
|
|
|
{
|
|
|
|
gtk_drag_dest_unset (GTK_WIDGET (icon_view));
|
2008-11-03 18:40:56 +00:00
|
|
|
icon_view->priv->dest_set = FALSE;
|
2005-05-06 04:14:32 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
unset_reorderable (icon_view);
|
|
|
|
}
|
|
|
|
|
|
|
|
/* These are useful to implement your own custom stuff. */
|
|
|
|
/**
|
|
|
|
* gtk_icon_view_set_drag_dest_item:
|
|
|
|
* @icon_view: a #GtkIconView
|
2009-12-10 10:23:40 +00:00
|
|
|
* @path: (allow-none): The path of the item to highlight, or %NULL.
|
2005-09-19 18:56:55 +00:00
|
|
|
* @pos: Specifies where to drop, relative to the item
|
2009-12-10 10:23:40 +00:00
|
|
|
*
|
2005-05-06 04:14:32 +00:00
|
|
|
* Sets the item that is highlighted for feedback.
|
|
|
|
*
|
|
|
|
* Since: 2.8
|
|
|
|
*/
|
|
|
|
void
|
|
|
|
gtk_icon_view_set_drag_dest_item (GtkIconView *icon_view,
|
|
|
|
GtkTreePath *path,
|
|
|
|
GtkIconViewDropPosition pos)
|
|
|
|
{
|
|
|
|
/* Note; this function is exported to allow a custom DND
|
|
|
|
* implementation, so it can't touch TreeViewDragInfo
|
|
|
|
*/
|
|
|
|
|
|
|
|
g_return_if_fail (GTK_IS_ICON_VIEW (icon_view));
|
|
|
|
|
|
|
|
if (icon_view->priv->dest_item)
|
|
|
|
{
|
|
|
|
GtkTreePath *current_path;
|
|
|
|
current_path = gtk_tree_row_reference_get_path (icon_view->priv->dest_item);
|
|
|
|
gtk_tree_row_reference_free (icon_view->priv->dest_item);
|
|
|
|
icon_view->priv->dest_item = NULL;
|
|
|
|
|
|
|
|
gtk_icon_view_queue_draw_path (icon_view, current_path);
|
|
|
|
gtk_tree_path_free (current_path);
|
|
|
|
}
|
|
|
|
|
|
|
|
/* special case a drop on an empty model */
|
|
|
|
icon_view->priv->empty_view_drop = FALSE;
|
2009-07-17 17:29:07 +00:00
|
|
|
if (pos == GTK_ICON_VIEW_DROP_ABOVE && path
|
2005-05-06 04:14:32 +00:00
|
|
|
&& gtk_tree_path_get_depth (path) == 1
|
2010-06-28 18:15:10 +00:00
|
|
|
&& gtk_tree_path_get_indices (path)[0] == 0)
|
2005-05-06 04:14:32 +00:00
|
|
|
{
|
|
|
|
gint n_children;
|
|
|
|
|
|
|
|
n_children = gtk_tree_model_iter_n_children (icon_view->priv->model,
|
|
|
|
NULL);
|
|
|
|
|
|
|
|
if (n_children == 0)
|
|
|
|
icon_view->priv->empty_view_drop = TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
icon_view->priv->dest_pos = pos;
|
|
|
|
|
|
|
|
if (path)
|
|
|
|
{
|
|
|
|
icon_view->priv->dest_item =
|
|
|
|
gtk_tree_row_reference_new_proxy (G_OBJECT (icon_view),
|
|
|
|
icon_view->priv->model, path);
|
|
|
|
|
|
|
|
gtk_icon_view_queue_draw_path (icon_view, path);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* gtk_icon_view_get_drag_dest_item:
|
|
|
|
* @icon_view: a #GtkIconView
|
2011-01-18 09:10:30 +00:00
|
|
|
* @path: (out) (allow-none): Return location for the path of
|
|
|
|
* the highlighted item, or %NULL.
|
|
|
|
* @pos: (out) (allow-none): Return location for the drop position, or %NULL
|
2005-05-06 04:14:32 +00:00
|
|
|
*
|
|
|
|
* Gets information about the item that is highlighted for feedback.
|
|
|
|
*
|
|
|
|
* Since: 2.8
|
|
|
|
**/
|
|
|
|
void
|
|
|
|
gtk_icon_view_get_drag_dest_item (GtkIconView *icon_view,
|
|
|
|
GtkTreePath **path,
|
|
|
|
GtkIconViewDropPosition *pos)
|
|
|
|
{
|
|
|
|
g_return_if_fail (GTK_IS_ICON_VIEW (icon_view));
|
|
|
|
|
|
|
|
if (path)
|
|
|
|
{
|
|
|
|
if (icon_view->priv->dest_item)
|
|
|
|
*path = gtk_tree_row_reference_get_path (icon_view->priv->dest_item);
|
|
|
|
else
|
|
|
|
*path = NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (pos)
|
|
|
|
*pos = icon_view->priv->dest_pos;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* gtk_icon_view_get_dest_item_at_pos:
|
|
|
|
* @icon_view: a #GtkIconView
|
|
|
|
* @drag_x: the position to determine the destination item for
|
|
|
|
* @drag_y: the position to determine the destination item for
|
2011-01-18 09:10:30 +00:00
|
|
|
* @path: (out) (allow-none): Return location for the path of the item,
|
|
|
|
* or %NULL.
|
|
|
|
* @pos: (out) (allow-none): Return location for the drop position, or %NULL
|
2005-05-06 04:14:32 +00:00
|
|
|
*
|
|
|
|
* Determines the destination item for a given position.
|
|
|
|
*
|
|
|
|
* Return value: whether there is an item at the given position.
|
|
|
|
*
|
2005-05-08 03:13:37 +00:00
|
|
|
* Since: 2.8
|
2005-05-06 04:14:32 +00:00
|
|
|
**/
|
|
|
|
gboolean
|
|
|
|
gtk_icon_view_get_dest_item_at_pos (GtkIconView *icon_view,
|
|
|
|
gint drag_x,
|
|
|
|
gint drag_y,
|
|
|
|
GtkTreePath **path,
|
|
|
|
GtkIconViewDropPosition *pos)
|
|
|
|
{
|
|
|
|
GtkIconViewItem *item;
|
|
|
|
|
|
|
|
/* Note; this function is exported to allow a custom DND
|
|
|
|
* implementation, so it can't touch TreeViewDragInfo
|
|
|
|
*/
|
|
|
|
|
|
|
|
g_return_val_if_fail (GTK_IS_ICON_VIEW (icon_view), FALSE);
|
|
|
|
g_return_val_if_fail (drag_x >= 0, FALSE);
|
|
|
|
g_return_val_if_fail (drag_y >= 0, FALSE);
|
|
|
|
g_return_val_if_fail (icon_view->priv->bin_window != NULL, FALSE);
|
|
|
|
|
|
|
|
|
|
|
|
if (path)
|
|
|
|
*path = NULL;
|
|
|
|
|
|
|
|
item = gtk_icon_view_get_item_at_coords (icon_view,
|
2011-01-05 19:57:46 +00:00
|
|
|
drag_x + gtk_adjustment_get_value (icon_view->priv->hadjustment),
|
|
|
|
drag_y + gtk_adjustment_get_value (icon_view->priv->vadjustment),
|
2005-05-06 04:14:32 +00:00
|
|
|
FALSE, NULL);
|
|
|
|
|
|
|
|
if (item == NULL)
|
|
|
|
return FALSE;
|
|
|
|
|
|
|
|
if (path)
|
|
|
|
*path = gtk_tree_path_new_from_indices (item->index, -1);
|
|
|
|
|
|
|
|
if (pos)
|
|
|
|
{
|
2010-12-13 08:41:50 +00:00
|
|
|
if (drag_x < item->cell_area.x + item->cell_area.width / 4)
|
2005-05-06 04:14:32 +00:00
|
|
|
*pos = GTK_ICON_VIEW_DROP_LEFT;
|
2010-12-13 08:41:50 +00:00
|
|
|
else if (drag_x > item->cell_area.x + item->cell_area.width * 3 / 4)
|
2005-05-06 04:14:32 +00:00
|
|
|
*pos = GTK_ICON_VIEW_DROP_RIGHT;
|
2010-12-13 08:41:50 +00:00
|
|
|
else if (drag_y < item->cell_area.y + item->cell_area.height / 4)
|
2005-05-06 04:14:32 +00:00
|
|
|
*pos = GTK_ICON_VIEW_DROP_ABOVE;
|
2010-12-13 08:41:50 +00:00
|
|
|
else if (drag_y > item->cell_area.y + item->cell_area.height * 3 / 4)
|
2005-05-06 04:14:32 +00:00
|
|
|
*pos = GTK_ICON_VIEW_DROP_BELOW;
|
|
|
|
else
|
|
|
|
*pos = GTK_ICON_VIEW_DROP_INTO;
|
|
|
|
}
|
|
|
|
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* gtk_icon_view_create_drag_icon:
|
|
|
|
* @icon_view: a #GtkIconView
|
|
|
|
* @path: a #GtkTreePath in @icon_view
|
|
|
|
*
|
2010-08-24 14:03:09 +00:00
|
|
|
* Creates a #cairo_surface_t representation of the item at @path.
|
2005-05-06 04:14:32 +00:00
|
|
|
* This image is used for a drag icon.
|
|
|
|
*
|
2011-01-18 09:14:33 +00:00
|
|
|
* Return value: (transfer full): a newly-allocated surface of the drag icon.
|
2005-05-06 04:14:32 +00:00
|
|
|
*
|
|
|
|
* Since: 2.8
|
|
|
|
**/
|
2010-08-24 14:03:09 +00:00
|
|
|
cairo_surface_t *
|
2005-05-06 04:14:32 +00:00
|
|
|
gtk_icon_view_create_drag_icon (GtkIconView *icon_view,
|
|
|
|
GtkTreePath *path)
|
|
|
|
{
|
|
|
|
GtkWidget *widget;
|
2011-01-12 20:26:25 +00:00
|
|
|
GtkStyleContext *context;
|
2005-05-06 04:14:32 +00:00
|
|
|
cairo_t *cr;
|
2010-08-24 14:03:09 +00:00
|
|
|
cairo_surface_t *surface;
|
2005-05-06 04:14:32 +00:00
|
|
|
GList *l;
|
|
|
|
gint index;
|
|
|
|
|
2005-09-13 13:33:01 +00:00
|
|
|
g_return_val_if_fail (GTK_IS_ICON_VIEW (icon_view), NULL);
|
|
|
|
g_return_val_if_fail (path != NULL, NULL);
|
|
|
|
|
2005-05-06 04:14:32 +00:00
|
|
|
widget = GTK_WIDGET (icon_view);
|
2011-01-12 20:26:25 +00:00
|
|
|
context = gtk_widget_get_style_context (widget);
|
2005-05-06 04:14:32 +00:00
|
|
|
|
2010-03-02 06:16:02 +00:00
|
|
|
if (!gtk_widget_get_realized (widget))
|
2005-09-13 13:33:01 +00:00
|
|
|
return NULL;
|
|
|
|
|
2010-06-28 18:15:10 +00:00
|
|
|
index = gtk_tree_path_get_indices (path)[0];
|
2005-05-06 04:14:32 +00:00
|
|
|
|
|
|
|
for (l = icon_view->priv->items; l; l = l->next)
|
|
|
|
{
|
|
|
|
GtkIconViewItem *item = l->data;
|
|
|
|
|
|
|
|
if (index == item->index)
|
|
|
|
{
|
2010-12-13 08:41:50 +00:00
|
|
|
GdkRectangle rect = {
|
|
|
|
item->cell_area.x - icon_view->priv->item_padding,
|
|
|
|
item->cell_area.y - icon_view->priv->item_padding,
|
|
|
|
item->cell_area.width + icon_view->priv->item_padding * 2,
|
|
|
|
item->cell_area.height + icon_view->priv->item_padding * 2
|
|
|
|
};
|
|
|
|
|
2010-08-24 14:03:09 +00:00
|
|
|
surface = gdk_window_create_similar_surface (icon_view->priv->bin_window,
|
|
|
|
CAIRO_CONTENT_COLOR,
|
2010-12-13 08:41:50 +00:00
|
|
|
rect.width + 2,
|
|
|
|
rect.height + 2);
|
2005-05-06 04:14:32 +00:00
|
|
|
|
2010-08-24 14:03:09 +00:00
|
|
|
cr = cairo_create (surface);
|
2005-05-06 04:14:32 +00:00
|
|
|
cairo_set_line_width (cr, 1.);
|
|
|
|
|
2011-01-12 20:26:25 +00:00
|
|
|
gtk_render_background (context, cr, 0, 0,
|
|
|
|
rect.width + 2, rect.height + 2);
|
2005-05-06 04:14:32 +00:00
|
|
|
|
2010-08-22 02:32:52 +00:00
|
|
|
cairo_save (cr);
|
|
|
|
|
2010-12-13 08:41:50 +00:00
|
|
|
cairo_rectangle (cr, 1, 1, rect.width, rect.height);
|
2010-08-22 02:32:52 +00:00
|
|
|
cairo_clip (cr);
|
|
|
|
|
2010-12-13 08:41:50 +00:00
|
|
|
gtk_icon_view_paint_item (icon_view, cr, item,
|
|
|
|
icon_view->priv->item_padding + 1,
|
|
|
|
icon_view->priv->item_padding + 1, FALSE);
|
2005-05-06 04:14:32 +00:00
|
|
|
|
2010-08-22 02:32:52 +00:00
|
|
|
cairo_restore (cr);
|
2005-05-06 04:14:32 +00:00
|
|
|
|
2005-05-11 19:16:19 +00:00
|
|
|
cairo_set_source_rgb (cr, 0.0, 0.0, 0.0); /* black */
|
2010-12-13 08:41:50 +00:00
|
|
|
cairo_rectangle (cr, 0.5, 0.5, rect.width + 1, rect.height + 1);
|
2005-05-11 19:16:19 +00:00
|
|
|
cairo_stroke (cr);
|
2005-05-06 04:14:32 +00:00
|
|
|
|
|
|
|
cairo_destroy (cr);
|
|
|
|
|
2010-08-24 14:03:09 +00:00
|
|
|
return surface;
|
2005-05-06 04:14:32 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* gtk_icon_view_get_reorderable:
|
|
|
|
* @icon_view: a #GtkIconView
|
|
|
|
*
|
|
|
|
* Retrieves whether the user can reorder the list via drag-and-drop.
|
|
|
|
* See gtk_icon_view_set_reorderable().
|
|
|
|
*
|
|
|
|
* Return value: %TRUE if the list can be reordered.
|
|
|
|
*
|
2005-07-11 13:14:04 +00:00
|
|
|
* Since: 2.8
|
2005-05-06 04:14:32 +00:00
|
|
|
**/
|
|
|
|
gboolean
|
|
|
|
gtk_icon_view_get_reorderable (GtkIconView *icon_view)
|
|
|
|
{
|
|
|
|
g_return_val_if_fail (GTK_IS_ICON_VIEW (icon_view), FALSE);
|
|
|
|
|
|
|
|
return icon_view->priv->reorderable;
|
|
|
|
}
|
|
|
|
|
|
|
|
static const GtkTargetEntry item_targets[] = {
|
|
|
|
{ "GTK_TREE_MODEL_ROW", GTK_TARGET_SAME_WIDGET, 0 }
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* gtk_icon_view_set_reorderable:
|
|
|
|
* @icon_view: A #GtkIconView.
|
|
|
|
* @reorderable: %TRUE, if the list of items can be reordered.
|
|
|
|
*
|
|
|
|
* This function is a convenience function to allow you to reorder models that
|
|
|
|
* support the #GtkTreeDragSourceIface and the #GtkTreeDragDestIface. Both
|
|
|
|
* #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
|
2009-01-24 22:22:35 +00:00
|
|
|
* 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.
|
2005-05-06 04:14:32 +00:00
|
|
|
*
|
|
|
|
* 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
|
|
|
|
* handle drag and drop manually.
|
|
|
|
*
|
|
|
|
* Since: 2.8
|
|
|
|
**/
|
|
|
|
void
|
|
|
|
gtk_icon_view_set_reorderable (GtkIconView *icon_view,
|
|
|
|
gboolean reorderable)
|
|
|
|
{
|
|
|
|
g_return_if_fail (GTK_IS_ICON_VIEW (icon_view));
|
|
|
|
|
|
|
|
reorderable = reorderable != FALSE;
|
|
|
|
|
|
|
|
if (icon_view->priv->reorderable == reorderable)
|
|
|
|
return;
|
|
|
|
|
|
|
|
if (reorderable)
|
|
|
|
{
|
|
|
|
gtk_icon_view_enable_model_drag_source (icon_view,
|
|
|
|
GDK_BUTTON1_MASK,
|
|
|
|
item_targets,
|
|
|
|
G_N_ELEMENTS (item_targets),
|
|
|
|
GDK_ACTION_MOVE);
|
|
|
|
gtk_icon_view_enable_model_drag_dest (icon_view,
|
|
|
|
item_targets,
|
|
|
|
G_N_ELEMENTS (item_targets),
|
|
|
|
GDK_ACTION_MOVE);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
gtk_icon_view_unset_model_drag_source (icon_view);
|
|
|
|
gtk_icon_view_unset_model_drag_dest (icon_view);
|
|
|
|
}
|
|
|
|
|
|
|
|
icon_view->priv->reorderable = reorderable;
|
|
|
|
|
|
|
|
g_object_notify (G_OBJECT (icon_view), "reorderable");
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2004-08-12 05:37:10 +00:00
|
|
|
/* Accessibility Support */
|
|
|
|
|
|
|
|
static gpointer accessible_parent_class;
|
|
|
|
static gpointer accessible_item_parent_class;
|
|
|
|
static GQuark accessible_private_data_quark = 0;
|
|
|
|
|
|
|
|
#define GTK_TYPE_ICON_VIEW_ITEM_ACCESSIBLE (gtk_icon_view_item_accessible_get_type ())
|
|
|
|
#define GTK_ICON_VIEW_ITEM_ACCESSIBLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_ICON_VIEW_ITEM_ACCESSIBLE, GtkIconViewItemAccessible))
|
|
|
|
#define GTK_IS_ICON_VIEW_ITEM_ACCESSIBLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_ICON_VIEW_ITEM_ACCESSIBLE))
|
|
|
|
|
|
|
|
static GType gtk_icon_view_item_accessible_get_type (void);
|
|
|
|
|
|
|
|
enum {
|
|
|
|
ACTION_ACTIVATE,
|
|
|
|
LAST_ACTION
|
|
|
|
};
|
|
|
|
|
|
|
|
typedef struct
|
|
|
|
{
|
|
|
|
AtkObject parent;
|
|
|
|
|
|
|
|
GtkIconViewItem *item;
|
|
|
|
|
|
|
|
GtkWidget *widget;
|
|
|
|
|
|
|
|
AtkStateSet *state_set;
|
|
|
|
|
|
|
|
gchar *text;
|
|
|
|
|
|
|
|
GtkTextBuffer *text_buffer;
|
|
|
|
|
|
|
|
gchar *action_descriptions[LAST_ACTION];
|
|
|
|
gchar *image_description;
|
|
|
|
guint action_idle_handler;
|
|
|
|
} GtkIconViewItemAccessible;
|
|
|
|
|
2005-03-01 06:25:55 +00:00
|
|
|
static const gchar *const gtk_icon_view_item_accessible_action_names[] =
|
2004-08-12 05:37:10 +00:00
|
|
|
{
|
|
|
|
"activate",
|
|
|
|
NULL
|
|
|
|
};
|
|
|
|
|
2005-03-01 06:25:55 +00:00
|
|
|
static const gchar *const gtk_icon_view_item_accessible_action_descriptions[] =
|
2004-08-12 05:37:10 +00:00
|
|
|
{
|
|
|
|
"Activate item",
|
|
|
|
NULL
|
|
|
|
};
|
|
|
|
typedef struct _GtkIconViewItemAccessibleClass
|
|
|
|
{
|
|
|
|
AtkObjectClass parent_class;
|
|
|
|
|
|
|
|
} GtkIconViewItemAccessibleClass;
|
|
|
|
|
|
|
|
static gboolean gtk_icon_view_item_accessible_is_showing (GtkIconViewItemAccessible *item);
|
|
|
|
|
|
|
|
static gboolean
|
|
|
|
gtk_icon_view_item_accessible_idle_do_action (gpointer data)
|
|
|
|
{
|
|
|
|
GtkIconViewItemAccessible *item;
|
|
|
|
GtkIconView *icon_view;
|
|
|
|
GtkTreePath *path;
|
|
|
|
|
|
|
|
item = GTK_ICON_VIEW_ITEM_ACCESSIBLE (data);
|
2004-08-18 15:45:13 +00:00
|
|
|
item->action_idle_handler = 0;
|
2004-08-12 05:37:10 +00:00
|
|
|
|
2004-08-30 13:16:39 +00:00
|
|
|
if (item->widget != NULL)
|
|
|
|
{
|
|
|
|
icon_view = GTK_ICON_VIEW (item->widget);
|
|
|
|
path = gtk_tree_path_new_from_indices (item->item->index, -1);
|
|
|
|
gtk_icon_view_item_activated (icon_view, path);
|
|
|
|
gtk_tree_path_free (path);
|
|
|
|
}
|
2004-08-12 05:37:10 +00:00
|
|
|
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
static gboolean
|
|
|
|
gtk_icon_view_item_accessible_action_do_action (AtkAction *action,
|
|
|
|
gint i)
|
|
|
|
{
|
|
|
|
GtkIconViewItemAccessible *item;
|
|
|
|
|
|
|
|
if (i < 0 || i >= LAST_ACTION)
|
|
|
|
return FALSE;
|
|
|
|
|
|
|
|
item = GTK_ICON_VIEW_ITEM_ACCESSIBLE (action);
|
|
|
|
|
|
|
|
if (!GTK_IS_ICON_VIEW (item->widget))
|
|
|
|
return FALSE;
|
|
|
|
|
|
|
|
if (atk_state_set_contains_state (item->state_set, ATK_STATE_DEFUNCT))
|
|
|
|
return FALSE;
|
|
|
|
|
|
|
|
switch (i)
|
|
|
|
{
|
|
|
|
case ACTION_ACTIVATE:
|
|
|
|
if (!item->action_idle_handler)
|
2006-12-22 19:10:43 +00:00
|
|
|
item->action_idle_handler = gdk_threads_add_idle (gtk_icon_view_item_accessible_idle_do_action, item);
|
2004-08-12 05:37:10 +00:00
|
|
|
break;
|
|
|
|
default:
|
|
|
|
g_assert_not_reached ();
|
|
|
|
return FALSE;
|
|
|
|
|
|
|
|
}
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
static gint
|
|
|
|
gtk_icon_view_item_accessible_action_get_n_actions (AtkAction *action)
|
|
|
|
{
|
|
|
|
return LAST_ACTION;
|
|
|
|
}
|
|
|
|
|
|
|
|
static const gchar *
|
|
|
|
gtk_icon_view_item_accessible_action_get_description (AtkAction *action,
|
|
|
|
gint i)
|
|
|
|
{
|
|
|
|
GtkIconViewItemAccessible *item;
|
|
|
|
|
|
|
|
if (i < 0 || i >= LAST_ACTION)
|
|
|
|
return NULL;
|
|
|
|
|
|
|
|
item = GTK_ICON_VIEW_ITEM_ACCESSIBLE (action);
|
|
|
|
|
|
|
|
if (item->action_descriptions[i])
|
|
|
|
return item->action_descriptions[i];
|
|
|
|
else
|
|
|
|
return gtk_icon_view_item_accessible_action_descriptions[i];
|
|
|
|
}
|
|
|
|
|
|
|
|
static const gchar *
|
|
|
|
gtk_icon_view_item_accessible_action_get_name (AtkAction *action,
|
|
|
|
gint i)
|
|
|
|
{
|
|
|
|
if (i < 0 || i >= LAST_ACTION)
|
|
|
|
return NULL;
|
|
|
|
|
|
|
|
return gtk_icon_view_item_accessible_action_names[i];
|
|
|
|
}
|
|
|
|
|
|
|
|
static gboolean
|
|
|
|
gtk_icon_view_item_accessible_action_set_description (AtkAction *action,
|
|
|
|
gint i,
|
|
|
|
const gchar *description)
|
|
|
|
{
|
|
|
|
GtkIconViewItemAccessible *item;
|
|
|
|
|
|
|
|
if (i < 0 || i >= LAST_ACTION)
|
|
|
|
return FALSE;
|
|
|
|
|
|
|
|
item = GTK_ICON_VIEW_ITEM_ACCESSIBLE (action);
|
|
|
|
|
2007-03-09 21:57:37 +00:00
|
|
|
g_free (item->action_descriptions[i]);
|
2004-08-12 05:37:10 +00:00
|
|
|
|
|
|
|
item->action_descriptions[i] = g_strdup (description);
|
|
|
|
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
atk_action_item_interface_init (AtkActionIface *iface)
|
|
|
|
{
|
|
|
|
iface->do_action = gtk_icon_view_item_accessible_action_do_action;
|
|
|
|
iface->get_n_actions = gtk_icon_view_item_accessible_action_get_n_actions;
|
|
|
|
iface->get_description = gtk_icon_view_item_accessible_action_get_description;
|
|
|
|
iface->get_name = gtk_icon_view_item_accessible_action_get_name;
|
|
|
|
iface->set_description = gtk_icon_view_item_accessible_action_set_description;
|
|
|
|
}
|
|
|
|
|
|
|
|
static const gchar *
|
|
|
|
gtk_icon_view_item_accessible_image_get_image_description (AtkImage *image)
|
|
|
|
{
|
|
|
|
GtkIconViewItemAccessible *item;
|
|
|
|
|
|
|
|
item = GTK_ICON_VIEW_ITEM_ACCESSIBLE (image);
|
|
|
|
|
|
|
|
return item->image_description;
|
|
|
|
}
|
|
|
|
|
|
|
|
static gboolean
|
|
|
|
gtk_icon_view_item_accessible_image_set_image_description (AtkImage *image,
|
|
|
|
const gchar *description)
|
|
|
|
{
|
|
|
|
GtkIconViewItemAccessible *item;
|
|
|
|
|
|
|
|
item = GTK_ICON_VIEW_ITEM_ACCESSIBLE (image);
|
|
|
|
|
|
|
|
g_free (item->image_description);
|
2009-02-28 00:15:01 +00:00
|
|
|
item->image_description = g_strdup (description);
|
2004-08-12 05:37:10 +00:00
|
|
|
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
2010-12-12 07:29:41 +00:00
|
|
|
typedef struct {
|
|
|
|
GdkRectangle box;
|
|
|
|
gboolean pixbuf_found;
|
|
|
|
} GetPixbufBoxData;
|
|
|
|
|
|
|
|
static gboolean
|
|
|
|
get_pixbuf_foreach (GtkCellRenderer *renderer,
|
|
|
|
const GdkRectangle *cell_area,
|
|
|
|
const GdkRectangle *cell_background,
|
|
|
|
GetPixbufBoxData *data)
|
|
|
|
{
|
|
|
|
if (GTK_IS_CELL_RENDERER_PIXBUF (renderer))
|
|
|
|
{
|
|
|
|
data->box = *cell_area;
|
|
|
|
data->pixbuf_found = TRUE;
|
|
|
|
}
|
|
|
|
return (data->pixbuf_found != FALSE);
|
|
|
|
}
|
|
|
|
|
2005-05-02 20:28:37 +00:00
|
|
|
static gboolean
|
|
|
|
get_pixbuf_box (GtkIconView *icon_view,
|
|
|
|
GtkIconViewItem *item,
|
|
|
|
GdkRectangle *box)
|
|
|
|
{
|
2010-12-12 07:29:41 +00:00
|
|
|
GetPixbufBoxData data = { { 0, }, FALSE };
|
2010-12-12 15:24:26 +00:00
|
|
|
GtkCellAreaContext *context;
|
2005-05-02 20:28:37 +00:00
|
|
|
|
2010-12-12 15:24:26 +00:00
|
|
|
context = g_ptr_array_index (icon_view->priv->row_contexts, item->row);
|
2010-12-12 11:37:38 +00:00
|
|
|
|
2010-12-12 07:29:41 +00:00
|
|
|
gtk_icon_view_set_cell_data (icon_view, item);
|
2010-12-12 15:24:26 +00:00
|
|
|
gtk_cell_area_foreach_alloc (icon_view->priv->cell_area, context,
|
2010-12-12 07:29:41 +00:00
|
|
|
GTK_WIDGET (icon_view),
|
2010-12-13 08:41:50 +00:00
|
|
|
(GdkRectangle *)item, (GdkRectangle *)item,
|
2010-12-12 07:29:41 +00:00
|
|
|
(GtkCellAllocCallback)get_pixbuf_foreach, &data);
|
|
|
|
|
|
|
|
return data.pixbuf_found;
|
|
|
|
}
|
|
|
|
|
|
|
|
static gboolean
|
|
|
|
get_text_foreach (GtkCellRenderer *renderer,
|
|
|
|
gchar **text)
|
|
|
|
{
|
|
|
|
if (GTK_IS_CELL_RENDERER_TEXT (renderer))
|
2005-05-02 20:28:37 +00:00
|
|
|
{
|
2010-12-12 07:29:41 +00:00
|
|
|
g_object_get (renderer, "text", text, NULL);
|
2005-05-02 20:28:37 +00:00
|
|
|
|
2010-12-12 07:29:41 +00:00
|
|
|
return TRUE;
|
2005-05-02 20:28:37 +00:00
|
|
|
}
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
static gchar *
|
|
|
|
get_text (GtkIconView *icon_view,
|
|
|
|
GtkIconViewItem *item)
|
|
|
|
{
|
2010-12-12 07:29:41 +00:00
|
|
|
gchar *text = NULL;
|
2005-05-02 20:28:37 +00:00
|
|
|
|
2010-12-12 07:29:41 +00:00
|
|
|
gtk_icon_view_set_cell_data (icon_view, item);
|
|
|
|
gtk_cell_area_foreach (icon_view->priv->cell_area,
|
|
|
|
(GtkCellCallback)get_text_foreach, &text);
|
2005-05-02 20:28:37 +00:00
|
|
|
|
2010-12-12 07:29:41 +00:00
|
|
|
return text;
|
2005-05-02 20:28:37 +00:00
|
|
|
}
|
|
|
|
|
2004-08-12 05:37:10 +00:00
|
|
|
static void
|
|
|
|
gtk_icon_view_item_accessible_image_get_image_size (AtkImage *image,
|
|
|
|
gint *width,
|
|
|
|
gint *height)
|
|
|
|
{
|
|
|
|
GtkIconViewItemAccessible *item;
|
2005-05-02 20:28:37 +00:00
|
|
|
GdkRectangle box;
|
2004-08-12 05:37:10 +00:00
|
|
|
|
|
|
|
item = GTK_ICON_VIEW_ITEM_ACCESSIBLE (image);
|
|
|
|
|
|
|
|
if (!GTK_IS_ICON_VIEW (item->widget))
|
|
|
|
return;
|
|
|
|
|
|
|
|
if (atk_state_set_contains_state (item->state_set, ATK_STATE_DEFUNCT))
|
|
|
|
return;
|
|
|
|
|
2005-05-02 20:28:37 +00:00
|
|
|
if (get_pixbuf_box (GTK_ICON_VIEW (item->widget), item->item, &box))
|
|
|
|
{
|
|
|
|
*width = box.width;
|
|
|
|
*height = box.height;
|
|
|
|
}
|
2004-08-12 05:37:10 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
gtk_icon_view_item_accessible_image_get_image_position (AtkImage *image,
|
|
|
|
gint *x,
|
|
|
|
gint *y,
|
|
|
|
AtkCoordType coord_type)
|
|
|
|
{
|
|
|
|
GtkIconViewItemAccessible *item;
|
2005-05-02 20:28:37 +00:00
|
|
|
GdkRectangle box;
|
2004-08-12 05:37:10 +00:00
|
|
|
|
|
|
|
item = GTK_ICON_VIEW_ITEM_ACCESSIBLE (image);
|
|
|
|
|
|
|
|
if (!GTK_IS_ICON_VIEW (item->widget))
|
|
|
|
return;
|
|
|
|
|
|
|
|
if (atk_state_set_contains_state (item->state_set, ATK_STATE_DEFUNCT))
|
|
|
|
return;
|
|
|
|
|
|
|
|
atk_component_get_position (ATK_COMPONENT (image), x, y, coord_type);
|
2005-05-02 20:28:37 +00:00
|
|
|
|
|
|
|
if (get_pixbuf_box (GTK_ICON_VIEW (item->widget), item->item, &box))
|
|
|
|
{
|
2010-12-13 08:41:50 +00:00
|
|
|
*x+= box.x - item->item->cell_area.x;
|
|
|
|
*y+= box.y - item->item->cell_area.y;
|
2005-05-02 20:28:37 +00:00
|
|
|
}
|
|
|
|
|
2004-08-12 05:37:10 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
atk_image_item_interface_init (AtkImageIface *iface)
|
|
|
|
{
|
|
|
|
iface->get_image_description = gtk_icon_view_item_accessible_image_get_image_description;
|
|
|
|
iface->set_image_description = gtk_icon_view_item_accessible_image_set_image_description;
|
|
|
|
iface->get_image_size = gtk_icon_view_item_accessible_image_get_image_size;
|
|
|
|
iface->get_image_position = gtk_icon_view_item_accessible_image_get_image_position;
|
|
|
|
}
|
|
|
|
|
|
|
|
static gchar *
|
|
|
|
gtk_icon_view_item_accessible_text_get_text (AtkText *text,
|
|
|
|
gint start_pos,
|
|
|
|
gint end_pos)
|
|
|
|
{
|
|
|
|
GtkIconViewItemAccessible *item;
|
|
|
|
GtkTextIter start, end;
|
|
|
|
GtkTextBuffer *buffer;
|
|
|
|
|
|
|
|
item = GTK_ICON_VIEW_ITEM_ACCESSIBLE (text);
|
|
|
|
|
|
|
|
if (!GTK_IS_ICON_VIEW (item->widget))
|
|
|
|
return NULL;
|
|
|
|
|
|
|
|
if (atk_state_set_contains_state (item->state_set, ATK_STATE_DEFUNCT))
|
|
|
|
return NULL;
|
|
|
|
|
|
|
|
buffer = item->text_buffer;
|
|
|
|
gtk_text_buffer_get_iter_at_offset (buffer, &start, start_pos);
|
|
|
|
if (end_pos < 0)
|
|
|
|
gtk_text_buffer_get_end_iter (buffer, &end);
|
|
|
|
else
|
|
|
|
gtk_text_buffer_get_iter_at_offset (buffer, &end, end_pos);
|
|
|
|
|
|
|
|
return gtk_text_buffer_get_text (buffer, &start, &end, FALSE);
|
|
|
|
}
|
|
|
|
|
|
|
|
static gunichar
|
|
|
|
gtk_icon_view_item_accessible_text_get_character_at_offset (AtkText *text,
|
|
|
|
gint offset)
|
|
|
|
{
|
|
|
|
GtkIconViewItemAccessible *item;
|
|
|
|
GtkTextIter start, end;
|
|
|
|
GtkTextBuffer *buffer;
|
|
|
|
gchar *string;
|
|
|
|
gunichar unichar;
|
|
|
|
|
|
|
|
item = GTK_ICON_VIEW_ITEM_ACCESSIBLE (text);
|
|
|
|
|
|
|
|
if (!GTK_IS_ICON_VIEW (item->widget))
|
|
|
|
return '\0';
|
|
|
|
|
|
|
|
if (atk_state_set_contains_state (item->state_set, ATK_STATE_DEFUNCT))
|
|
|
|
return '\0';
|
|
|
|
|
|
|
|
buffer = item->text_buffer;
|
|
|
|
if (offset >= gtk_text_buffer_get_char_count (buffer))
|
|
|
|
return '\0';
|
|
|
|
|
|
|
|
gtk_text_buffer_get_iter_at_offset (buffer, &start, offset);
|
|
|
|
end = start;
|
|
|
|
gtk_text_iter_forward_char (&end);
|
|
|
|
string = gtk_text_buffer_get_slice (buffer, &start, &end, FALSE);
|
|
|
|
unichar = g_utf8_get_char (string);
|
|
|
|
g_free(string);
|
|
|
|
|
|
|
|
return unichar;
|
|
|
|
}
|
|
|
|
|
2005-09-13 19:57:42 +00:00
|
|
|
#if 0
|
2004-08-12 05:37:10 +00:00
|
|
|
static void
|
|
|
|
get_pango_text_offsets (PangoLayout *layout,
|
|
|
|
GtkTextBuffer *buffer,
|
|
|
|
gint function,
|
|
|
|
AtkTextBoundary boundary_type,
|
|
|
|
gint offset,
|
|
|
|
gint *start_offset,
|
|
|
|
gint *end_offset,
|
|
|
|
GtkTextIter *start_iter,
|
|
|
|
GtkTextIter *end_iter)
|
|
|
|
{
|
|
|
|
PangoLayoutIter *iter;
|
|
|
|
PangoLayoutLine *line, *prev_line = NULL, *prev_prev_line = NULL;
|
|
|
|
gint index, start_index, end_index;
|
|
|
|
const gchar *text;
|
|
|
|
gboolean found = FALSE;
|
|
|
|
|
|
|
|
text = pango_layout_get_text (layout);
|
|
|
|
index = g_utf8_offset_to_pointer (text, offset) - text;
|
|
|
|
iter = pango_layout_get_iter (layout);
|
|
|
|
do
|
|
|
|
{
|
Bug 340141 – Update to Pango 1.16 API
2006-12-24 Behdad Esfahbod <behdad@gnome.org>
Bug 340141 – Update to Pango 1.16 API
* gdk/gdkpango.c (layout_iter_get_line_clip_region),
(gdk_pango_layout_line_get_clip_region):
* gtk/gtkcalendar.c (gtk_calendar_size_request):
* gtk/gtkentry.c (gtk_entry_get_pixel_ranges),
(get_layout_position), (gtk_entry_find_position),
(gtk_entry_adjust_scroll):
* gtk/gtkiconview.c (get_pango_text_offsets):
* gtk/gtklabel.c (get_cursor_direction):
* gtk/gtkstyle.c (get_insensitive_layout):
* gtk/gtktextdisplay.c (render_para):
* gtk/gtktextlayout.c (allocate_child_widgets),
(find_display_line_below), (find_display_line_above),
(gtk_text_layout_move_iter_to_previous_line),
(gtk_text_layout_move_iter_to_next_line),
(gtk_text_layout_move_iter_to_line_end),
(gtk_text_layout_iter_starts_line),
(gtk_text_layout_move_iter_to_x):
* gtk/gtktextutil.c (limit_layout_lines):
Use the _readonly version of pango_layout_iter_get_line(),
pango_layout_iter_get_run(), pango_layout_get_line(), and
pango_layout_get_lines().
* gtk/gtkmain.c (gtk_get_default_language): Use
pango_get_default_language().
2006-12-24 05:29:25 +00:00
|
|
|
line = pango_layout_iter_get_line_readonly (iter);
|
2004-08-12 05:37:10 +00:00
|
|
|
start_index = line->start_index;
|
|
|
|
end_index = start_index + line->length;
|
|
|
|
|
|
|
|
if (index >= start_index && index <= end_index)
|
|
|
|
{
|
|
|
|
/*
|
|
|
|
* Found line for offset
|
|
|
|
*/
|
|
|
|
switch (function)
|
|
|
|
{
|
|
|
|
case 0:
|
|
|
|
/*
|
|
|
|
* We want the previous line
|
|
|
|
*/
|
|
|
|
if (prev_line)
|
|
|
|
{
|
|
|
|
switch (boundary_type)
|
|
|
|
{
|
|
|
|
case ATK_TEXT_BOUNDARY_LINE_START:
|
|
|
|
end_index = start_index;
|
|
|
|
start_index = prev_line->start_index;
|
|
|
|
break;
|
|
|
|
case ATK_TEXT_BOUNDARY_LINE_END:
|
|
|
|
if (prev_prev_line)
|
|
|
|
start_index = prev_prev_line->start_index +
|
|
|
|
prev_prev_line->length;
|
|
|
|
end_index = prev_line->start_index + prev_line->length;
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
g_assert_not_reached();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
start_index = end_index = 0;
|
|
|
|
break;
|
|
|
|
case 1:
|
|
|
|
switch (boundary_type)
|
|
|
|
{
|
|
|
|
case ATK_TEXT_BOUNDARY_LINE_START:
|
|
|
|
if (pango_layout_iter_next_line (iter))
|
Bug 340141 – Update to Pango 1.16 API
2006-12-24 Behdad Esfahbod <behdad@gnome.org>
Bug 340141 – Update to Pango 1.16 API
* gdk/gdkpango.c (layout_iter_get_line_clip_region),
(gdk_pango_layout_line_get_clip_region):
* gtk/gtkcalendar.c (gtk_calendar_size_request):
* gtk/gtkentry.c (gtk_entry_get_pixel_ranges),
(get_layout_position), (gtk_entry_find_position),
(gtk_entry_adjust_scroll):
* gtk/gtkiconview.c (get_pango_text_offsets):
* gtk/gtklabel.c (get_cursor_direction):
* gtk/gtkstyle.c (get_insensitive_layout):
* gtk/gtktextdisplay.c (render_para):
* gtk/gtktextlayout.c (allocate_child_widgets),
(find_display_line_below), (find_display_line_above),
(gtk_text_layout_move_iter_to_previous_line),
(gtk_text_layout_move_iter_to_next_line),
(gtk_text_layout_move_iter_to_line_end),
(gtk_text_layout_iter_starts_line),
(gtk_text_layout_move_iter_to_x):
* gtk/gtktextutil.c (limit_layout_lines):
Use the _readonly version of pango_layout_iter_get_line(),
pango_layout_iter_get_run(), pango_layout_get_line(), and
pango_layout_get_lines().
* gtk/gtkmain.c (gtk_get_default_language): Use
pango_get_default_language().
2006-12-24 05:29:25 +00:00
|
|
|
end_index = pango_layout_iter_get_line_readonly (iter)->start_index;
|
2004-08-12 05:37:10 +00:00
|
|
|
break;
|
|
|
|
case ATK_TEXT_BOUNDARY_LINE_END:
|
|
|
|
if (prev_line)
|
|
|
|
start_index = prev_line->start_index +
|
|
|
|
prev_line->length;
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
g_assert_not_reached();
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case 2:
|
|
|
|
/*
|
|
|
|
* We want the next line
|
|
|
|
*/
|
|
|
|
if (pango_layout_iter_next_line (iter))
|
|
|
|
{
|
Bug 340141 – Update to Pango 1.16 API
2006-12-24 Behdad Esfahbod <behdad@gnome.org>
Bug 340141 – Update to Pango 1.16 API
* gdk/gdkpango.c (layout_iter_get_line_clip_region),
(gdk_pango_layout_line_get_clip_region):
* gtk/gtkcalendar.c (gtk_calendar_size_request):
* gtk/gtkentry.c (gtk_entry_get_pixel_ranges),
(get_layout_position), (gtk_entry_find_position),
(gtk_entry_adjust_scroll):
* gtk/gtkiconview.c (get_pango_text_offsets):
* gtk/gtklabel.c (get_cursor_direction):
* gtk/gtkstyle.c (get_insensitive_layout):
* gtk/gtktextdisplay.c (render_para):
* gtk/gtktextlayout.c (allocate_child_widgets),
(find_display_line_below), (find_display_line_above),
(gtk_text_layout_move_iter_to_previous_line),
(gtk_text_layout_move_iter_to_next_line),
(gtk_text_layout_move_iter_to_line_end),
(gtk_text_layout_iter_starts_line),
(gtk_text_layout_move_iter_to_x):
* gtk/gtktextutil.c (limit_layout_lines):
Use the _readonly version of pango_layout_iter_get_line(),
pango_layout_iter_get_run(), pango_layout_get_line(), and
pango_layout_get_lines().
* gtk/gtkmain.c (gtk_get_default_language): Use
pango_get_default_language().
2006-12-24 05:29:25 +00:00
|
|
|
line = pango_layout_iter_get_line_readonly (iter);
|
2004-08-12 05:37:10 +00:00
|
|
|
switch (boundary_type)
|
|
|
|
{
|
|
|
|
case ATK_TEXT_BOUNDARY_LINE_START:
|
|
|
|
start_index = line->start_index;
|
|
|
|
if (pango_layout_iter_next_line (iter))
|
Bug 340141 – Update to Pango 1.16 API
2006-12-24 Behdad Esfahbod <behdad@gnome.org>
Bug 340141 – Update to Pango 1.16 API
* gdk/gdkpango.c (layout_iter_get_line_clip_region),
(gdk_pango_layout_line_get_clip_region):
* gtk/gtkcalendar.c (gtk_calendar_size_request):
* gtk/gtkentry.c (gtk_entry_get_pixel_ranges),
(get_layout_position), (gtk_entry_find_position),
(gtk_entry_adjust_scroll):
* gtk/gtkiconview.c (get_pango_text_offsets):
* gtk/gtklabel.c (get_cursor_direction):
* gtk/gtkstyle.c (get_insensitive_layout):
* gtk/gtktextdisplay.c (render_para):
* gtk/gtktextlayout.c (allocate_child_widgets),
(find_display_line_below), (find_display_line_above),
(gtk_text_layout_move_iter_to_previous_line),
(gtk_text_layout_move_iter_to_next_line),
(gtk_text_layout_move_iter_to_line_end),
(gtk_text_layout_iter_starts_line),
(gtk_text_layout_move_iter_to_x):
* gtk/gtktextutil.c (limit_layout_lines):
Use the _readonly version of pango_layout_iter_get_line(),
pango_layout_iter_get_run(), pango_layout_get_line(), and
pango_layout_get_lines().
* gtk/gtkmain.c (gtk_get_default_language): Use
pango_get_default_language().
2006-12-24 05:29:25 +00:00
|
|
|
end_index = pango_layout_iter_get_line_readonly (iter)->start_index;
|
2004-08-12 05:37:10 +00:00
|
|
|
else
|
|
|
|
end_index = start_index + line->length;
|
|
|
|
break;
|
|
|
|
case ATK_TEXT_BOUNDARY_LINE_END:
|
|
|
|
start_index = end_index;
|
|
|
|
end_index = line->start_index + line->length;
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
g_assert_not_reached();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
start_index = end_index;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
found = TRUE;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
prev_prev_line = prev_line;
|
|
|
|
prev_line = line;
|
|
|
|
}
|
|
|
|
while (pango_layout_iter_next_line (iter));
|
|
|
|
|
|
|
|
if (!found)
|
|
|
|
{
|
|
|
|
start_index = prev_line->start_index + prev_line->length;
|
|
|
|
end_index = start_index;
|
|
|
|
}
|
|
|
|
pango_layout_iter_free (iter);
|
|
|
|
*start_offset = g_utf8_pointer_to_offset (text, text + start_index);
|
|
|
|
*end_offset = g_utf8_pointer_to_offset (text, text + end_index);
|
|
|
|
|
|
|
|
gtk_text_buffer_get_iter_at_offset (buffer, start_iter, *start_offset);
|
|
|
|
gtk_text_buffer_get_iter_at_offset (buffer, end_iter, *end_offset);
|
|
|
|
}
|
2005-09-13 19:57:42 +00:00
|
|
|
#endif
|
2004-08-12 05:37:10 +00:00
|
|
|
|
|
|
|
static gchar*
|
|
|
|
gtk_icon_view_item_accessible_text_get_text_before_offset (AtkText *text,
|
|
|
|
gint offset,
|
|
|
|
AtkTextBoundary boundary_type,
|
|
|
|
gint *start_offset,
|
|
|
|
gint *end_offset)
|
|
|
|
{
|
|
|
|
GtkIconViewItemAccessible *item;
|
|
|
|
GtkTextIter start, end;
|
|
|
|
GtkTextBuffer *buffer;
|
2005-09-13 19:57:42 +00:00
|
|
|
#if 0
|
2004-08-12 05:37:10 +00:00
|
|
|
GtkIconView *icon_view;
|
2005-09-13 19:57:42 +00:00
|
|
|
#endif
|
2004-08-12 05:37:10 +00:00
|
|
|
|
|
|
|
item = GTK_ICON_VIEW_ITEM_ACCESSIBLE (text);
|
|
|
|
|
|
|
|
if (!GTK_IS_ICON_VIEW (item->widget))
|
|
|
|
return NULL;
|
|
|
|
|
|
|
|
if (atk_state_set_contains_state (item->state_set, ATK_STATE_DEFUNCT))
|
|
|
|
return NULL;
|
|
|
|
|
|
|
|
buffer = item->text_buffer;
|
|
|
|
|
|
|
|
if (!gtk_text_buffer_get_char_count (buffer))
|
|
|
|
{
|
|
|
|
*start_offset = 0;
|
|
|
|
*end_offset = 0;
|
|
|
|
return g_strdup ("");
|
|
|
|
}
|
|
|
|
gtk_text_buffer_get_iter_at_offset (buffer, &start, offset);
|
|
|
|
|
|
|
|
end = start;
|
|
|
|
|
|
|
|
switch (boundary_type)
|
|
|
|
{
|
|
|
|
case ATK_TEXT_BOUNDARY_CHAR:
|
|
|
|
gtk_text_iter_backward_char(&start);
|
|
|
|
break;
|
|
|
|
case ATK_TEXT_BOUNDARY_WORD_START:
|
|
|
|
if (!gtk_text_iter_starts_word (&start))
|
|
|
|
gtk_text_iter_backward_word_start (&start);
|
|
|
|
end = start;
|
|
|
|
gtk_text_iter_backward_word_start(&start);
|
|
|
|
break;
|
|
|
|
case ATK_TEXT_BOUNDARY_WORD_END:
|
|
|
|
if (gtk_text_iter_inside_word (&start) &&
|
|
|
|
!gtk_text_iter_starts_word (&start))
|
|
|
|
gtk_text_iter_backward_word_start (&start);
|
|
|
|
while (!gtk_text_iter_ends_word (&start))
|
|
|
|
{
|
|
|
|
if (!gtk_text_iter_backward_char (&start))
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
end = start;
|
|
|
|
gtk_text_iter_backward_word_start(&start);
|
|
|
|
while (!gtk_text_iter_ends_word (&start))
|
|
|
|
{
|
|
|
|
if (!gtk_text_iter_backward_char (&start))
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case ATK_TEXT_BOUNDARY_SENTENCE_START:
|
|
|
|
if (!gtk_text_iter_starts_sentence (&start))
|
|
|
|
gtk_text_iter_backward_sentence_start (&start);
|
|
|
|
end = start;
|
|
|
|
gtk_text_iter_backward_sentence_start (&start);
|
|
|
|
break;
|
|
|
|
case ATK_TEXT_BOUNDARY_SENTENCE_END:
|
|
|
|
if (gtk_text_iter_inside_sentence (&start) &&
|
|
|
|
!gtk_text_iter_starts_sentence (&start))
|
|
|
|
gtk_text_iter_backward_sentence_start (&start);
|
|
|
|
while (!gtk_text_iter_ends_sentence (&start))
|
|
|
|
{
|
|
|
|
if (!gtk_text_iter_backward_char (&start))
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
end = start;
|
|
|
|
gtk_text_iter_backward_sentence_start (&start);
|
|
|
|
while (!gtk_text_iter_ends_sentence (&start))
|
|
|
|
{
|
|
|
|
if (!gtk_text_iter_backward_char (&start))
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case ATK_TEXT_BOUNDARY_LINE_START:
|
|
|
|
case ATK_TEXT_BOUNDARY_LINE_END:
|
2005-05-02 20:28:37 +00:00
|
|
|
#if 0
|
2005-09-13 19:57:42 +00:00
|
|
|
icon_view = GTK_ICON_VIEW (item->widget);
|
2005-05-02 20:28:37 +00:00
|
|
|
/* FIXME we probably have to use GailTextCell to salvage this */
|
2004-08-12 05:37:10 +00:00
|
|
|
gtk_icon_view_update_item_text (icon_view, item->item);
|
|
|
|
get_pango_text_offsets (icon_view->priv->layout,
|
|
|
|
buffer,
|
|
|
|
0,
|
|
|
|
boundary_type,
|
|
|
|
offset,
|
|
|
|
start_offset,
|
|
|
|
end_offset,
|
|
|
|
&start,
|
|
|
|
&end);
|
2005-05-02 20:28:37 +00:00
|
|
|
#endif
|
2004-08-12 05:37:10 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
*start_offset = gtk_text_iter_get_offset (&start);
|
|
|
|
*end_offset = gtk_text_iter_get_offset (&end);
|
|
|
|
|
|
|
|
return gtk_text_buffer_get_text (buffer, &start, &end, FALSE);
|
|
|
|
}
|
|
|
|
|
|
|
|
static gchar*
|
|
|
|
gtk_icon_view_item_accessible_text_get_text_at_offset (AtkText *text,
|
|
|
|
gint offset,
|
|
|
|
AtkTextBoundary boundary_type,
|
|
|
|
gint *start_offset,
|
|
|
|
gint *end_offset)
|
|
|
|
{
|
|
|
|
GtkIconViewItemAccessible *item;
|
|
|
|
GtkTextIter start, end;
|
|
|
|
GtkTextBuffer *buffer;
|
2005-09-13 19:57:42 +00:00
|
|
|
#if 0
|
2004-08-12 05:37:10 +00:00
|
|
|
GtkIconView *icon_view;
|
2005-09-13 19:57:42 +00:00
|
|
|
#endif
|
2004-08-12 05:37:10 +00:00
|
|
|
|
|
|
|
item = GTK_ICON_VIEW_ITEM_ACCESSIBLE (text);
|
|
|
|
|
|
|
|
if (!GTK_IS_ICON_VIEW (item->widget))
|
|
|
|
return NULL;
|
|
|
|
|
|
|
|
if (atk_state_set_contains_state (item->state_set, ATK_STATE_DEFUNCT))
|
|
|
|
return NULL;
|
|
|
|
|
|
|
|
buffer = item->text_buffer;
|
|
|
|
|
|
|
|
if (!gtk_text_buffer_get_char_count (buffer))
|
|
|
|
{
|
|
|
|
*start_offset = 0;
|
|
|
|
*end_offset = 0;
|
|
|
|
return g_strdup ("");
|
|
|
|
}
|
|
|
|
gtk_text_buffer_get_iter_at_offset (buffer, &start, offset);
|
|
|
|
|
|
|
|
end = start;
|
|
|
|
|
|
|
|
switch (boundary_type)
|
|
|
|
{
|
|
|
|
case ATK_TEXT_BOUNDARY_CHAR:
|
|
|
|
gtk_text_iter_forward_char (&end);
|
|
|
|
break;
|
|
|
|
case ATK_TEXT_BOUNDARY_WORD_START:
|
|
|
|
if (!gtk_text_iter_starts_word (&start))
|
|
|
|
gtk_text_iter_backward_word_start (&start);
|
|
|
|
if (gtk_text_iter_inside_word (&end))
|
|
|
|
gtk_text_iter_forward_word_end (&end);
|
|
|
|
while (!gtk_text_iter_starts_word (&end))
|
|
|
|
{
|
|
|
|
if (!gtk_text_iter_forward_char (&end))
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case ATK_TEXT_BOUNDARY_WORD_END:
|
|
|
|
if (gtk_text_iter_inside_word (&start) &&
|
|
|
|
!gtk_text_iter_starts_word (&start))
|
|
|
|
gtk_text_iter_backward_word_start (&start);
|
|
|
|
while (!gtk_text_iter_ends_word (&start))
|
|
|
|
{
|
|
|
|
if (!gtk_text_iter_backward_char (&start))
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
gtk_text_iter_forward_word_end (&end);
|
|
|
|
break;
|
|
|
|
case ATK_TEXT_BOUNDARY_SENTENCE_START:
|
|
|
|
if (!gtk_text_iter_starts_sentence (&start))
|
|
|
|
gtk_text_iter_backward_sentence_start (&start);
|
|
|
|
if (gtk_text_iter_inside_sentence (&end))
|
|
|
|
gtk_text_iter_forward_sentence_end (&end);
|
|
|
|
while (!gtk_text_iter_starts_sentence (&end))
|
|
|
|
{
|
|
|
|
if (!gtk_text_iter_forward_char (&end))
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case ATK_TEXT_BOUNDARY_SENTENCE_END:
|
|
|
|
if (gtk_text_iter_inside_sentence (&start) &&
|
|
|
|
!gtk_text_iter_starts_sentence (&start))
|
|
|
|
gtk_text_iter_backward_sentence_start (&start);
|
|
|
|
while (!gtk_text_iter_ends_sentence (&start))
|
|
|
|
{
|
|
|
|
if (!gtk_text_iter_backward_char (&start))
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
gtk_text_iter_forward_sentence_end (&end);
|
|
|
|
break;
|
|
|
|
case ATK_TEXT_BOUNDARY_LINE_START:
|
|
|
|
case ATK_TEXT_BOUNDARY_LINE_END:
|
2005-05-02 20:28:37 +00:00
|
|
|
#if 0
|
2005-09-13 19:57:42 +00:00
|
|
|
icon_view = GTK_ICON_VIEW (item->widget);
|
2005-05-02 20:28:37 +00:00
|
|
|
/* FIXME we probably have to use GailTextCell to salvage this */
|
2004-08-12 05:37:10 +00:00
|
|
|
gtk_icon_view_update_item_text (icon_view, item->item);
|
|
|
|
get_pango_text_offsets (icon_view->priv->layout,
|
|
|
|
buffer,
|
|
|
|
1,
|
|
|
|
boundary_type,
|
|
|
|
offset,
|
|
|
|
start_offset,
|
|
|
|
end_offset,
|
|
|
|
&start,
|
|
|
|
&end);
|
2005-05-02 20:28:37 +00:00
|
|
|
#endif
|
2004-08-12 05:37:10 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
*start_offset = gtk_text_iter_get_offset (&start);
|
|
|
|
*end_offset = gtk_text_iter_get_offset (&end);
|
|
|
|
|
|
|
|
return gtk_text_buffer_get_text (buffer, &start, &end, FALSE);
|
|
|
|
}
|
|
|
|
|
|
|
|
static gchar*
|
|
|
|
gtk_icon_view_item_accessible_text_get_text_after_offset (AtkText *text,
|
|
|
|
gint offset,
|
|
|
|
AtkTextBoundary boundary_type,
|
|
|
|
gint *start_offset,
|
|
|
|
gint *end_offset)
|
|
|
|
{
|
|
|
|
GtkIconViewItemAccessible *item;
|
|
|
|
GtkTextIter start, end;
|
|
|
|
GtkTextBuffer *buffer;
|
2005-09-13 19:57:42 +00:00
|
|
|
#if 0
|
2004-08-12 05:37:10 +00:00
|
|
|
GtkIconView *icon_view;
|
2005-09-13 19:57:42 +00:00
|
|
|
#endif
|
2004-08-12 05:37:10 +00:00
|
|
|
|
|
|
|
item = GTK_ICON_VIEW_ITEM_ACCESSIBLE (text);
|
|
|
|
|
|
|
|
if (!GTK_IS_ICON_VIEW (item->widget))
|
|
|
|
return NULL;
|
|
|
|
|
|
|
|
if (atk_state_set_contains_state (item->state_set, ATK_STATE_DEFUNCT))
|
|
|
|
return NULL;
|
|
|
|
|
|
|
|
buffer = item->text_buffer;
|
|
|
|
|
|
|
|
if (!gtk_text_buffer_get_char_count (buffer))
|
|
|
|
{
|
|
|
|
*start_offset = 0;
|
|
|
|
*end_offset = 0;
|
|
|
|
return g_strdup ("");
|
|
|
|
}
|
|
|
|
gtk_text_buffer_get_iter_at_offset (buffer, &start, offset);
|
|
|
|
|
|
|
|
end = start;
|
|
|
|
|
|
|
|
switch (boundary_type)
|
|
|
|
{
|
|
|
|
case ATK_TEXT_BOUNDARY_CHAR:
|
|
|
|
gtk_text_iter_forward_char(&start);
|
|
|
|
gtk_text_iter_forward_chars(&end, 2);
|
|
|
|
break;
|
|
|
|
case ATK_TEXT_BOUNDARY_WORD_START:
|
|
|
|
if (gtk_text_iter_inside_word (&end))
|
|
|
|
gtk_text_iter_forward_word_end (&end);
|
|
|
|
while (!gtk_text_iter_starts_word (&end))
|
|
|
|
{
|
|
|
|
if (!gtk_text_iter_forward_char (&end))
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
start = end;
|
|
|
|
if (!gtk_text_iter_is_end (&end))
|
|
|
|
{
|
|
|
|
gtk_text_iter_forward_word_end (&end);
|
|
|
|
while (!gtk_text_iter_starts_word (&end))
|
|
|
|
{
|
|
|
|
if (!gtk_text_iter_forward_char (&end))
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case ATK_TEXT_BOUNDARY_WORD_END:
|
|
|
|
gtk_text_iter_forward_word_end (&end);
|
|
|
|
start = end;
|
|
|
|
if (!gtk_text_iter_is_end (&end))
|
|
|
|
gtk_text_iter_forward_word_end (&end);
|
|
|
|
break;
|
|
|
|
case ATK_TEXT_BOUNDARY_SENTENCE_START:
|
|
|
|
if (gtk_text_iter_inside_sentence (&end))
|
|
|
|
gtk_text_iter_forward_sentence_end (&end);
|
|
|
|
while (!gtk_text_iter_starts_sentence (&end))
|
|
|
|
{
|
|
|
|
if (!gtk_text_iter_forward_char (&end))
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
start = end;
|
|
|
|
if (!gtk_text_iter_is_end (&end))
|
|
|
|
{
|
|
|
|
gtk_text_iter_forward_sentence_end (&end);
|
|
|
|
while (!gtk_text_iter_starts_sentence (&end))
|
|
|
|
{
|
|
|
|
if (!gtk_text_iter_forward_char (&end))
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case ATK_TEXT_BOUNDARY_SENTENCE_END:
|
|
|
|
gtk_text_iter_forward_sentence_end (&end);
|
|
|
|
start = end;
|
|
|
|
if (!gtk_text_iter_is_end (&end))
|
|
|
|
gtk_text_iter_forward_sentence_end (&end);
|
|
|
|
break;
|
|
|
|
case ATK_TEXT_BOUNDARY_LINE_START:
|
|
|
|
case ATK_TEXT_BOUNDARY_LINE_END:
|
2005-05-02 20:28:37 +00:00
|
|
|
#if 0
|
2005-09-13 19:57:42 +00:00
|
|
|
icon_view = GTK_ICON_VIEW (item->widget);
|
2005-05-02 20:28:37 +00:00
|
|
|
/* FIXME we probably have to use GailTextCell to salvage this */
|
2004-08-12 05:37:10 +00:00
|
|
|
gtk_icon_view_update_item_text (icon_view, item->item);
|
|
|
|
get_pango_text_offsets (icon_view->priv->layout,
|
|
|
|
buffer,
|
|
|
|
2,
|
|
|
|
boundary_type,
|
|
|
|
offset,
|
|
|
|
start_offset,
|
|
|
|
end_offset,
|
|
|
|
&start,
|
|
|
|
&end);
|
2005-05-02 20:28:37 +00:00
|
|
|
#endif
|
2004-08-12 05:37:10 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
*start_offset = gtk_text_iter_get_offset (&start);
|
|
|
|
*end_offset = gtk_text_iter_get_offset (&end);
|
|
|
|
|
|
|
|
return gtk_text_buffer_get_text (buffer, &start, &end, FALSE);
|
|
|
|
}
|
|
|
|
|
|
|
|
static gint
|
|
|
|
gtk_icon_view_item_accessible_text_get_character_count (AtkText *text)
|
|
|
|
{
|
|
|
|
GtkIconViewItemAccessible *item;
|
|
|
|
|
|
|
|
item = GTK_ICON_VIEW_ITEM_ACCESSIBLE (text);
|
|
|
|
|
|
|
|
if (!GTK_IS_ICON_VIEW (item->widget))
|
|
|
|
return 0;
|
|
|
|
|
|
|
|
if (atk_state_set_contains_state (item->state_set, ATK_STATE_DEFUNCT))
|
|
|
|
return 0;
|
|
|
|
|
|
|
|
return gtk_text_buffer_get_char_count (item->text_buffer);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
gtk_icon_view_item_accessible_text_get_character_extents (AtkText *text,
|
|
|
|
gint offset,
|
|
|
|
gint *x,
|
|
|
|
gint *y,
|
|
|
|
gint *width,
|
|
|
|
gint *height,
|
|
|
|
AtkCoordType coord_type)
|
|
|
|
{
|
|
|
|
GtkIconViewItemAccessible *item;
|
2005-09-13 19:57:42 +00:00
|
|
|
#if 0
|
2004-08-12 05:37:10 +00:00
|
|
|
GtkIconView *icon_view;
|
|
|
|
PangoRectangle char_rect;
|
|
|
|
const gchar *item_text;
|
|
|
|
gint index;
|
2005-09-13 19:57:42 +00:00
|
|
|
#endif
|
2004-08-12 05:37:10 +00:00
|
|
|
|
|
|
|
item = GTK_ICON_VIEW_ITEM_ACCESSIBLE (text);
|
|
|
|
|
|
|
|
if (!GTK_IS_ICON_VIEW (item->widget))
|
|
|
|
return;
|
|
|
|
|
|
|
|
if (atk_state_set_contains_state (item->state_set, ATK_STATE_DEFUNCT))
|
|
|
|
return;
|
|
|
|
|
2005-05-02 20:28:37 +00:00
|
|
|
#if 0
|
2005-09-13 19:57:42 +00:00
|
|
|
icon_view = GTK_ICON_VIEW (item->widget);
|
2005-05-02 20:28:37 +00:00
|
|
|
/* FIXME we probably have to use GailTextCell to salvage this */
|
2004-08-12 05:37:10 +00:00
|
|
|
gtk_icon_view_update_item_text (icon_view, item->item);
|
|
|
|
item_text = pango_layout_get_text (icon_view->priv->layout);
|
|
|
|
index = g_utf8_offset_to_pointer (item_text, offset) - item_text;
|
|
|
|
pango_layout_index_to_pos (icon_view->priv->layout, index, &char_rect);
|
|
|
|
|
|
|
|
atk_component_get_position (ATK_COMPONENT (text), x, y, coord_type);
|
|
|
|
*x += item->item->layout_x - item->item->x + char_rect.x / PANGO_SCALE;
|
|
|
|
/* Look at gtk_icon_view_paint_item() to see where the text is. */
|
2004-12-14 06:39:45 +00:00
|
|
|
*x -= ((item->item->width - item->item->layout_width) / 2) + (MAX (item->item->pixbuf_width, icon_view->priv->item_width) - item->item->width) / 2,
|
2004-08-12 05:37:10 +00:00
|
|
|
*y += item->item->layout_y - item->item->y + char_rect.y / PANGO_SCALE;
|
|
|
|
*width = char_rect.width / PANGO_SCALE;
|
|
|
|
*height = char_rect.height / PANGO_SCALE;
|
2005-05-02 20:28:37 +00:00
|
|
|
#endif
|
2004-08-12 05:37:10 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static gint
|
|
|
|
gtk_icon_view_item_accessible_text_get_offset_at_point (AtkText *text,
|
|
|
|
gint x,
|
|
|
|
gint y,
|
|
|
|
AtkCoordType coord_type)
|
|
|
|
{
|
|
|
|
GtkIconViewItemAccessible *item;
|
2005-09-13 19:57:42 +00:00
|
|
|
gint offset = 0;
|
|
|
|
#if 0
|
2004-08-12 05:37:10 +00:00
|
|
|
GtkIconView *icon_view;
|
|
|
|
const gchar *item_text;
|
|
|
|
gint index;
|
|
|
|
gint l_x, l_y;
|
2005-09-13 19:57:42 +00:00
|
|
|
#endif
|
2004-08-12 05:37:10 +00:00
|
|
|
|
|
|
|
item = GTK_ICON_VIEW_ITEM_ACCESSIBLE (text);
|
|
|
|
|
|
|
|
if (!GTK_IS_ICON_VIEW (item->widget))
|
|
|
|
return -1;
|
|
|
|
|
|
|
|
if (atk_state_set_contains_state (item->state_set, ATK_STATE_DEFUNCT))
|
|
|
|
return -1;
|
|
|
|
|
2005-05-02 20:28:37 +00:00
|
|
|
#if 0
|
2005-09-13 19:57:42 +00:00
|
|
|
icon_view = GTK_ICON_VIEW (item->widget);
|
2005-05-02 20:28:37 +00:00
|
|
|
/* FIXME we probably have to use GailTextCell to salvage this */
|
2004-08-12 05:37:10 +00:00
|
|
|
gtk_icon_view_update_item_text (icon_view, item->item);
|
|
|
|
atk_component_get_position (ATK_COMPONENT (text), &l_x, &l_y, coord_type);
|
|
|
|
x -= l_x + item->item->layout_x - item->item->x;
|
2004-12-14 06:39:45 +00:00
|
|
|
x += ((item->item->width - item->item->layout_width) / 2) + (MAX (item->item->pixbuf_width, icon_view->priv->item_width) - item->item->width) / 2,
|
2004-08-12 05:37:10 +00:00
|
|
|
y -= l_y + item->item->layout_y - item->item->y;
|
|
|
|
item_text = pango_layout_get_text (icon_view->priv->layout);
|
|
|
|
if (!pango_layout_xy_to_index (icon_view->priv->layout,
|
|
|
|
x * PANGO_SCALE,
|
|
|
|
y * PANGO_SCALE,
|
|
|
|
&index, NULL))
|
|
|
|
{
|
|
|
|
if (x < 0 || y < 0)
|
|
|
|
index = 0;
|
|
|
|
else
|
|
|
|
index = -1;
|
|
|
|
}
|
|
|
|
if (index == -1)
|
|
|
|
offset = g_utf8_strlen (item_text, -1);
|
|
|
|
else
|
|
|
|
offset = g_utf8_pointer_to_offset (item_text, item_text + index);
|
2005-05-02 20:28:37 +00:00
|
|
|
#endif
|
2004-08-12 05:37:10 +00:00
|
|
|
return offset;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
atk_text_item_interface_init (AtkTextIface *iface)
|
|
|
|
{
|
|
|
|
iface->get_text = gtk_icon_view_item_accessible_text_get_text;
|
|
|
|
iface->get_character_at_offset = gtk_icon_view_item_accessible_text_get_character_at_offset;
|
|
|
|
iface->get_text_before_offset = gtk_icon_view_item_accessible_text_get_text_before_offset;
|
|
|
|
iface->get_text_at_offset = gtk_icon_view_item_accessible_text_get_text_at_offset;
|
|
|
|
iface->get_text_after_offset = gtk_icon_view_item_accessible_text_get_text_after_offset;
|
|
|
|
iface->get_character_count = gtk_icon_view_item_accessible_text_get_character_count;
|
|
|
|
iface->get_character_extents = gtk_icon_view_item_accessible_text_get_character_extents;
|
|
|
|
iface->get_offset_at_point = gtk_icon_view_item_accessible_text_get_offset_at_point;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
gtk_icon_view_item_accessible_get_extents (AtkComponent *component,
|
|
|
|
gint *x,
|
|
|
|
gint *y,
|
|
|
|
gint *width,
|
|
|
|
gint *height,
|
|
|
|
AtkCoordType coord_type)
|
|
|
|
{
|
|
|
|
GtkIconViewItemAccessible *item;
|
|
|
|
AtkObject *parent_obj;
|
|
|
|
gint l_x, l_y;
|
|
|
|
|
|
|
|
g_return_if_fail (GTK_IS_ICON_VIEW_ITEM_ACCESSIBLE (component));
|
|
|
|
|
|
|
|
item = GTK_ICON_VIEW_ITEM_ACCESSIBLE (component);
|
|
|
|
if (!GTK_IS_WIDGET (item->widget))
|
|
|
|
return;
|
|
|
|
|
|
|
|
if (atk_state_set_contains_state (item->state_set, ATK_STATE_DEFUNCT))
|
|
|
|
return;
|
|
|
|
|
2010-12-13 08:41:50 +00:00
|
|
|
*width = item->item->cell_area.width;
|
|
|
|
*height = item->item->cell_area.height;
|
2004-08-12 05:37:10 +00:00
|
|
|
if (gtk_icon_view_item_accessible_is_showing (item))
|
|
|
|
{
|
|
|
|
parent_obj = gtk_widget_get_accessible (item->widget);
|
|
|
|
atk_component_get_position (ATK_COMPONENT (parent_obj), &l_x, &l_y, coord_type);
|
2010-12-13 08:41:50 +00:00
|
|
|
*x = l_x + item->item->cell_area.x;
|
|
|
|
*y = l_y + item->item->cell_area.y;
|
2004-08-12 05:37:10 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
*x = G_MININT;
|
|
|
|
*y = G_MININT;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static gboolean
|
|
|
|
gtk_icon_view_item_accessible_grab_focus (AtkComponent *component)
|
|
|
|
{
|
|
|
|
GtkIconViewItemAccessible *item;
|
|
|
|
GtkWidget *toplevel;
|
|
|
|
|
|
|
|
g_return_val_if_fail (GTK_IS_ICON_VIEW_ITEM_ACCESSIBLE (component), FALSE);
|
|
|
|
|
|
|
|
item = GTK_ICON_VIEW_ITEM_ACCESSIBLE (component);
|
|
|
|
if (!GTK_IS_WIDGET (item->widget))
|
|
|
|
return FALSE;
|
|
|
|
|
|
|
|
gtk_widget_grab_focus (item->widget);
|
2010-12-12 07:29:41 +00:00
|
|
|
gtk_icon_view_set_cursor_item (GTK_ICON_VIEW (item->widget), item->item, NULL);
|
2004-08-12 05:37:10 +00:00
|
|
|
toplevel = gtk_widget_get_toplevel (GTK_WIDGET (item->widget));
|
2010-01-04 06:49:26 +00:00
|
|
|
if (gtk_widget_is_toplevel (toplevel))
|
2004-08-12 05:37:10 +00:00
|
|
|
gtk_window_present (GTK_WINDOW (toplevel));
|
|
|
|
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
atk_component_item_interface_init (AtkComponentIface *iface)
|
|
|
|
{
|
|
|
|
iface->get_extents = gtk_icon_view_item_accessible_get_extents;
|
|
|
|
iface->grab_focus = gtk_icon_view_item_accessible_grab_focus;
|
|
|
|
}
|
|
|
|
|
|
|
|
static gboolean
|
|
|
|
gtk_icon_view_item_accessible_add_state (GtkIconViewItemAccessible *item,
|
|
|
|
AtkStateType state_type,
|
|
|
|
gboolean emit_signal)
|
|
|
|
{
|
|
|
|
gboolean rc;
|
|
|
|
|
|
|
|
rc = atk_state_set_add_state (item->state_set, state_type);
|
|
|
|
/*
|
|
|
|
* The signal should only be generated if the value changed,
|
|
|
|
* not when the item is set up. So states that are set
|
|
|
|
* initially should pass FALSE as the emit_signal argument.
|
|
|
|
*/
|
|
|
|
|
|
|
|
if (emit_signal)
|
|
|
|
{
|
|
|
|
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)
|
2008-08-11 12:54:57 +00:00
|
|
|
g_signal_emit_by_name (item, "visible-data-changed");
|
2004-08-12 05:37:10 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
return rc;
|
|
|
|
}
|
|
|
|
|
|
|
|
static gboolean
|
|
|
|
gtk_icon_view_item_accessible_remove_state (GtkIconViewItemAccessible *item,
|
|
|
|
AtkStateType state_type,
|
|
|
|
gboolean emit_signal)
|
|
|
|
{
|
|
|
|
if (atk_state_set_contains_state (item->state_set, state_type))
|
|
|
|
{
|
|
|
|
gboolean rc;
|
|
|
|
|
|
|
|
rc = atk_state_set_remove_state (item->state_set, state_type);
|
|
|
|
/*
|
|
|
|
* The signal should only be generated if the value changed,
|
|
|
|
* not when the item is set up. So states that are set
|
|
|
|
* initially should pass FALSE as the emit_signal argument.
|
|
|
|
*/
|
|
|
|
|
|
|
|
if (emit_signal)
|
|
|
|
{
|
|
|
|
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)
|
2008-08-11 12:54:57 +00:00
|
|
|
g_signal_emit_by_name (item, "visible-data-changed");
|
2004-08-12 05:37:10 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
return rc;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
static gboolean
|
|
|
|
gtk_icon_view_item_accessible_is_showing (GtkIconViewItemAccessible *item)
|
|
|
|
{
|
2010-08-11 21:10:57 +00:00
|
|
|
GtkAllocation allocation;
|
2004-08-12 05:37:10 +00:00
|
|
|
GtkIconView *icon_view;
|
|
|
|
GdkRectangle visible_rect;
|
|
|
|
gboolean is_showing;
|
|
|
|
|
|
|
|
/*
|
|
|
|
* An item is considered "SHOWING" if any part of the item is in the
|
|
|
|
* visible rectangle.
|
|
|
|
*/
|
|
|
|
|
|
|
|
if (!GTK_IS_ICON_VIEW (item->widget))
|
|
|
|
return FALSE;
|
|
|
|
|
|
|
|
if (item->item == NULL)
|
|
|
|
return FALSE;
|
|
|
|
|
2010-08-11 21:10:57 +00:00
|
|
|
gtk_widget_get_allocation (item->widget, &allocation);
|
|
|
|
|
2004-08-12 05:37:10 +00:00
|
|
|
icon_view = GTK_ICON_VIEW (item->widget);
|
|
|
|
visible_rect.x = 0;
|
|
|
|
if (icon_view->priv->hadjustment)
|
2011-01-05 19:57:46 +00:00
|
|
|
visible_rect.x += gtk_adjustment_get_value (icon_view->priv->hadjustment);
|
2004-08-12 05:37:10 +00:00
|
|
|
visible_rect.y = 0;
|
|
|
|
if (icon_view->priv->hadjustment)
|
2011-01-05 19:57:46 +00:00
|
|
|
visible_rect.y += gtk_adjustment_get_value (icon_view->priv->vadjustment);
|
2010-08-11 21:10:57 +00:00
|
|
|
visible_rect.width = allocation.width;
|
|
|
|
visible_rect.height = allocation.height;
|
2004-08-12 05:37:10 +00:00
|
|
|
|
2010-12-13 08:41:50 +00:00
|
|
|
if (((item->item->cell_area.x + item->item->cell_area.width) < visible_rect.x) ||
|
|
|
|
((item->item->cell_area.y + item->item->cell_area.height) < (visible_rect.y)) ||
|
|
|
|
(item->item->cell_area.x > (visible_rect.x + visible_rect.width)) ||
|
|
|
|
(item->item->cell_area.y > (visible_rect.y + visible_rect.height)))
|
2004-08-12 05:37:10 +00:00
|
|
|
is_showing = FALSE;
|
|
|
|
else
|
|
|
|
is_showing = TRUE;
|
|
|
|
|
|
|
|
return is_showing;
|
|
|
|
}
|
|
|
|
|
|
|
|
static gboolean
|
|
|
|
gtk_icon_view_item_accessible_set_visibility (GtkIconViewItemAccessible *item,
|
|
|
|
gboolean emit_signal)
|
|
|
|
{
|
|
|
|
if (gtk_icon_view_item_accessible_is_showing (item))
|
2004-08-18 15:45:13 +00:00
|
|
|
return gtk_icon_view_item_accessible_add_state (item, ATK_STATE_SHOWING,
|
|
|
|
emit_signal);
|
2004-08-12 05:37:10 +00:00
|
|
|
else
|
2004-08-18 15:45:13 +00:00
|
|
|
return gtk_icon_view_item_accessible_remove_state (item, ATK_STATE_SHOWING,
|
|
|
|
emit_signal);
|
2004-08-12 05:37:10 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
gtk_icon_view_item_accessible_object_init (GtkIconViewItemAccessible *item)
|
|
|
|
{
|
|
|
|
gint i;
|
|
|
|
|
|
|
|
item->state_set = atk_state_set_new ();
|
|
|
|
|
|
|
|
atk_state_set_add_state (item->state_set, ATK_STATE_ENABLED);
|
|
|
|
atk_state_set_add_state (item->state_set, ATK_STATE_FOCUSABLE);
|
|
|
|
atk_state_set_add_state (item->state_set, ATK_STATE_SENSITIVE);
|
|
|
|
atk_state_set_add_state (item->state_set, ATK_STATE_SELECTABLE);
|
|
|
|
atk_state_set_add_state (item->state_set, ATK_STATE_VISIBLE);
|
|
|
|
|
|
|
|
for (i = 0; i < LAST_ACTION; i++)
|
|
|
|
item->action_descriptions[i] = NULL;
|
|
|
|
|
|
|
|
item->image_description = NULL;
|
|
|
|
|
|
|
|
item->action_idle_handler = 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
gtk_icon_view_item_accessible_finalize (GObject *object)
|
|
|
|
{
|
|
|
|
GtkIconViewItemAccessible *item;
|
|
|
|
gint i;
|
|
|
|
|
|
|
|
g_return_if_fail (GTK_IS_ICON_VIEW_ITEM_ACCESSIBLE (object));
|
|
|
|
|
|
|
|
item = GTK_ICON_VIEW_ITEM_ACCESSIBLE (object);
|
|
|
|
|
|
|
|
if (item->widget)
|
|
|
|
g_object_remove_weak_pointer (G_OBJECT (item->widget), (gpointer) &item->widget);
|
|
|
|
|
|
|
|
if (item->state_set)
|
|
|
|
g_object_unref (item->state_set);
|
|
|
|
|
|
|
|
if (item->text_buffer)
|
|
|
|
g_object_unref (item->text_buffer);
|
|
|
|
|
|
|
|
for (i = 0; i < LAST_ACTION; i++)
|
|
|
|
g_free (item->action_descriptions[i]);
|
|
|
|
|
|
|
|
g_free (item->image_description);
|
|
|
|
|
|
|
|
if (item->action_idle_handler)
|
|
|
|
{
|
|
|
|
g_source_remove (item->action_idle_handler);
|
|
|
|
item->action_idle_handler = 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
G_OBJECT_CLASS (accessible_item_parent_class)->finalize (object);
|
|
|
|
}
|
|
|
|
|
|
|
|
static AtkObject*
|
|
|
|
gtk_icon_view_item_accessible_get_parent (AtkObject *obj)
|
|
|
|
{
|
|
|
|
GtkIconViewItemAccessible *item;
|
|
|
|
|
|
|
|
g_return_val_if_fail (GTK_IS_ICON_VIEW_ITEM_ACCESSIBLE (obj), NULL);
|
|
|
|
item = GTK_ICON_VIEW_ITEM_ACCESSIBLE (obj);
|
|
|
|
|
|
|
|
if (item->widget)
|
|
|
|
return gtk_widget_get_accessible (item->widget);
|
|
|
|
else
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static gint
|
|
|
|
gtk_icon_view_item_accessible_get_index_in_parent (AtkObject *obj)
|
|
|
|
{
|
|
|
|
GtkIconViewItemAccessible *item;
|
|
|
|
|
|
|
|
g_return_val_if_fail (GTK_IS_ICON_VIEW_ITEM_ACCESSIBLE (obj), 0);
|
|
|
|
item = GTK_ICON_VIEW_ITEM_ACCESSIBLE (obj);
|
|
|
|
|
|
|
|
return item->item->index;
|
|
|
|
}
|
|
|
|
|
|
|
|
static AtkStateSet *
|
|
|
|
gtk_icon_view_item_accessible_ref_state_set (AtkObject *obj)
|
|
|
|
{
|
|
|
|
GtkIconViewItemAccessible *item;
|
|
|
|
GtkIconView *icon_view;
|
|
|
|
|
|
|
|
item = GTK_ICON_VIEW_ITEM_ACCESSIBLE (obj);
|
|
|
|
g_return_val_if_fail (item->state_set, NULL);
|
|
|
|
|
|
|
|
if (!item->widget)
|
|
|
|
return NULL;
|
|
|
|
|
|
|
|
icon_view = GTK_ICON_VIEW (item->widget);
|
|
|
|
if (icon_view->priv->cursor_item == item->item)
|
|
|
|
atk_state_set_add_state (item->state_set, ATK_STATE_FOCUSED);
|
|
|
|
else
|
|
|
|
atk_state_set_remove_state (item->state_set, ATK_STATE_FOCUSED);
|
2008-02-12 16:43:04 +00:00
|
|
|
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);
|
2004-08-12 05:37:10 +00:00
|
|
|
|
|
|
|
return g_object_ref (item->state_set);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
gtk_icon_view_item_accessible_class_init (AtkObjectClass *klass)
|
|
|
|
{
|
|
|
|
GObjectClass *gobject_class;
|
|
|
|
|
|
|
|
accessible_item_parent_class = g_type_class_peek_parent (klass);
|
|
|
|
|
|
|
|
gobject_class = (GObjectClass *)klass;
|
|
|
|
|
|
|
|
gobject_class->finalize = gtk_icon_view_item_accessible_finalize;
|
|
|
|
|
2011-02-17 20:56:52 +00:00
|
|
|
klass->get_index_in_parent = gtk_icon_view_item_accessible_get_index_in_parent;
|
|
|
|
klass->get_parent = gtk_icon_view_item_accessible_get_parent;
|
|
|
|
klass->ref_state_set = gtk_icon_view_item_accessible_ref_state_set;
|
2004-08-12 05:37:10 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static GType
|
|
|
|
gtk_icon_view_item_accessible_get_type (void)
|
|
|
|
{
|
|
|
|
static GType type = 0;
|
|
|
|
|
|
|
|
if (!type)
|
|
|
|
{
|
2006-10-03 15:54:52 +00:00
|
|
|
const GTypeInfo tinfo =
|
2004-08-12 05:37:10 +00:00
|
|
|
{
|
|
|
|
sizeof (GtkIconViewItemAccessibleClass),
|
|
|
|
(GBaseInitFunc) NULL, /* base init */
|
|
|
|
(GBaseFinalizeFunc) NULL, /* base finalize */
|
|
|
|
(GClassInitFunc) gtk_icon_view_item_accessible_class_init, /* class init */
|
|
|
|
(GClassFinalizeFunc) NULL, /* class finalize */
|
|
|
|
NULL, /* class data */
|
|
|
|
sizeof (GtkIconViewItemAccessible), /* instance size */
|
|
|
|
0, /* nb preallocs */
|
|
|
|
(GInstanceInitFunc) gtk_icon_view_item_accessible_object_init, /* instance init */
|
|
|
|
NULL /* value table */
|
|
|
|
};
|
|
|
|
|
2009-11-06 00:21:09 +00:00
|
|
|
const GInterfaceInfo atk_component_info =
|
2004-08-12 05:37:10 +00:00
|
|
|
{
|
|
|
|
(GInterfaceInitFunc) atk_component_item_interface_init,
|
|
|
|
(GInterfaceFinalizeFunc) NULL,
|
|
|
|
NULL
|
|
|
|
};
|
2009-11-06 00:21:09 +00:00
|
|
|
const GInterfaceInfo atk_action_info =
|
2004-08-12 05:37:10 +00:00
|
|
|
{
|
|
|
|
(GInterfaceInitFunc) atk_action_item_interface_init,
|
|
|
|
(GInterfaceFinalizeFunc) NULL,
|
|
|
|
NULL
|
|
|
|
};
|
2009-11-06 00:21:09 +00:00
|
|
|
const GInterfaceInfo atk_image_info =
|
2004-08-12 05:37:10 +00:00
|
|
|
{
|
|
|
|
(GInterfaceInitFunc) atk_image_item_interface_init,
|
|
|
|
(GInterfaceFinalizeFunc) NULL,
|
|
|
|
NULL
|
|
|
|
};
|
2009-11-06 00:21:09 +00:00
|
|
|
const GInterfaceInfo atk_text_info =
|
2004-08-12 05:37:10 +00:00
|
|
|
{
|
|
|
|
(GInterfaceInitFunc) atk_text_item_interface_init,
|
|
|
|
(GInterfaceFinalizeFunc) NULL,
|
|
|
|
NULL
|
|
|
|
};
|
|
|
|
|
|
|
|
type = g_type_register_static (ATK_TYPE_OBJECT,
|
2005-09-01 05:11:46 +00:00
|
|
|
I_("GtkIconViewItemAccessible"), &tinfo, 0);
|
2004-08-12 05:37:10 +00:00
|
|
|
g_type_add_interface_static (type, ATK_TYPE_COMPONENT,
|
|
|
|
&atk_component_info);
|
|
|
|
g_type_add_interface_static (type, ATK_TYPE_ACTION,
|
|
|
|
&atk_action_info);
|
|
|
|
g_type_add_interface_static (type, ATK_TYPE_IMAGE,
|
|
|
|
&atk_image_info);
|
|
|
|
g_type_add_interface_static (type, ATK_TYPE_TEXT,
|
|
|
|
&atk_text_info);
|
|
|
|
}
|
|
|
|
|
|
|
|
return type;
|
|
|
|
}
|
|
|
|
|
|
|
|
#define GTK_TYPE_ICON_VIEW_ACCESSIBLE (gtk_icon_view_accessible_get_type ())
|
|
|
|
#define GTK_ICON_VIEW_ACCESSIBLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_ICON_VIEW_ACCESSIBLE, GtkIconViewAccessible))
|
|
|
|
#define GTK_IS_ICON_VIEW_ACCESSIBLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_ICON_VIEW_ACCESSIBLE))
|
|
|
|
|
|
|
|
static GType gtk_icon_view_accessible_get_type (void);
|
|
|
|
|
|
|
|
typedef struct
|
|
|
|
{
|
|
|
|
AtkObject parent;
|
|
|
|
} GtkIconViewAccessible;
|
|
|
|
|
|
|
|
typedef struct
|
|
|
|
{
|
|
|
|
AtkObject *item;
|
|
|
|
gint index;
|
|
|
|
} GtkIconViewItemAccessibleInfo;
|
|
|
|
|
|
|
|
typedef struct
|
|
|
|
{
|
|
|
|
GList *items;
|
|
|
|
|
|
|
|
GtkAdjustment *old_hadj;
|
|
|
|
GtkAdjustment *old_vadj;
|
|
|
|
|
|
|
|
GtkTreeModel *model;
|
|
|
|
|
|
|
|
} GtkIconViewAccessiblePrivate;
|
|
|
|
|
|
|
|
static GtkIconViewAccessiblePrivate *
|
|
|
|
gtk_icon_view_accessible_get_priv (AtkObject *accessible)
|
|
|
|
{
|
|
|
|
return g_object_get_qdata (G_OBJECT (accessible),
|
|
|
|
accessible_private_data_quark);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
gtk_icon_view_item_accessible_info_new (AtkObject *accessible,
|
|
|
|
AtkObject *item,
|
|
|
|
gint index)
|
|
|
|
{
|
|
|
|
GtkIconViewItemAccessibleInfo *info;
|
|
|
|
GtkIconViewItemAccessibleInfo *tmp_info;
|
|
|
|
GtkIconViewAccessiblePrivate *priv;
|
|
|
|
GList *items;
|
|
|
|
|
|
|
|
info = g_new (GtkIconViewItemAccessibleInfo, 1);
|
|
|
|
info->item = item;
|
|
|
|
info->index = index;
|
|
|
|
|
|
|
|
priv = gtk_icon_view_accessible_get_priv (accessible);
|
|
|
|
items = priv->items;
|
|
|
|
while (items)
|
|
|
|
{
|
|
|
|
tmp_info = items->data;
|
|
|
|
if (tmp_info->index > index)
|
|
|
|
break;
|
|
|
|
items = items->next;
|
|
|
|
}
|
|
|
|
priv->items = g_list_insert_before (priv->items, items, info);
|
|
|
|
priv->old_hadj = NULL;
|
|
|
|
priv->old_vadj = NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static gint
|
|
|
|
gtk_icon_view_accessible_get_n_children (AtkObject *accessible)
|
|
|
|
{
|
|
|
|
GtkIconView *icon_view;
|
|
|
|
GtkWidget *widget;
|
|
|
|
|
2010-05-22 23:55:33 +00:00
|
|
|
widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (accessible));
|
2004-08-12 05:37:10 +00:00
|
|
|
if (!widget)
|
|
|
|
return 0;
|
|
|
|
|
|
|
|
icon_view = GTK_ICON_VIEW (widget);
|
|
|
|
|
|
|
|
return g_list_length (icon_view->priv->items);
|
|
|
|
}
|
|
|
|
|
|
|
|
static AtkObject *
|
|
|
|
gtk_icon_view_accessible_find_child (AtkObject *accessible,
|
|
|
|
gint index)
|
|
|
|
{
|
|
|
|
GtkIconViewAccessiblePrivate *priv;
|
|
|
|
GtkIconViewItemAccessibleInfo *info;
|
|
|
|
GList *items;
|
|
|
|
|
|
|
|
priv = gtk_icon_view_accessible_get_priv (accessible);
|
|
|
|
items = priv->items;
|
|
|
|
|
|
|
|
while (items)
|
|
|
|
{
|
|
|
|
info = items->data;
|
|
|
|
if (info->index == index)
|
|
|
|
return info->item;
|
|
|
|
items = items->next;
|
|
|
|
}
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static AtkObject *
|
|
|
|
gtk_icon_view_accessible_ref_child (AtkObject *accessible,
|
|
|
|
gint index)
|
|
|
|
{
|
|
|
|
GtkIconView *icon_view;
|
|
|
|
GtkWidget *widget;
|
|
|
|
GList *icons;
|
|
|
|
AtkObject *obj;
|
|
|
|
GtkIconViewItemAccessible *a11y_item;
|
|
|
|
|
2010-05-22 23:55:33 +00:00
|
|
|
widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (accessible));
|
2004-08-12 05:37:10 +00:00
|
|
|
if (!widget)
|
|
|
|
return NULL;
|
|
|
|
|
|
|
|
icon_view = GTK_ICON_VIEW (widget);
|
|
|
|
icons = g_list_nth (icon_view->priv->items, index);
|
|
|
|
obj = NULL;
|
|
|
|
if (icons)
|
|
|
|
{
|
|
|
|
GtkIconViewItem *item = icons->data;
|
|
|
|
|
|
|
|
g_return_val_if_fail (item->index == index, NULL);
|
|
|
|
obj = gtk_icon_view_accessible_find_child (accessible, index);
|
|
|
|
if (!obj)
|
|
|
|
{
|
2007-05-25 16:29:14 +00:00
|
|
|
gchar *text;
|
|
|
|
|
2004-08-12 05:37:10 +00:00
|
|
|
obj = g_object_new (gtk_icon_view_item_accessible_get_type (), NULL);
|
|
|
|
gtk_icon_view_item_accessible_info_new (accessible,
|
|
|
|
obj,
|
|
|
|
index);
|
|
|
|
obj->role = ATK_ROLE_ICON;
|
|
|
|
a11y_item = GTK_ICON_VIEW_ITEM_ACCESSIBLE (obj);
|
|
|
|
a11y_item->item = item;
|
|
|
|
a11y_item->widget = widget;
|
|
|
|
a11y_item->text_buffer = gtk_text_buffer_new (NULL);
|
2005-05-02 20:28:37 +00:00
|
|
|
|
2007-05-25 16:29:14 +00:00
|
|
|
text = get_text (icon_view, item);
|
|
|
|
if (text)
|
|
|
|
{
|
|
|
|
gtk_text_buffer_set_text (a11y_item->text_buffer, text, -1);
|
|
|
|
g_free (text);
|
|
|
|
}
|
2005-05-02 20:28:37 +00:00
|
|
|
|
2004-08-12 05:37:10 +00:00
|
|
|
gtk_icon_view_item_accessible_set_visibility (a11y_item, FALSE);
|
|
|
|
g_object_add_weak_pointer (G_OBJECT (widget), (gpointer) &(a11y_item->widget));
|
|
|
|
}
|
|
|
|
g_object_ref (obj);
|
|
|
|
}
|
|
|
|
return obj;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
gtk_icon_view_accessible_traverse_items (GtkIconViewAccessible *view,
|
|
|
|
GList *list)
|
|
|
|
{
|
|
|
|
GtkIconViewAccessiblePrivate *priv;
|
|
|
|
GtkIconViewItemAccessibleInfo *info;
|
|
|
|
GtkIconViewItemAccessible *item;
|
|
|
|
GList *items;
|
|
|
|
|
|
|
|
priv = gtk_icon_view_accessible_get_priv (ATK_OBJECT (view));
|
|
|
|
if (priv->items)
|
|
|
|
{
|
|
|
|
GtkWidget *widget;
|
|
|
|
gboolean act_on_item;
|
|
|
|
|
2010-05-22 23:55:33 +00:00
|
|
|
widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (view));
|
2004-08-12 05:37:10 +00:00
|
|
|
if (widget == NULL)
|
|
|
|
return;
|
|
|
|
|
|
|
|
items = priv->items;
|
|
|
|
|
|
|
|
act_on_item = (list == NULL);
|
|
|
|
|
|
|
|
while (items)
|
|
|
|
{
|
|
|
|
|
|
|
|
info = (GtkIconViewItemAccessibleInfo *)items->data;
|
|
|
|
item = GTK_ICON_VIEW_ITEM_ACCESSIBLE (info->item);
|
|
|
|
|
|
|
|
if (act_on_item == FALSE && list == items)
|
|
|
|
act_on_item = TRUE;
|
|
|
|
|
|
|
|
if (act_on_item)
|
|
|
|
gtk_icon_view_item_accessible_set_visibility (item, TRUE);
|
|
|
|
|
|
|
|
items = items->next;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2010-11-28 01:56:09 +00:00
|
|
|
gtk_icon_view_accessible_adjustment_changed (GtkAdjustment *adjustment,
|
|
|
|
GtkIconViewAccessible *view)
|
2004-08-12 05:37:10 +00:00
|
|
|
{
|
|
|
|
gtk_icon_view_accessible_traverse_items (view, NULL);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2010-11-28 01:56:09 +00:00
|
|
|
gtk_icon_view_accessible_set_adjustment (AtkObject *accessible,
|
2010-10-18 04:21:39 +00:00
|
|
|
GtkOrientation orientation,
|
|
|
|
GtkAdjustment *adjustment)
|
2004-08-12 05:37:10 +00:00
|
|
|
{
|
|
|
|
GtkIconViewAccessiblePrivate *priv;
|
2010-10-18 04:21:39 +00:00
|
|
|
GtkAdjustment **old_adj_ptr;
|
2004-08-12 05:37:10 +00:00
|
|
|
|
2010-11-28 01:56:09 +00:00
|
|
|
priv = gtk_icon_view_accessible_get_priv (accessible);
|
2004-08-12 05:37:10 +00:00
|
|
|
|
2010-10-18 04:21:39 +00:00
|
|
|
/* Adjustments are set for the first time in constructor and priv is not
|
|
|
|
* initialized at that time, so skip this first setting. */
|
|
|
|
if (!priv)
|
|
|
|
return;
|
|
|
|
|
|
|
|
if (orientation == GTK_ORIENTATION_HORIZONTAL)
|
2004-08-12 05:37:10 +00:00
|
|
|
{
|
2010-10-18 04:21:39 +00:00
|
|
|
if (priv->old_hadj == adjustment)
|
|
|
|
return;
|
|
|
|
|
|
|
|
old_adj_ptr = &priv->old_hadj;
|
2004-08-12 05:37:10 +00:00
|
|
|
}
|
2010-10-18 04:21:39 +00:00
|
|
|
else
|
2004-08-12 05:37:10 +00:00
|
|
|
{
|
2010-10-18 04:21:39 +00:00
|
|
|
if (priv->old_vadj == adjustment)
|
|
|
|
return;
|
|
|
|
|
|
|
|
old_adj_ptr = &priv->old_vadj;
|
2004-08-12 05:37:10 +00:00
|
|
|
}
|
2010-10-18 04:21:39 +00:00
|
|
|
|
|
|
|
/* Disconnect signal handlers */
|
|
|
|
if (*old_adj_ptr)
|
|
|
|
{
|
|
|
|
g_object_remove_weak_pointer (G_OBJECT (*old_adj_ptr),
|
|
|
|
(gpointer *)&priv->old_hadj);
|
|
|
|
g_signal_handlers_disconnect_by_func (*old_adj_ptr,
|
|
|
|
gtk_icon_view_accessible_adjustment_changed,
|
2010-11-28 01:56:09 +00:00
|
|
|
accessible);
|
2010-10-18 04:21:39 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/* Connect signal */
|
|
|
|
*old_adj_ptr = adjustment;
|
|
|
|
g_object_add_weak_pointer (G_OBJECT (adjustment), (gpointer *)old_adj_ptr);
|
|
|
|
g_signal_connect (adjustment, "value-changed",
|
|
|
|
G_CALLBACK (gtk_icon_view_accessible_adjustment_changed),
|
2010-11-28 01:56:09 +00:00
|
|
|
accessible);
|
2004-08-12 05:37:10 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
gtk_icon_view_accessible_model_row_changed (GtkTreeModel *tree_model,
|
|
|
|
GtkTreePath *path,
|
|
|
|
GtkTreeIter *iter,
|
2008-12-13 07:59:58 +00:00
|
|
|
gpointer user_data)
|
2004-08-12 05:37:10 +00:00
|
|
|
{
|
|
|
|
AtkObject *atk_obj;
|
2008-12-13 07:59:58 +00:00
|
|
|
gint index;
|
|
|
|
GtkWidget *widget;
|
|
|
|
GtkIconView *icon_view;
|
|
|
|
GtkIconViewItem *item;
|
|
|
|
GtkIconViewItemAccessible *a11y_item;
|
2009-06-17 08:28:03 +00:00
|
|
|
const gchar *name;
|
|
|
|
gchar *text;
|
2004-08-12 05:37:10 +00:00
|
|
|
|
|
|
|
atk_obj = gtk_widget_get_accessible (GTK_WIDGET (user_data));
|
2010-06-28 18:15:10 +00:00
|
|
|
index = gtk_tree_path_get_indices(path)[0];
|
2009-06-17 08:28:03 +00:00
|
|
|
a11y_item = GTK_ICON_VIEW_ITEM_ACCESSIBLE (
|
|
|
|
gtk_icon_view_accessible_find_child (atk_obj, index));
|
2008-12-13 07:59:58 +00:00
|
|
|
|
2008-12-22 09:04:19 +00:00
|
|
|
if (a11y_item)
|
|
|
|
{
|
2010-05-22 23:55:33 +00:00
|
|
|
widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (atk_obj));
|
2008-12-22 09:04:19 +00:00
|
|
|
icon_view = GTK_ICON_VIEW (widget);
|
|
|
|
item = a11y_item->item;
|
2008-12-13 07:59:58 +00:00
|
|
|
|
2011-02-17 20:56:52 +00:00
|
|
|
name = atk_object_get_name (ATK_OBJECT (a11y_item));
|
2008-12-13 07:59:58 +00:00
|
|
|
|
2008-12-22 09:04:19 +00:00
|
|
|
if (!name || strcmp (name, "") == 0)
|
2008-12-13 07:59:58 +00:00
|
|
|
{
|
2008-12-22 09:04:19 +00:00
|
|
|
text = get_text (icon_view, item);
|
|
|
|
if (text)
|
|
|
|
{
|
|
|
|
gtk_text_buffer_set_text (a11y_item->text_buffer, text, -1);
|
|
|
|
g_free (text);
|
|
|
|
}
|
2008-12-13 07:59:58 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2008-08-11 12:54:57 +00:00
|
|
|
g_signal_emit_by_name (atk_obj, "visible-data-changed");
|
2004-08-12 05:37:10 +00:00
|
|
|
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
gtk_icon_view_accessible_model_row_inserted (GtkTreeModel *tree_model,
|
|
|
|
GtkTreePath *path,
|
|
|
|
GtkTreeIter *iter,
|
|
|
|
gpointer user_data)
|
|
|
|
{
|
|
|
|
GtkIconViewAccessiblePrivate *priv;
|
|
|
|
GtkIconViewItemAccessibleInfo *info;
|
|
|
|
GtkIconViewAccessible *view;
|
|
|
|
GtkIconViewItemAccessible *item;
|
|
|
|
GList *items;
|
|
|
|
GList *tmp_list;
|
|
|
|
AtkObject *atk_obj;
|
|
|
|
gint index;
|
|
|
|
|
2010-06-28 18:15:10 +00:00
|
|
|
index = gtk_tree_path_get_indices(path)[0];
|
2004-08-12 05:37:10 +00:00
|
|
|
atk_obj = gtk_widget_get_accessible (GTK_WIDGET (user_data));
|
|
|
|
view = GTK_ICON_VIEW_ACCESSIBLE (atk_obj);
|
|
|
|
priv = gtk_icon_view_accessible_get_priv (atk_obj);
|
|
|
|
|
|
|
|
items = priv->items;
|
|
|
|
tmp_list = NULL;
|
|
|
|
while (items)
|
|
|
|
{
|
|
|
|
info = items->data;
|
|
|
|
item = GTK_ICON_VIEW_ITEM_ACCESSIBLE (info->item);
|
|
|
|
if (info->index != item->item->index)
|
|
|
|
{
|
|
|
|
if (info->index < index)
|
2004-08-18 15:45:13 +00:00
|
|
|
g_warning ("Unexpected index value on insertion %d %d", index, info->index);
|
2004-08-12 05:37:10 +00:00
|
|
|
|
2004-08-18 15:45:13 +00:00
|
|
|
if (tmp_list == NULL)
|
2004-08-12 05:37:10 +00:00
|
|
|
tmp_list = items;
|
|
|
|
|
|
|
|
info->index = item->item->index;
|
|
|
|
}
|
|
|
|
|
|
|
|
items = items->next;
|
|
|
|
}
|
|
|
|
gtk_icon_view_accessible_traverse_items (view, tmp_list);
|
2008-08-11 12:54:57 +00:00
|
|
|
g_signal_emit_by_name (atk_obj, "children-changed::add",
|
2004-08-12 05:37:10 +00:00
|
|
|
index, NULL, NULL);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
gtk_icon_view_accessible_model_row_deleted (GtkTreeModel *tree_model,
|
|
|
|
GtkTreePath *path,
|
|
|
|
gpointer user_data)
|
|
|
|
{
|
|
|
|
GtkIconViewAccessiblePrivate *priv;
|
|
|
|
GtkIconViewItemAccessibleInfo *info;
|
|
|
|
GtkIconViewAccessible *view;
|
|
|
|
GtkIconViewItemAccessible *item;
|
|
|
|
GList *items;
|
|
|
|
GList *tmp_list;
|
|
|
|
GList *deleted_item;
|
|
|
|
AtkObject *atk_obj;
|
|
|
|
gint index;
|
|
|
|
|
2010-06-28 18:15:10 +00:00
|
|
|
index = gtk_tree_path_get_indices(path)[0];
|
2004-08-12 05:37:10 +00:00
|
|
|
atk_obj = gtk_widget_get_accessible (GTK_WIDGET (user_data));
|
|
|
|
view = GTK_ICON_VIEW_ACCESSIBLE (atk_obj);
|
|
|
|
priv = gtk_icon_view_accessible_get_priv (atk_obj);
|
|
|
|
|
|
|
|
items = priv->items;
|
|
|
|
tmp_list = NULL;
|
|
|
|
deleted_item = NULL;
|
2004-08-18 15:45:13 +00:00
|
|
|
info = NULL;
|
2004-08-12 05:37:10 +00:00
|
|
|
while (items)
|
|
|
|
{
|
|
|
|
info = items->data;
|
|
|
|
item = GTK_ICON_VIEW_ITEM_ACCESSIBLE (info->item);
|
|
|
|
if (info->index == index)
|
|
|
|
{
|
|
|
|
deleted_item = items;
|
|
|
|
}
|
|
|
|
if (info->index != item->item->index)
|
|
|
|
{
|
2004-08-18 15:45:13 +00:00
|
|
|
if (tmp_list == NULL)
|
2004-08-12 05:37:10 +00:00
|
|
|
tmp_list = items;
|
2008-07-10 16:37:53 +00:00
|
|
|
|
|
|
|
info->index = item->item->index;
|
2004-08-12 05:37:10 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
items = items->next;
|
|
|
|
}
|
|
|
|
gtk_icon_view_accessible_traverse_items (view, tmp_list);
|
|
|
|
if (deleted_item)
|
|
|
|
{
|
|
|
|
info = deleted_item->data;
|
|
|
|
gtk_icon_view_item_accessible_add_state (GTK_ICON_VIEW_ITEM_ACCESSIBLE (info->item), ATK_STATE_DEFUNCT, TRUE);
|
2008-08-11 12:54:57 +00:00
|
|
|
g_signal_emit_by_name (atk_obj, "children-changed::remove",
|
2008-07-10 16:37:53 +00:00
|
|
|
index, NULL, NULL);
|
2004-08-12 05:37:10 +00:00
|
|
|
priv->items = g_list_remove_link (priv->items, deleted_item);
|
|
|
|
g_free (info);
|
|
|
|
}
|
|
|
|
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2004-08-25 16:21:15 +00:00
|
|
|
static gint
|
2004-08-12 05:37:10 +00:00
|
|
|
gtk_icon_view_accessible_item_compare (GtkIconViewItemAccessibleInfo *i1,
|
|
|
|
GtkIconViewItemAccessibleInfo *i2)
|
|
|
|
{
|
|
|
|
return i1->index - i2->index;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
gtk_icon_view_accessible_model_rows_reordered (GtkTreeModel *tree_model,
|
|
|
|
GtkTreePath *path,
|
|
|
|
GtkTreeIter *iter,
|
|
|
|
gint *new_order,
|
|
|
|
gpointer user_data)
|
|
|
|
{
|
|
|
|
GtkIconViewAccessiblePrivate *priv;
|
|
|
|
GtkIconViewItemAccessibleInfo *info;
|
|
|
|
GtkIconView *icon_view;
|
|
|
|
GtkIconViewItemAccessible *item;
|
|
|
|
GList *items;
|
|
|
|
AtkObject *atk_obj;
|
2008-12-13 05:28:21 +00:00
|
|
|
gint *order;
|
|
|
|
gint length, i;
|
2004-08-12 05:37:10 +00:00
|
|
|
|
|
|
|
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);
|
|
|
|
|
2008-12-13 05:28:21 +00:00
|
|
|
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;
|
|
|
|
|
2004-08-12 05:37:10 +00:00
|
|
|
items = priv->items;
|
|
|
|
while (items)
|
|
|
|
{
|
|
|
|
info = items->data;
|
|
|
|
item = GTK_ICON_VIEW_ITEM_ACCESSIBLE (info->item);
|
2008-12-13 05:28:21 +00:00
|
|
|
info->index = order[info->index];
|
2005-09-19 18:36:04 +00:00
|
|
|
item->item = g_list_nth_data (icon_view->priv->items, info->index);
|
2004-08-12 05:37:10 +00:00
|
|
|
items = items->next;
|
|
|
|
}
|
2008-12-13 05:28:21 +00:00
|
|
|
g_free (order);
|
2004-08-12 05:37:10 +00:00
|
|
|
priv->items = g_list_sort (priv->items,
|
|
|
|
(GCompareFunc)gtk_icon_view_accessible_item_compare);
|
|
|
|
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
gtk_icon_view_accessible_disconnect_model_signals (GtkTreeModel *model,
|
|
|
|
GtkWidget *widget)
|
|
|
|
{
|
|
|
|
GObject *obj;
|
|
|
|
|
|
|
|
obj = G_OBJECT (model);
|
|
|
|
g_signal_handlers_disconnect_by_func (obj, (gpointer) gtk_icon_view_accessible_model_row_changed, widget);
|
|
|
|
g_signal_handlers_disconnect_by_func (obj, (gpointer) gtk_icon_view_accessible_model_row_inserted, widget);
|
|
|
|
g_signal_handlers_disconnect_by_func (obj, (gpointer) gtk_icon_view_accessible_model_row_deleted, widget);
|
|
|
|
g_signal_handlers_disconnect_by_func (obj, (gpointer) gtk_icon_view_accessible_model_rows_reordered, widget);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
gtk_icon_view_accessible_connect_model_signals (GtkIconView *icon_view)
|
|
|
|
{
|
|
|
|
GObject *obj;
|
|
|
|
|
|
|
|
obj = G_OBJECT (icon_view->priv->model);
|
2008-08-11 12:54:57 +00:00
|
|
|
g_signal_connect_data (obj, "row-changed",
|
2004-08-12 05:37:10 +00:00
|
|
|
(GCallback) gtk_icon_view_accessible_model_row_changed,
|
|
|
|
icon_view, NULL, 0);
|
2008-08-11 12:54:57 +00:00
|
|
|
g_signal_connect_data (obj, "row-inserted",
|
2004-08-12 05:37:10 +00:00
|
|
|
(GCallback) gtk_icon_view_accessible_model_row_inserted,
|
|
|
|
icon_view, NULL, G_CONNECT_AFTER);
|
2008-08-11 12:54:57 +00:00
|
|
|
g_signal_connect_data (obj, "row-deleted",
|
2004-08-12 05:37:10 +00:00
|
|
|
(GCallback) gtk_icon_view_accessible_model_row_deleted,
|
|
|
|
icon_view, NULL, G_CONNECT_AFTER);
|
2008-08-11 12:54:57 +00:00
|
|
|
g_signal_connect_data (obj, "rows-reordered",
|
2004-08-12 05:37:10 +00:00
|
|
|
(GCallback) gtk_icon_view_accessible_model_rows_reordered,
|
|
|
|
icon_view, NULL, G_CONNECT_AFTER);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
gtk_icon_view_accessible_clear_cache (GtkIconViewAccessiblePrivate *priv)
|
|
|
|
{
|
|
|
|
GtkIconViewItemAccessibleInfo *info;
|
|
|
|
GList *items;
|
|
|
|
|
|
|
|
items = priv->items;
|
|
|
|
while (items)
|
|
|
|
{
|
|
|
|
info = (GtkIconViewItemAccessibleInfo *) items->data;
|
|
|
|
g_object_unref (info->item);
|
|
|
|
g_free (items->data);
|
|
|
|
items = items->next;
|
|
|
|
}
|
|
|
|
g_list_free (priv->items);
|
|
|
|
priv->items = NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
gtk_icon_view_accessible_notify_gtk (GObject *obj,
|
|
|
|
GParamSpec *pspec)
|
|
|
|
{
|
|
|
|
GtkIconView *icon_view;
|
|
|
|
GtkWidget *widget;
|
|
|
|
AtkObject *atk_obj;
|
|
|
|
GtkIconViewAccessiblePrivate *priv;
|
|
|
|
|
|
|
|
if (strcmp (pspec->name, "model") == 0)
|
|
|
|
{
|
|
|
|
widget = GTK_WIDGET (obj);
|
|
|
|
atk_obj = gtk_widget_get_accessible (widget);
|
|
|
|
priv = gtk_icon_view_accessible_get_priv (atk_obj);
|
|
|
|
if (priv->model)
|
|
|
|
{
|
|
|
|
g_object_remove_weak_pointer (G_OBJECT (priv->model),
|
|
|
|
(gpointer *)&priv->model);
|
|
|
|
gtk_icon_view_accessible_disconnect_model_signals (priv->model, widget);
|
|
|
|
}
|
|
|
|
gtk_icon_view_accessible_clear_cache (priv);
|
|
|
|
|
|
|
|
icon_view = GTK_ICON_VIEW (obj);
|
|
|
|
priv->model = icon_view->priv->model;
|
|
|
|
/* If there is no model the GtkIconView is probably being destroyed */
|
|
|
|
if (priv->model)
|
|
|
|
{
|
|
|
|
g_object_add_weak_pointer (G_OBJECT (priv->model), (gpointer *)&priv->model);
|
|
|
|
gtk_icon_view_accessible_connect_model_signals (icon_view);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
gtk_icon_view_accessible_initialize (AtkObject *accessible,
|
|
|
|
gpointer data)
|
|
|
|
{
|
|
|
|
GtkIconViewAccessiblePrivate *priv;
|
|
|
|
GtkIconView *icon_view;
|
|
|
|
|
|
|
|
if (ATK_OBJECT_CLASS (accessible_parent_class)->initialize)
|
|
|
|
ATK_OBJECT_CLASS (accessible_parent_class)->initialize (accessible, data);
|
|
|
|
|
|
|
|
priv = g_new0 (GtkIconViewAccessiblePrivate, 1);
|
|
|
|
g_object_set_qdata (G_OBJECT (accessible),
|
|
|
|
accessible_private_data_quark,
|
|
|
|
priv);
|
|
|
|
|
|
|
|
icon_view = GTK_ICON_VIEW (data);
|
|
|
|
if (icon_view->priv->hadjustment)
|
2010-11-28 01:56:09 +00:00
|
|
|
gtk_icon_view_accessible_set_adjustment (accessible,
|
2010-10-18 04:21:39 +00:00
|
|
|
GTK_ORIENTATION_HORIZONTAL,
|
|
|
|
icon_view->priv->hadjustment);
|
2004-08-12 05:37:10 +00:00
|
|
|
if (icon_view->priv->vadjustment)
|
2010-11-28 01:56:09 +00:00
|
|
|
gtk_icon_view_accessible_set_adjustment (accessible,
|
2010-10-18 04:21:39 +00:00
|
|
|
GTK_ORIENTATION_VERTICAL,
|
|
|
|
icon_view->priv->vadjustment);
|
2004-08-12 05:37:10 +00:00
|
|
|
g_signal_connect (data,
|
|
|
|
"notify",
|
|
|
|
G_CALLBACK (gtk_icon_view_accessible_notify_gtk),
|
|
|
|
NULL);
|
|
|
|
|
|
|
|
priv->model = icon_view->priv->model;
|
|
|
|
if (priv->model)
|
|
|
|
{
|
|
|
|
g_object_add_weak_pointer (G_OBJECT (priv->model), (gpointer *)&priv->model);
|
|
|
|
gtk_icon_view_accessible_connect_model_signals (icon_view);
|
|
|
|
}
|
|
|
|
|
|
|
|
accessible->role = ATK_ROLE_LAYERED_PANE;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
gtk_icon_view_accessible_finalize (GObject *object)
|
|
|
|
{
|
|
|
|
GtkIconViewAccessiblePrivate *priv;
|
|
|
|
|
|
|
|
priv = gtk_icon_view_accessible_get_priv (ATK_OBJECT (object));
|
|
|
|
gtk_icon_view_accessible_clear_cache (priv);
|
|
|
|
|
|
|
|
g_free (priv);
|
|
|
|
|
|
|
|
G_OBJECT_CLASS (accessible_parent_class)->finalize (object);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
gtk_icon_view_accessible_destroyed (GtkWidget *widget,
|
|
|
|
GtkAccessible *accessible)
|
|
|
|
{
|
|
|
|
AtkObject *atk_obj;
|
|
|
|
GtkIconViewAccessiblePrivate *priv;
|
|
|
|
|
|
|
|
atk_obj = ATK_OBJECT (accessible);
|
|
|
|
priv = gtk_icon_view_accessible_get_priv (atk_obj);
|
|
|
|
if (priv->old_hadj)
|
|
|
|
{
|
|
|
|
g_object_remove_weak_pointer (G_OBJECT (priv->old_hadj),
|
|
|
|
(gpointer *)&priv->old_hadj);
|
|
|
|
|
|
|
|
g_signal_handlers_disconnect_by_func (priv->old_hadj,
|
|
|
|
(gpointer) gtk_icon_view_accessible_adjustment_changed,
|
2010-11-28 01:56:09 +00:00
|
|
|
accessible);
|
2004-08-12 05:37:10 +00:00
|
|
|
priv->old_hadj = NULL;
|
|
|
|
}
|
|
|
|
if (priv->old_vadj)
|
|
|
|
{
|
|
|
|
g_object_remove_weak_pointer (G_OBJECT (priv->old_vadj),
|
|
|
|
(gpointer *)&priv->old_vadj);
|
|
|
|
|
|
|
|
g_signal_handlers_disconnect_by_func (priv->old_vadj,
|
|
|
|
(gpointer) gtk_icon_view_accessible_adjustment_changed,
|
2010-11-28 01:56:09 +00:00
|
|
|
accessible);
|
2004-08-12 05:37:10 +00:00
|
|
|
priv->old_vadj = NULL;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
gtk_icon_view_accessible_connect_widget_destroyed (GtkAccessible *accessible)
|
|
|
|
{
|
2010-05-22 23:55:33 +00:00
|
|
|
GtkWidget *widget;
|
|
|
|
|
|
|
|
widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (accessible));
|
|
|
|
if (widget)
|
2004-08-12 05:37:10 +00:00
|
|
|
{
|
2010-05-22 23:55:33 +00:00
|
|
|
g_signal_connect_after (widget,
|
2004-08-12 05:37:10 +00:00
|
|
|
"destroy",
|
|
|
|
G_CALLBACK (gtk_icon_view_accessible_destroyed),
|
|
|
|
accessible);
|
|
|
|
}
|
|
|
|
GTK_ACCESSIBLE_CLASS (accessible_parent_class)->connect_widget_destroyed (accessible);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
gtk_icon_view_accessible_class_init (AtkObjectClass *klass)
|
|
|
|
{
|
|
|
|
GObjectClass *gobject_class;
|
|
|
|
GtkAccessibleClass *accessible_class;
|
|
|
|
|
|
|
|
accessible_parent_class = g_type_class_peek_parent (klass);
|
|
|
|
|
|
|
|
gobject_class = (GObjectClass *)klass;
|
|
|
|
accessible_class = (GtkAccessibleClass *)klass;
|
|
|
|
|
|
|
|
gobject_class->finalize = gtk_icon_view_accessible_finalize;
|
|
|
|
|
|
|
|
klass->get_n_children = gtk_icon_view_accessible_get_n_children;
|
|
|
|
klass->ref_child = gtk_icon_view_accessible_ref_child;
|
|
|
|
klass->initialize = gtk_icon_view_accessible_initialize;
|
|
|
|
|
|
|
|
accessible_class->connect_widget_destroyed = gtk_icon_view_accessible_connect_widget_destroyed;
|
|
|
|
|
|
|
|
accessible_private_data_quark = g_quark_from_static_string ("icon_view-accessible-private-data");
|
|
|
|
}
|
|
|
|
|
|
|
|
static AtkObject*
|
|
|
|
gtk_icon_view_accessible_ref_accessible_at_point (AtkComponent *component,
|
|
|
|
gint x,
|
|
|
|
gint y,
|
|
|
|
AtkCoordType coord_type)
|
|
|
|
{
|
|
|
|
GtkWidget *widget;
|
|
|
|
GtkIconView *icon_view;
|
|
|
|
GtkIconViewItem *item;
|
|
|
|
gint x_pos, y_pos;
|
|
|
|
|
2010-05-22 23:55:33 +00:00
|
|
|
widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (component));
|
2004-08-12 05:37:10 +00:00
|
|
|
if (widget == NULL)
|
|
|
|
/* State is defunct */
|
|
|
|
return NULL;
|
|
|
|
|
|
|
|
icon_view = GTK_ICON_VIEW (widget);
|
|
|
|
atk_component_get_extents (component, &x_pos, &y_pos, NULL, NULL, coord_type);
|
2005-05-06 04:14:32 +00:00
|
|
|
item = gtk_icon_view_get_item_at_coords (icon_view, x - x_pos, y - y_pos, TRUE, NULL);
|
2004-08-12 05:37:10 +00:00
|
|
|
if (item)
|
|
|
|
return gtk_icon_view_accessible_ref_child (ATK_OBJECT (component), item->index);
|
|
|
|
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
atk_component_interface_init (AtkComponentIface *iface)
|
|
|
|
{
|
|
|
|
iface->ref_accessible_at_point = gtk_icon_view_accessible_ref_accessible_at_point;
|
|
|
|
}
|
|
|
|
|
|
|
|
static gboolean
|
|
|
|
gtk_icon_view_accessible_add_selection (AtkSelection *selection,
|
|
|
|
gint i)
|
|
|
|
{
|
|
|
|
GtkWidget *widget;
|
|
|
|
GtkIconView *icon_view;
|
|
|
|
GtkIconViewItem *item;
|
|
|
|
|
2010-05-22 23:55:33 +00:00
|
|
|
widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (selection));
|
2004-08-12 05:37:10 +00:00
|
|
|
if (widget == NULL)
|
|
|
|
return FALSE;
|
|
|
|
|
|
|
|
icon_view = GTK_ICON_VIEW (widget);
|
|
|
|
|
2005-09-19 18:36:04 +00:00
|
|
|
item = g_list_nth_data (icon_view->priv->items, i);
|
|
|
|
|
|
|
|
if (!item)
|
2004-08-12 05:37:10 +00:00
|
|
|
return FALSE;
|
|
|
|
|
|
|
|
gtk_icon_view_select_item (icon_view, item);
|
|
|
|
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
static gboolean
|
|
|
|
gtk_icon_view_accessible_clear_selection (AtkSelection *selection)
|
|
|
|
{
|
|
|
|
GtkWidget *widget;
|
|
|
|
GtkIconView *icon_view;
|
|
|
|
|
2010-05-22 23:55:33 +00:00
|
|
|
widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (selection));
|
2004-08-12 05:37:10 +00:00
|
|
|
if (widget == NULL)
|
|
|
|
return FALSE;
|
|
|
|
|
|
|
|
icon_view = GTK_ICON_VIEW (widget);
|
|
|
|
gtk_icon_view_unselect_all (icon_view);
|
|
|
|
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
static AtkObject*
|
|
|
|
gtk_icon_view_accessible_ref_selection (AtkSelection *selection,
|
|
|
|
gint i)
|
|
|
|
{
|
2006-12-29 04:39:51 +00:00
|
|
|
GList *l;
|
2004-08-12 05:37:10 +00:00
|
|
|
GtkWidget *widget;
|
|
|
|
GtkIconView *icon_view;
|
|
|
|
GtkIconViewItem *item;
|
|
|
|
|
2010-05-22 23:55:33 +00:00
|
|
|
widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (selection));
|
2004-08-12 05:37:10 +00:00
|
|
|
if (widget == NULL)
|
2004-10-28 15:00:05 +00:00
|
|
|
return NULL;
|
2004-08-12 05:37:10 +00:00
|
|
|
|
|
|
|
icon_view = GTK_ICON_VIEW (widget);
|
|
|
|
|
|
|
|
l = icon_view->priv->items;
|
|
|
|
while (l)
|
|
|
|
{
|
|
|
|
item = l->data;
|
|
|
|
if (item->selected)
|
|
|
|
{
|
|
|
|
if (i == 0)
|
|
|
|
return atk_object_ref_accessible_child (gtk_widget_get_accessible (widget), item->index);
|
|
|
|
else
|
|
|
|
i--;
|
|
|
|
}
|
|
|
|
l = l->next;
|
|
|
|
}
|
|
|
|
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static gint
|
|
|
|
gtk_icon_view_accessible_get_selection_count (AtkSelection *selection)
|
|
|
|
{
|
|
|
|
GtkWidget *widget;
|
|
|
|
GtkIconView *icon_view;
|
|
|
|
GtkIconViewItem *item;
|
|
|
|
GList *l;
|
|
|
|
gint count;
|
|
|
|
|
2010-05-22 23:55:33 +00:00
|
|
|
widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (selection));
|
2004-08-12 05:37:10 +00:00
|
|
|
if (widget == NULL)
|
|
|
|
return 0;
|
|
|
|
|
|
|
|
icon_view = GTK_ICON_VIEW (widget);
|
|
|
|
|
|
|
|
l = icon_view->priv->items;
|
|
|
|
count = 0;
|
|
|
|
while (l)
|
|
|
|
{
|
|
|
|
item = l->data;
|
|
|
|
|
|
|
|
if (item->selected)
|
|
|
|
count++;
|
|
|
|
|
|
|
|
l = l->next;
|
|
|
|
}
|
|
|
|
|
|
|
|
return count;
|
|
|
|
}
|
|
|
|
|
|
|
|
static gboolean
|
|
|
|
gtk_icon_view_accessible_is_child_selected (AtkSelection *selection,
|
|
|
|
gint i)
|
|
|
|
{
|
|
|
|
GtkWidget *widget;
|
|
|
|
GtkIconView *icon_view;
|
|
|
|
GtkIconViewItem *item;
|
|
|
|
|
2010-05-22 23:55:33 +00:00
|
|
|
widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (selection));
|
2004-08-12 05:37:10 +00:00
|
|
|
if (widget == NULL)
|
|
|
|
return FALSE;
|
|
|
|
|
|
|
|
icon_view = GTK_ICON_VIEW (widget);
|
|
|
|
|
2005-09-19 18:36:04 +00:00
|
|
|
item = g_list_nth_data (icon_view->priv->items, i);
|
|
|
|
if (!item)
|
|
|
|
return FALSE;
|
2004-08-12 05:37:10 +00:00
|
|
|
|
|
|
|
return item->selected;
|
|
|
|
}
|
|
|
|
|
|
|
|
static gboolean
|
|
|
|
gtk_icon_view_accessible_remove_selection (AtkSelection *selection,
|
|
|
|
gint i)
|
|
|
|
{
|
|
|
|
GtkWidget *widget;
|
|
|
|
GtkIconView *icon_view;
|
|
|
|
GtkIconViewItem *item;
|
|
|
|
GList *l;
|
|
|
|
gint count;
|
|
|
|
|
2010-05-22 23:55:33 +00:00
|
|
|
widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (selection));
|
2004-08-12 05:37:10 +00:00
|
|
|
if (widget == NULL)
|
|
|
|
return FALSE;
|
|
|
|
|
|
|
|
icon_view = GTK_ICON_VIEW (widget);
|
|
|
|
l = icon_view->priv->items;
|
|
|
|
count = 0;
|
|
|
|
while (l)
|
|
|
|
{
|
|
|
|
item = l->data;
|
|
|
|
if (item->selected)
|
|
|
|
{
|
|
|
|
if (count == i)
|
|
|
|
{
|
|
|
|
gtk_icon_view_unselect_item (icon_view, item);
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
count++;
|
|
|
|
}
|
|
|
|
l = l->next;
|
|
|
|
}
|
|
|
|
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
static gboolean
|
|
|
|
gtk_icon_view_accessible_select_all_selection (AtkSelection *selection)
|
|
|
|
{
|
|
|
|
GtkWidget *widget;
|
|
|
|
GtkIconView *icon_view;
|
|
|
|
|
2010-05-22 23:55:33 +00:00
|
|
|
widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (selection));
|
2004-08-12 05:37:10 +00:00
|
|
|
if (widget == NULL)
|
|
|
|
return FALSE;
|
|
|
|
|
|
|
|
icon_view = GTK_ICON_VIEW (widget);
|
|
|
|
gtk_icon_view_select_all (icon_view);
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
gtk_icon_view_accessible_selection_interface_init (AtkSelectionIface *iface)
|
|
|
|
{
|
|
|
|
iface->add_selection = gtk_icon_view_accessible_add_selection;
|
|
|
|
iface->clear_selection = gtk_icon_view_accessible_clear_selection;
|
|
|
|
iface->ref_selection = gtk_icon_view_accessible_ref_selection;
|
|
|
|
iface->get_selection_count = gtk_icon_view_accessible_get_selection_count;
|
|
|
|
iface->is_child_selected = gtk_icon_view_accessible_is_child_selected;
|
|
|
|
iface->remove_selection = gtk_icon_view_accessible_remove_selection;
|
|
|
|
iface->select_all_selection = gtk_icon_view_accessible_select_all_selection;
|
|
|
|
}
|
|
|
|
|
|
|
|
static GType
|
|
|
|
gtk_icon_view_accessible_get_type (void)
|
|
|
|
{
|
|
|
|
static GType type = 0;
|
|
|
|
|
|
|
|
if (!type)
|
|
|
|
{
|
2009-11-06 00:21:09 +00:00
|
|
|
GTypeInfo tinfo =
|
2004-08-12 05:37:10 +00:00
|
|
|
{
|
|
|
|
0, /* class size */
|
|
|
|
(GBaseInitFunc) NULL, /* base init */
|
|
|
|
(GBaseFinalizeFunc) NULL, /* base finalize */
|
|
|
|
(GClassInitFunc) gtk_icon_view_accessible_class_init,
|
|
|
|
(GClassFinalizeFunc) NULL, /* class finalize */
|
|
|
|
NULL, /* class data */
|
|
|
|
0, /* instance size */
|
|
|
|
0, /* nb preallocs */
|
|
|
|
(GInstanceInitFunc) NULL, /* instance init */
|
|
|
|
NULL /* value table */
|
|
|
|
};
|
2009-11-06 00:21:09 +00:00
|
|
|
const GInterfaceInfo atk_component_info =
|
2004-08-12 05:37:10 +00:00
|
|
|
{
|
|
|
|
(GInterfaceInitFunc) atk_component_interface_init,
|
|
|
|
(GInterfaceFinalizeFunc) NULL,
|
|
|
|
NULL
|
|
|
|
};
|
2009-11-06 00:21:09 +00:00
|
|
|
const GInterfaceInfo atk_selection_info =
|
2004-08-12 05:37:10 +00:00
|
|
|
{
|
|
|
|
(GInterfaceInitFunc) gtk_icon_view_accessible_selection_interface_init,
|
|
|
|
(GInterfaceFinalizeFunc) NULL,
|
|
|
|
NULL
|
|
|
|
};
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Figure out the size of the class and instance
|
|
|
|
* we are deriving from
|
|
|
|
*/
|
|
|
|
AtkObjectFactory *factory;
|
|
|
|
GType derived_type;
|
|
|
|
GTypeQuery query;
|
|
|
|
GType derived_atk_type;
|
|
|
|
|
|
|
|
derived_type = g_type_parent (GTK_TYPE_ICON_VIEW);
|
|
|
|
factory = atk_registry_get_factory (atk_get_default_registry (),
|
|
|
|
derived_type);
|
|
|
|
derived_atk_type = atk_object_factory_get_accessible_type (factory);
|
|
|
|
g_type_query (derived_atk_type, &query);
|
|
|
|
tinfo.class_size = query.class_size;
|
|
|
|
tinfo.instance_size = query.instance_size;
|
|
|
|
|
|
|
|
type = g_type_register_static (derived_atk_type,
|
2007-04-27 23:10:38 +00:00
|
|
|
I_("GtkIconViewAccessible"),
|
2004-08-12 05:37:10 +00:00
|
|
|
&tinfo, 0);
|
|
|
|
g_type_add_interface_static (type, ATK_TYPE_COMPONENT,
|
|
|
|
&atk_component_info);
|
|
|
|
g_type_add_interface_static (type, ATK_TYPE_SELECTION,
|
|
|
|
&atk_selection_info);
|
|
|
|
}
|
|
|
|
return type;
|
|
|
|
}
|
|
|
|
|
2004-08-25 16:21:15 +00:00
|
|
|
static AtkObject *
|
2004-08-12 05:37:10 +00:00
|
|
|
gtk_icon_view_accessible_new (GObject *obj)
|
|
|
|
{
|
|
|
|
AtkObject *accessible;
|
|
|
|
|
|
|
|
g_return_val_if_fail (GTK_IS_WIDGET (obj), NULL);
|
|
|
|
|
|
|
|
accessible = g_object_new (gtk_icon_view_accessible_get_type (), NULL);
|
|
|
|
atk_object_initialize (accessible, obj);
|
|
|
|
|
|
|
|
return accessible;
|
|
|
|
}
|
|
|
|
|
|
|
|
static GType
|
|
|
|
gtk_icon_view_accessible_factory_get_accessible_type (void)
|
|
|
|
{
|
|
|
|
return gtk_icon_view_accessible_get_type ();
|
|
|
|
}
|
|
|
|
|
|
|
|
static AtkObject*
|
|
|
|
gtk_icon_view_accessible_factory_create_accessible (GObject *obj)
|
|
|
|
{
|
|
|
|
return gtk_icon_view_accessible_new (obj);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
gtk_icon_view_accessible_factory_class_init (AtkObjectFactoryClass *klass)
|
|
|
|
{
|
|
|
|
klass->create_accessible = gtk_icon_view_accessible_factory_create_accessible;
|
|
|
|
klass->get_accessible_type = gtk_icon_view_accessible_factory_get_accessible_type;
|
|
|
|
}
|
|
|
|
|
|
|
|
static GType
|
|
|
|
gtk_icon_view_accessible_factory_get_type (void)
|
|
|
|
{
|
|
|
|
static GType type = 0;
|
|
|
|
|
|
|
|
if (!type)
|
|
|
|
{
|
2006-10-03 15:54:52 +00:00
|
|
|
const GTypeInfo tinfo =
|
2004-08-12 05:37:10 +00:00
|
|
|
{
|
|
|
|
sizeof (AtkObjectFactoryClass),
|
|
|
|
NULL, /* base_init */
|
|
|
|
NULL, /* base_finalize */
|
|
|
|
(GClassInitFunc) gtk_icon_view_accessible_factory_class_init,
|
|
|
|
NULL, /* class_finalize */
|
|
|
|
NULL, /* class_data */
|
|
|
|
sizeof (AtkObjectFactory),
|
|
|
|
0, /* n_preallocs */
|
|
|
|
NULL, NULL
|
|
|
|
};
|
|
|
|
|
|
|
|
type = g_type_register_static (ATK_TYPE_OBJECT_FACTORY,
|
2007-04-27 23:10:38 +00:00
|
|
|
I_("GtkIconViewAccessibleFactory"),
|
2004-08-12 05:37:10 +00:00
|
|
|
&tinfo, 0);
|
|
|
|
}
|
|
|
|
return type;
|
|
|
|
}
|
|
|
|
|
2005-05-02 20:28:37 +00:00
|
|
|
|
2004-08-12 05:37:10 +00:00
|
|
|
static AtkObject *
|
|
|
|
gtk_icon_view_get_accessible (GtkWidget *widget)
|
|
|
|
{
|
|
|
|
static gboolean first_time = TRUE;
|
|
|
|
|
|
|
|
if (first_time)
|
|
|
|
{
|
2011-02-17 06:30:33 +00:00
|
|
|
_gtk_accessible_set_factory_type (GTK_TYPE_ICON_VIEW,
|
|
|
|
gtk_icon_view_accessible_factory_get_type ());
|
2004-08-12 05:37:10 +00:00
|
|
|
first_time = FALSE;
|
2011-02-17 06:30:33 +00:00
|
|
|
}
|
2008-08-12 09:06:34 +00:00
|
|
|
return GTK_WIDGET_CLASS (gtk_icon_view_parent_class)->get_accessible (widget);
|
2004-08-12 05:37:10 +00:00
|
|
|
}
|
|
|
|
|
Add GtkBuilder, fixes #172535
2007-06-15 Johan Dahlin <jdahlin@async.com.br>
* demos/gtk-demo/Makefile.am:
* demos/gtk-demo/builder.c: (quit_activate), (about_activate),
(do_builder):
* demos/gtk-demo/demo.ui:
* docs/reference/gtk/gtk-docs.sgml:
* docs/reference/gtk/gtk-sections.txt:
* docs/reference/gtk/gtk.types:
* docs/reference/gtk/tmpl/gtkbuildable.sgml:
* docs/reference/gtk/tmpl/gtkbuilder.sgml:
* gtk/Makefile.am:
* gtk/gtk.h:
* gtk/gtk.symbols:
* gtk/gtkaction.c: (gtk_action_buildable_init),
(gtk_action_buildable_set_name), (gtk_action_buildable_get_name):
* gtk/gtkactiongroup.c: (gtk_action_group_get_type),
(gtk_action_group_buildable_init),
(gtk_action_group_buildable_add),
(gtk_action_group_buildable_set_name),
(gtk_action_group_buildable_get_name):
* gtk/gtkbuildable.c: (gtk_buildable_get_type),
(gtk_buildable_set_name), (gtk_buildable_get_name),
(gtk_buildable_add), (gtk_buildable_set_property),
(gtk_buildable_parser_finished), (gtk_buildable_construct_child),
(gtk_buildable_custom_tag_start), (gtk_buildable_custom_tag_end),
(gtk_buildable_custom_finished),
(gtk_buildable_get_internal_child):
* gtk/gtkbuildable.h:
* gtk/gtkbuilder.c: (gtk_builder_class_init), (gtk_builder_init),
(gtk_builder_finalize), (gtk_builder_set_property),
(gtk_builder_get_property), (_gtk_builder_resolve_type_lazily),
(gtk_builder_real_get_type_from_name),
(gtk_builder_get_parameters), (gtk_builder_get_internal_child),
(_gtk_builder_construct), (_gtk_builder_add),
(apply_delayed_properties), (_gtk_builder_finish),
(gtk_builder_new), (gtk_builder_add_from_file),
(gtk_builder_add_from_string), (gtk_builder_get_object),
(object_add_to_list), (gtk_builder_get_objects),
(gtk_builder_set_translation_domain),
(gtk_builder_get_translation_domain),
(gtk_builder_connect_signals_default),
(gtk_builder_connect_signals), (gtk_builder_connect_signals_full),
(gtk_builder_value_from_string),
(gtk_builder_value_from_string_type),
(_gtk_builder_enum_from_string), (_gtk_builder_flags_from_string),
(gtk_builder_get_type_from_name), (gtk_builder_error_quark):
* gtk/gtkbuilder.h:
* gtk/gtkbuilderparser.c: (state_push), (state_peek), (state_pop),
(error_missing_attribute), (error_invalid_attribute),
(error_invalid_tag), (builder_construct), (parse_object),
(free_object_info), (_get_type_by_symbol), (parse_child),
(free_child_info), (parse_property), (free_property_info),
(parse_signal), (_free_signal_info), (parse_interface),
(create_subparser), (free_subparser), (subparser_start),
(subparser_end), (parse_custom), (start_element), (end_element),
(text), (_gtk_builder_parser_parse_buffer):
* gtk/gtkbuilderprivate.h:
* gtk/gtkcelllayout.c: (attributes_start_element),
(attributes_text_element),
(_gtk_cell_layout_buildable_custom_tag_start),
(_gtk_cell_layout_buildable_custom_tag_end),
(_gtk_cell_layout_buildable_add):
* gtk/gtkcelllayout.h:
* gtk/gtkcellview.c: (gtk_cell_view_buildable_init),
(gtk_cell_view_buildable_custom_tag_start),
(gtk_cell_view_buildable_custom_tag_end):
* gtk/gtkcolorseldialog.c:
(gtk_color_selection_dialog_buildable_interface_init),
(gtk_color_selection_dialog_buildable_get_internal_child):
* gtk/gtkcombobox.c: (gtk_combo_box_buildable_init),
(gtk_combo_box_buildable_custom_tag_start),
(gtk_combo_box_buildable_custom_tag_end):
* gtk/gtkcomboboxentry.c:
(gtk_combo_box_entry_buildable_interface_init),
(gtk_combo_box_entry_buildable_get_internal_child):
* gtk/gtkcontainer.c: (gtk_container_get_type),
(gtk_container_buildable_init), (gtk_container_buildable_add),
(gtk_container_buildable_set_child_property),
(attributes_start_element), (attributes_text_element),
(gtk_container_buildable_custom_tag_start),
(gtk_container_buildable_custom_tag_end):
* gtk/gtkdebug.h:
* gtk/gtkdialog.c: (gtk_dialog_buildable_interface_init),
(gtk_dialog_buildable_get_internal_child),
(attributes_start_element), (attributes_text_element),
(gtk_dialog_buildable_custom_tag_start),
(gtk_dialog_buildable_custom_finished):
* gtk/gtkentrycompletion.c: (gtk_entry_completion_buildable_init):
* gtk/gtkexpander.c: (gtk_expander_buildable_add),
(gtk_expander_buildable_init):
* gtk/gtkfontsel.c:
(gtk_font_selection_dialog_buildable_interface_init),
(gtk_font_selection_dialog_buildable_get_internal_child):
* gtk/gtkframe.c: (gtk_frame_buildable_init),
(gtk_frame_buildable_add):
* gtk/gtkiconview.c: (gtk_icon_view_buildable_init),
(gtk_icon_view_buildable_custom_tag_start),
(gtk_icon_view_buildable_custom_tag_end):
* gtk/gtkliststore.c: (gtk_list_store_buildable_init),
(list_store_start_element), (list_store_end_element),
(list_store_text), (gtk_list_store_buildable_custom_tag_start),
(gtk_list_store_buildable_custom_tag_end):
* gtk/gtkmain.c:
* gtk/gtknotebook.c: (gtk_notebook_buildable_init),
(gtk_notebook_buildable_add):
* gtk/gtksizegroup.c: (gtk_size_group_buildable_init),
(size_group_start_element),
(gtk_size_group_buildable_custom_tag_start),
(gtk_size_group_buildable_custom_finished):
* gtk/gtktreestore.c: (gtk_tree_store_buildable_init),
(tree_model_start_element),
(gtk_tree_store_buildable_custom_tag_start),
(gtk_tree_store_buildable_custom_finished):
* gtk/gtktreeview.c: (gtk_tree_view_buildable_init),
(gtk_tree_view_buildable_add):
* gtk/gtktreeviewcolumn.c: (gtk_tree_view_column_buildable_init):
* gtk/gtkuimanager.c: (gtk_ui_manager_buildable_init),
(gtk_ui_manager_buildable_add),
(gtk_ui_manager_buildable_construct_child),
(gtk_ui_manager_buildable_custom_tag_start),
(gtk_ui_manager_buildable_custom_tag_end):
* gtk/gtkwidget.c: (gtk_widget_get_type),
(gtk_widget_buildable_interface_init),
(gtk_widget_buildable_set_name), (gtk_widget_buildable_get_name),
(gtk_widget_buildable_set_property),
(gtk_widget_buildable_parser_finshed), (accel_group_start_element),
(gtk_widget_buildable_custom_tag_start),
(gtk_widget_buildable_custom_finshed):
* gtk/gtkwindow.c: (gtk_window_buildable_interface_init),
(gtk_window_buildable_set_property),
(gtk_window_buildable_parser_finished):
* tests/Makefile.am:
* tests/buildertest.c: (builder_new_from_string), (test_parser),
(signal_normal), (signal_after), (signal_object),
(signal_object_after), (signal_first), (signal_second),
(signal_extra), (signal_extra2), (test_connect_signals),
(test_uimanager_simple), (test_domain), (test_translation),
(test_sizegroup), (test_list_store), (test_tree_store),
(test_types), (test_spin_button), (test_notebook),
(test_construct_only_property), (test_children),
(test_child_properties), (test_treeview_column), (test_icon_view),
(test_combo_box), (test_combo_box_entry), (test_cell_view),
(test_dialog), (test_accelerators), (test_widget), (main):
Add GtkBuilder, fixes #172535
svn path=/trunk/; revision=18141
2007-06-15 17:53:46 +00:00
|
|
|
static gboolean
|
|
|
|
gtk_icon_view_buildable_custom_tag_start (GtkBuildable *buildable,
|
|
|
|
GtkBuilder *builder,
|
|
|
|
GObject *child,
|
|
|
|
const gchar *tagname,
|
|
|
|
GMarkupParser *parser,
|
|
|
|
gpointer *data)
|
|
|
|
{
|
|
|
|
if (parent_buildable_iface->custom_tag_start (buildable, builder, child,
|
|
|
|
tagname, parser, data))
|
|
|
|
return TRUE;
|
|
|
|
|
|
|
|
return _gtk_cell_layout_buildable_custom_tag_start (buildable, builder, child,
|
|
|
|
tagname, parser, data);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
gtk_icon_view_buildable_custom_tag_end (GtkBuildable *buildable,
|
|
|
|
GtkBuilder *builder,
|
|
|
|
GObject *child,
|
|
|
|
const gchar *tagname,
|
|
|
|
gpointer *data)
|
|
|
|
{
|
2010-12-13 07:01:58 +00:00
|
|
|
if (!_gtk_cell_layout_buildable_custom_tag_end (buildable, builder,
|
|
|
|
child, tagname, data))
|
Add GtkBuilder, fixes #172535
2007-06-15 Johan Dahlin <jdahlin@async.com.br>
* demos/gtk-demo/Makefile.am:
* demos/gtk-demo/builder.c: (quit_activate), (about_activate),
(do_builder):
* demos/gtk-demo/demo.ui:
* docs/reference/gtk/gtk-docs.sgml:
* docs/reference/gtk/gtk-sections.txt:
* docs/reference/gtk/gtk.types:
* docs/reference/gtk/tmpl/gtkbuildable.sgml:
* docs/reference/gtk/tmpl/gtkbuilder.sgml:
* gtk/Makefile.am:
* gtk/gtk.h:
* gtk/gtk.symbols:
* gtk/gtkaction.c: (gtk_action_buildable_init),
(gtk_action_buildable_set_name), (gtk_action_buildable_get_name):
* gtk/gtkactiongroup.c: (gtk_action_group_get_type),
(gtk_action_group_buildable_init),
(gtk_action_group_buildable_add),
(gtk_action_group_buildable_set_name),
(gtk_action_group_buildable_get_name):
* gtk/gtkbuildable.c: (gtk_buildable_get_type),
(gtk_buildable_set_name), (gtk_buildable_get_name),
(gtk_buildable_add), (gtk_buildable_set_property),
(gtk_buildable_parser_finished), (gtk_buildable_construct_child),
(gtk_buildable_custom_tag_start), (gtk_buildable_custom_tag_end),
(gtk_buildable_custom_finished),
(gtk_buildable_get_internal_child):
* gtk/gtkbuildable.h:
* gtk/gtkbuilder.c: (gtk_builder_class_init), (gtk_builder_init),
(gtk_builder_finalize), (gtk_builder_set_property),
(gtk_builder_get_property), (_gtk_builder_resolve_type_lazily),
(gtk_builder_real_get_type_from_name),
(gtk_builder_get_parameters), (gtk_builder_get_internal_child),
(_gtk_builder_construct), (_gtk_builder_add),
(apply_delayed_properties), (_gtk_builder_finish),
(gtk_builder_new), (gtk_builder_add_from_file),
(gtk_builder_add_from_string), (gtk_builder_get_object),
(object_add_to_list), (gtk_builder_get_objects),
(gtk_builder_set_translation_domain),
(gtk_builder_get_translation_domain),
(gtk_builder_connect_signals_default),
(gtk_builder_connect_signals), (gtk_builder_connect_signals_full),
(gtk_builder_value_from_string),
(gtk_builder_value_from_string_type),
(_gtk_builder_enum_from_string), (_gtk_builder_flags_from_string),
(gtk_builder_get_type_from_name), (gtk_builder_error_quark):
* gtk/gtkbuilder.h:
* gtk/gtkbuilderparser.c: (state_push), (state_peek), (state_pop),
(error_missing_attribute), (error_invalid_attribute),
(error_invalid_tag), (builder_construct), (parse_object),
(free_object_info), (_get_type_by_symbol), (parse_child),
(free_child_info), (parse_property), (free_property_info),
(parse_signal), (_free_signal_info), (parse_interface),
(create_subparser), (free_subparser), (subparser_start),
(subparser_end), (parse_custom), (start_element), (end_element),
(text), (_gtk_builder_parser_parse_buffer):
* gtk/gtkbuilderprivate.h:
* gtk/gtkcelllayout.c: (attributes_start_element),
(attributes_text_element),
(_gtk_cell_layout_buildable_custom_tag_start),
(_gtk_cell_layout_buildable_custom_tag_end),
(_gtk_cell_layout_buildable_add):
* gtk/gtkcelllayout.h:
* gtk/gtkcellview.c: (gtk_cell_view_buildable_init),
(gtk_cell_view_buildable_custom_tag_start),
(gtk_cell_view_buildable_custom_tag_end):
* gtk/gtkcolorseldialog.c:
(gtk_color_selection_dialog_buildable_interface_init),
(gtk_color_selection_dialog_buildable_get_internal_child):
* gtk/gtkcombobox.c: (gtk_combo_box_buildable_init),
(gtk_combo_box_buildable_custom_tag_start),
(gtk_combo_box_buildable_custom_tag_end):
* gtk/gtkcomboboxentry.c:
(gtk_combo_box_entry_buildable_interface_init),
(gtk_combo_box_entry_buildable_get_internal_child):
* gtk/gtkcontainer.c: (gtk_container_get_type),
(gtk_container_buildable_init), (gtk_container_buildable_add),
(gtk_container_buildable_set_child_property),
(attributes_start_element), (attributes_text_element),
(gtk_container_buildable_custom_tag_start),
(gtk_container_buildable_custom_tag_end):
* gtk/gtkdebug.h:
* gtk/gtkdialog.c: (gtk_dialog_buildable_interface_init),
(gtk_dialog_buildable_get_internal_child),
(attributes_start_element), (attributes_text_element),
(gtk_dialog_buildable_custom_tag_start),
(gtk_dialog_buildable_custom_finished):
* gtk/gtkentrycompletion.c: (gtk_entry_completion_buildable_init):
* gtk/gtkexpander.c: (gtk_expander_buildable_add),
(gtk_expander_buildable_init):
* gtk/gtkfontsel.c:
(gtk_font_selection_dialog_buildable_interface_init),
(gtk_font_selection_dialog_buildable_get_internal_child):
* gtk/gtkframe.c: (gtk_frame_buildable_init),
(gtk_frame_buildable_add):
* gtk/gtkiconview.c: (gtk_icon_view_buildable_init),
(gtk_icon_view_buildable_custom_tag_start),
(gtk_icon_view_buildable_custom_tag_end):
* gtk/gtkliststore.c: (gtk_list_store_buildable_init),
(list_store_start_element), (list_store_end_element),
(list_store_text), (gtk_list_store_buildable_custom_tag_start),
(gtk_list_store_buildable_custom_tag_end):
* gtk/gtkmain.c:
* gtk/gtknotebook.c: (gtk_notebook_buildable_init),
(gtk_notebook_buildable_add):
* gtk/gtksizegroup.c: (gtk_size_group_buildable_init),
(size_group_start_element),
(gtk_size_group_buildable_custom_tag_start),
(gtk_size_group_buildable_custom_finished):
* gtk/gtktreestore.c: (gtk_tree_store_buildable_init),
(tree_model_start_element),
(gtk_tree_store_buildable_custom_tag_start),
(gtk_tree_store_buildable_custom_finished):
* gtk/gtktreeview.c: (gtk_tree_view_buildable_init),
(gtk_tree_view_buildable_add):
* gtk/gtktreeviewcolumn.c: (gtk_tree_view_column_buildable_init):
* gtk/gtkuimanager.c: (gtk_ui_manager_buildable_init),
(gtk_ui_manager_buildable_add),
(gtk_ui_manager_buildable_construct_child),
(gtk_ui_manager_buildable_custom_tag_start),
(gtk_ui_manager_buildable_custom_tag_end):
* gtk/gtkwidget.c: (gtk_widget_get_type),
(gtk_widget_buildable_interface_init),
(gtk_widget_buildable_set_name), (gtk_widget_buildable_get_name),
(gtk_widget_buildable_set_property),
(gtk_widget_buildable_parser_finshed), (accel_group_start_element),
(gtk_widget_buildable_custom_tag_start),
(gtk_widget_buildable_custom_finshed):
* gtk/gtkwindow.c: (gtk_window_buildable_interface_init),
(gtk_window_buildable_set_property),
(gtk_window_buildable_parser_finished):
* tests/Makefile.am:
* tests/buildertest.c: (builder_new_from_string), (test_parser),
(signal_normal), (signal_after), (signal_object),
(signal_object_after), (signal_first), (signal_second),
(signal_extra), (signal_extra2), (test_connect_signals),
(test_uimanager_simple), (test_domain), (test_translation),
(test_sizegroup), (test_list_store), (test_tree_store),
(test_types), (test_spin_button), (test_notebook),
(test_construct_only_property), (test_children),
(test_child_properties), (test_treeview_column), (test_icon_view),
(test_combo_box), (test_combo_box_entry), (test_cell_view),
(test_dialog), (test_accelerators), (test_widget), (main):
Add GtkBuilder, fixes #172535
svn path=/trunk/; revision=18141
2007-06-15 17:53:46 +00:00
|
|
|
parent_buildable_iface->custom_tag_end (buildable, builder, child, tagname,
|
|
|
|
data);
|
|
|
|
}
|