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
|
2012-02-27 13:01:10 +00:00
|
|
|
|
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
|
2002-04-30 17:08:52 +00:00
|
|
|
|
*/
|
|
|
|
|
|
2008-06-22 14:28:52 +00:00
|
|
|
|
#include "config.h"
|
2011-01-04 17:21:41 +00:00
|
|
|
|
|
2011-12-18 15:16:34 +00:00
|
|
|
|
#include "gtkiconviewprivate.h"
|
|
|
|
|
|
2014-07-03 00:36:23 +00:00
|
|
|
|
#include "gtkadjustmentprivate.h"
|
2010-12-10 08:15:39 +00:00
|
|
|
|
#include "gtkcellareabox.h"
|
2010-12-12 07:29:41 +00:00
|
|
|
|
#include "gtkcellareacontext.h"
|
2018-02-09 00:02:06 +00:00
|
|
|
|
#include "gtkcelllayout.h"
|
|
|
|
|
#include "gtkcellrenderer.h"
|
2005-05-02 20:28:37 +00:00
|
|
|
|
#include "gtkcellrendererpixbuf.h"
|
2018-02-09 00:02:06 +00:00
|
|
|
|
#include "gtkcellrenderertext.h"
|
2020-12-25 17:57:48 +00:00
|
|
|
|
#include "gtkdragsourceprivate.h"
|
2005-05-02 20:28:37 +00:00
|
|
|
|
#include "gtkentry.h"
|
2018-02-09 00:02:06 +00:00
|
|
|
|
#include "gtkintl.h"
|
|
|
|
|
#include "gtkmain.h"
|
|
|
|
|
#include "gtkmarshalers.h"
|
|
|
|
|
#include "gtkorientable.h"
|
|
|
|
|
#include "gtkprivate.h"
|
2010-10-18 04:21:39 +00:00
|
|
|
|
#include "gtkscrollable.h"
|
2010-09-07 22:25:47 +00:00
|
|
|
|
#include "gtksizerequest.h"
|
2018-03-11 05:29:46 +00:00
|
|
|
|
#include "gtksnapshot.h"
|
2018-02-09 00:02:06 +00:00
|
|
|
|
#include "gtkstylecontextprivate.h"
|
2005-05-06 04:14:32 +00:00
|
|
|
|
#include "gtktreednd.h"
|
2011-01-04 19:51:19 +00:00
|
|
|
|
#include "gtktypebuiltins.h"
|
2015-11-10 05:25:19 +00:00
|
|
|
|
#include "gtkwidgetprivate.h"
|
2018-02-09 00:02:06 +00:00
|
|
|
|
#include "gtkwindow.h"
|
2018-03-11 12:56:21 +00:00
|
|
|
|
#include "gtkeventcontrollerkey.h"
|
2019-12-31 22:04:01 +00:00
|
|
|
|
#include "gtkdragsource.h"
|
2020-01-07 00:10:15 +00:00
|
|
|
|
#include "gtkdragicon.h"
|
|
|
|
|
#include "gtknative.h"
|
2018-02-09 00:02:06 +00:00
|
|
|
|
|
|
|
|
|
#include <string.h>
|
|
|
|
|
|
2010-06-08 23:44:56 +00:00
|
|
|
|
/**
|
2021-03-02 03:47:38 +00:00
|
|
|
|
* GtkIconView:
|
2010-06-08 23:44:56 +00:00
|
|
|
|
*
|
2021-03-02 03:47:38 +00:00
|
|
|
|
* `GtkIconView` is a widget which displays data in a grid of icons.
|
|
|
|
|
*
|
|
|
|
|
* `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
|
2021-03-02 03:47:38 +00:00
|
|
|
|
* [class@Gtk.TreeView], it allows to select one or multiple items
|
|
|
|
|
* (depending on the selection mode, see [method@Gtk.IconView.set_selection_mode]).
|
|
|
|
|
* In addition to selection with the arrow keys, `GtkIconView` supports
|
2010-06-08 23:44:56 +00:00
|
|
|
|
* 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
|
2014-02-07 18:01:26 +00:00
|
|
|
|
* ignore the tree’s branches.
|
2015-10-30 21:44:36 +00:00
|
|
|
|
*
|
|
|
|
|
* # CSS nodes
|
|
|
|
|
*
|
2021-03-02 03:47:38 +00:00
|
|
|
|
* ```
|
2015-11-10 12:37:25 +00:00
|
|
|
|
* iconview.view
|
|
|
|
|
* ╰── [rubberband]
|
2021-03-02 03:47:38 +00:00
|
|
|
|
* ```
|
2015-11-10 05:25:19 +00:00
|
|
|
|
*
|
2021-03-02 03:47:38 +00:00
|
|
|
|
* `GtkIconView` has a single CSS node with name iconview and style class .view.
|
2015-11-10 05:25:19 +00:00
|
|
|
|
* For rubberband selection, a subnode with name rubberband is used.
|
2010-06-08 23:44:56 +00:00
|
|
|
|
*/
|
|
|
|
|
|
2005-05-06 04:14:32 +00:00
|
|
|
|
#define SCROLL_EDGE_SIZE 15
|
|
|
|
|
|
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
|
|
|
|
|
|
|
|
|
/* 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
|
|
|
|
PROP_HADJUSTMENT,
|
2010-10-26 00:59:02 +00:00
|
|
|
|
PROP_VADJUSTMENT,
|
|
|
|
|
PROP_HSCROLL_POLICY,
|
2013-01-18 05:59:55 +00:00
|
|
|
|
PROP_VSCROLL_POLICY,
|
|
|
|
|
PROP_ACTIVATE_ON_SINGLE_CLICK
|
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);
|
2014-06-26 22:22:42 +00:00
|
|
|
|
static void gtk_icon_view_constructed (GObject *object);
|
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 */
|
2012-05-05 02:33:47 +00:00
|
|
|
|
static GtkSizeRequestMode gtk_icon_view_get_request_mode (GtkWidget *widget);
|
2016-10-22 14:06:14 +00:00
|
|
|
|
static void gtk_icon_view_measure (GtkWidget *widget,
|
|
|
|
|
GtkOrientation orientation,
|
|
|
|
|
int for_size,
|
|
|
|
|
int *minimum,
|
|
|
|
|
int *natural,
|
|
|
|
|
int *minimum_baseline,
|
|
|
|
|
int *natural_baseline);
|
2018-08-16 04:53:03 +00:00
|
|
|
|
static void gtk_icon_view_size_allocate (GtkWidget *widget,
|
|
|
|
|
int width,
|
|
|
|
|
int height,
|
|
|
|
|
int baseline);
|
2016-12-19 16:16:09 +00:00
|
|
|
|
static void gtk_icon_view_snapshot (GtkWidget *widget,
|
|
|
|
|
GtkSnapshot *snapshot);
|
2018-01-02 04:48:32 +00:00
|
|
|
|
static void gtk_icon_view_motion (GtkEventController *controller,
|
|
|
|
|
double x,
|
|
|
|
|
double y,
|
|
|
|
|
gpointer user_data);
|
2020-02-20 03:04:28 +00:00
|
|
|
|
static void gtk_icon_view_leave (GtkEventController *controller,
|
2020-02-16 01:47:23 +00:00
|
|
|
|
gpointer user_data);
|
2019-05-29 17:10:46 +00:00
|
|
|
|
static void gtk_icon_view_button_press (GtkGestureClick *gesture,
|
2017-09-13 15:58:45 +00:00
|
|
|
|
int n_press,
|
|
|
|
|
double x,
|
|
|
|
|
double y,
|
|
|
|
|
gpointer user_data);
|
2019-05-29 17:10:46 +00:00
|
|
|
|
static void gtk_icon_view_button_release (GtkGestureClick *gesture,
|
2017-09-13 15:58:45 +00:00
|
|
|
|
int n_press,
|
|
|
|
|
double x,
|
|
|
|
|
double y,
|
|
|
|
|
gpointer user_data);
|
2018-03-11 12:56:21 +00:00
|
|
|
|
static gboolean gtk_icon_view_key_pressed (GtkEventControllerKey *controller,
|
|
|
|
|
guint keyval,
|
|
|
|
|
guint keycode,
|
|
|
|
|
GdkModifierType state,
|
|
|
|
|
GtkWidget *widget);
|
2005-05-02 20:28:37 +00:00
|
|
|
|
|
2020-05-07 04:47:25 +00:00
|
|
|
|
static void gtk_icon_view_remove (GtkIconView *icon_view,
|
|
|
|
|
GtkWidget *widget);
|
2005-05-02 20:28:37 +00:00
|
|
|
|
|
|
|
|
|
/* 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);
|
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);
|
2016-12-19 16:16:09 +00:00
|
|
|
|
static void gtk_icon_view_snapshot_item (GtkIconView *icon_view,
|
|
|
|
|
GtkSnapshot *snapshot,
|
2005-05-02 20:28:37 +00:00
|
|
|
|
GtkIconViewItem *item,
|
2020-07-24 13:54:49 +00:00
|
|
|
|
int x,
|
|
|
|
|
int y,
|
2010-08-22 02:32:52 +00:00
|
|
|
|
gboolean draw_focus);
|
2016-12-19 16:16:09 +00:00
|
|
|
|
static void gtk_icon_view_snapshot_rubberband (GtkIconView *icon_view,
|
|
|
|
|
GtkSnapshot *snapshot);
|
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_start_rubberbanding (GtkIconView *icon_view,
|
2010-05-25 22:38:44 +00:00
|
|
|
|
GdkDevice *device,
|
2020-07-24 13:54:49 +00:00
|
|
|
|
int x,
|
|
|
|
|
int y);
|
2005-05-02 20:28:37 +00:00
|
|
|
|
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,
|
2020-07-24 13:54:49 +00:00
|
|
|
|
int x,
|
|
|
|
|
int y,
|
|
|
|
|
int width,
|
|
|
|
|
int height);
|
2005-05-02 20:28:37 +00:00
|
|
|
|
static gboolean gtk_icon_view_unselect_all_internal (GtkIconView *icon_view);
|
2017-06-27 09:11:57 +00:00
|
|
|
|
static void gtk_icon_view_update_rubberband (GtkIconView *icon_view);
|
2005-05-02 20:28:37 +00:00
|
|
|
|
static void gtk_icon_view_item_invalidate_size (GtkIconViewItem *item);
|
|
|
|
|
static void gtk_icon_view_invalidate_sizes (GtkIconView *icon_view);
|
2018-08-12 15:07:23 +00:00
|
|
|
|
static void gtk_icon_view_add_move_binding (GtkWidgetClass *widget_class,
|
2005-05-02 20:28:37 +00:00
|
|
|
|
guint keyval,
|
|
|
|
|
guint modmask,
|
|
|
|
|
GtkMovementStep step,
|
2020-07-24 13:54:49 +00:00
|
|
|
|
int count);
|
2005-05-02 20:28:37 +00:00
|
|
|
|
static gboolean gtk_icon_view_real_move_cursor (GtkIconView *icon_view,
|
|
|
|
|
GtkMovementStep step,
|
2020-07-24 13:54:49 +00:00
|
|
|
|
int count,
|
2020-04-11 18:52:43 +00:00
|
|
|
|
gboolean extend,
|
|
|
|
|
gboolean modify);
|
2005-05-02 20:28:37 +00:00
|
|
|
|
static void gtk_icon_view_move_cursor_up_down (GtkIconView *icon_view,
|
2020-07-24 13:54:49 +00:00
|
|
|
|
int count);
|
2005-05-02 20:28:37 +00:00
|
|
|
|
static void gtk_icon_view_move_cursor_page_up_down (GtkIconView *icon_view,
|
2020-07-24 13:54:49 +00:00
|
|
|
|
int count);
|
2005-05-02 20:28:37 +00:00
|
|
|
|
static void gtk_icon_view_move_cursor_left_right (GtkIconView *icon_view,
|
2020-07-24 13:54:49 +00:00
|
|
|
|
int count);
|
2005-05-02 20:28:37 +00:00
|
|
|
|
static void gtk_icon_view_move_cursor_start_end (GtkIconView *icon_view,
|
2020-07-24 13:54:49 +00:00
|
|
|
|
int count);
|
2005-05-02 20:28:37 +00:00
|
|
|
|
static void gtk_icon_view_scroll_to_item (GtkIconView *icon_view,
|
|
|
|
|
GtkIconViewItem *item);
|
|
|
|
|
static gboolean gtk_icon_view_select_all_between (GtkIconView *icon_view,
|
|
|
|
|
GtkIconViewItem *anchor,
|
|
|
|
|
GtkIconViewItem *cursor);
|
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);
|
|
|
|
|
|
2010-12-12 10:59:41 +00:00
|
|
|
|
static void gtk_icon_view_add_editable (GtkCellArea *area,
|
|
|
|
|
GtkCellRenderer *renderer,
|
|
|
|
|
GtkCellEditable *editable,
|
|
|
|
|
GdkRectangle *cell_area,
|
2020-07-24 18:40:36 +00:00
|
|
|
|
const char *path,
|
2010-12-12 10:59:41 +00:00
|
|
|
|
GtkIconView *icon_view);
|
|
|
|
|
static void gtk_icon_view_remove_editable (GtkCellArea *area,
|
|
|
|
|
GtkCellRenderer *renderer,
|
|
|
|
|
GtkCellEditable *editable,
|
|
|
|
|
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 */
|
2020-01-07 00:10:15 +00:00
|
|
|
|
static void gtk_icon_view_dnd_finished_cb (GdkDrag *drag,
|
|
|
|
|
GtkWidget *widget);
|
2020-02-18 00:41:42 +00:00
|
|
|
|
static GdkContentProvider * gtk_icon_view_drag_data_get (GtkIconView *icon_view,
|
|
|
|
|
GtkTreePath *source_row);
|
2005-05-06 04:14:32 +00:00
|
|
|
|
|
|
|
|
|
/* Target side drag signals */
|
2020-02-29 02:47:17 +00:00
|
|
|
|
static void gtk_icon_view_drag_leave (GtkDropTargetAsync *dest,
|
|
|
|
|
GdkDrop *drop,
|
|
|
|
|
GtkIconView *icon_view);
|
|
|
|
|
static GdkDragAction gtk_icon_view_drag_motion (GtkDropTargetAsync *dest,
|
|
|
|
|
GdkDrop *drop,
|
|
|
|
|
double x,
|
|
|
|
|
double y,
|
|
|
|
|
GtkIconView *icon_view);
|
|
|
|
|
static gboolean gtk_icon_view_drag_drop (GtkDropTargetAsync *dest,
|
|
|
|
|
GdkDrop *drop,
|
|
|
|
|
double x,
|
|
|
|
|
double y,
|
|
|
|
|
GtkIconView *icon_view);
|
2020-01-03 07:22:56 +00:00
|
|
|
|
static void gtk_icon_view_drag_data_received (GObject *source,
|
|
|
|
|
GAsyncResult *result,
|
|
|
|
|
gpointer data);
|
2018-01-02 04:48:32 +00:00
|
|
|
|
static gboolean gtk_icon_view_maybe_begin_drag (GtkIconView *icon_view,
|
|
|
|
|
double x,
|
|
|
|
|
double y,
|
|
|
|
|
GdkDevice *device);
|
2005-05-06 04:14:32 +00:00
|
|
|
|
|
|
|
|
|
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;
|
2019-08-29 13:21:20 +00:00
|
|
|
|
static void gtk_icon_view_buildable_init (GtkBuildableIface *iface);
|
|
|
|
|
static gboolean gtk_icon_view_buildable_custom_tag_start (GtkBuildable *buildable,
|
|
|
|
|
GtkBuilder *builder,
|
|
|
|
|
GObject *child,
|
2020-07-24 18:40:36 +00:00
|
|
|
|
const char *tagname,
|
2019-08-29 13:21:20 +00:00
|
|
|
|
GtkBuildableParser *parser,
|
|
|
|
|
gpointer *data);
|
|
|
|
|
static void gtk_icon_view_buildable_custom_tag_end (GtkBuildable *buildable,
|
|
|
|
|
GtkBuilder *builder,
|
|
|
|
|
GObject *child,
|
2020-07-24 18:40:36 +00:00
|
|
|
|
const char *tagname,
|
2019-08-29 13:21:20 +00:00
|
|
|
|
gpointer 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
|
|
|
|
|
2004-07-04 15:56:55 +00:00
|
|
|
|
static guint icon_view_signals[LAST_SIGNAL] = { 0 };
|
2002-04-30 17:08:52 +00:00
|
|
|
|
|
2020-05-07 04:47:25 +00:00
|
|
|
|
G_DEFINE_TYPE_WITH_CODE (GtkIconView, gtk_icon_view, GTK_TYPE_WIDGET,
|
2013-06-27 19:02:52 +00:00
|
|
|
|
G_ADD_PRIVATE (GtkIconView)
|
2005-05-02 20:28:37 +00:00
|
|
|
|
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
|
|
|
|
{
|
2018-08-12 15:07:23 +00:00
|
|
|
|
GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
|
|
|
|
|
GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (klass);
|
2002-04-30 17:08:52 +00:00
|
|
|
|
|
2014-06-26 22:22:42 +00:00
|
|
|
|
gobject_class->constructed = gtk_icon_view_constructed;
|
2010-12-10 08:15:39 +00:00
|
|
|
|
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;
|
|
|
|
|
|
2012-05-05 02:33:47 +00:00
|
|
|
|
widget_class->get_request_mode = gtk_icon_view_get_request_mode;
|
2016-10-22 14:06:14 +00:00
|
|
|
|
widget_class->measure = gtk_icon_view_measure;
|
2004-07-04 15:56:55 +00:00
|
|
|
|
widget_class->size_allocate = gtk_icon_view_size_allocate;
|
2016-12-19 16:16:09 +00:00
|
|
|
|
widget_class->snapshot = gtk_icon_view_snapshot;
|
2020-04-08 11:43:28 +00:00
|
|
|
|
widget_class->focus = gtk_widget_focus_self;
|
|
|
|
|
widget_class->grab_focus = gtk_widget_grab_focus_self;
|
2004-07-27 21:58:09 +00:00
|
|
|
|
|
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.
|
|
|
|
|
*/
|
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,
|
2014-06-09 12:59:33 +00:00
|
|
|
|
GTK_PARAM_READWRITE|G_PARAM_EXPLICIT_NOTIFY));
|
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.
|
|
|
|
|
*/
|
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,
|
2014-06-09 12:59:33 +00:00
|
|
|
|
GTK_PARAM_READWRITE|G_PARAM_EXPLICIT_NOTIFY));
|
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.
|
|
|
|
|
*/
|
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,
|
2014-06-09 12:59:33 +00:00
|
|
|
|
GTK_PARAM_READWRITE|G_PARAM_EXPLICIT_NOTIFY));
|
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.
|
|
|
|
|
*/
|
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,
|
2014-06-09 12:59:33 +00:00
|
|
|
|
GTK_PARAM_READWRITE|G_PARAM_EXPLICIT_NOTIFY));
|
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.
|
|
|
|
|
*/
|
|
|
|
|
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,
|
2014-06-09 12:59:33 +00:00
|
|
|
|
GTK_PARAM_READWRITE|G_PARAM_EXPLICIT_NOTIFY));
|
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.
|
|
|
|
|
*/
|
|
|
|
|
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,
|
2014-06-09 12:59:33 +00:00
|
|
|
|
GTK_PARAM_READWRITE|G_PARAM_EXPLICIT_NOTIFY));
|
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.
|
|
|
|
|
*/
|
|
|
|
|
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,
|
2014-06-09 12:59:33 +00:00
|
|
|
|
GTK_PARAM_READWRITE|G_PARAM_EXPLICIT_NOTIFY));
|
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.
|
|
|
|
|
*/
|
|
|
|
|
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,
|
2014-06-09 12:59:33 +00:00
|
|
|
|
GTK_PARAM_READWRITE|G_PARAM_EXPLICIT_NOTIFY));
|
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.
|
|
|
|
|
*/
|
|
|
|
|
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,
|
2014-06-09 12:59:33 +00:00
|
|
|
|
GTK_PARAM_READWRITE|G_PARAM_EXPLICIT_NOTIFY));
|
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.
|
|
|
|
|
*/
|
|
|
|
|
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,
|
2014-06-09 12:59:33 +00:00
|
|
|
|
GTK_PARAM_READWRITE|G_PARAM_EXPLICIT_NOTIFY));
|
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.
|
|
|
|
|
*/
|
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,
|
2014-06-09 12:59:33 +00:00
|
|
|
|
GTK_PARAM_READWRITE|G_PARAM_EXPLICIT_NOTIFY));
|
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.
|
|
|
|
|
*/
|
|
|
|
|
g_object_class_install_property (gobject_class,
|
|
|
|
|
PROP_REORDERABLE,
|
|
|
|
|
g_param_spec_boolean ("reorderable",
|
|
|
|
|
P_("Reorderable"),
|
|
|
|
|
P_("View is reorderable"),
|
|
|
|
|
FALSE,
|
2014-06-09 12:59:33 +00:00
|
|
|
|
G_PARAM_READWRITE|G_PARAM_EXPLICIT_NOTIFY));
|
2005-05-06 04:14:32 +00:00
|
|
|
|
|
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,
|
2014-06-09 12:59:33 +00:00
|
|
|
|
GTK_PARAM_READWRITE|G_PARAM_EXPLICIT_NOTIFY));
|
2007-07-19 14:59:44 +00:00
|
|
|
|
|
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.
|
|
|
|
|
*/
|
|
|
|
|
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,
|
2014-06-09 12:59:33 +00:00
|
|
|
|
GTK_PARAM_READWRITE|G_PARAM_EXPLICIT_NOTIFY));
|
2009-08-07 03:56:30 +00:00
|
|
|
|
|
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
|
|
|
|
*/
|
|
|
|
|
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));
|
|
|
|
|
|
2013-01-18 05:59:55 +00:00
|
|
|
|
/**
|
|
|
|
|
* GtkIconView:activate-on-single-click:
|
|
|
|
|
*
|
|
|
|
|
* The activate-on-single-click property specifies whether the "item-activated" signal
|
|
|
|
|
* will be emitted after a single click.
|
|
|
|
|
*/
|
|
|
|
|
g_object_class_install_property (gobject_class,
|
|
|
|
|
PROP_ACTIVATE_ON_SINGLE_CLICK,
|
|
|
|
|
g_param_spec_boolean ("activate-on-single-click",
|
|
|
|
|
P_("Activate on Single Click"),
|
|
|
|
|
P_("Activate row on a single click"),
|
|
|
|
|
FALSE,
|
2014-06-09 12:59:33 +00:00
|
|
|
|
GTK_PARAM_READWRITE|G_PARAM_EXPLICIT_NOTIFY));
|
2013-01-18 05:59:55 +00:00
|
|
|
|
|
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
|
|
|
|
|
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
|
2013-01-18 05:59:55 +00:00
|
|
|
|
* gtk_icon_view_item_activated() is called, when the user double
|
|
|
|
|
* clicks an item with the "activate-on-single-click" property set
|
|
|
|
|
* to %FALSE, or when the user single clicks an item when the
|
|
|
|
|
* "activate-on-single-click" property set to %TRUE. It is also
|
|
|
|
|
* emitted when a non-editable item is selected and one of the keys:
|
|
|
|
|
* Space, Return or Enter is pressed.
|
2008-12-30 00:52:04 +00:00
|
|
|
|
*/
|
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,
|
2019-05-31 03:56:50 +00:00
|
|
|
|
NULL,
|
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,
|
2019-05-29 20:05:19 +00:00
|
|
|
|
NULL,
|
2002-04-30 17:08:52 +00:00
|
|
|
|
G_TYPE_NONE, 0);
|
|
|
|
|
|
2008-12-30 00:52:04 +00:00
|
|
|
|
/**
|
|
|
|
|
* GtkIconView::select-all:
|
|
|
|
|
* @iconview: the object on which the signal is emitted
|
|
|
|
|
*
|
2020-11-17 03:58:53 +00:00
|
|
|
|
* A [keybinding signal][GtkSignalAction]
|
2008-12-30 00:52:04 +00:00
|
|
|
|
* 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,
|
2019-05-29 20:05:19 +00:00
|
|
|
|
NULL,
|
2002-04-30 17:08:52 +00:00
|
|
|
|
G_TYPE_NONE, 0);
|
|
|
|
|
|
2008-12-30 00:52:04 +00:00
|
|
|
|
/**
|
|
|
|
|
* GtkIconView::unselect-all:
|
|
|
|
|
* @iconview: the object on which the signal is emitted
|
|
|
|
|
*
|
2020-11-17 03:58:53 +00:00
|
|
|
|
* A [keybinding signal][GtkSignalAction]
|
2008-12-30 00:52:04 +00:00
|
|
|
|
* 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,
|
2019-05-29 20:05:19 +00:00
|
|
|
|
NULL,
|
2002-04-30 17:08:52 +00:00
|
|
|
|
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
|
|
|
|
|
*
|
2020-11-17 03:58:53 +00:00
|
|
|
|
* A [keybinding signal][GtkSignalAction]
|
2008-12-30 00:52:04 +00:00
|
|
|
|
* 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,
|
2019-05-29 20:05:19 +00:00
|
|
|
|
NULL,
|
2002-04-30 17:08:52 +00:00
|
|
|
|
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
|
|
|
|
|
*
|
2020-11-17 03:58:53 +00:00
|
|
|
|
* A [keybinding signal][GtkSignalAction]
|
2008-12-30 00:52:04 +00:00
|
|
|
|
* 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,
|
2019-05-29 20:05:19 +00:00
|
|
|
|
NULL,
|
2002-04-30 17:08:52 +00:00
|
|
|
|
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
|
|
|
|
|
*
|
2020-11-17 03:58:53 +00:00
|
|
|
|
* A [keybinding signal][GtkSignalAction]
|
2008-12-30 00:52:04 +00:00
|
|
|
|
* 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);
|
2019-06-06 22:27:54 +00:00
|
|
|
|
g_signal_set_va_marshaller (icon_view_signals[ACTIVATE_CURSOR_ITEM],
|
|
|
|
|
G_TYPE_FROM_CLASS (klass),
|
|
|
|
|
_gtk_marshal_BOOLEAN__VOIDv);
|
2004-07-04 23:19:46 +00:00
|
|
|
|
|
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
|
2020-04-11 18:52:43 +00:00
|
|
|
|
* @extend: whether to extend the selection
|
|
|
|
|
* @modify: whether to modify the selection
|
2008-12-30 00:52:04 +00:00
|
|
|
|
*
|
|
|
|
|
* The ::move-cursor signal is a
|
2020-11-17 03:58:53 +00:00
|
|
|
|
* [keybinding signal][GtkSignalAction]
|
2008-12-30 00:52:04 +00:00
|
|
|
|
* 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
|
2014-02-02 06:07:39 +00:00
|
|
|
|
* - Arrow keys which move by individual steps
|
|
|
|
|
* - Home/End keys which move to the first/last item
|
|
|
|
|
* - PageUp/PageDown which move by "pages"
|
2008-12-30 00:52:04 +00:00
|
|
|
|
* 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,
|
2020-04-11 18:52:43 +00:00
|
|
|
|
_gtk_marshal_BOOLEAN__ENUM_INT_BOOLEAN_BOOLEAN,
|
|
|
|
|
G_TYPE_BOOLEAN, 4,
|
2004-06-18 05:17:01 +00:00
|
|
|
|
GTK_TYPE_MOVEMENT_STEP,
|
2020-04-11 18:52:43 +00:00
|
|
|
|
G_TYPE_INT,
|
|
|
|
|
G_TYPE_BOOLEAN,
|
|
|
|
|
G_TYPE_BOOLEAN);
|
2019-06-06 22:27:54 +00:00
|
|
|
|
g_signal_set_va_marshaller (icon_view_signals[MOVE_CURSOR],
|
|
|
|
|
G_TYPE_FROM_CLASS (klass),
|
2020-04-11 18:52:43 +00:00
|
|
|
|
_gtk_marshal_BOOLEAN__ENUM_INT_BOOLEAN_BOOLEANv);
|
2004-06-18 05:17:01 +00:00
|
|
|
|
|
2002-04-30 17:08:52 +00:00
|
|
|
|
/* Key bindings */
|
2018-08-12 15:07:23 +00:00
|
|
|
|
gtk_widget_class_add_binding_signal (widget_class,
|
|
|
|
|
GDK_KEY_a, GDK_CONTROL_MASK,
|
|
|
|
|
"select-all",
|
|
|
|
|
NULL);
|
|
|
|
|
gtk_widget_class_add_binding_signal (widget_class,
|
|
|
|
|
GDK_KEY_a, GDK_CONTROL_MASK | GDK_SHIFT_MASK,
|
|
|
|
|
"unselect-all",
|
|
|
|
|
NULL);
|
|
|
|
|
gtk_widget_class_add_binding_signal (widget_class,
|
|
|
|
|
GDK_KEY_space, GDK_CONTROL_MASK,
|
|
|
|
|
"toggle-cursor-item",
|
|
|
|
|
NULL);
|
|
|
|
|
gtk_widget_class_add_binding_signal (widget_class,
|
|
|
|
|
GDK_KEY_KP_Space, GDK_CONTROL_MASK,
|
|
|
|
|
"toggle-cursor-item",
|
|
|
|
|
NULL);
|
|
|
|
|
|
|
|
|
|
gtk_widget_class_add_binding_signal (widget_class,
|
|
|
|
|
GDK_KEY_space, 0,
|
|
|
|
|
"activate-cursor-item",
|
|
|
|
|
NULL);
|
|
|
|
|
gtk_widget_class_add_binding_signal (widget_class,
|
|
|
|
|
GDK_KEY_KP_Space, 0,
|
|
|
|
|
"activate-cursor-item",
|
|
|
|
|
NULL);
|
|
|
|
|
gtk_widget_class_add_binding_signal (widget_class,
|
|
|
|
|
GDK_KEY_Return, 0,
|
|
|
|
|
"activate-cursor-item",
|
|
|
|
|
NULL);
|
|
|
|
|
gtk_widget_class_add_binding_signal (widget_class,
|
|
|
|
|
GDK_KEY_ISO_Enter, 0,
|
|
|
|
|
"activate-cursor-item",
|
|
|
|
|
NULL);
|
|
|
|
|
gtk_widget_class_add_binding_signal (widget_class,
|
|
|
|
|
GDK_KEY_KP_Enter, 0,
|
|
|
|
|
"activate-cursor-item",
|
|
|
|
|
NULL);
|
|
|
|
|
|
|
|
|
|
gtk_icon_view_add_move_binding (widget_class, GDK_KEY_Up, 0,
|
2004-06-18 05:17:01 +00:00
|
|
|
|
GTK_MOVEMENT_DISPLAY_LINES, -1);
|
2018-08-12 15:07:23 +00:00
|
|
|
|
gtk_icon_view_add_move_binding (widget_class, GDK_KEY_KP_Up, 0,
|
2004-06-18 05:17:01 +00:00
|
|
|
|
GTK_MOVEMENT_DISPLAY_LINES, -1);
|
|
|
|
|
|
2018-08-12 15:07:23 +00:00
|
|
|
|
gtk_icon_view_add_move_binding (widget_class, GDK_KEY_Down, 0,
|
2004-06-18 05:17:01 +00:00
|
|
|
|
GTK_MOVEMENT_DISPLAY_LINES, 1);
|
2018-08-12 15:07:23 +00:00
|
|
|
|
gtk_icon_view_add_move_binding (widget_class, GDK_KEY_KP_Down, 0,
|
2004-06-18 05:17:01 +00:00
|
|
|
|
GTK_MOVEMENT_DISPLAY_LINES, 1);
|
|
|
|
|
|
2018-08-12 15:07:23 +00:00
|
|
|
|
gtk_icon_view_add_move_binding (widget_class, GDK_KEY_p, GDK_CONTROL_MASK,
|
2004-06-18 05:17:01 +00:00
|
|
|
|
GTK_MOVEMENT_DISPLAY_LINES, -1);
|
|
|
|
|
|
2018-08-12 15:07:23 +00:00
|
|
|
|
gtk_icon_view_add_move_binding (widget_class, GDK_KEY_n, GDK_CONTROL_MASK,
|
2004-06-18 05:17:01 +00:00
|
|
|
|
GTK_MOVEMENT_DISPLAY_LINES, 1);
|
|
|
|
|
|
2018-08-12 15:07:23 +00:00
|
|
|
|
gtk_icon_view_add_move_binding (widget_class, GDK_KEY_Home, 0,
|
2004-06-18 05:17:01 +00:00
|
|
|
|
GTK_MOVEMENT_BUFFER_ENDS, -1);
|
2018-08-12 15:07:23 +00:00
|
|
|
|
gtk_icon_view_add_move_binding (widget_class, GDK_KEY_KP_Home, 0,
|
2004-06-18 05:17:01 +00:00
|
|
|
|
GTK_MOVEMENT_BUFFER_ENDS, -1);
|
|
|
|
|
|
2018-08-12 15:07:23 +00:00
|
|
|
|
gtk_icon_view_add_move_binding (widget_class, GDK_KEY_End, 0,
|
2004-06-18 05:17:01 +00:00
|
|
|
|
GTK_MOVEMENT_BUFFER_ENDS, 1);
|
2018-08-12 15:07:23 +00:00
|
|
|
|
gtk_icon_view_add_move_binding (widget_class, GDK_KEY_KP_End, 0,
|
2004-06-18 05:17:01 +00:00
|
|
|
|
GTK_MOVEMENT_BUFFER_ENDS, 1);
|
|
|
|
|
|
2018-08-12 15:07:23 +00:00
|
|
|
|
gtk_icon_view_add_move_binding (widget_class, GDK_KEY_Page_Up, 0,
|
2004-06-18 05:17:01 +00:00
|
|
|
|
GTK_MOVEMENT_PAGES, -1);
|
2018-08-12 15:07:23 +00:00
|
|
|
|
gtk_icon_view_add_move_binding (widget_class, GDK_KEY_KP_Page_Up, 0,
|
2004-06-18 05:17:01 +00:00
|
|
|
|
GTK_MOVEMENT_PAGES, -1);
|
|
|
|
|
|
2018-08-12 15:07:23 +00:00
|
|
|
|
gtk_icon_view_add_move_binding (widget_class, GDK_KEY_Page_Down, 0,
|
2004-06-18 05:17:01 +00:00
|
|
|
|
GTK_MOVEMENT_PAGES, 1);
|
2018-08-12 15:07:23 +00:00
|
|
|
|
gtk_icon_view_add_move_binding (widget_class, GDK_KEY_KP_Page_Down, 0,
|
2004-06-18 05:17:01 +00:00
|
|
|
|
GTK_MOVEMENT_PAGES, 1);
|
|
|
|
|
|
2018-08-12 15:07:23 +00:00
|
|
|
|
gtk_icon_view_add_move_binding (widget_class, GDK_KEY_Right, 0,
|
2004-06-18 05:17:01 +00:00
|
|
|
|
GTK_MOVEMENT_VISUAL_POSITIONS, 1);
|
2018-08-12 15:07:23 +00:00
|
|
|
|
gtk_icon_view_add_move_binding (widget_class, GDK_KEY_Left, 0,
|
2004-06-18 05:17:01 +00:00
|
|
|
|
GTK_MOVEMENT_VISUAL_POSITIONS, -1);
|
|
|
|
|
|
2018-08-12 15:07:23 +00:00
|
|
|
|
gtk_icon_view_add_move_binding (widget_class, GDK_KEY_KP_Right, 0,
|
2004-06-18 05:17:01 +00:00
|
|
|
|
GTK_MOVEMENT_VISUAL_POSITIONS, 1);
|
2018-08-12 15:07:23 +00:00
|
|
|
|
gtk_icon_view_add_move_binding (widget_class, GDK_KEY_KP_Left, 0,
|
2004-06-18 05:17:01 +00:00
|
|
|
|
GTK_MOVEMENT_VISUAL_POSITIONS, -1);
|
2011-07-02 03:29:06 +00:00
|
|
|
|
|
2017-11-18 03:49:57 +00:00
|
|
|
|
gtk_widget_class_set_css_name (widget_class, I_("iconview"));
|
2004-06-18 05:17:01 +00:00
|
|
|
|
}
|
2002-04-30 17:08:52 +00:00
|
|
|
|
|
2018-03-08 02:13:57 +00:00
|
|
|
|
static void
|
|
|
|
|
gtk_icon_view_buildable_add_child (GtkBuildable *buildable,
|
|
|
|
|
GtkBuilder *builder,
|
|
|
|
|
GObject *child,
|
2020-07-24 18:40:36 +00:00
|
|
|
|
const char *type)
|
2018-03-08 02:13:57 +00:00
|
|
|
|
{
|
|
|
|
|
if (GTK_IS_CELL_RENDERER (child))
|
|
|
|
|
_gtk_cell_layout_buildable_add_child (buildable, builder, child, type);
|
|
|
|
|
else
|
|
|
|
|
parent_buildable_iface->add_child (buildable, builder, child, type);
|
|
|
|
|
}
|
|
|
|
|
|
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);
|
2018-03-08 02:13:57 +00:00
|
|
|
|
iface->add_child = gtk_icon_view_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
|
|
|
|
{
|
2018-03-10 17:45:23 +00:00
|
|
|
|
GtkEventController *controller;
|
2018-03-09 05:14:59 +00:00
|
|
|
|
GtkGesture *gesture;
|
|
|
|
|
|
2013-06-27 19:02:52 +00:00
|
|
|
|
icon_view->priv = gtk_icon_view_get_instance_private (icon_view);
|
2010-06-23 18:00:42 +00:00
|
|
|
|
|
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;
|
2017-06-27 09:11:57 +00:00
|
|
|
|
icon_view->priv->mouse_x = -1;
|
|
|
|
|
icon_view->priv->mouse_y = -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
|
|
|
|
|
2019-02-08 17:15:57 +00:00
|
|
|
|
gtk_widget_set_overflow (GTK_WIDGET (icon_view), GTK_OVERFLOW_HIDDEN);
|
2020-05-05 18:57:21 +00:00
|
|
|
|
gtk_widget_set_focusable (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;
|
2013-01-18 05:59:55 +00:00
|
|
|
|
icon_view->priv->activate_on_single_click = FALSE;
|
2008-09-27 12:53:05 +00:00
|
|
|
|
|
|
|
|
|
icon_view->priv->draw_focus = TRUE;
|
2012-05-07 23:53:48 +00:00
|
|
|
|
|
|
|
|
|
icon_view->priv->row_contexts =
|
|
|
|
|
g_ptr_array_new_with_free_func ((GDestroyNotify)g_object_unref);
|
2012-11-20 17:28:14 +00:00
|
|
|
|
|
2020-08-13 23:49:02 +00:00
|
|
|
|
gtk_widget_add_css_class (GTK_WIDGET (icon_view), "view");
|
2017-09-13 15:58:45 +00:00
|
|
|
|
|
2019-05-29 17:10:46 +00:00
|
|
|
|
gesture = gtk_gesture_click_new ();
|
2018-03-09 05:14:59 +00:00
|
|
|
|
g_signal_connect (gesture, "pressed", G_CALLBACK (gtk_icon_view_button_press),
|
2017-09-13 15:58:45 +00:00
|
|
|
|
icon_view);
|
2018-03-09 05:14:59 +00:00
|
|
|
|
g_signal_connect (gesture, "released", G_CALLBACK (gtk_icon_view_button_release),
|
2017-09-13 15:58:45 +00:00
|
|
|
|
icon_view);
|
2018-03-09 05:14:59 +00:00
|
|
|
|
gtk_widget_add_controller (GTK_WIDGET (icon_view), GTK_EVENT_CONTROLLER (gesture));
|
2018-01-02 04:48:32 +00:00
|
|
|
|
|
2018-03-10 17:45:23 +00:00
|
|
|
|
controller = gtk_event_controller_motion_new ();
|
2020-02-20 03:04:28 +00:00
|
|
|
|
g_signal_connect (controller, "leave", G_CALLBACK (gtk_icon_view_leave), icon_view);
|
|
|
|
|
g_signal_connect (controller, "motion", G_CALLBACK (gtk_icon_view_motion), icon_view);
|
2018-03-10 17:45:23 +00:00
|
|
|
|
gtk_widget_add_controller (GTK_WIDGET (icon_view), controller);
|
2018-03-11 12:56:21 +00:00
|
|
|
|
|
2018-04-20 17:58:06 +00:00
|
|
|
|
controller = gtk_event_controller_key_new ();
|
|
|
|
|
g_signal_connect (controller, "key-pressed", G_CALLBACK (gtk_icon_view_key_pressed),
|
2018-03-11 12:56:21 +00:00
|
|
|
|
icon_view);
|
2018-04-20 17:58:06 +00:00
|
|
|
|
gtk_widget_add_controller (GTK_WIDGET (icon_view), controller);
|
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
|
|
|
|
|
2014-06-26 22:22:42 +00:00
|
|
|
|
static void
|
|
|
|
|
gtk_icon_view_constructed (GObject *object)
|
|
|
|
|
{
|
|
|
|
|
GtkIconView *icon_view = GTK_ICON_VIEW (object);
|
2010-12-10 08:15:39 +00:00
|
|
|
|
|
2014-06-26 22:22:42 +00:00
|
|
|
|
G_OBJECT_CLASS (gtk_icon_view_parent_class)->constructed (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
|
|
|
|
}
|
|
|
|
|
|
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;
|
|
|
|
|
|
2020-05-05 20:50:21 +00:00
|
|
|
|
gtk_icon_view_set_model (icon_view, NULL);
|
|
|
|
|
|
|
|
|
|
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;
|
|
|
|
|
}
|
|
|
|
|
|
2010-12-10 08:15:39 +00:00
|
|
|
|
if (priv->cell_area_context)
|
|
|
|
|
{
|
|
|
|
|
g_object_unref (priv->cell_area_context);
|
|
|
|
|
priv->cell_area_context = NULL;
|
|
|
|
|
}
|
|
|
|
|
|
2012-05-07 23:53:48 +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;
|
|
|
|
|
}
|
|
|
|
|
|
2018-03-11 12:56:21 +00:00
|
|
|
|
g_clear_object (&priv->key_controller);
|
2017-09-13 15:58:45 +00:00
|
|
|
|
|
2020-01-07 00:10:15 +00:00
|
|
|
|
g_clear_pointer (&priv->source_formats, gdk_content_formats_unref);
|
2020-01-02 06:00:44 +00:00
|
|
|
|
|
2010-12-10 08:15:39 +00:00
|
|
|
|
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;
|
|
|
|
|
|
2013-01-18 05:59:55 +00:00
|
|
|
|
case PROP_ACTIVATE_ON_SINGLE_CLICK:
|
|
|
|
|
gtk_icon_view_set_activate_on_single_click (icon_view, g_value_get_boolean (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:
|
2014-06-09 12:59:33 +00:00
|
|
|
|
if (icon_view->priv->hscroll_policy != g_value_get_enum (value))
|
|
|
|
|
{
|
|
|
|
|
icon_view->priv->hscroll_policy = g_value_get_enum (value);
|
|
|
|
|
gtk_widget_queue_resize (GTK_WIDGET (icon_view));
|
|
|
|
|
g_object_notify_by_pspec (object, pspec);
|
|
|
|
|
}
|
2010-10-26 00:59:02 +00:00
|
|
|
|
break;
|
|
|
|
|
case PROP_VSCROLL_POLICY:
|
2014-06-09 12:59:33 +00:00
|
|
|
|
if (icon_view->priv->vscroll_policy != g_value_get_enum (value))
|
|
|
|
|
{
|
|
|
|
|
icon_view->priv->vscroll_policy = g_value_get_enum (value);
|
|
|
|
|
gtk_widget_queue_resize (GTK_WIDGET (icon_view));
|
|
|
|
|
g_object_notify_by_pspec (object, pspec);
|
|
|
|
|
}
|
2010-10-26 00:59:02 +00:00
|
|
|
|
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;
|
|
|
|
|
|
2013-01-18 05:59:55 +00:00
|
|
|
|
case PROP_ACTIVATE_ON_SINGLE_CLICK:
|
|
|
|
|
g_value_set_boolean (value, icon_view->priv->activate_on_single_click);
|
|
|
|
|
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 */
|
|
|
|
|
|
2020-07-24 13:54:49 +00:00
|
|
|
|
static int
|
2012-05-05 02:33:47 +00:00
|
|
|
|
gtk_icon_view_get_n_items (GtkIconView *icon_view)
|
|
|
|
|
{
|
|
|
|
|
GtkIconViewPrivate *priv = icon_view->priv;
|
|
|
|
|
|
|
|
|
|
if (priv->model == NULL)
|
|
|
|
|
return 0;
|
|
|
|
|
|
|
|
|
|
return gtk_tree_model_iter_n_children (priv->model, NULL);
|
|
|
|
|
}
|
|
|
|
|
|
2012-05-07 23:51:51 +00:00
|
|
|
|
static void
|
|
|
|
|
adjust_wrap_width (GtkIconView *icon_view)
|
|
|
|
|
{
|
|
|
|
|
if (icon_view->priv->text_cell)
|
|
|
|
|
{
|
2020-07-24 13:54:49 +00:00
|
|
|
|
int pixbuf_width, wrap_width;
|
2012-09-30 11:09:53 +00:00
|
|
|
|
|
|
|
|
|
if (icon_view->priv->items && icon_view->priv->pixbuf_cell)
|
|
|
|
|
{
|
|
|
|
|
gtk_cell_renderer_get_preferred_width (icon_view->priv->pixbuf_cell,
|
|
|
|
|
GTK_WIDGET (icon_view),
|
|
|
|
|
&pixbuf_width, NULL);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
pixbuf_width = 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (icon_view->priv->item_width >= 0)
|
|
|
|
|
{
|
|
|
|
|
if (icon_view->priv->item_orientation == GTK_ORIENTATION_VERTICAL)
|
|
|
|
|
{
|
|
|
|
|
wrap_width = icon_view->priv->item_width;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
wrap_width = icon_view->priv->item_width - pixbuf_width;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
wrap_width -= 2 * icon_view->priv->item_padding * 2;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
wrap_width = MAX (pixbuf_width * 2, 50);
|
|
|
|
|
}
|
2012-05-07 23:51:51 +00:00
|
|
|
|
|
|
|
|
|
if (icon_view->priv->items && icon_view->priv->pixbuf_cell)
|
|
|
|
|
{
|
2012-09-30 11:09:53 +00:00
|
|
|
|
/* 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 */
|
2012-05-07 23:51:51 +00:00
|
|
|
|
|
|
|
|
|
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);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2012-06-13 02:20:06 +00:00
|
|
|
|
/* General notes about layout
|
|
|
|
|
*
|
|
|
|
|
* The icon view is layouted like this:
|
|
|
|
|
*
|
|
|
|
|
* +----------+ s +----------+
|
|
|
|
|
* | padding | p | padding |
|
|
|
|
|
* | +------+ | a | +------+ |
|
|
|
|
|
* | | cell | | c | | cell | |
|
|
|
|
|
* | +------+ | i | +------+ |
|
|
|
|
|
* | | n | |
|
|
|
|
|
* +----------+ g +----------+
|
|
|
|
|
*
|
|
|
|
|
* In size request and allocation code, there are 3 sizes that are used:
|
|
|
|
|
* * cell size
|
|
|
|
|
* This is the size returned by gtk_cell_area_get_preferred_foo(). In places
|
|
|
|
|
* where code is interacting with the cell area and renderers this is useful.
|
|
|
|
|
* * padded size
|
|
|
|
|
* This is the cell size plus the item padding on each side.
|
|
|
|
|
* * spaced size
|
2014-02-07 18:01:26 +00:00
|
|
|
|
* This is the padded size plus the spacing. This is what’s used for most
|
2012-06-13 02:20:06 +00:00
|
|
|
|
* calculations because it can (ab)use the following formula:
|
|
|
|
|
* iconview_size = 2 * margin + n_items * spaced_size - spacing
|
|
|
|
|
* So when reading this code and fixing my bugs where I confuse these two, be
|
|
|
|
|
* aware of this distinction.
|
|
|
|
|
*/
|
2002-04-30 17:08:52 +00:00
|
|
|
|
static void
|
2012-05-05 02:33:47 +00:00
|
|
|
|
cell_area_get_preferred_size (GtkIconView *icon_view,
|
|
|
|
|
GtkCellAreaContext *context,
|
|
|
|
|
GtkOrientation orientation,
|
2020-07-24 13:54:49 +00:00
|
|
|
|
int for_size,
|
|
|
|
|
int *minimum,
|
|
|
|
|
int *natural)
|
2012-05-05 02:33:47 +00:00
|
|
|
|
{
|
|
|
|
|
if (orientation == GTK_ORIENTATION_HORIZONTAL)
|
|
|
|
|
{
|
|
|
|
|
if (for_size > 0)
|
|
|
|
|
gtk_cell_area_get_preferred_width_for_height (icon_view->priv->cell_area,
|
|
|
|
|
context,
|
|
|
|
|
GTK_WIDGET (icon_view),
|
|
|
|
|
for_size,
|
|
|
|
|
minimum, natural);
|
|
|
|
|
else
|
|
|
|
|
gtk_cell_area_get_preferred_width (icon_view->priv->cell_area,
|
|
|
|
|
context,
|
|
|
|
|
GTK_WIDGET (icon_view),
|
|
|
|
|
minimum, natural);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
if (for_size > 0)
|
|
|
|
|
gtk_cell_area_get_preferred_height_for_width (icon_view->priv->cell_area,
|
|
|
|
|
context,
|
|
|
|
|
GTK_WIDGET (icon_view),
|
|
|
|
|
for_size,
|
|
|
|
|
minimum, natural);
|
|
|
|
|
else
|
|
|
|
|
gtk_cell_area_get_preferred_height (icon_view->priv->cell_area,
|
|
|
|
|
context,
|
|
|
|
|
GTK_WIDGET (icon_view),
|
|
|
|
|
minimum, natural);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2012-06-14 16:52:09 +00:00
|
|
|
|
static gboolean
|
|
|
|
|
gtk_icon_view_is_empty (GtkIconView *icon_view)
|
|
|
|
|
{
|
|
|
|
|
return icon_view->priv->items == NULL;
|
|
|
|
|
}
|
|
|
|
|
|
2012-05-05 02:33:47 +00:00
|
|
|
|
static void
|
|
|
|
|
gtk_icon_view_get_preferred_item_size (GtkIconView *icon_view,
|
|
|
|
|
GtkOrientation orientation,
|
2020-07-24 13:54:49 +00:00
|
|
|
|
int for_size,
|
|
|
|
|
int *minimum,
|
|
|
|
|
int *natural)
|
2002-04-30 17:08:52 +00:00
|
|
|
|
{
|
2012-05-05 02:33:47 +00:00
|
|
|
|
GtkIconViewPrivate *priv = icon_view->priv;
|
|
|
|
|
GtkCellAreaContext *context;
|
|
|
|
|
GList *items;
|
|
|
|
|
|
2012-06-15 00:44:45 +00:00
|
|
|
|
g_assert (!gtk_icon_view_is_empty (icon_view));
|
2012-06-14 05:35:15 +00:00
|
|
|
|
|
2012-05-05 02:33:47 +00:00
|
|
|
|
context = gtk_cell_area_create_context (priv->cell_area);
|
|
|
|
|
|
|
|
|
|
for_size -= 2 * priv->item_padding;
|
|
|
|
|
|
|
|
|
|
if (for_size > 0)
|
|
|
|
|
{
|
|
|
|
|
/* This is necessary for the context to work properly */
|
|
|
|
|
for (items = priv->items; items; items = items->next)
|
|
|
|
|
{
|
|
|
|
|
GtkIconViewItem *item = items->data;
|
|
|
|
|
|
|
|
|
|
_gtk_icon_view_set_cell_data (icon_view, item);
|
|
|
|
|
cell_area_get_preferred_size (icon_view, context, 1 - orientation, -1, NULL, NULL);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
for (items = priv->items; items; items = items->next)
|
|
|
|
|
{
|
|
|
|
|
GtkIconViewItem *item = items->data;
|
|
|
|
|
|
|
|
|
|
_gtk_icon_view_set_cell_data (icon_view, item);
|
2012-05-07 23:51:51 +00:00
|
|
|
|
if (items == priv->items)
|
|
|
|
|
adjust_wrap_width (icon_view);
|
2012-05-05 02:33:47 +00:00
|
|
|
|
cell_area_get_preferred_size (icon_view, context, orientation, for_size, NULL, NULL);
|
|
|
|
|
}
|
|
|
|
|
|
2012-05-08 01:57:07 +00:00
|
|
|
|
if (orientation == GTK_ORIENTATION_HORIZONTAL)
|
|
|
|
|
{
|
|
|
|
|
if (for_size > 0)
|
|
|
|
|
gtk_cell_area_context_get_preferred_width_for_height (context,
|
|
|
|
|
for_size,
|
|
|
|
|
minimum, natural);
|
|
|
|
|
else
|
|
|
|
|
gtk_cell_area_context_get_preferred_width (context,
|
|
|
|
|
minimum, natural);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
if (for_size > 0)
|
|
|
|
|
gtk_cell_area_context_get_preferred_height_for_width (context,
|
|
|
|
|
for_size,
|
|
|
|
|
minimum, natural);
|
|
|
|
|
else
|
|
|
|
|
gtk_cell_area_context_get_preferred_height (context,
|
|
|
|
|
minimum, natural);
|
|
|
|
|
}
|
2012-05-05 02:33:47 +00:00
|
|
|
|
|
2012-05-06 01:21:18 +00:00
|
|
|
|
if (orientation == GTK_ORIENTATION_HORIZONTAL && priv->item_width >= 0)
|
|
|
|
|
{
|
|
|
|
|
if (minimum)
|
|
|
|
|
*minimum = MAX (*minimum, priv->item_width);
|
|
|
|
|
if (natural)
|
|
|
|
|
*natural = *minimum;
|
|
|
|
|
}
|
|
|
|
|
|
2012-05-05 02:33:47 +00:00
|
|
|
|
if (minimum)
|
2012-06-14 16:44:06 +00:00
|
|
|
|
*minimum = MAX (1, *minimum + 2 * priv->item_padding);
|
2012-05-05 02:33:47 +00:00
|
|
|
|
if (natural)
|
2012-06-14 16:44:06 +00:00
|
|
|
|
*natural = MAX (1, *natural + 2 * priv->item_padding);
|
2012-05-05 02:33:47 +00:00
|
|
|
|
|
|
|
|
|
g_object_unref (context);
|
2010-10-27 05:11:36 +00:00
|
|
|
|
}
|
2005-05-02 20:28:37 +00:00
|
|
|
|
|
2010-10-27 05:11:36 +00:00
|
|
|
|
static void
|
2012-05-05 02:33:47 +00:00
|
|
|
|
gtk_icon_view_compute_n_items_for_size (GtkIconView *icon_view,
|
|
|
|
|
GtkOrientation orientation,
|
2020-07-24 13:54:49 +00:00
|
|
|
|
int size,
|
|
|
|
|
int *min_items,
|
|
|
|
|
int *min_item_size,
|
|
|
|
|
int *max_items,
|
|
|
|
|
int *max_item_size)
|
2010-10-27 05:11:36 +00:00
|
|
|
|
{
|
2012-05-05 02:33:47 +00:00
|
|
|
|
GtkIconViewPrivate *priv = icon_view->priv;
|
2012-06-12 15:39:50 +00:00
|
|
|
|
int minimum, natural, spacing;
|
2012-05-05 02:33:47 +00:00
|
|
|
|
|
2012-05-08 01:57:07 +00:00
|
|
|
|
g_return_if_fail (min_item_size == NULL || min_items != NULL);
|
|
|
|
|
g_return_if_fail (max_item_size == NULL || max_items != NULL);
|
2012-06-15 00:44:45 +00:00
|
|
|
|
g_return_if_fail (!gtk_icon_view_is_empty (icon_view));
|
2012-05-08 01:57:07 +00:00
|
|
|
|
|
|
|
|
|
gtk_icon_view_get_preferred_item_size (icon_view, orientation, -1, &minimum, &natural);
|
|
|
|
|
|
|
|
|
|
if (orientation == GTK_ORIENTATION_HORIZONTAL)
|
2012-06-12 15:39:50 +00:00
|
|
|
|
spacing = priv->column_spacing;
|
2012-05-08 01:57:07 +00:00
|
|
|
|
else
|
2012-06-12 15:39:50 +00:00
|
|
|
|
spacing = priv->row_spacing;
|
2012-05-08 01:57:07 +00:00
|
|
|
|
|
2012-06-12 15:39:50 +00:00
|
|
|
|
size -= 2 * priv->margin;
|
|
|
|
|
size += spacing;
|
|
|
|
|
minimum += spacing;
|
|
|
|
|
natural += spacing;
|
|
|
|
|
|
2012-05-05 02:33:47 +00:00
|
|
|
|
if (priv->columns > 0)
|
|
|
|
|
{
|
iconview: Reduce complexity of sizing code
Always assume max-columns and min-rows. The old approach was kinda
insane.
As an example, try to write an algorithm that optimizes the minimum size
for infinite (take a reasonably large number like 2520) word-wrapped
Monospace text cells containing the text "XXXXX XXX XXX XXXXX" (keep in
mind that this is the easy problem, because it's assuming equal cell
renderers). There's 4 ways to reasonably lay out this text:
19 glyphs (19x1):
XXXXX XXX XXX XXXXX
18 glyphs (9x2):
XXXXX XXX
XXX XXXXX
21 glyphs (7x3):
XXXXX
XXX XXX
XXXXX
20 glyphs (5x4):
XXXXX
XXX
XXX
XXXXX
The best thing to do usually is using the 9x2 approach, but that's
neither the one using the natural nor the one using the minimum size.
As a side note, this does not include spacing and padding, which might
also influence the decision. Nor does it include height-for-width
considerations. Look at this table (numbers given in glyphs, not pixels,
as for pixel-sizes it gets even more interesting):
given best solution
width columns sizing glyphs per cell
6 1 6x4 20
7 1 7x3 21
8 1 7x3 24
9 1 9x2 18
10 1/2 9x2/5x4 20
11 1/2 9x2/5x4 22
12 1/2 9x2/5x4 24
13 1/2 9x2/5x4 26
14 2 7x3 21
15 3 5x4 20
16 3 5x4 21.3
17 3 5x4 22.7
18 2 9x2 18
19 1/2 19x1/8x2 19
20 1/2/4 19x1/8x2/5x4 20
21 1-4 any 21
22 1-4 any 22
23 1-4 any 23
24 1-4 any 24
25 5 5x4 20
26 5 5x4 20.8
27 3 9x2 18
28 3 9x2 18.7
29 3 9x2 19.3
30 3/6 9x2/5x4 20
Now of course, nobody wants the number of columns to randomly change in
inexplicable ways while they enlarge or shrink an iconview, so we not
only have to optimize for smallest or other size measurements, but we
also have to optimize for "most pleasing to the eye".
And last but not least, I'd like to once again remind you - if you kept
up until now - that this discussion was for identically-sized cells
only.
2012-05-05 22:51:14 +00:00
|
|
|
|
if (orientation == GTK_ORIENTATION_HORIZONTAL)
|
|
|
|
|
{
|
|
|
|
|
if (min_items)
|
|
|
|
|
*min_items = priv->columns;
|
|
|
|
|
if (max_items)
|
|
|
|
|
*max_items = priv->columns;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
int n_items = gtk_icon_view_get_n_items (icon_view);
|
|
|
|
|
|
|
|
|
|
if (min_items)
|
|
|
|
|
*min_items = (n_items + priv->columns - 1) / priv->columns;
|
|
|
|
|
if (max_items)
|
|
|
|
|
*max_items = (n_items + priv->columns - 1) / priv->columns;
|
|
|
|
|
}
|
2012-05-05 02:33:47 +00:00
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
2012-05-08 01:57:07 +00:00
|
|
|
|
if (max_items)
|
|
|
|
|
{
|
|
|
|
|
if (size <= minimum)
|
|
|
|
|
*max_items = 1;
|
|
|
|
|
else
|
|
|
|
|
*max_items = size / minimum;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (min_items)
|
|
|
|
|
{
|
|
|
|
|
if (size <= natural)
|
|
|
|
|
*min_items = 1;
|
|
|
|
|
else
|
|
|
|
|
*min_items = size / natural;
|
|
|
|
|
}
|
2012-05-05 02:33:47 +00:00
|
|
|
|
}
|
|
|
|
|
|
2012-05-08 01:57:07 +00:00
|
|
|
|
if (min_item_size)
|
iconview: Reduce complexity of sizing code
Always assume max-columns and min-rows. The old approach was kinda
insane.
As an example, try to write an algorithm that optimizes the minimum size
for infinite (take a reasonably large number like 2520) word-wrapped
Monospace text cells containing the text "XXXXX XXX XXX XXXXX" (keep in
mind that this is the easy problem, because it's assuming equal cell
renderers). There's 4 ways to reasonably lay out this text:
19 glyphs (19x1):
XXXXX XXX XXX XXXXX
18 glyphs (9x2):
XXXXX XXX
XXX XXXXX
21 glyphs (7x3):
XXXXX
XXX XXX
XXXXX
20 glyphs (5x4):
XXXXX
XXX
XXX
XXXXX
The best thing to do usually is using the 9x2 approach, but that's
neither the one using the natural nor the one using the minimum size.
As a side note, this does not include spacing and padding, which might
also influence the decision. Nor does it include height-for-width
considerations. Look at this table (numbers given in glyphs, not pixels,
as for pixel-sizes it gets even more interesting):
given best solution
width columns sizing glyphs per cell
6 1 6x4 20
7 1 7x3 21
8 1 7x3 24
9 1 9x2 18
10 1/2 9x2/5x4 20
11 1/2 9x2/5x4 22
12 1/2 9x2/5x4 24
13 1/2 9x2/5x4 26
14 2 7x3 21
15 3 5x4 20
16 3 5x4 21.3
17 3 5x4 22.7
18 2 9x2 18
19 1/2 19x1/8x2 19
20 1/2/4 19x1/8x2/5x4 20
21 1-4 any 21
22 1-4 any 22
23 1-4 any 23
24 1-4 any 24
25 5 5x4 20
26 5 5x4 20.8
27 3 9x2 18
28 3 9x2 18.7
29 3 9x2 19.3
30 3/6 9x2/5x4 20
Now of course, nobody wants the number of columns to randomly change in
inexplicable ways while they enlarge or shrink an iconview, so we not
only have to optimize for smallest or other size measurements, but we
also have to optimize for "most pleasing to the eye".
And last but not least, I'd like to once again remind you - if you kept
up until now - that this discussion was for identically-sized cells
only.
2012-05-05 22:51:14 +00:00
|
|
|
|
{
|
2012-05-08 01:57:07 +00:00
|
|
|
|
*min_item_size = size / *min_items;
|
2012-06-13 17:26:09 +00:00
|
|
|
|
*min_item_size = CLAMP (*min_item_size, minimum, natural);
|
2012-06-12 15:39:50 +00:00
|
|
|
|
*min_item_size -= spacing;
|
2012-05-08 01:57:07 +00:00
|
|
|
|
*min_item_size -= 2 * priv->item_padding;
|
iconview: Reduce complexity of sizing code
Always assume max-columns and min-rows. The old approach was kinda
insane.
As an example, try to write an algorithm that optimizes the minimum size
for infinite (take a reasonably large number like 2520) word-wrapped
Monospace text cells containing the text "XXXXX XXX XXX XXXXX" (keep in
mind that this is the easy problem, because it's assuming equal cell
renderers). There's 4 ways to reasonably lay out this text:
19 glyphs (19x1):
XXXXX XXX XXX XXXXX
18 glyphs (9x2):
XXXXX XXX
XXX XXXXX
21 glyphs (7x3):
XXXXX
XXX XXX
XXXXX
20 glyphs (5x4):
XXXXX
XXX
XXX
XXXXX
The best thing to do usually is using the 9x2 approach, but that's
neither the one using the natural nor the one using the minimum size.
As a side note, this does not include spacing and padding, which might
also influence the decision. Nor does it include height-for-width
considerations. Look at this table (numbers given in glyphs, not pixels,
as for pixel-sizes it gets even more interesting):
given best solution
width columns sizing glyphs per cell
6 1 6x4 20
7 1 7x3 21
8 1 7x3 24
9 1 9x2 18
10 1/2 9x2/5x4 20
11 1/2 9x2/5x4 22
12 1/2 9x2/5x4 24
13 1/2 9x2/5x4 26
14 2 7x3 21
15 3 5x4 20
16 3 5x4 21.3
17 3 5x4 22.7
18 2 9x2 18
19 1/2 19x1/8x2 19
20 1/2/4 19x1/8x2/5x4 20
21 1-4 any 21
22 1-4 any 22
23 1-4 any 23
24 1-4 any 24
25 5 5x4 20
26 5 5x4 20.8
27 3 9x2 18
28 3 9x2 18.7
29 3 9x2 19.3
30 3/6 9x2/5x4 20
Now of course, nobody wants the number of columns to randomly change in
inexplicable ways while they enlarge or shrink an iconview, so we not
only have to optimize for smallest or other size measurements, but we
also have to optimize for "most pleasing to the eye".
And last but not least, I'd like to once again remind you - if you kept
up until now - that this discussion was for identically-sized cells
only.
2012-05-05 22:51:14 +00:00
|
|
|
|
}
|
|
|
|
|
|
2012-05-08 01:57:07 +00:00
|
|
|
|
if (max_item_size)
|
iconview: Reduce complexity of sizing code
Always assume max-columns and min-rows. The old approach was kinda
insane.
As an example, try to write an algorithm that optimizes the minimum size
for infinite (take a reasonably large number like 2520) word-wrapped
Monospace text cells containing the text "XXXXX XXX XXX XXXXX" (keep in
mind that this is the easy problem, because it's assuming equal cell
renderers). There's 4 ways to reasonably lay out this text:
19 glyphs (19x1):
XXXXX XXX XXX XXXXX
18 glyphs (9x2):
XXXXX XXX
XXX XXXXX
21 glyphs (7x3):
XXXXX
XXX XXX
XXXXX
20 glyphs (5x4):
XXXXX
XXX
XXX
XXXXX
The best thing to do usually is using the 9x2 approach, but that's
neither the one using the natural nor the one using the minimum size.
As a side note, this does not include spacing and padding, which might
also influence the decision. Nor does it include height-for-width
considerations. Look at this table (numbers given in glyphs, not pixels,
as for pixel-sizes it gets even more interesting):
given best solution
width columns sizing glyphs per cell
6 1 6x4 20
7 1 7x3 21
8 1 7x3 24
9 1 9x2 18
10 1/2 9x2/5x4 20
11 1/2 9x2/5x4 22
12 1/2 9x2/5x4 24
13 1/2 9x2/5x4 26
14 2 7x3 21
15 3 5x4 20
16 3 5x4 21.3
17 3 5x4 22.7
18 2 9x2 18
19 1/2 19x1/8x2 19
20 1/2/4 19x1/8x2/5x4 20
21 1-4 any 21
22 1-4 any 22
23 1-4 any 23
24 1-4 any 24
25 5 5x4 20
26 5 5x4 20.8
27 3 9x2 18
28 3 9x2 18.7
29 3 9x2 19.3
30 3/6 9x2/5x4 20
Now of course, nobody wants the number of columns to randomly change in
inexplicable ways while they enlarge or shrink an iconview, so we not
only have to optimize for smallest or other size measurements, but we
also have to optimize for "most pleasing to the eye".
And last but not least, I'd like to once again remind you - if you kept
up until now - that this discussion was for identically-sized cells
only.
2012-05-05 22:51:14 +00:00
|
|
|
|
{
|
2012-05-08 01:57:07 +00:00
|
|
|
|
*max_item_size = size / *max_items;
|
2012-06-13 17:26:09 +00:00
|
|
|
|
*max_item_size = CLAMP (*max_item_size, minimum, natural);
|
2012-06-12 15:39:50 +00:00
|
|
|
|
*max_item_size -= spacing;
|
2012-05-08 01:57:07 +00:00
|
|
|
|
*max_item_size -= 2 * priv->item_padding;
|
iconview: Reduce complexity of sizing code
Always assume max-columns and min-rows. The old approach was kinda
insane.
As an example, try to write an algorithm that optimizes the minimum size
for infinite (take a reasonably large number like 2520) word-wrapped
Monospace text cells containing the text "XXXXX XXX XXX XXXXX" (keep in
mind that this is the easy problem, because it's assuming equal cell
renderers). There's 4 ways to reasonably lay out this text:
19 glyphs (19x1):
XXXXX XXX XXX XXXXX
18 glyphs (9x2):
XXXXX XXX
XXX XXXXX
21 glyphs (7x3):
XXXXX
XXX XXX
XXXXX
20 glyphs (5x4):
XXXXX
XXX
XXX
XXXXX
The best thing to do usually is using the 9x2 approach, but that's
neither the one using the natural nor the one using the minimum size.
As a side note, this does not include spacing and padding, which might
also influence the decision. Nor does it include height-for-width
considerations. Look at this table (numbers given in glyphs, not pixels,
as for pixel-sizes it gets even more interesting):
given best solution
width columns sizing glyphs per cell
6 1 6x4 20
7 1 7x3 21
8 1 7x3 24
9 1 9x2 18
10 1/2 9x2/5x4 20
11 1/2 9x2/5x4 22
12 1/2 9x2/5x4 24
13 1/2 9x2/5x4 26
14 2 7x3 21
15 3 5x4 20
16 3 5x4 21.3
17 3 5x4 22.7
18 2 9x2 18
19 1/2 19x1/8x2 19
20 1/2/4 19x1/8x2/5x4 20
21 1-4 any 21
22 1-4 any 22
23 1-4 any 23
24 1-4 any 24
25 5 5x4 20
26 5 5x4 20.8
27 3 9x2 18
28 3 9x2 18.7
29 3 9x2 19.3
30 3/6 9x2/5x4 20
Now of course, nobody wants the number of columns to randomly change in
inexplicable ways while they enlarge or shrink an iconview, so we not
only have to optimize for smallest or other size measurements, but we
also have to optimize for "most pleasing to the eye".
And last but not least, I'd like to once again remind you - if you kept
up until now - that this discussion was for identically-sized cells
only.
2012-05-05 22:51:14 +00:00
|
|
|
|
}
|
2012-05-05 02:33:47 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static GtkSizeRequestMode
|
|
|
|
|
gtk_icon_view_get_request_mode (GtkWidget *widget)
|
|
|
|
|
{
|
|
|
|
|
return GTK_SIZE_REQUEST_HEIGHT_FOR_WIDTH;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void
|
2016-10-22 14:06:14 +00:00
|
|
|
|
gtk_icon_view_measure (GtkWidget *widget,
|
|
|
|
|
GtkOrientation orientation,
|
|
|
|
|
int for_size,
|
|
|
|
|
int *minimum,
|
|
|
|
|
int *natural,
|
|
|
|
|
int *minimum_baseline,
|
|
|
|
|
int *natural_baseline)
|
2012-05-05 02:33:47 +00:00
|
|
|
|
{
|
|
|
|
|
GtkIconView *icon_view = GTK_ICON_VIEW (widget);
|
|
|
|
|
GtkIconViewPrivate *priv = icon_view->priv;
|
2016-10-22 14:06:14 +00:00
|
|
|
|
GtkOrientation other_orientation = orientation == GTK_ORIENTATION_HORIZONTAL ?
|
|
|
|
|
GTK_ORIENTATION_VERTICAL : GTK_ORIENTATION_HORIZONTAL;
|
2020-06-02 18:41:38 +00:00
|
|
|
|
int item_min, item_nat, items = 0, item_size = 0, n_items;
|
2012-05-05 02:33:47 +00:00
|
|
|
|
|
2012-06-15 00:44:45 +00:00
|
|
|
|
if (gtk_icon_view_is_empty (icon_view))
|
|
|
|
|
{
|
|
|
|
|
*minimum = *natural = 2 * priv->margin;
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
2012-05-05 02:33:47 +00:00
|
|
|
|
n_items = gtk_icon_view_get_n_items (icon_view);
|
|
|
|
|
|
2016-10-22 14:06:14 +00:00
|
|
|
|
if (for_size < 0)
|
2012-06-15 00:44:45 +00:00
|
|
|
|
{
|
2016-10-22 14:06:14 +00:00
|
|
|
|
gtk_icon_view_get_preferred_item_size (icon_view, orientation, -1, &item_min, &item_nat);
|
2012-05-05 02:33:47 +00:00
|
|
|
|
|
2016-10-22 14:06:14 +00:00
|
|
|
|
if (priv->columns > 0)
|
|
|
|
|
{
|
|
|
|
|
int n_rows = (n_items + priv->columns - 1) / priv->columns;
|
2012-05-05 02:33:47 +00:00
|
|
|
|
|
2016-10-22 14:06:14 +00:00
|
|
|
|
*minimum = item_min * n_rows + priv->row_spacing * (n_rows - 1);
|
|
|
|
|
*natural = item_nat * n_rows + priv->row_spacing * (n_rows - 1);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
*minimum = item_min;
|
|
|
|
|
*natural = item_nat * n_items + priv->row_spacing * (n_items - 1);
|
|
|
|
|
}
|
2012-05-05 02:33:47 +00:00
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
2016-10-22 14:06:14 +00:00
|
|
|
|
gtk_icon_view_compute_n_items_for_size (icon_view, orientation, for_size, NULL, NULL, &items, &item_size);
|
|
|
|
|
gtk_icon_view_get_preferred_item_size (icon_view, other_orientation, item_size, &item_min, &item_nat);
|
|
|
|
|
*minimum = (item_min + priv->row_spacing) * ((n_items + items - 1) / items) - priv->row_spacing;
|
|
|
|
|
*natural = (item_nat + priv->row_spacing) * ((n_items + items - 1) / items) - priv->row_spacing;
|
2012-05-05 02:33:47 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
*minimum += 2 * priv->margin;
|
|
|
|
|
*natural += 2 * priv->margin;
|
|
|
|
|
}
|
|
|
|
|
|
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 */
|
2018-03-31 19:02:28 +00:00
|
|
|
|
gtk_widget_size_allocate (child->widget, &child->area, -1);
|
2005-05-02 20:28:37 +00:00
|
|
|
|
}
|
2002-04-30 17:08:52 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void
|
2018-08-16 04:53:03 +00:00
|
|
|
|
gtk_icon_view_size_allocate (GtkWidget *widget,
|
|
|
|
|
int width,
|
|
|
|
|
int height,
|
|
|
|
|
int baseline)
|
2002-04-30 17:08:52 +00:00
|
|
|
|
{
|
2005-05-02 20:28:37 +00:00
|
|
|
|
GtkIconView *icon_view = GTK_ICON_VIEW (widget);
|
|
|
|
|
|
2012-05-05 02:33:47 +00:00
|
|
|
|
gtk_icon_view_layout (icon_view);
|
|
|
|
|
|
2005-05-02 20:28:37 +00:00
|
|
|
|
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
|
|
|
|
}
|
|
|
|
|
|
2016-12-19 16:16:09 +00:00
|
|
|
|
static void
|
|
|
|
|
gtk_icon_view_snapshot (GtkWidget *widget,
|
|
|
|
|
GtkSnapshot *snapshot)
|
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;
|
2020-07-24 13:54:49 +00:00
|
|
|
|
int dest_index;
|
2005-05-06 04:14:32 +00:00
|
|
|
|
GtkIconViewDropPosition dest_pos;
|
|
|
|
|
GtkIconViewItem *dest_item = NULL;
|
2012-11-20 17:28:14 +00:00
|
|
|
|
GtkStyleContext *context;
|
2017-06-28 06:19:35 +00:00
|
|
|
|
int width, height;
|
2019-01-17 14:55:57 +00:00
|
|
|
|
double offset_x, offset_y;
|
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
|
|
|
|
|
2012-11-20 17:28:14 +00:00
|
|
|
|
context = gtk_widget_get_style_context (widget);
|
2017-12-06 06:56:12 +00:00
|
|
|
|
width = gtk_widget_get_width (widget);
|
|
|
|
|
height = gtk_widget_get_height (widget);
|
2016-12-19 16:16:09 +00:00
|
|
|
|
|
2019-01-17 14:55:57 +00:00
|
|
|
|
offset_x = gtk_adjustment_get_value (icon_view->priv->hadjustment);
|
|
|
|
|
offset_y = gtk_adjustment_get_value (icon_view->priv->vadjustment);
|
|
|
|
|
|
2019-02-21 04:34:12 +00:00
|
|
|
|
gtk_snapshot_save (snapshot);
|
|
|
|
|
gtk_snapshot_translate (snapshot, &GRAPHENE_POINT_INIT (- offset_x, - offset_y));
|
2005-03-17 01:54:40 +00:00
|
|
|
|
|
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;
|
|
|
|
|
|
2011-08-10 14:00:38 +00:00
|
|
|
|
for (icons = icon_view->priv->items; icons; icons = icons->next)
|
2005-05-02 20:28:37 +00:00
|
|
|
|
{
|
|
|
|
|
GtkIconViewItem *item = icons->data;
|
2018-03-31 15:22:48 +00:00
|
|
|
|
graphene_rect_t area;
|
2010-08-22 02:32:52 +00:00
|
|
|
|
|
2018-03-31 15:22:48 +00:00
|
|
|
|
graphene_rect_init (&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);
|
2017-01-11 15:14:03 +00:00
|
|
|
|
|
2019-01-17 14:55:57 +00:00
|
|
|
|
if (gdk_rectangle_intersect (&item->cell_area,
|
|
|
|
|
&(GdkRectangle) { offset_x, offset_y, width, height }, NULL))
|
2010-08-22 02:32:52 +00:00
|
|
|
|
{
|
2016-12-19 16:16:09 +00:00
|
|
|
|
gtk_icon_view_snapshot_item (icon_view, snapshot, item,
|
|
|
|
|
item->cell_area.x, item->cell_area.y,
|
|
|
|
|
icon_view->priv->draw_focus);
|
2011-08-10 14:00:38 +00:00
|
|
|
|
|
2010-08-22 02:32:52 +00:00
|
|
|
|
if (dest_index == item->index)
|
|
|
|
|
dest_item = item;
|
|
|
|
|
}
|
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
|
|
|
|
GdkRectangle rect = { 0 };
|
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;
|
2020-03-06 07:32:21 +00:00
|
|
|
|
break;
|
2017-10-06 19:19:42 +00:00
|
|
|
|
case GTK_ICON_VIEW_NO_DROP:
|
|
|
|
|
default:
|
2005-05-06 04:14:32 +00:00
|
|
|
|
break;
|
2011-01-12 20:26:25 +00:00
|
|
|
|
}
|
|
|
|
|
|
2020-01-07 22:29:44 +00:00
|
|
|
|
gtk_style_context_save_to_node (context, icon_view->priv->dndnode);
|
2020-01-07 02:25:15 +00:00
|
|
|
|
gtk_style_context_set_state (context, gtk_style_context_get_state (context) | GTK_STATE_FLAG_DROP_ACTIVE);
|
|
|
|
|
|
|
|
|
|
gtk_snapshot_render_frame (snapshot, context,
|
2016-12-19 16:16:09 +00:00
|
|
|
|
rect.x, rect.y,
|
|
|
|
|
rect.width, rect.height);
|
2020-01-07 02:25:15 +00:00
|
|
|
|
|
|
|
|
|
gtk_style_context_restore (context);
|
2005-05-06 04:14:32 +00:00
|
|
|
|
}
|
2011-08-10 14:00:38 +00:00
|
|
|
|
|
2004-07-04 15:56:55 +00:00
|
|
|
|
if (icon_view->priv->doing_rubberband)
|
2016-12-19 16:16:09 +00:00
|
|
|
|
gtk_icon_view_snapshot_rubberband (icon_view, snapshot);
|
2002-04-30 17:08:52 +00:00
|
|
|
|
|
2019-02-21 04:34:12 +00:00
|
|
|
|
gtk_snapshot_restore (snapshot);
|
|
|
|
|
|
2016-12-19 16:16:09 +00:00
|
|
|
|
GTK_WIDGET_CLASS (gtk_icon_view_parent_class)->snapshot (widget, snapshot);
|
2002-04-30 17:08:52 +00:00
|
|
|
|
}
|
|
|
|
|
|
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;
|
|
|
|
|
}
|
|
|
|
|
|
2017-04-10 15:19:37 +00:00
|
|
|
|
static GtkIconViewItem *
|
|
|
|
|
_gtk_icon_view_get_item_at_widget_coords (GtkIconView *icon_view,
|
2020-07-24 13:54:49 +00:00
|
|
|
|
int x,
|
|
|
|
|
int y,
|
2017-04-10 15:19:37 +00:00
|
|
|
|
gboolean only_in_cell,
|
|
|
|
|
GtkCellRenderer **cell_at_pos)
|
|
|
|
|
{
|
|
|
|
|
x += gtk_adjustment_get_value (icon_view->priv->hadjustment);
|
|
|
|
|
y += gtk_adjustment_get_value (icon_view->priv->vadjustment);
|
|
|
|
|
|
|
|
|
|
return _gtk_icon_view_get_item_at_coords (icon_view, x, y,
|
|
|
|
|
only_in_cell, cell_at_pos);
|
|
|
|
|
}
|
|
|
|
|
|
2018-01-02 04:48:32 +00:00
|
|
|
|
static void
|
|
|
|
|
gtk_icon_view_motion (GtkEventController *controller,
|
|
|
|
|
double x,
|
|
|
|
|
double y,
|
|
|
|
|
gpointer user_data)
|
2002-04-30 17:08:52 +00:00
|
|
|
|
{
|
2004-07-04 15:56:55 +00:00
|
|
|
|
GtkIconView *icon_view;
|
2020-07-24 13:54:49 +00:00
|
|
|
|
int abs_y;
|
2018-01-02 04:48:32 +00:00
|
|
|
|
GdkDevice *device;
|
|
|
|
|
|
|
|
|
|
icon_view = GTK_ICON_VIEW (user_data);
|
2005-05-06 04:14:32 +00:00
|
|
|
|
|
2018-01-02 04:48:32 +00:00
|
|
|
|
icon_view->priv->mouse_x = x;
|
|
|
|
|
icon_view->priv->mouse_y = y;
|
2017-06-27 09:11:57 +00:00
|
|
|
|
|
2020-04-11 18:52:43 +00:00
|
|
|
|
device = gtk_event_controller_get_current_event_device (controller);
|
2018-01-02 04:48:32 +00:00
|
|
|
|
gtk_icon_view_maybe_begin_drag (icon_view, x, y, device);
|
2005-05-06 04:14:32 +00:00
|
|
|
|
|
2004-07-04 15:56:55 +00:00
|
|
|
|
if (icon_view->priv->doing_rubberband)
|
2004-05-31 19:44:01 +00:00
|
|
|
|
{
|
2017-12-06 06:56:12 +00:00
|
|
|
|
int height;
|
2017-06-27 09:11:57 +00:00
|
|
|
|
gtk_icon_view_update_rubberband (icon_view);
|
2018-01-02 04:48:32 +00:00
|
|
|
|
|
2017-08-25 14:48:09 +00:00
|
|
|
|
abs_y = icon_view->priv->mouse_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
|
|
|
|
|
2018-01-02 04:48:32 +00:00
|
|
|
|
height = gtk_widget_get_height (GTK_WIDGET (icon_view));
|
2017-12-06 06:56:12 +00:00
|
|
|
|
|
2010-08-11 21:10:57 +00:00
|
|
|
|
|
2017-06-28 06:19:35 +00:00
|
|
|
|
if (abs_y < 0 || abs_y > 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
|
2017-06-28 06:19:35 +00:00
|
|
|
|
icon_view->priv->scroll_value_diff = abs_y - height;
|
2004-05-31 19:44:01 +00:00
|
|
|
|
|
2017-08-25 14:48:09 +00:00
|
|
|
|
icon_view->priv->event_last_x = icon_view->priv->mouse_x;
|
|
|
|
|
icon_view->priv->event_last_y = icon_view->priv->mouse_x;
|
2004-05-31 19:44:01 +00:00
|
|
|
|
|
2013-10-22 13:43:43 +00:00
|
|
|
|
if (icon_view->priv->scroll_timeout_id == 0) {
|
2018-02-02 14:51:47 +00:00
|
|
|
|
icon_view->priv->scroll_timeout_id = g_timeout_add (30, rubberband_scroll_timeout, icon_view);
|
2019-02-05 10:26:20 +00:00
|
|
|
|
g_source_set_name_by_id (icon_view->priv->scroll_timeout_id, "[gtk] rubberband_scroll_timeout");
|
2013-10-22 13:43:43 +00:00
|
|
|
|
}
|
2005-05-06 04:14:32 +00:00
|
|
|
|
}
|
2018-01-02 04:48:32 +00:00
|
|
|
|
else
|
2005-05-06 04:14:32 +00:00
|
|
|
|
remove_scroll_timeout (icon_view);
|
2004-05-31 19:44:01 +00:00
|
|
|
|
}
|
2011-09-14 21:32:02 +00:00
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
GtkIconViewItem *item, *last_prelight_item;
|
|
|
|
|
GtkCellRenderer *cell = NULL;
|
|
|
|
|
|
|
|
|
|
last_prelight_item = icon_view->priv->last_prelight;
|
2017-04-10 15:19:37 +00:00
|
|
|
|
item = _gtk_icon_view_get_item_at_widget_coords (icon_view,
|
2017-08-25 14:48:09 +00:00
|
|
|
|
icon_view->priv->mouse_x,
|
|
|
|
|
icon_view->priv->mouse_y,
|
2017-04-10 15:19:37 +00:00
|
|
|
|
FALSE,
|
|
|
|
|
&cell);
|
2011-09-14 21:32:02 +00:00
|
|
|
|
|
2014-09-15 14:06:41 +00:00
|
|
|
|
if (item != last_prelight_item)
|
2011-09-14 21:32:02 +00:00
|
|
|
|
{
|
2014-09-15 14:06:41 +00:00
|
|
|
|
if (item != NULL)
|
|
|
|
|
{
|
|
|
|
|
gtk_icon_view_queue_draw_item (icon_view, item);
|
|
|
|
|
}
|
2011-09-14 21:32:02 +00:00
|
|
|
|
|
2014-09-15 14:06:41 +00:00
|
|
|
|
if (last_prelight_item != NULL)
|
|
|
|
|
{
|
|
|
|
|
gtk_icon_view_queue_draw_item (icon_view,
|
|
|
|
|
icon_view->priv->last_prelight);
|
|
|
|
|
}
|
2011-09-14 21:32:02 +00:00
|
|
|
|
|
2014-09-15 14:06:41 +00:00
|
|
|
|
icon_view->priv->last_prelight = item;
|
|
|
|
|
}
|
2011-09-14 21:32:02 +00:00
|
|
|
|
}
|
2002-04-30 17:08:52 +00:00
|
|
|
|
}
|
|
|
|
|
|
2018-01-02 04:48:32 +00:00
|
|
|
|
static void
|
2020-05-24 15:47:53 +00:00
|
|
|
|
gtk_icon_view_leave (GtkEventController *controller,
|
|
|
|
|
gpointer user_data)
|
2014-09-16 02:17:01 +00:00
|
|
|
|
{
|
|
|
|
|
GtkIconView *icon_view;
|
|
|
|
|
GtkIconViewPrivate *priv;
|
|
|
|
|
|
2020-02-20 03:04:28 +00:00
|
|
|
|
icon_view = GTK_ICON_VIEW (user_data);
|
|
|
|
|
priv = icon_view->priv;
|
2020-02-16 01:47:23 +00:00
|
|
|
|
|
2020-02-20 03:04:28 +00:00
|
|
|
|
if (priv->last_prelight)
|
|
|
|
|
{
|
|
|
|
|
gtk_icon_view_queue_draw_item (icon_view, priv->last_prelight);
|
|
|
|
|
priv->last_prelight = NULL;
|
2014-09-16 02:17:01 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2005-05-02 20:28:37 +00:00
|
|
|
|
static void
|
2020-05-07 04:47:25 +00:00
|
|
|
|
gtk_icon_view_remove (GtkIconView *icon_view,
|
|
|
|
|
GtkWidget *widget)
|
2002-04-30 17:08:52 +00:00
|
|
|
|
{
|
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
|
|
|
|
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
|
|
|
|
|
2010-12-12 10:59:41 +00:00
|
|
|
|
static void
|
|
|
|
|
gtk_icon_view_add_editable (GtkCellArea *area,
|
|
|
|
|
GtkCellRenderer *renderer,
|
|
|
|
|
GtkCellEditable *editable,
|
|
|
|
|
GdkRectangle *cell_area,
|
2020-07-24 18:40:36 +00:00
|
|
|
|
const char *path,
|
2010-12-12 10:59:41 +00:00
|
|
|
|
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);
|
|
|
|
|
|
|
|
|
|
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,
|
2020-05-07 04:47:25 +00:00
|
|
|
|
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));
|
2020-05-07 04:47:25 +00:00
|
|
|
|
|
|
|
|
|
gtk_icon_view_remove (icon_view, GTK_WIDGET (editable));
|
2005-05-02 20:28:37 +00:00
|
|
|
|
|
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
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 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
|
2014-02-07 18:01:26 +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.
|
|
|
|
|
*
|
2014-02-04 23:21:13 +00:00
|
|
|
|
* This function is often followed by `gtk_widget_grab_focus
|
|
|
|
|
* (icon_view)` in order to give keyboard focus to the widget.
|
2005-05-02 20:28:37 +00:00
|
|
|
|
* Please note that editing can only happen when the widget is realized.
|
|
|
|
|
**/
|
|
|
|
|
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
|
|
|
|
|
2011-12-18 15:16:34 +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
|
|
|
|
{
|
2012-05-07 23:53:48 +00:00
|
|
|
|
GtkCellAreaContext *context;
|
|
|
|
|
|
|
|
|
|
context = g_ptr_array_index (icon_view->priv->row_contexts, item->row);
|
2011-12-18 15:16:34 +00:00
|
|
|
|
_gtk_icon_view_set_cell_data (icon_view, item);
|
2012-05-07 23:53:48 +00:00
|
|
|
|
gtk_cell_area_activate (icon_view->priv->cell_area, context,
|
2012-05-03 22:31:14 +00:00
|
|
|
|
GTK_WIDGET (icon_view), &item->cell_area,
|
2010-12-13 08:41:50 +00:00
|
|
|
|
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
|
2013-07-28 20:16:16 +00:00
|
|
|
|
* @path: (out) (allow-none) (transfer full): Return location for the current
|
|
|
|
|
* cursor path, or %NULL
|
|
|
|
|
* @cell: (out) (allow-none) (transfer 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.
|
2014-02-07 18:32:47 +00:00
|
|
|
|
* If the cursor isn’t currently set, then *@path will be %NULL.
|
2005-05-02 20:28:37 +00:00
|
|
|
|
* If no cell currently has focus, then *@cell will be %NULL.
|
|
|
|
|
*
|
|
|
|
|
* The returned #GtkTreePath must be freed with gtk_tree_path_free().
|
|
|
|
|
*
|
2014-02-19 23:49:43 +00:00
|
|
|
|
* Returns: %TRUE if the cursor is set.
|
2005-05-02 20:28:37 +00:00
|
|
|
|
**/
|
|
|
|
|
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);
|
|
|
|
|
}
|
|
|
|
|
|
2017-09-13 15:58:45 +00:00
|
|
|
|
static void
|
2019-05-29 17:10:46 +00:00
|
|
|
|
gtk_icon_view_button_press (GtkGestureClick *gesture,
|
|
|
|
|
int n_press,
|
|
|
|
|
double x,
|
|
|
|
|
double y,
|
|
|
|
|
gpointer user_data)
|
2005-05-02 20:28:37 +00:00
|
|
|
|
{
|
2017-09-13 15:58:45 +00:00
|
|
|
|
GtkIconView *icon_view = user_data;
|
|
|
|
|
GtkWidget *widget = GTK_WIDGET (icon_view);
|
2005-05-02 20:28:37 +00:00
|
|
|
|
GtkIconViewItem *item;
|
|
|
|
|
gboolean dirty = FALSE;
|
2010-12-12 07:29:41 +00:00
|
|
|
|
GtkCellRenderer *cell = NULL, *cursor_cell = NULL;
|
2017-09-13 15:58:45 +00:00
|
|
|
|
int button = gtk_gesture_single_get_current_button (GTK_GESTURE_SINGLE (gesture));
|
|
|
|
|
GdkEventSequence *sequence = gtk_gesture_single_get_current_sequence (GTK_GESTURE_SINGLE (gesture));
|
2020-04-05 23:52:25 +00:00
|
|
|
|
GdkEvent *event = gtk_gesture_get_last_event (GTK_GESTURE (gesture), sequence);
|
2017-08-25 14:48:09 +00:00
|
|
|
|
GdkModifierType state;
|
2005-05-02 20:28:37 +00:00
|
|
|
|
|
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);
|
|
|
|
|
|
2020-02-18 03:11:56 +00:00
|
|
|
|
if (button == GDK_BUTTON_PRIMARY)
|
2005-05-02 20:28:37 +00:00
|
|
|
|
{
|
2020-04-05 23:52:25 +00:00
|
|
|
|
GdkModifierType extend_mod_mask = GDK_SHIFT_MASK;
|
|
|
|
|
GdkModifierType modify_mod_mask = GDK_CONTROL_MASK;
|
2011-09-27 10:06:10 +00:00
|
|
|
|
|
2020-04-05 23:52:25 +00:00
|
|
|
|
state = gdk_event_get_modifier_state (event);
|
2011-09-27 10:06:10 +00:00
|
|
|
|
|
2017-04-10 15:19:37 +00:00
|
|
|
|
item = _gtk_icon_view_get_item_at_widget_coords (icon_view,
|
2017-09-13 15:58:45 +00:00
|
|
|
|
x, y,
|
2017-04-10 15:19:37 +00:00
|
|
|
|
FALSE,
|
|
|
|
|
&cell);
|
2008-09-24 08:04:15 +00:00
|
|
|
|
|
|
|
|
|
/*
|
2012-08-26 14:52:08 +00:00
|
|
|
|
* We consider only the cells' area as the item area if the
|
2008-09-24 08:04:15 +00:00
|
|
|
|
* 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)
|
|
|
|
|
{
|
2011-12-18 15:16:34 +00:00
|
|
|
|
_gtk_icon_view_set_cursor_item (icon_view, item, cursor_cell);
|
2005-05-02 20:28:37 +00:00
|
|
|
|
}
|
|
|
|
|
else if (icon_view->priv->selection_mode == GTK_SELECTION_MULTIPLE &&
|
2017-08-25 14:48:09 +00:00
|
|
|
|
(state & extend_mod_mask))
|
2005-05-02 20:28:37 +00:00
|
|
|
|
{
|
|
|
|
|
gtk_icon_view_unselect_all_internal (icon_view);
|
|
|
|
|
|
2011-12-18 15:16:34 +00:00
|
|
|
|
_gtk_icon_view_set_cursor_item (icon_view, item, cursor_cell);
|
2005-05-02 20:28:37 +00:00
|
|
|
|
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;
|
|
|
|
|
}
|
2017-08-25 14:48:09 +00:00
|
|
|
|
else
|
2005-05-02 20:28:37 +00:00
|
|
|
|
{
|
|
|
|
|
if ((icon_view->priv->selection_mode == GTK_SELECTION_MULTIPLE ||
|
|
|
|
|
((icon_view->priv->selection_mode == GTK_SELECTION_SINGLE) && item->selected)) &&
|
2017-08-25 14:48:09 +00:00
|
|
|
|
(state & modify_mod_mask))
|
2005-05-02 20:28:37 +00:00
|
|
|
|
{
|
|
|
|
|
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
|
|
|
|
}
|
2011-12-18 15:16:34 +00:00
|
|
|
|
_gtk_icon_view_set_cursor_item (icon_view, item, cursor_cell);
|
2005-05-02 20:28:37 +00:00
|
|
|
|
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)
|
|
|
|
|
{
|
2017-09-13 15:58:45 +00:00
|
|
|
|
icon_view->priv->pressed_button = button;
|
|
|
|
|
icon_view->priv->press_start_x = x;
|
|
|
|
|
icon_view->priv->press_start_y = y;
|
2005-05-02 20:28:37 +00:00
|
|
|
|
}
|
2005-05-06 04:14:32 +00:00
|
|
|
|
|
2013-01-18 21:50:47 +00:00
|
|
|
|
icon_view->priv->last_single_clicked = item;
|
2005-05-02 20:28:37 +00:00
|
|
|
|
|
|
|
|
|
/* 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
|
|
|
|
{
|
2012-05-07 23:53:48 +00:00
|
|
|
|
GtkCellAreaContext *context;
|
|
|
|
|
|
|
|
|
|
context = g_ptr_array_index (icon_view->priv->row_contexts, item->row);
|
|
|
|
|
|
2011-12-18 15:16:34 +00:00
|
|
|
|
_gtk_icon_view_set_cell_data (icon_view, item);
|
2012-05-07 23:53:48 +00:00
|
|
|
|
gtk_cell_area_activate (icon_view->priv->cell_area, context,
|
2010-12-12 07:29:41 +00:00
|
|
|
|
GTK_WIDGET (icon_view),
|
2012-05-03 22:31:14 +00:00
|
|
|
|
&item->cell_area, 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 &&
|
2017-08-25 14:48:09 +00:00
|
|
|
|
!(state & modify_mod_mask))
|
2005-05-02 20:28:37 +00:00
|
|
|
|
{
|
|
|
|
|
dirty = gtk_icon_view_unselect_all_internal (icon_view);
|
|
|
|
|
}
|
2017-08-25 14:48:09 +00:00
|
|
|
|
|
2005-05-02 20:28:37 +00:00
|
|
|
|
if (icon_view->priv->selection_mode == GTK_SELECTION_MULTIPLE)
|
2017-08-25 14:48:09 +00:00
|
|
|
|
gtk_icon_view_start_rubberbanding (icon_view,
|
|
|
|
|
gtk_gesture_get_device (GTK_GESTURE (gesture)),
|
|
|
|
|
x, y);
|
2005-05-02 20:28:37 +00:00
|
|
|
|
}
|
|
|
|
|
|
2019-08-25 12:52:24 +00:00
|
|
|
|
/* don't draw keyboard focus around a clicked-on item */
|
2008-09-27 12:53:05 +00:00
|
|
|
|
icon_view->priv->draw_focus = FALSE;
|
2005-05-02 20:28:37 +00:00
|
|
|
|
}
|
|
|
|
|
|
2013-01-18 05:59:55 +00:00
|
|
|
|
if (!icon_view->priv->activate_on_single_click
|
2017-09-13 15:58:45 +00:00
|
|
|
|
&& button == GDK_BUTTON_PRIMARY
|
|
|
|
|
&& n_press == 2)
|
2005-05-02 20:28:37 +00:00
|
|
|
|
{
|
2017-04-10 15:19:37 +00:00
|
|
|
|
item = _gtk_icon_view_get_item_at_widget_coords (icon_view,
|
2017-09-13 15:58:45 +00:00
|
|
|
|
x, y,
|
2017-04-10 15:19:37 +00:00
|
|
|
|
FALSE,
|
|
|
|
|
NULL);
|
2005-05-02 20:28:37 +00:00
|
|
|
|
|
|
|
|
|
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);
|
|
|
|
|
}
|
|
|
|
|
|
2013-01-18 05:59:55 +00:00
|
|
|
|
static gboolean
|
Restructure the GdkEvent type hierarchy
GdkEvent has been a "I-can't-believe-this-is-not-OOP" type for ages,
using a union of sub-types. This has always been problematic when it
comes to implementing accessor functions: either you get generic API
that takes a GdkEvent and uses a massive switch() to determine which
event types have the data you're looking for; or you create namespaced
accessors, but break language bindings horribly, as boxed types cannot
have derived types.
The recent conversion of GskRenderNode (which had similar issues) to
GTypeInstance, and the fact that GdkEvent is now a completely opaque
type, provide us with the chance of moving GdkEvent to GTypeInstance,
and have sub-types for GdkEvent.
The change from boxed type to GTypeInstance is pretty small, all things
considered, but ends up cascading to a larger commit, as we still have
backends and code in GTK trying to access GdkEvent structures directly.
Additionally, the naming of the public getter functions requires
renaming all the data structures to conform to the namespace/type-name
pattern.
2020-04-16 16:23:36 +00:00
|
|
|
|
button_event_modifies_selection (GdkEvent *event)
|
2013-01-18 05:59:55 +00:00
|
|
|
|
{
|
Restructure the GdkEvent type hierarchy
GdkEvent has been a "I-can't-believe-this-is-not-OOP" type for ages,
using a union of sub-types. This has always been problematic when it
comes to implementing accessor functions: either you get generic API
that takes a GdkEvent and uses a massive switch() to determine which
event types have the data you're looking for; or you create namespaced
accessors, but break language bindings horribly, as boxed types cannot
have derived types.
The recent conversion of GskRenderNode (which had similar issues) to
GTypeInstance, and the fact that GdkEvent is now a completely opaque
type, provide us with the chance of moving GdkEvent to GTypeInstance,
and have sub-types for GdkEvent.
The change from boxed type to GTypeInstance is pretty small, all things
considered, but ends up cascading to a larger commit, as we still have
backends and code in GTK trying to access GdkEvent structures directly.
Additionally, the naming of the public getter functions requires
renaming all the data structures to conform to the namespace/type-name
pattern.
2020-04-16 16:23:36 +00:00
|
|
|
|
guint state = gdk_event_get_modifier_state (event);
|
2017-08-25 14:48:09 +00:00
|
|
|
|
|
|
|
|
|
return (state & (GDK_CONTROL_MASK | GDK_SHIFT_MASK)) != 0;
|
2013-01-18 05:59:55 +00:00
|
|
|
|
}
|
|
|
|
|
|
2017-09-13 15:58:45 +00:00
|
|
|
|
static void
|
2019-05-29 17:10:46 +00:00
|
|
|
|
gtk_icon_view_button_release (GtkGestureClick *gesture,
|
|
|
|
|
int n_press,
|
|
|
|
|
double x,
|
|
|
|
|
double y,
|
|
|
|
|
gpointer user_data)
|
2005-05-02 20:28:37 +00:00
|
|
|
|
{
|
2017-09-13 15:58:45 +00:00
|
|
|
|
GtkIconView *icon_view = user_data;
|
|
|
|
|
int button = gtk_gesture_single_get_current_button (GTK_GESTURE_SINGLE (gesture));
|
|
|
|
|
GdkEventSequence *sequence = gtk_gesture_single_get_current_sequence (GTK_GESTURE_SINGLE (gesture));
|
Restructure the GdkEvent type hierarchy
GdkEvent has been a "I-can't-believe-this-is-not-OOP" type for ages,
using a union of sub-types. This has always been problematic when it
comes to implementing accessor functions: either you get generic API
that takes a GdkEvent and uses a massive switch() to determine which
event types have the data you're looking for; or you create namespaced
accessors, but break language bindings horribly, as boxed types cannot
have derived types.
The recent conversion of GskRenderNode (which had similar issues) to
GTypeInstance, and the fact that GdkEvent is now a completely opaque
type, provide us with the chance of moving GdkEvent to GTypeInstance,
and have sub-types for GdkEvent.
The change from boxed type to GTypeInstance is pretty small, all things
considered, but ends up cascading to a larger commit, as we still have
backends and code in GTK trying to access GdkEvent structures directly.
Additionally, the naming of the public getter functions requires
renaming all the data structures to conform to the namespace/type-name
pattern.
2020-04-16 16:23:36 +00:00
|
|
|
|
GdkEvent *event = gtk_gesture_get_last_event (GTK_GESTURE (gesture), sequence);
|
2005-05-02 20:28:37 +00:00
|
|
|
|
|
2017-09-13 15:58:45 +00:00
|
|
|
|
if (icon_view->priv->pressed_button == button)
|
2005-05-02 20:28:37 +00:00
|
|
|
|
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
|
|
|
|
|
2017-09-13 15:58:45 +00:00
|
|
|
|
if (button == GDK_BUTTON_PRIMARY
|
2013-01-18 05:59:55 +00:00
|
|
|
|
&& icon_view->priv->activate_on_single_click
|
|
|
|
|
&& !button_event_modifies_selection (event)
|
|
|
|
|
&& icon_view->priv->last_single_clicked != NULL)
|
|
|
|
|
{
|
|
|
|
|
GtkIconViewItem *item;
|
|
|
|
|
|
2017-04-10 15:19:37 +00:00
|
|
|
|
item = _gtk_icon_view_get_item_at_widget_coords (icon_view,
|
2017-09-13 15:58:45 +00:00
|
|
|
|
x, y,
|
2017-04-10 15:19:37 +00:00
|
|
|
|
FALSE,
|
|
|
|
|
NULL);
|
2013-01-18 05:59:55 +00:00
|
|
|
|
if (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-05-02 20:28:37 +00:00
|
|
|
|
}
|
|
|
|
|
|
2007-05-09 14:06:02 +00:00
|
|
|
|
static gboolean
|
2018-03-11 12:56:21 +00:00
|
|
|
|
gtk_icon_view_key_pressed (GtkEventControllerKey *controller,
|
|
|
|
|
guint keyval,
|
|
|
|
|
guint keycode,
|
|
|
|
|
GdkModifierType state,
|
|
|
|
|
GtkWidget *widget)
|
2007-05-09 14:06:02 +00:00
|
|
|
|
{
|
|
|
|
|
GtkIconView *icon_view = GTK_ICON_VIEW (widget);
|
|
|
|
|
|
|
|
|
|
if (icon_view->priv->doing_rubberband)
|
|
|
|
|
{
|
2018-03-11 12:56:21 +00:00
|
|
|
|
if (keyval == GDK_KEY_Escape)
|
2007-05-09 14:06:02 +00:00
|
|
|
|
gtk_icon_view_stop_rubberbanding (icon_view);
|
|
|
|
|
|
|
|
|
|
return TRUE;
|
|
|
|
|
}
|
|
|
|
|
|
2018-03-11 12:56:21 +00:00
|
|
|
|
return FALSE;
|
2007-05-09 14:06:02 +00:00
|
|
|
|
}
|
|
|
|
|
|
2005-05-02 20:28:37 +00:00
|
|
|
|
static void
|
2017-06-27 09:11:57 +00:00
|
|
|
|
gtk_icon_view_update_rubberband (GtkIconView *icon_view)
|
2005-05-02 20:28:37 +00:00
|
|
|
|
{
|
2020-07-24 13:54:49 +00:00
|
|
|
|
int x, y;
|
2017-05-24 16:30:25 +00:00
|
|
|
|
|
2017-06-27 09:11:57 +00:00
|
|
|
|
x = MAX (icon_view->priv->mouse_x, 0);
|
|
|
|
|
y = MAX (icon_view->priv->mouse_y, 0);
|
2002-04-30 17:08:52 +00:00
|
|
|
|
|
2017-10-11 08:55:20 +00:00
|
|
|
|
icon_view->priv->rubberband_x2 = x + gtk_adjustment_get_value (icon_view->priv->hadjustment);
|
|
|
|
|
icon_view->priv->rubberband_y2 = y + gtk_adjustment_get_value (icon_view->priv->vadjustment);
|
2002-04-30 17:08:52 +00:00
|
|
|
|
|
2004-07-04 15:56:55 +00:00
|
|
|
|
gtk_icon_view_update_rubberband_selection (icon_view);
|
2017-06-27 09:11:57 +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_start_rubberbanding (GtkIconView *icon_view,
|
2010-05-25 22:38:44 +00:00
|
|
|
|
GdkDevice *device,
|
2020-07-24 13:54:49 +00:00
|
|
|
|
int x,
|
|
|
|
|
int y)
|
2002-04-30 17:08:52 +00:00
|
|
|
|
{
|
2015-11-10 05:25:19 +00:00
|
|
|
|
GtkIconViewPrivate *priv = icon_view->priv;
|
2002-04-30 17:08:52 +00:00
|
|
|
|
GList *items;
|
2015-11-10 05:25:19 +00:00
|
|
|
|
GtkCssNode *widget_node;
|
2002-04-30 17:08:52 +00:00
|
|
|
|
|
2015-11-10 05:25:19 +00:00
|
|
|
|
if (priv->rubberband_device)
|
2010-05-25 22:38:44 +00:00
|
|
|
|
return;
|
2002-04-30 17:08:52 +00:00
|
|
|
|
|
2015-11-10 05:25:19 +00:00
|
|
|
|
for (items = 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;
|
|
|
|
|
}
|
|
|
|
|
|
2017-10-11 08:55:20 +00:00
|
|
|
|
priv->rubberband_x1 = x + gtk_adjustment_get_value (priv->hadjustment);
|
|
|
|
|
priv->rubberband_y1 = y + gtk_adjustment_get_value (priv->vadjustment);
|
|
|
|
|
priv->rubberband_x2 = priv->rubberband_x1;
|
|
|
|
|
priv->rubberband_y2 = priv->rubberband_y1;
|
2015-11-10 05:25:19 +00:00
|
|
|
|
|
|
|
|
|
priv->doing_rubberband = TRUE;
|
|
|
|
|
priv->rubberband_device = device;
|
|
|
|
|
|
|
|
|
|
widget_node = gtk_widget_get_css_node (GTK_WIDGET (icon_view));
|
|
|
|
|
priv->rubberband_node = gtk_css_node_new ();
|
2020-01-23 23:43:26 +00:00
|
|
|
|
gtk_css_node_set_name (priv->rubberband_node, g_quark_from_static_string ("rubberband"));
|
2015-11-10 05:25:19 +00:00
|
|
|
|
gtk_css_node_set_parent (priv->rubberband_node, widget_node);
|
|
|
|
|
gtk_css_node_set_state (priv->rubberband_node, gtk_css_node_get_state (widget_node));
|
|
|
|
|
g_object_unref (priv->rubberband_node);
|
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
|
|
|
|
{
|
2015-11-10 05:25:19 +00:00
|
|
|
|
GtkIconViewPrivate *priv = icon_view->priv;
|
|
|
|
|
|
|
|
|
|
if (!priv->doing_rubberband)
|
2002-04-30 17:08:52 +00:00
|
|
|
|
return;
|
|
|
|
|
|
2015-11-10 05:25:19 +00:00
|
|
|
|
priv->doing_rubberband = FALSE;
|
|
|
|
|
priv->rubberband_device = NULL;
|
|
|
|
|
gtk_css_node_set_parent (priv->rubberband_node, NULL);
|
|
|
|
|
priv->rubberband_node = 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;
|
2020-07-24 13:54:49 +00:00
|
|
|
|
int x, y, width, height;
|
2002-04-30 17:08:52 +00:00
|
|
|
|
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,
|
2020-07-24 13:54:49 +00:00
|
|
|
|
int x,
|
|
|
|
|
int y,
|
|
|
|
|
int width,
|
|
|
|
|
int height)
|
2002-04-30 17:08:52 +00:00
|
|
|
|
{
|
2010-12-12 07:29:41 +00:00
|
|
|
|
HitTestData data = { { x, y, width, height }, FALSE };
|
2012-05-07 23:53:48 +00:00
|
|
|
|
GtkCellAreaContext *context;
|
2012-05-03 22:31:14 +00:00
|
|
|
|
GdkRectangle *item_area = &item->cell_area;
|
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;
|
|
|
|
|
|
2012-05-07 23:53:48 +00:00
|
|
|
|
context = g_ptr_array_index (icon_view->priv->row_contexts, item->row);
|
|
|
|
|
|
2011-12-18 15:16:34 +00:00
|
|
|
|
_gtk_icon_view_set_cell_data (icon_view, item);
|
2012-05-07 23:53:48 +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);
|
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)
|
2011-12-18 15:16:34 +00:00
|
|
|
|
_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;
|
2012-05-07 23:53:48 +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;
|
|
|
|
|
|
2012-05-07 23:53:48 +00:00
|
|
|
|
context = g_ptr_array_index (icon_view->priv->row_contexts, icon_view->priv->cursor_item->row);
|
|
|
|
|
|
2011-12-18 15:16:34 +00:00
|
|
|
|
_gtk_icon_view_set_cell_data (icon_view, icon_view->priv->cursor_item);
|
2012-05-07 23:53:48 +00:00
|
|
|
|
gtk_cell_area_activate (icon_view->priv->cell_area, context,
|
2011-01-24 02:50:39 +00:00
|
|
|
|
GTK_WIDGET (icon_view),
|
2012-05-03 22:31:14 +00:00
|
|
|
|
&icon_view->priv->cursor_item->cell_area,
|
2011-01-24 02:50:39 +00:00
|
|
|
|
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:
|
2017-10-06 19:19:42 +00:00
|
|
|
|
default:
|
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_BROWSE:
|
2011-12-18 15:16:34 +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)
|
2011-12-18 15:16:34 +00:00
|
|
|
|
_gtk_icon_view_unselect_item (icon_view, icon_view->priv->cursor_item);
|
2002-04-30 17:08:52 +00:00
|
|
|
|
else
|
2011-12-18 15:16:34 +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
|
|
|
|
|
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
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2010-10-18 04:21:39 +00:00
|
|
|
|
static void
|
|
|
|
|
gtk_icon_view_set_hadjustment_values (GtkIconView *icon_view)
|
|
|
|
|
{
|
2017-12-06 06:56:12 +00:00
|
|
|
|
int width;
|
2010-10-18 04:21:39 +00:00
|
|
|
|
GtkAdjustment *adj = icon_view->priv->hadjustment;
|
2020-07-24 20:32:16 +00:00
|
|
|
|
double old_page_size;
|
|
|
|
|
double old_upper;
|
|
|
|
|
double old_value;
|
|
|
|
|
double new_value;
|
|
|
|
|
double new_upper;
|
2010-10-18 04:21:39 +00:00
|
|
|
|
|
2017-12-06 06:56:12 +00:00
|
|
|
|
width = gtk_widget_get_width (GTK_WIDGET (icon_view));
|
2010-10-18 04:21:39 +00:00
|
|
|
|
|
|
|
|
|
old_value = gtk_adjustment_get_value (adj);
|
|
|
|
|
old_upper = gtk_adjustment_get_upper (adj);
|
|
|
|
|
old_page_size = gtk_adjustment_get_page_size (adj);
|
2017-06-28 06:19:35 +00:00
|
|
|
|
new_upper = MAX (width, icon_view->priv->width);
|
2010-10-18 04:21:39 +00:00
|
|
|
|
|
|
|
|
|
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.
|
|
|
|
|
*/
|
2017-06-28 06:19:35 +00:00
|
|
|
|
new_value = (new_upper - width) -
|
2010-10-18 04:21:39 +00:00
|
|
|
|
(old_upper - old_value - old_page_size);
|
2017-06-28 06:19:35 +00:00
|
|
|
|
new_value = CLAMP (new_value, 0, new_upper - width);
|
2010-10-18 04:21:39 +00:00
|
|
|
|
}
|
|
|
|
|
else
|
2017-06-28 06:19:35 +00:00
|
|
|
|
new_value = CLAMP (old_value, 0, new_upper - width);
|
2010-10-18 04:21:39 +00:00
|
|
|
|
|
2011-01-05 22:14:02 +00:00
|
|
|
|
gtk_adjustment_configure (adj,
|
|
|
|
|
new_value,
|
|
|
|
|
0.0,
|
|
|
|
|
new_upper,
|
2017-06-28 06:19:35 +00:00
|
|
|
|
width * 0.1,
|
|
|
|
|
width * 0.9,
|
|
|
|
|
width);
|
2010-10-18 04:21:39 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void
|
|
|
|
|
gtk_icon_view_set_vadjustment_values (GtkIconView *icon_view)
|
|
|
|
|
{
|
2017-12-06 06:56:12 +00:00
|
|
|
|
int height;
|
2010-10-18 04:21:39 +00:00
|
|
|
|
GtkAdjustment *adj = icon_view->priv->vadjustment;
|
|
|
|
|
|
2017-12-06 06:56:12 +00:00
|
|
|
|
height = gtk_widget_get_height (GTK_WIDGET (icon_view));
|
2010-10-18 04:21:39 +00:00
|
|
|
|
|
2011-01-05 22:14:02 +00:00
|
|
|
|
gtk_adjustment_configure (adj,
|
|
|
|
|
gtk_adjustment_get_value (adj),
|
|
|
|
|
0.0,
|
2017-06-28 06:19:35 +00:00
|
|
|
|
MAX (height, icon_view->priv->height),
|
|
|
|
|
height * 0.1,
|
|
|
|
|
height * 0.9,
|
|
|
|
|
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;
|
|
|
|
|
|
|
|
|
|
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);
|
|
|
|
|
|
|
|
|
|
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;
|
|
|
|
|
|
|
|
|
|
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);
|
|
|
|
|
|
|
|
|
|
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
|
|
|
|
{
|
2020-04-27 16:43:28 +00:00
|
|
|
|
GtkWidget *widget = GTK_WIDGET (icon_view);
|
|
|
|
|
|
|
|
|
|
if (gtk_widget_get_realized (widget))
|
2002-04-30 17:08:52 +00:00
|
|
|
|
{
|
2004-07-04 15:56:55 +00:00
|
|
|
|
if (icon_view->priv->doing_rubberband)
|
2017-06-27 09:11:57 +00:00
|
|
|
|
gtk_icon_view_update_rubberband (icon_view);
|
2002-04-30 17:08:52 +00:00
|
|
|
|
}
|
2017-06-27 09:11:57 +00:00
|
|
|
|
|
|
|
|
|
gtk_widget_queue_draw (GTK_WIDGET (icon_view));
|
2002-04-30 17:08:52 +00:00
|
|
|
|
}
|
|
|
|
|
|
2020-07-24 13:54:49 +00:00
|
|
|
|
static int
|
2012-05-06 03:39:58 +00:00
|
|
|
|
compare_sizes (gconstpointer p1,
|
|
|
|
|
gconstpointer p2,
|
|
|
|
|
gpointer unused)
|
|
|
|
|
{
|
|
|
|
|
return GPOINTER_TO_INT (((const GtkRequestedSize *) p1)->data)
|
|
|
|
|
- GPOINTER_TO_INT (((const GtkRequestedSize *) p2)->data);
|
|
|
|
|
}
|
|
|
|
|
|
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
|
|
|
|
{
|
2012-05-06 03:39:58 +00:00
|
|
|
|
GtkIconViewPrivate *priv = icon_view->priv;
|
|
|
|
|
GtkWidget *widget = GTK_WIDGET (icon_view);
|
|
|
|
|
GList *items;
|
2020-07-24 13:54:49 +00:00
|
|
|
|
int item_width = 0; /* this doesn't include item_padding */
|
|
|
|
|
int n_columns, n_rows, n_items;
|
|
|
|
|
int col, row;
|
2012-05-06 03:39:58 +00:00
|
|
|
|
GtkRequestedSize *sizes;
|
2012-05-15 05:12:28 +00:00
|
|
|
|
gboolean rtl;
|
2017-06-28 06:19:35 +00:00
|
|
|
|
int width, height;
|
2012-05-15 05:12:28 +00:00
|
|
|
|
|
2012-06-15 00:44:45 +00:00
|
|
|
|
if (gtk_icon_view_is_empty (icon_view))
|
|
|
|
|
return;
|
2004-07-04 20:35:35 +00:00
|
|
|
|
|
2012-06-15 00:44:45 +00:00
|
|
|
|
rtl = gtk_widget_get_direction (GTK_WIDGET (icon_view)) == GTK_TEXT_DIR_RTL;
|
2012-05-06 03:39:58 +00:00
|
|
|
|
n_items = gtk_icon_view_get_n_items (icon_view);
|
2004-06-16 00:03:31 +00:00
|
|
|
|
|
2017-12-06 06:56:12 +00:00
|
|
|
|
width = gtk_widget_get_width (widget);
|
|
|
|
|
height = gtk_widget_get_height (widget);
|
2017-06-28 06:19:35 +00:00
|
|
|
|
|
2012-05-06 03:39:58 +00:00
|
|
|
|
gtk_icon_view_compute_n_items_for_size (icon_view,
|
|
|
|
|
GTK_ORIENTATION_HORIZONTAL,
|
2017-06-28 06:19:35 +00:00
|
|
|
|
width,
|
2012-05-08 01:57:07 +00:00
|
|
|
|
NULL, NULL,
|
|
|
|
|
&n_columns, &item_width);
|
2012-05-06 03:39:58 +00:00
|
|
|
|
n_rows = (n_items + n_columns - 1) / n_columns;
|
2004-12-14 06:39:45 +00:00
|
|
|
|
|
2012-06-10 14:28:47 +00:00
|
|
|
|
priv->width = n_columns * (item_width + 2 * priv->item_padding + priv->column_spacing) - priv->column_spacing;
|
|
|
|
|
priv->width += 2 * priv->margin;
|
2017-06-28 06:19:35 +00:00
|
|
|
|
priv->width = MAX (priv->width, width);
|
2006-03-02 19:52:26 +00:00
|
|
|
|
|
2012-05-07 23:53:48 +00:00
|
|
|
|
/* Clear the per row contexts */
|
|
|
|
|
g_ptr_array_set_size (icon_view->priv->row_contexts, 0);
|
|
|
|
|
|
2012-05-06 03:39:58 +00:00
|
|
|
|
gtk_cell_area_context_reset (priv->cell_area_context);
|
|
|
|
|
/* because layouting is complicated. We designed an API
|
|
|
|
|
* that is O(N²) and nonsensical.
|
|
|
|
|
* And we're proud of it. */
|
|
|
|
|
for (items = priv->items; items; items = items->next)
|
2010-09-09 07:27:22 +00:00
|
|
|
|
{
|
2012-05-06 03:39:58 +00:00
|
|
|
|
_gtk_icon_view_set_cell_data (icon_view, items->data);
|
|
|
|
|
gtk_cell_area_get_preferred_width (priv->cell_area,
|
|
|
|
|
priv->cell_area_context,
|
|
|
|
|
widget,
|
|
|
|
|
NULL, NULL);
|
2010-09-09 07:27:22 +00:00
|
|
|
|
}
|
2002-04-30 17:08:52 +00:00
|
|
|
|
|
2012-05-06 03:39:58 +00:00
|
|
|
|
sizes = g_newa (GtkRequestedSize, n_rows);
|
|
|
|
|
items = priv->items;
|
|
|
|
|
priv->height = priv->margin;
|
2007-05-30 13:28:24 +00:00
|
|
|
|
|
2012-05-06 03:39:58 +00:00
|
|
|
|
/* Collect the heights for all rows */
|
|
|
|
|
for (row = 0; row < n_rows; row++)
|
2005-05-02 20:28:37 +00:00
|
|
|
|
{
|
2012-05-07 23:53:48 +00:00
|
|
|
|
GtkCellAreaContext *context = gtk_cell_area_copy_context (priv->cell_area, priv->cell_area_context);
|
|
|
|
|
g_ptr_array_add (priv->row_contexts, context);
|
|
|
|
|
|
2012-05-06 03:39:58 +00:00
|
|
|
|
for (col = 0; col < n_columns && items; col++, items = items->next)
|
|
|
|
|
{
|
|
|
|
|
GtkIconViewItem *item = items->data;
|
2005-05-02 20:28:37 +00:00
|
|
|
|
|
2012-05-06 03:39:58 +00:00
|
|
|
|
_gtk_icon_view_set_cell_data (icon_view, item);
|
|
|
|
|
gtk_cell_area_get_preferred_height_for_width (priv->cell_area,
|
2012-05-07 23:53:48 +00:00
|
|
|
|
context,
|
2012-05-06 03:39:58 +00:00
|
|
|
|
widget,
|
|
|
|
|
item_width,
|
|
|
|
|
NULL, NULL);
|
|
|
|
|
}
|
2006-03-02 19:52:26 +00:00
|
|
|
|
|
2012-05-06 03:39:58 +00:00
|
|
|
|
sizes[row].data = GINT_TO_POINTER (row);
|
2012-05-07 23:53:48 +00:00
|
|
|
|
gtk_cell_area_context_get_preferred_height_for_width (context,
|
2012-05-06 03:39:58 +00:00
|
|
|
|
item_width,
|
|
|
|
|
&sizes[row].minimum_size,
|
|
|
|
|
&sizes[row].natural_size);
|
|
|
|
|
priv->height += sizes[row].minimum_size + 2 * priv->item_padding + priv->row_spacing;
|
2006-03-02 19:52:26 +00:00
|
|
|
|
}
|
2005-05-02 20:28:37 +00:00
|
|
|
|
|
2012-05-06 03:39:58 +00:00
|
|
|
|
priv->height -= priv->row_spacing;
|
|
|
|
|
priv->height += priv->margin;
|
2017-06-28 06:19:35 +00:00
|
|
|
|
priv->height = MIN (priv->height, height);
|
2005-01-06 21:09:37 +00:00
|
|
|
|
|
2017-06-28 06:19:35 +00:00
|
|
|
|
gtk_distribute_natural_allocation (height - priv->height,
|
2012-05-06 03:39:58 +00:00
|
|
|
|
n_rows,
|
|
|
|
|
sizes);
|
2010-12-13 09:08:37 +00:00
|
|
|
|
|
2012-05-06 03:39:58 +00:00
|
|
|
|
/* Actually allocate the rows */
|
|
|
|
|
g_qsort_with_data (sizes, n_rows, sizeof (GtkRequestedSize), compare_sizes, NULL);
|
|
|
|
|
|
|
|
|
|
items = priv->items;
|
|
|
|
|
priv->height = priv->margin;
|
|
|
|
|
|
|
|
|
|
for (row = 0; row < n_rows; row++)
|
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
|
|
|
|
{
|
2012-05-07 23:53:48 +00:00
|
|
|
|
GtkCellAreaContext *context = g_ptr_array_index (priv->row_contexts, row);
|
|
|
|
|
gtk_cell_area_context_allocate (context, item_width, sizes[row].minimum_size);
|
|
|
|
|
|
2012-05-06 03:39:58 +00:00
|
|
|
|
priv->height += priv->item_padding;
|
2006-03-06 04:55:53 +00:00
|
|
|
|
|
2012-05-06 03:39:58 +00:00
|
|
|
|
for (col = 0; col < n_columns && items; col++, items = items->next)
|
|
|
|
|
{
|
|
|
|
|
GtkIconViewItem *item = items->data;
|
|
|
|
|
|
|
|
|
|
item->cell_area.x = priv->margin + (col * 2 + 1) * priv->item_padding + col * (priv->column_spacing + item_width);
|
|
|
|
|
item->cell_area.width = item_width;
|
|
|
|
|
item->cell_area.y = priv->height;
|
|
|
|
|
item->cell_area.height = sizes[row].minimum_size;
|
|
|
|
|
item->row = row;
|
|
|
|
|
item->col = col;
|
2012-05-15 05:12:28 +00:00
|
|
|
|
if (rtl)
|
|
|
|
|
{
|
|
|
|
|
item->cell_area.x = priv->width - item_width - item->cell_area.x;
|
|
|
|
|
item->col = n_columns - 1 - col;
|
|
|
|
|
}
|
2012-05-06 03:39:58 +00:00
|
|
|
|
}
|
2012-05-15 05:12:28 +00:00
|
|
|
|
|
2012-05-06 03:39:58 +00:00
|
|
|
|
priv->height += sizes[row].minimum_size + priv->item_padding + priv->row_spacing;
|
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
|
|
|
|
|
2012-05-06 03:39:58 +00:00
|
|
|
|
priv->height -= priv->row_spacing;
|
|
|
|
|
priv->height += priv->margin;
|
2017-06-28 06:19:35 +00:00
|
|
|
|
priv->height = MAX (priv->height, height);
|
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
|
|
|
|
|
|
|
|
|
/* Re-layout the items */
|
2012-05-05 02:33:47 +00:00
|
|
|
|
gtk_widget_queue_resize (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_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
|
2016-12-19 16:16:09 +00:00
|
|
|
|
gtk_icon_view_snapshot_item (GtkIconView *icon_view,
|
|
|
|
|
GtkSnapshot *snapshot,
|
|
|
|
|
GtkIconViewItem *item,
|
2020-07-24 13:54:49 +00:00
|
|
|
|
int x,
|
|
|
|
|
int y,
|
2016-12-19 16:16:09 +00:00
|
|
|
|
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;
|
2012-05-07 23:53:48 +00:00
|
|
|
|
GtkCellAreaContext *context;
|
2010-08-11 21:10:57 +00:00
|
|
|
|
|
2012-05-09 12:23:10 +00:00
|
|
|
|
if (priv->model == NULL || item->cell_area.width <= 0 || item->cell_area.height <= 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
|
|
|
|
return;
|
2011-01-24 02:50:39 +00:00
|
|
|
|
|
2011-12-18 15:16:34 +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);
|
2011-12-19 14:04:10 +00:00
|
|
|
|
state = gtk_widget_get_state_flags (widget);
|
2011-01-12 20:26:25 +00:00
|
|
|
|
|
|
|
|
|
gtk_style_context_save (style_context);
|
2020-08-13 23:49:02 +00:00
|
|
|
|
gtk_style_context_add_class (style_context, "cell");
|
2011-01-12 20:26:25 +00:00
|
|
|
|
|
2011-12-19 14:04:10 +00:00
|
|
|
|
state &= ~(GTK_STATE_FLAG_SELECTED | GTK_STATE_FLAG_PRELIGHT);
|
|
|
|
|
|
2012-09-27 17:24:31 +00:00
|
|
|
|
if ((state & GTK_STATE_FLAG_FOCUSED) &&
|
|
|
|
|
item == icon_view->priv->cursor_item)
|
|
|
|
|
flags |= GTK_CELL_RENDERER_FOCUSED;
|
|
|
|
|
|
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
|
|
|
|
state |= GTK_STATE_FLAG_SELECTED;
|
|
|
|
|
flags |= GTK_CELL_RENDERER_SELECTED;
|
2011-09-14 21:32:02 +00:00
|
|
|
|
}
|
|
|
|
|
|
2014-09-16 00:58:21 +00:00
|
|
|
|
if (item == priv->last_prelight)
|
2011-09-14 21:32:02 +00:00
|
|
|
|
{
|
|
|
|
|
state |= GTK_STATE_FLAG_PRELIGHT;
|
|
|
|
|
flags |= GTK_CELL_RENDERER_PRELIT;
|
|
|
|
|
}
|
2011-01-12 20:26:25 +00:00
|
|
|
|
|
2011-09-14 21:32:02 +00:00
|
|
|
|
gtk_style_context_set_state (style_context, state);
|
2011-07-07 17:25:24 +00:00
|
|
|
|
|
2016-12-19 16:16:09 +00:00
|
|
|
|
gtk_snapshot_render_background (snapshot, style_context,
|
|
|
|
|
x - priv->item_padding,
|
|
|
|
|
y - priv->item_padding,
|
|
|
|
|
item->cell_area.width + priv->item_padding * 2,
|
|
|
|
|
item->cell_area.height + priv->item_padding * 2);
|
|
|
|
|
gtk_snapshot_render_frame (snapshot, style_context,
|
|
|
|
|
x - priv->item_padding,
|
|
|
|
|
y - priv->item_padding,
|
|
|
|
|
item->cell_area.width + priv->item_padding * 2,
|
|
|
|
|
item->cell_area.height + priv->item_padding * 2);
|
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
|
|
|
|
|
2012-05-07 23:53:48 +00:00
|
|
|
|
context = g_ptr_array_index (priv->row_contexts, item->row);
|
2016-12-19 16:16:09 +00:00
|
|
|
|
gtk_cell_area_snapshot (priv->cell_area, context,
|
|
|
|
|
widget, snapshot, &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
|
2016-12-19 16:16:09 +00:00
|
|
|
|
gtk_icon_view_snapshot_rubberband (GtkIconView *icon_view,
|
|
|
|
|
GtkSnapshot *snapshot)
|
2002-04-30 17:08:52 +00:00
|
|
|
|
{
|
2015-11-10 05:25:19 +00:00
|
|
|
|
GtkIconViewPrivate *priv = icon_view->priv;
|
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
|
|
|
|
|
2015-11-10 05:25:19 +00:00
|
|
|
|
rect.x = MIN (priv->rubberband_x1, priv->rubberband_x2);
|
|
|
|
|
rect.y = MIN (priv->rubberband_y1, priv->rubberband_y2);
|
|
|
|
|
rect.width = ABS (priv->rubberband_x1 - priv->rubberband_x2) + 1;
|
|
|
|
|
rect.height = ABS (priv->rubberband_y1 - 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
|
|
|
|
|
2015-11-10 05:25:19 +00:00
|
|
|
|
gtk_style_context_save_to_node (context, priv->rubberband_node);
|
2003-07-03 13:10:41 +00:00
|
|
|
|
|
2016-12-19 16:16:09 +00:00
|
|
|
|
gtk_snapshot_render_background (snapshot, context,
|
|
|
|
|
rect.x, rect.y,
|
|
|
|
|
rect.width, rect.height);
|
|
|
|
|
gtk_snapshot_render_frame (snapshot, context,
|
|
|
|
|
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);
|
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;
|
2020-07-24 13:54:49 +00:00
|
|
|
|
int index;
|
2005-05-06 04:14:32 +00:00
|
|
|
|
|
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
|
|
|
|
{
|
2017-06-28 06:19:35 +00:00
|
|
|
|
gtk_widget_queue_draw (GTK_WIDGET (icon_view));
|
2002-04-30 17:08:52 +00:00
|
|
|
|
}
|
|
|
|
|
|
2011-12-18 15:16:34 +00:00
|
|
|
|
void
|
|
|
|
|
_gtk_icon_view_set_cursor_item (GtkIconView *icon_view,
|
|
|
|
|
GtkIconViewItem *item,
|
|
|
|
|
GtkCellRenderer *cursor_cell)
|
2002-04-30 17:08:52 +00:00
|
|
|
|
{
|
Remove ATK
To build a better world sometimes means having to tear the old one down.
-- Alexander Pierce, "Captain America: The Winter Soldier"
ATK served us well for nearly 20 years, but the world has changed, and
GTK has changed with it. Now ATK is mostly a hindrance towards improving
the accessibility stack:
- it maps to a very specific implementation, AT-SPI, which is Linux and
Unix specific
- it requires implementing the same functionality in three different
layers of the stack: AT-SPI, ATK, and GTK
- only GTK uses it; every other Linux and Unix toolkit and application
talks to AT-SPI directly, including assistive technologies
Sadly, we cannot incrementally port GTK to a new accessibility stack;
since ATK insulates us entirely from the underlying implementation, we
cannot replace it piecemeal. Instead, we're going to remove everything
and then incrementally build on a clean slate:
- add an "accessible" interface, implemented by GTK objects directly,
which describe the accessible role and state changes for every UI
element
- add an "assistive technology context" to proxy a native accessibility
API, and assign it to every widget
- implement the AT context depending on the platform
For more information, see: https://gitlab.gnome.org/GNOME/gtk/-/issues/2833
2020-06-16 15:41:59 +00:00
|
|
|
|
/* When hitting this path from keynav, the focus cell is already set,
|
|
|
|
|
* but we still need to queue the draw here (in the case that the focus
|
|
|
|
|
* cell changes but not the cursor item).
|
2011-01-05 16:30:17 +00:00
|
|
|
|
*/
|
|
|
|
|
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;
|
|
|
|
|
|
2004-07-04 15:56:55 +00:00
|
|
|
|
if (icon_view->priv->cursor_item != NULL)
|
Remove ATK
To build a better world sometimes means having to tear the old one down.
-- Alexander Pierce, "Captain America: The Winter Soldier"
ATK served us well for nearly 20 years, but the world has changed, and
GTK has changed with it. Now ATK is mostly a hindrance towards improving
the accessibility stack:
- it maps to a very specific implementation, AT-SPI, which is Linux and
Unix specific
- it requires implementing the same functionality in three different
layers of the stack: AT-SPI, ATK, and GTK
- only GTK uses it; every other Linux and Unix toolkit and application
talks to AT-SPI directly, including assistive technologies
Sadly, we cannot incrementally port GTK to a new accessibility stack;
since ATK insulates us entirely from the underlying implementation, we
cannot replace it piecemeal. Instead, we're going to remove everything
and then incrementally build on a clean slate:
- add an "accessible" interface, implemented by GTK objects directly,
which describe the accessible role and state changes for every UI
element
- add an "assistive technology context" to proxy a native accessibility
API, and assign it to every widget
- implement the AT context depending on the platform
For more information, see: https://gitlab.gnome.org/GNOME/gtk/-/issues/2833
2020-06-16 15:41:59 +00:00
|
|
|
|
gtk_icon_view_queue_draw_item (icon_view, icon_view->priv->cursor_item);
|
|
|
|
|
|
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);
|
|
|
|
|
}
|
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
|
|
|
|
|
2011-12-18 15:16:34 +00:00
|
|
|
|
GtkIconViewItem *
|
|
|
|
|
_gtk_icon_view_get_item_at_coords (GtkIconView *icon_view,
|
2020-07-24 13:54:49 +00:00
|
|
|
|
int x,
|
|
|
|
|
int y,
|
2011-12-18 15:16:34 +00:00
|
|
|
|
gboolean only_in_cell,
|
|
|
|
|
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;
|
2012-05-03 22:31:14 +00:00
|
|
|
|
GdkRectangle *item_area = &item->cell_area;
|
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;
|
2012-05-07 23:53:48 +00:00
|
|
|
|
GtkCellAreaContext *context;
|
2009-09-28 16:41:29 +00:00
|
|
|
|
|
2012-05-07 23:53:48 +00:00
|
|
|
|
context = g_ptr_array_index (icon_view->priv->row_contexts, item->row);
|
2011-12-18 15:16:34 +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)
|
2012-05-07 23:53:48 +00:00
|
|
|
|
cell = gtk_cell_area_get_cell_at_position (icon_view->priv->cell_area, context,
|
|
|
|
|
GTK_WIDGET (icon_view),
|
|
|
|
|
item_area,
|
|
|
|
|
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;
|
|
|
|
|
}
|
|
|
|
|
|
2011-12-18 15:16:34 +00:00
|
|
|
|
void
|
|
|
|
|
_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;
|
|
|
|
|
|
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
|
|
|
|
|
2011-12-18 15:16:34 +00:00
|
|
|
|
void
|
|
|
|
|
_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;
|
|
|
|
|
|
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
|
|
|
|
*
|
2020-08-21 12:41:13 +00:00
|
|
|
|
* For now GtkIconView still can't 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);
|
2020-07-24 13:54:49 +00:00
|
|
|
|
int 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;
|
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
|
|
|
|
|
2018-01-19 15:04:18 +00:00
|
|
|
|
gtk_tree_model_ref_node (model, iter);
|
|
|
|
|
|
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
|
|
|
|
|
|
|
|
|
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
|
|
|
|
|
2012-05-05 02:33:47 +00:00
|
|
|
|
gtk_widget_queue_resize (GTK_WIDGET (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);
|
2020-07-24 13:54:49 +00:00
|
|
|
|
int 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;
|
2018-01-19 15:04:18 +00:00
|
|
|
|
GtkTreeIter iter;
|
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
|
|
|
|
|
2018-01-31 16:44:26 +00:00
|
|
|
|
if (gtk_tree_model_get_iter (model, &iter, path))
|
|
|
|
|
gtk_tree_model_unref_node (model, &iter);
|
2018-01-19 15:04:18 +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
|
|
|
|
|
2011-09-14 21:32:02 +00:00
|
|
|
|
if (item == icon_view->priv->last_prelight)
|
|
|
|
|
icon_view->priv->last_prelight = 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
|
|
|
|
|
2012-05-05 02:33:47 +00:00
|
|
|
|
gtk_widget_queue_resize (GTK_WIDGET (icon_view));
|
2006-03-02 19:52:26 +00:00
|
|
|
|
|
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,
|
2020-07-24 13:54:49 +00:00
|
|
|
|
int *new_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
|
|
|
|
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;
|
2020-07-24 13:54:49 +00:00
|
|
|
|
int *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);
|
|
|
|
|
|
2020-07-24 13:54:49 +00:00
|
|
|
|
order = g_new (int, length);
|
2004-12-22 06:43:32 +00:00
|
|
|
|
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
|
|
|
|
|
2012-05-05 02:33:47 +00:00
|
|
|
|
gtk_widget_queue_resize (GTK_WIDGET (icon_view));
|
2005-04-29 15:24:30 +00:00
|
|
|
|
|
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;
|
|
|
|
|
GList *items = NULL;
|
|
|
|
|
|
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
|
|
|
|
|
|
|
|
|
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
|
2018-08-12 15:07:23 +00:00
|
|
|
|
gtk_icon_view_add_move_binding (GtkWidgetClass *widget_class,
|
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,
|
2020-07-24 13:54:49 +00:00
|
|
|
|
int 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
|
|
|
|
|
2018-08-12 15:07:23 +00:00
|
|
|
|
gtk_widget_class_add_binding_signal (widget_class,
|
|
|
|
|
keyval, modmask,
|
|
|
|
|
I_("move-cursor"),
|
2020-04-11 18:52:43 +00:00
|
|
|
|
"(iibb)", step, count, FALSE, FALSE);
|
2002-04-30 17:08:52 +00:00
|
|
|
|
|
2018-08-12 15:07:23 +00:00
|
|
|
|
gtk_widget_class_add_binding_signal (widget_class,
|
|
|
|
|
keyval, GDK_SHIFT_MASK,
|
|
|
|
|
"move-cursor",
|
2020-04-11 18:52:43 +00:00
|
|
|
|
"(iibb)", step, count, TRUE, 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
|
|
|
|
|
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
|
|
|
|
|
2018-08-12 15:07:23 +00:00
|
|
|
|
gtk_widget_class_add_binding_signal (widget_class,
|
|
|
|
|
keyval, GDK_CONTROL_MASK | GDK_SHIFT_MASK,
|
|
|
|
|
"move-cursor",
|
2020-04-11 18:52:43 +00:00
|
|
|
|
"(iibb)", step, count, TRUE, 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
|
|
|
|
|
2018-08-12 15:07:23 +00:00
|
|
|
|
gtk_widget_class_add_binding_signal (widget_class,
|
|
|
|
|
keyval, GDK_CONTROL_MASK,
|
|
|
|
|
"move-cursor",
|
2020-04-11 18:52:43 +00:00
|
|
|
|
"(iibb)", step, count, FALSE, TRUE);
|
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
|
|
|
|
}
|
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,
|
2020-07-24 13:54:49 +00:00
|
|
|
|
int count,
|
2020-04-11 18:52:43 +00:00
|
|
|
|
gboolean extend,
|
|
|
|
|
gboolean modify)
|
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_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
|
|
|
|
|
2020-04-11 18:52:43 +00:00
|
|
|
|
icon_view->priv->extend_selection_pressed = extend;
|
|
|
|
|
icon_view->priv->modify_selection_pressed = modify;
|
2004-06-18 05:17:01 +00:00
|
|
|
|
|
|
|
|
|
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;
|
2017-10-06 19:19:42 +00:00
|
|
|
|
case GTK_MOVEMENT_WORDS:
|
|
|
|
|
case GTK_MOVEMENT_DISPLAY_LINE_ENDS:
|
|
|
|
|
case GTK_MOVEMENT_PARAGRAPHS:
|
|
|
|
|
case GTK_MOVEMENT_PARAGRAPH_ENDS:
|
|
|
|
|
case GTK_MOVEMENT_HORIZONTAL_PAGES:
|
2004-06-18 05:17:01 +00:00
|
|
|
|
default:
|
|
|
|
|
g_assert_not_reached ();
|
2017-10-06 19:19:42 +00:00
|
|
|
|
break;
|
2004-06-18 05:17:01 +00:00
|
|
|
|
}
|
|
|
|
|
|
2011-09-17 18:05:33 +00:00
|
|
|
|
icon_view->priv->modify_selection_pressed = FALSE;
|
|
|
|
|
icon_view->priv->extend_selection_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,
|
2020-07-24 13:54:49 +00:00
|
|
|
|
int row_ofs,
|
|
|
|
|
int col_ofs)
|
2004-06-18 05:17:01 +00:00
|
|
|
|
{
|
2020-07-24 13:54:49 +00:00
|
|
|
|
int row, col;
|
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
|
|
|
|
|
|
|
|
|
/* 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,
|
2020-07-24 13:54:49 +00:00
|
|
|
|
int count)
|
2004-06-18 05:17:01 +00:00
|
|
|
|
{
|
|
|
|
|
GList *item, *next;
|
2020-07-24 13:54:49 +00:00
|
|
|
|
int y, col;
|
2004-06-18 05:17:01 +00:00
|
|
|
|
|
|
|
|
|
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;
|
2020-07-24 13:54:49 +00:00
|
|
|
|
int 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;
|
|
|
|
|
}
|
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,
|
2020-07-24 13:54:49 +00:00
|
|
|
|
int count)
|
2004-06-18 05:17:01 +00:00
|
|
|
|
{
|
2004-07-04 15:56:55 +00:00
|
|
|
|
GtkIconViewItem *item;
|
2011-08-25 18:47:21 +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;
|
2020-07-24 13:54:49 +00:00
|
|
|
|
int 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
|
|
|
|
|
2011-11-23 22:49:46 +00:00
|
|
|
|
if (list)
|
|
|
|
|
{
|
|
|
|
|
item = list->data;
|
2010-12-12 10:59:41 +00:00
|
|
|
|
|
2011-11-23 22:49:46 +00:00
|
|
|
|
/* Give focus to the first cell initially */
|
2011-12-18 15:16:34 +00:00
|
|
|
|
_gtk_icon_view_set_cell_data (icon_view, item);
|
2011-11-23 22:49:46 +00:00
|
|
|
|
gtk_cell_area_focus (icon_view->priv->cell_area, direction);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
item = NULL;
|
|
|
|
|
}
|
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)
|
|
|
|
|
{
|
2011-12-18 15:16:34 +00:00
|
|
|
|
_gtk_icon_view_set_cell_data (icon_view, item);
|
2010-12-12 10:59:41 +00:00
|
|
|
|
|
|
|
|
|
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))
|
|
|
|
|
{
|
2019-05-20 04:47:50 +00:00
|
|
|
|
GtkWidget *toplevel = GTK_WIDGET (gtk_widget_get_root (GTK_WIDGET (icon_view)));
|
2010-05-30 04:28:11 +00:00
|
|
|
|
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
|
|
|
|
|
2011-09-17 18:05:33 +00:00
|
|
|
|
if (icon_view->priv->modify_selection_pressed ||
|
|
|
|
|
!icon_view->priv->extend_selection_pressed ||
|
2004-07-04 15:56:55 +00:00
|
|
|
|
!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);
|
2011-12-18 15:16:34 +00:00
|
|
|
|
_gtk_icon_view_set_cursor_item (icon_view, item, cell);
|
2004-06-21 03:41:04 +00:00
|
|
|
|
|
2011-09-17 18:05:33 +00:00
|
|
|
|
if (!icon_view->priv->modify_selection_pressed &&
|
2004-07-04 15:56:55 +00:00
|
|
|
|
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,
|
2020-07-24 13:54:49 +00:00
|
|
|
|
int count)
|
2004-06-18 05:17:01 +00:00
|
|
|
|
{
|
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;
|
|
|
|
|
|
2011-09-17 18:05:33 +00:00
|
|
|
|
if (icon_view->priv->modify_selection_pressed ||
|
|
|
|
|
!icon_view->priv->extend_selection_pressed ||
|
2004-07-04 15:56:55 +00:00
|
|
|
|
!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
|
|
|
|
|
2011-12-18 15:16:34 +00:00
|
|
|
|
_gtk_icon_view_set_cursor_item (icon_view, item, NULL);
|
2004-06-21 03:41:04 +00:00
|
|
|
|
|
2011-09-17 18:05:33 +00:00
|
|
|
|
if (!icon_view->priv->modify_selection_pressed &&
|
2004-07-04 15:56:55 +00:00
|
|
|
|
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,
|
2020-07-24 13:54:49 +00:00
|
|
|
|
int count)
|
2004-06-18 05:17:01 +00:00
|
|
|
|
{
|
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;
|
2020-07-24 13:54:49 +00:00
|
|
|
|
int 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
|
|
|
|
|
2011-11-23 22:49:46 +00:00
|
|
|
|
if (list)
|
|
|
|
|
{
|
|
|
|
|
item = list->data;
|
2010-12-12 10:59:41 +00:00
|
|
|
|
|
2011-11-23 22:49:46 +00:00
|
|
|
|
/* Give focus to the first cell initially */
|
2011-12-18 15:16:34 +00:00
|
|
|
|
_gtk_icon_view_set_cell_data (icon_view, item);
|
2011-11-23 22:49:46 +00:00
|
|
|
|
gtk_cell_area_focus (icon_view->priv->cell_area, direction);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
item = NULL;
|
|
|
|
|
}
|
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)
|
|
|
|
|
{
|
2011-12-18 15:16:34 +00:00
|
|
|
|
_gtk_icon_view_set_cell_data (icon_view, item);
|
2010-12-12 10:59:41 +00:00
|
|
|
|
|
|
|
|
|
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))
|
|
|
|
|
{
|
2019-05-20 04:47:50 +00:00
|
|
|
|
GtkWidget *toplevel = GTK_WIDGET (gtk_widget_get_root (GTK_WIDGET (icon_view)));
|
2010-05-30 06:15:40 +00:00
|
|
|
|
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
|
|
|
|
|
2011-09-17 18:05:33 +00:00
|
|
|
|
if (icon_view->priv->modify_selection_pressed ||
|
|
|
|
|
!icon_view->priv->extend_selection_pressed ||
|
2004-07-04 15:56:55 +00:00
|
|
|
|
!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);
|
2011-12-18 15:16:34 +00:00
|
|
|
|
_gtk_icon_view_set_cursor_item (icon_view, item, cell);
|
2004-06-21 03:41:04 +00:00
|
|
|
|
|
2011-09-17 18:05:33 +00:00
|
|
|
|
if (!icon_view->priv->modify_selection_pressed &&
|
2004-07-04 15:56:55 +00:00
|
|
|
|
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,
|
2020-07-24 13:54:49 +00:00
|
|
|
|
int count)
|
2004-06-18 05:17:01 +00:00
|
|
|
|
{
|
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;
|
|
|
|
|
|
2011-09-17 18:05:33 +00:00
|
|
|
|
if (icon_view->priv->modify_selection_pressed ||
|
|
|
|
|
!icon_view->priv->extend_selection_pressed ||
|
2004-07-04 15:56:55 +00:00
|
|
|
|
!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
|
|
|
|
|
2011-12-18 15:16:34 +00:00
|
|
|
|
_gtk_icon_view_set_cursor_item (icon_view, item, NULL);
|
2004-06-21 03:41:04 +00:00
|
|
|
|
|
2011-09-17 18:05:33 +00:00
|
|
|
|
if (!icon_view->priv->modify_selection_pressed &&
|
2004-07-04 15:56:55 +00:00
|
|
|
|
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
|
|
|
|
**/
|
|
|
|
|
void
|
|
|
|
|
gtk_icon_view_scroll_to_path (GtkIconView *icon_view,
|
|
|
|
|
GtkTreePath *path,
|
|
|
|
|
gboolean use_align,
|
2020-07-24 20:25:56 +00:00
|
|
|
|
float row_align,
|
|
|
|
|
float col_align)
|
2005-06-09 06:07:57 +00:00
|
|
|
|
{
|
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)
|
|
|
|
|
{
|
2017-06-28 06:19:35 +00:00
|
|
|
|
int width, height;
|
2020-07-24 13:54:49 +00:00
|
|
|
|
int x, y;
|
2020-07-24 20:25:56 +00:00
|
|
|
|
float 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
|
|
|
|
|
2017-06-27 09:11:57 +00:00
|
|
|
|
x =0;
|
|
|
|
|
y =0;
|
2010-08-11 21:10:57 +00:00
|
|
|
|
|
2017-12-06 06:56:12 +00:00
|
|
|
|
width = gtk_widget_get_width (widget);
|
|
|
|
|
height = gtk_widget_get_height (widget);
|
2010-08-11 21:10:57 +00:00
|
|
|
|
|
2017-06-28 06:19:35 +00:00
|
|
|
|
offset = y + item_area.y - row_align * (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
|
|
|
|
|
2017-06-28 06:19:35 +00:00
|
|
|
|
offset = x + item_area.x - col_align * (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
|
|
|
|
}
|
|
|
|
|
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;
|
2017-06-27 09:11:57 +00:00
|
|
|
|
int widget_width, widget_height;
|
2020-07-24 13:54:49 +00:00
|
|
|
|
int x, y;
|
2011-01-24 02:50:39 +00:00
|
|
|
|
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
|
|
|
|
|
2017-12-06 06:56:12 +00:00
|
|
|
|
widget_width = gtk_widget_get_width (widget);
|
|
|
|
|
widget_height = gtk_widget_get_height (widget);
|
2017-05-24 16:30:25 +00:00
|
|
|
|
|
2011-01-24 02:50:39 +00:00
|
|
|
|
hadj = icon_view->priv->hadjustment;
|
|
|
|
|
vadj = icon_view->priv->vadjustment;
|
|
|
|
|
|
2017-06-27 09:11:57 +00:00
|
|
|
|
x = - gtk_adjustment_get_value (hadj);
|
|
|
|
|
y = - gtk_adjustment_get_value (vadj);
|
|
|
|
|
|
2010-12-13 08:41:50 +00:00
|
|
|
|
if (y + item_area.y < 0)
|
2014-07-03 00:36:23 +00:00
|
|
|
|
gtk_adjustment_animate_to_value (vadj,
|
|
|
|
|
gtk_adjustment_get_value (vadj)
|
|
|
|
|
+ y + item_area.y);
|
2017-06-27 09:11:57 +00:00
|
|
|
|
else if (y + item_area.y + item_area.height > widget_height)
|
2014-07-03 00:36:23 +00:00
|
|
|
|
gtk_adjustment_animate_to_value (vadj,
|
|
|
|
|
gtk_adjustment_get_value (vadj)
|
2017-06-27 09:11:57 +00:00
|
|
|
|
+ y + item_area.y + item_area.height - widget_height);
|
2005-05-02 20:28:37 +00:00
|
|
|
|
|
2010-12-13 08:41:50 +00:00
|
|
|
|
if (x + item_area.x < 0)
|
2014-07-03 00:36:23 +00:00
|
|
|
|
gtk_adjustment_animate_to_value (hadj,
|
|
|
|
|
gtk_adjustment_get_value (hadj)
|
|
|
|
|
+ x + item_area.x);
|
2017-06-27 09:11:57 +00:00
|
|
|
|
else if (x + item_area.x + item_area.width > widget_width)
|
2014-07-03 00:36:23 +00:00
|
|
|
|
gtk_adjustment_animate_to_value (hadj,
|
|
|
|
|
gtk_adjustment_get_value (hadj)
|
2017-06-27 09:11:57 +00:00
|
|
|
|
+ x + item_area.x + item_area.width - widget_width);
|
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);
|
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
|
|
|
|
}
|
|
|
|
|
|
2011-12-18 15:16:34 +00:00
|
|
|
|
void
|
|
|
|
|
_gtk_icon_view_set_cell_data (GtkIconView *icon_view,
|
|
|
|
|
GtkIconViewItem *item)
|
2005-05-02 20:28:37 +00:00
|
|
|
|
{
|
|
|
|
|
GtkTreeIter iter;
|
2012-05-04 16:44:39 +00:00
|
|
|
|
GtkTreePath *path;
|
2011-01-31 22:34:37 +00:00
|
|
|
|
|
2012-05-04 16:44:39 +00:00
|
|
|
|
path = gtk_tree_path_new_from_indices (item->index, -1);
|
|
|
|
|
if (!gtk_tree_model_get_iter (icon_view->priv->model, &iter, path))
|
|
|
|
|
return;
|
|
|
|
|
gtk_tree_path_free (path);
|
2005-05-02 20:28:37 +00:00
|
|
|
|
|
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
|
|
|
|
*
|
2014-02-19 23:49:43 +00:00
|
|
|
|
* Returns: 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
|
|
|
|
**/
|
|
|
|
|
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.
|
|
|
|
|
*
|
2014-02-19 23:49:43 +00:00
|
|
|
|
* Returns: A newly created #GtkIconView widget
|
2010-12-13 06:54:02 +00:00
|
|
|
|
**/
|
|
|
|
|
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
|
|
|
|
*
|
2014-02-19 23:49:43 +00:00
|
|
|
|
* Returns: 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
|
|
|
|
**/
|
|
|
|
|
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
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
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
|
2020-09-14 01:49:11 +00:00
|
|
|
|
*
|
|
|
|
|
* Gets the path for the icon at the given position.
|
|
|
|
|
*
|
2015-12-28 20:14:08 +00:00
|
|
|
|
* Returns: (nullable) (transfer full): The #GtkTreePath corresponding
|
|
|
|
|
* to the icon or %NULL 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
|
|
|
|
**/
|
|
|
|
|
GtkTreePath *
|
2004-07-04 15:56:55 +00:00
|
|
|
|
gtk_icon_view_get_path_at_pos (GtkIconView *icon_view,
|
2020-07-24 13:54:49 +00:00
|
|
|
|
int x,
|
|
|
|
|
int 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
|
|
|
|
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
|
|
|
|
|
2011-12-18 15:16:34 +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
|
2018-01-06 08:27:44 +00:00
|
|
|
|
* @cell: (out) (allow-none) (transfer none): Return location for the renderer
|
2011-01-18 09:10:30 +00:00
|
|
|
|
* responsible for the cell at (@x, @y), or %NULL
|
2020-09-14 01:49:11 +00:00
|
|
|
|
*
|
|
|
|
|
* Gets the path and cell for the icon at the given position.
|
|
|
|
|
*
|
2014-02-19 23:49:43 +00:00
|
|
|
|
* Returns: %TRUE if an item exists at the specified position
|
2005-05-02 20:28:37 +00:00
|
|
|
|
**/
|
|
|
|
|
gboolean
|
|
|
|
|
gtk_icon_view_get_item_at_pos (GtkIconView *icon_view,
|
2020-07-24 13:54:49 +00:00
|
|
|
|
int x,
|
|
|
|
|
int y,
|
2005-05-02 20:28:37 +00:00
|
|
|
|
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);
|
|
|
|
|
|
2011-12-18 15:16:34 +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);
|
|
|
|
|
}
|
|
|
|
|
|
2012-06-19 16:58:13 +00:00
|
|
|
|
/**
|
2012-06-25 13:00:42 +00:00
|
|
|
|
* gtk_icon_view_get_cell_rect:
|
2012-06-19 16:58:13 +00:00
|
|
|
|
* @icon_view: a #GtkIconView
|
|
|
|
|
* @path: a #GtkTreePath
|
|
|
|
|
* @cell: (allow-none): a #GtkCellRenderer or %NULL
|
|
|
|
|
* @rect: (out): rectangle to fill with cell rect
|
|
|
|
|
*
|
|
|
|
|
* Fills the bounding rectangle in widget coordinates for the cell specified by
|
|
|
|
|
* @path and @cell. If @cell is %NULL the main cell area is used.
|
|
|
|
|
*
|
|
|
|
|
* This function is only valid if @icon_view is realized.
|
|
|
|
|
*
|
2014-02-19 23:49:43 +00:00
|
|
|
|
* Returns: %FALSE if there is no such item, %TRUE otherwise
|
2012-06-19 16:58:13 +00:00
|
|
|
|
*/
|
|
|
|
|
gboolean
|
2012-06-25 13:00:42 +00:00
|
|
|
|
gtk_icon_view_get_cell_rect (GtkIconView *icon_view,
|
2012-06-19 16:58:13 +00:00
|
|
|
|
GtkTreePath *path,
|
|
|
|
|
GtkCellRenderer *cell,
|
|
|
|
|
GdkRectangle *rect)
|
|
|
|
|
{
|
|
|
|
|
GtkIconViewItem *item = NULL;
|
|
|
|
|
|
|
|
|
|
g_return_val_if_fail (GTK_IS_ICON_VIEW (icon_view), FALSE);
|
|
|
|
|
g_return_val_if_fail (cell == NULL || GTK_IS_CELL_RENDERER (cell), FALSE);
|
|
|
|
|
|
|
|
|
|
if (gtk_tree_path_get_depth (path) > 0)
|
|
|
|
|
item = g_list_nth_data (icon_view->priv->items,
|
|
|
|
|
gtk_tree_path_get_indices(path)[0]);
|
|
|
|
|
|
|
|
|
|
if (!item)
|
|
|
|
|
return FALSE;
|
|
|
|
|
|
|
|
|
|
if (cell)
|
|
|
|
|
{
|
|
|
|
|
GtkCellAreaContext *context;
|
|
|
|
|
|
|
|
|
|
context = g_ptr_array_index (icon_view->priv->row_contexts, item->row);
|
|
|
|
|
_gtk_icon_view_set_cell_data (icon_view, item);
|
|
|
|
|
gtk_cell_area_get_cell_allocation (icon_view->priv->cell_area, context,
|
|
|
|
|
GTK_WIDGET (icon_view),
|
|
|
|
|
cell, &item->cell_area, rect);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
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;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return TRUE;
|
|
|
|
|
}
|
|
|
|
|
|
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().
|
|
|
|
|
*/
|
|
|
|
|
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
|
|
|
|
*/
|
|
|
|
|
void
|
|
|
|
|
gtk_icon_view_set_tooltip_cell (GtkIconView *icon_view,
|
|
|
|
|
GtkTooltip *tooltip,
|
|
|
|
|
GtkTreePath *path,
|
|
|
|
|
GtkCellRenderer *cell)
|
|
|
|
|
{
|
|
|
|
|
GdkRectangle rect;
|
2012-06-19 16:58:13 +00:00
|
|
|
|
|
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));
|
|
|
|
|
|
2012-06-25 13:00:42 +00:00
|
|
|
|
if (!gtk_icon_view_get_cell_rect (icon_view, path, cell, &rect))
|
2007-07-16 14:04:35 +00:00
|
|
|
|
return;
|
|
|
|
|
|
2012-06-19 16:58:13 +00:00
|
|
|
|
gtk_tooltip_set_tip_area (tooltip, &rect);
|
2007-07-16 14:04:35 +00:00
|
|
|
|
}
|
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
|
2020-11-17 14:40:52 +00:00
|
|
|
|
* @x: the x coordinate (relative to widget coordinates)
|
|
|
|
|
* @y: 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
|
2012-08-01 16:51:21 +00:00
|
|
|
|
* @model: (out) (allow-none) (transfer none): a pointer to receive a
|
|
|
|
|
* #GtkTreeModel or %NULL
|
2010-07-07 16:20:37 +00:00
|
|
|
|
* @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
|
2017-06-27 09:11:57 +00:00
|
|
|
|
* that row and the corresponding model.
|
2007-07-19 14:59:44 +00:00
|
|
|
|
*
|
2019-08-25 12:52:24 +00:00
|
|
|
|
* Returns: whether or not the given tooltip context points to an item
|
2007-07-19 14:59:44 +00:00
|
|
|
|
*/
|
|
|
|
|
gboolean
|
|
|
|
|
gtk_icon_view_get_tooltip_context (GtkIconView *icon_view,
|
2020-11-17 14:40:52 +00:00
|
|
|
|
int x,
|
|
|
|
|
int y,
|
2007-07-19 14:59:44 +00:00
|
|
|
|
gboolean keyboard_tip,
|
|
|
|
|
GtkTreeModel **model,
|
|
|
|
|
GtkTreePath **path,
|
|
|
|
|
GtkTreeIter *iter)
|
|
|
|
|
{
|
|
|
|
|
GtkTreePath *tmppath = NULL;
|
|
|
|
|
|
|
|
|
|
g_return_val_if_fail (GTK_IS_ICON_VIEW (icon_view), FALSE);
|
|
|
|
|
|
|
|
|
|
if (keyboard_tip)
|
|
|
|
|
{
|
|
|
|
|
gtk_icon_view_get_cursor (icon_view, &tmppath, NULL);
|
|
|
|
|
|
|
|
|
|
if (!tmppath)
|
|
|
|
|
return FALSE;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
2020-11-17 14:40:52 +00:00
|
|
|
|
if (!gtk_icon_view_get_item_at_pos (icon_view, x, y, &tmppath, NULL))
|
2007-07-19 14:59:44 +00:00
|
|
|
|
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,
|
2020-07-24 13:54:49 +00:00
|
|
|
|
int x,
|
|
|
|
|
int y,
|
2007-07-19 14:59:44 +00:00
|
|
|
|
gboolean keyboard_tip,
|
|
|
|
|
GtkTooltip *tooltip,
|
|
|
|
|
gpointer data)
|
|
|
|
|
{
|
2020-07-24 18:40:36 +00:00
|
|
|
|
char *str;
|
2007-07-19 14:59:44 +00:00
|
|
|
|
GtkTreeIter iter;
|
|
|
|
|
GtkTreePath *path;
|
|
|
|
|
GtkTreeModel *model;
|
|
|
|
|
GtkIconView *icon_view = GTK_ICON_VIEW (widget);
|
|
|
|
|
|
|
|
|
|
if (!gtk_icon_view_get_tooltip_context (GTK_ICON_VIEW (widget),
|
2020-11-17 14:40:52 +00:00
|
|
|
|
x, y,
|
2007-07-19 14:59:44 +00:00
|
|
|
|
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
|
2014-02-07 18:01:26 +00:00
|
|
|
|
* @column: an integer, which is a valid column number for @icon_view’s model
|
2007-07-19 14:59:44 +00:00
|
|
|
|
*
|
|
|
|
|
* If you only plan to have simple (text-only) tooltips on full items, you
|
|
|
|
|
* can use this function to have #GtkIconView handle these automatically
|
2014-02-07 18:01:26 +00:00
|
|
|
|
* for you. @column should be set to the column in @icon_view’s model
|
2007-07-19 14:59:44 +00:00
|
|
|
|
* containing the tooltip texts, or -1 to disable this feature.
|
|
|
|
|
*
|
2012-02-15 10:43:33 +00:00
|
|
|
|
* When enabled, #GtkWidget:has-tooltip will be set to %TRUE and
|
2007-07-19 14:59:44 +00:00
|
|
|
|
* @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(),
|
2014-02-09 22:24:06 +00:00
|
|
|
|
* so &, <, etc have to be escaped in the text.
|
2007-07-19 14:59:44 +00:00
|
|
|
|
*/
|
|
|
|
|
void
|
|
|
|
|
gtk_icon_view_set_tooltip_column (GtkIconView *icon_view,
|
2020-07-24 13:54:49 +00:00
|
|
|
|
int column)
|
2007-07-19 14:59:44 +00:00
|
|
|
|
{
|
|
|
|
|
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
|
|
|
|
|
*
|
2014-02-07 18:01:26 +00:00
|
|
|
|
* Returns the column of @icon_view’s model which is being used for
|
|
|
|
|
* displaying tooltips on @icon_view’s rows.
|
2007-07-19 14:59:44 +00:00
|
|
|
|
*
|
2014-02-19 23:49:43 +00:00
|
|
|
|
* Returns: the index of the tooltip column that is currently being
|
2007-07-19 14:59:44 +00:00
|
|
|
|
* used, or -1 if this is disabled.
|
|
|
|
|
*/
|
2020-07-24 13:54:49 +00:00
|
|
|
|
int
|
2007-07-19 14:59:44 +00:00
|
|
|
|
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.
|
|
|
|
|
*
|
2014-02-19 23:49:43 +00:00
|
|
|
|
* Returns: %TRUE, if valid paths were placed in @start_path and @end_path
|
2005-06-11 05:15:10 +00:00
|
|
|
|
**/
|
|
|
|
|
gboolean
|
|
|
|
|
gtk_icon_view_get_visible_range (GtkIconView *icon_view,
|
|
|
|
|
GtkTreePath **start_path,
|
|
|
|
|
GtkTreePath **end_path)
|
|
|
|
|
{
|
2020-07-24 13:54:49 +00:00
|
|
|
|
int start_index = -1;
|
|
|
|
|
int end_index = -1;
|
2005-06-11 05:15:10 +00:00
|
|
|
|
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;
|
2012-05-03 22:31:14 +00:00
|
|
|
|
GdkRectangle *item_area = &item->cell_area;
|
2010-12-13 08:41:50 +00:00
|
|
|
|
|
|
|
|
|
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.
|
|
|
|
|
**/
|
|
|
|
|
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
|
|
|
|
**/
|
|
|
|
|
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
|
|
|
|
*
|
2014-02-19 23:49:43 +00:00
|
|
|
|
* Returns: the current 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
|
|
|
|
**/
|
|
|
|
|
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.
|
|
|
|
|
**/
|
|
|
|
|
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)
|
|
|
|
|
{
|
2012-08-10 17:23:20 +00:00
|
|
|
|
gboolean dirty;
|
|
|
|
|
|
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
|
|
|
|
|
2012-08-10 17:23:20 +00:00
|
|
|
|
dirty = gtk_icon_view_unselect_all_internal (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
|
|
|
|
if (model)
|
|
|
|
|
{
|
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
|
|
|
|
{
|
2020-02-22 06:01:55 +00:00
|
|
|
|
g_return_if_fail (gtk_tree_model_get_column_type (model, icon_view->priv->pixbuf_column) == 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
|
|
|
|
{
|
2020-02-22 06:01:55 +00:00
|
|
|
|
g_return_if_fail (gtk_tree_model_get_column_type (model, icon_view->priv->text_column) == G_TYPE_STRING);
|
2004-11-26 05:51:32 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (icon_view->priv->markup_column != -1)
|
|
|
|
|
{
|
2020-02-22 06:01:55 +00:00
|
|
|
|
g_return_if_fail (gtk_tree_model_get_column_type (model, icon_view->priv->markup_column) == 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
|
|
|
|
|
2012-01-02 03:20:59 +00:00
|
|
|
|
g_list_free_full (icon_view->priv->items, (GDestroyNotify) gtk_icon_view_item_free);
|
2004-07-04 15:56:55 +00:00
|
|
|
|
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;
|
2011-09-14 21:32:02 +00:00
|
|
|
|
icon_view->priv->last_prelight = 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);
|
2005-03-09 16:09:22 +00:00
|
|
|
|
}
|
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
|
|
|
|
|
2012-08-10 17:23:20 +00:00
|
|
|
|
if (dirty)
|
|
|
|
|
g_signal_emit (icon_view, icon_view_signals[SELECTION_CHANGED], 0);
|
|
|
|
|
|
2012-05-05 02:33:47 +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.
|
|
|
|
|
*
|
2015-12-28 20:14:08 +00:00
|
|
|
|
* Returns: (nullable) (transfer none): A #GtkTreeModel, or %NULL if none is
|
2010-09-21 04:18:11 +00:00
|
|
|
|
* 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
|
|
|
|
**/
|
|
|
|
|
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.
|
|
|
|
|
**/
|
|
|
|
|
void
|
2004-07-04 15:56:55 +00:00
|
|
|
|
gtk_icon_view_set_text_column (GtkIconView *icon_view,
|
2020-07-24 13:54:49 +00:00
|
|
|
|
int 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
|
|
|
|
{
|
2020-02-22 06:01:55 +00:00
|
|
|
|
g_return_if_fail (gtk_tree_model_get_column_type (icon_view->priv->model, column) == 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
|
|
|
|
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
|
|
|
|
*
|
2014-02-07 18:01:26 +00:00
|
|
|
|
* Returns: the text column, or -1 if it’s unset.
|
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
|
|
|
|
*/
|
2020-07-24 13:54:49 +00:00
|
|
|
|
int
|
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
|
|
|
|
**/
|
|
|
|
|
void
|
2004-07-04 15:56:55 +00:00
|
|
|
|
gtk_icon_view_set_markup_column (GtkIconView *icon_view,
|
2020-07-24 13:54:49 +00:00
|
|
|
|
int 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
|
|
|
|
{
|
2020-02-22 06:01:55 +00:00
|
|
|
|
g_return_if_fail (gtk_tree_model_get_column_type (icon_view->priv->model, column) == 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
|
|
|
|
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
|
|
|
|
*
|
2014-02-07 18:01:26 +00:00
|
|
|
|
* Returns: the markup column, or -1 if it’s unset.
|
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
|
|
|
|
*/
|
2020-07-24 13:54:49 +00:00
|
|
|
|
int
|
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
|
|
|
|
|
**/
|
|
|
|
|
void
|
2004-07-04 15:56:55 +00:00
|
|
|
|
gtk_icon_view_set_pixbuf_column (GtkIconView *icon_view,
|
2020-07-24 13:54:49 +00:00
|
|
|
|
int 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
|
|
|
|
{
|
2020-02-22 06:01:55 +00:00
|
|
|
|
g_return_if_fail (gtk_tree_model_get_column_type (icon_view->priv->model, column) == 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
|
|
|
|
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
|
|
|
|
*
|
2014-02-07 18:01:26 +00:00
|
|
|
|
* Returns: the pixbuf column, or -1 if it’s unset.
|
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
|
|
|
|
*/
|
2020-07-24 13:54:49 +00:00
|
|
|
|
int
|
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.
|
|
|
|
|
**/
|
|
|
|
|
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)
|
2011-12-18 15:16:34 +00:00
|
|
|
|
_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.
|
|
|
|
|
**/
|
|
|
|
|
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;
|
|
|
|
|
|
2011-12-18 15:16:34 +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
|
2014-02-09 22:24:06 +00:00
|
|
|
|
* want to convert the returned list into a list of #GtkTreeRowReferences.
|
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
|
|
|
|
* To do this, you can use gtk_tree_row_reference_new().
|
|
|
|
|
*
|
|
|
|
|
* To free the return value, use:
|
2014-01-27 19:55:18 +00:00
|
|
|
|
* |[<!-- language="C" -->
|
2012-08-10 16:23:02 +00:00
|
|
|
|
* g_list_free_full (list, (GDestroyNotify) gtk_tree_path_free);
|
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
|
|
|
|
*
|
2014-02-19 23:49:43 +00:00
|
|
|
|
* Returns: (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
|
|
|
|
**/
|
|
|
|
|
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.
|
|
|
|
|
**/
|
|
|
|
|
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.
|
|
|
|
|
**/
|
|
|
|
|
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
|
|
|
|
*
|
2014-02-19 23:49:43 +00:00
|
|
|
|
* Returns: %TRUE if @path is 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
|
|
|
|
**/
|
|
|
|
|
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
|
|
|
|
|
*/
|
2020-07-24 13:54:49 +00:00
|
|
|
|
int
|
2010-05-30 06:15:40 +00:00
|
|
|
|
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
|
|
|
|
|
*/
|
2020-07-24 13:54:49 +00:00
|
|
|
|
int
|
2010-05-30 06:15:40 +00:00
|
|
|
|
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.
|
|
|
|
|
**/
|
|
|
|
|
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.
|
|
|
|
|
**/
|
|
|
|
|
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.
|
|
|
|
|
*
|
2014-02-19 23:49:43 +00:00
|
|
|
|
* Returns: the relative position of texts and icons
|
2004-07-18 03:39:50 +00:00
|
|
|
|
**/
|
|
|
|
|
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.
|
|
|
|
|
*/
|
|
|
|
|
void
|
|
|
|
|
gtk_icon_view_set_columns (GtkIconView *icon_view,
|
2020-07-24 13:54:49 +00:00
|
|
|
|
int 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);
|
|
|
|
|
|
2012-05-05 02:33:47 +00:00
|
|
|
|
gtk_widget_queue_resize (GTK_WIDGET (icon_view));
|
2004-12-14 06:39:45 +00:00
|
|
|
|
|
|
|
|
|
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.
|
|
|
|
|
*
|
2014-02-19 23:49:43 +00:00
|
|
|
|
* Returns: the number of columns, or -1
|
2005-03-17 03:23:23 +00:00
|
|
|
|
*/
|
2020-07-24 13:54:49 +00:00
|
|
|
|
int
|
2004-12-14 06:39:45 +00:00
|
|
|
|
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.
|
|
|
|
|
*/
|
|
|
|
|
void
|
|
|
|
|
gtk_icon_view_set_item_width (GtkIconView *icon_view,
|
2020-07-24 13:54:49 +00:00
|
|
|
|
int 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.
|
|
|
|
|
*
|
2014-02-19 23:49:43 +00:00
|
|
|
|
* Returns: the width of a single item, or -1
|
2005-03-17 03:23:23 +00:00
|
|
|
|
*/
|
2020-07-24 13:54:49 +00:00
|
|
|
|
int
|
2004-12-14 06:39:45 +00:00
|
|
|
|
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.
|
|
|
|
|
*/
|
|
|
|
|
void
|
|
|
|
|
gtk_icon_view_set_spacing (GtkIconView *icon_view,
|
2020-07-24 13:54:49 +00:00
|
|
|
|
int 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.
|
|
|
|
|
*
|
2014-02-19 23:49:43 +00:00
|
|
|
|
* Returns: the space between cells
|
2005-03-17 03:23:23 +00:00
|
|
|
|
*/
|
2020-07-24 13:54:49 +00:00
|
|
|
|
int
|
2004-12-14 06:39:45 +00:00
|
|
|
|
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.
|
|
|
|
|
*/
|
|
|
|
|
void
|
|
|
|
|
gtk_icon_view_set_row_spacing (GtkIconView *icon_view,
|
2020-07-24 13:54:49 +00:00
|
|
|
|
int 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.
|
|
|
|
|
*
|
2014-02-19 23:49:43 +00:00
|
|
|
|
* Returns: the space between rows
|
2005-03-17 03:23:23 +00:00
|
|
|
|
*/
|
2020-07-24 13:54:49 +00:00
|
|
|
|
int
|
2004-12-14 06:39:45 +00:00
|
|
|
|
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.
|
|
|
|
|
*/
|
|
|
|
|
void
|
|
|
|
|
gtk_icon_view_set_column_spacing (GtkIconView *icon_view,
|
2020-07-24 13:54:49 +00:00
|
|
|
|
int 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.
|
|
|
|
|
*
|
2014-02-19 23:49:43 +00:00
|
|
|
|
* Returns: the space between columns
|
2005-03-17 03:23:23 +00:00
|
|
|
|
*/
|
2020-07-24 13:54:49 +00:00
|
|
|
|
int
|
2004-12-14 06:39:45 +00:00
|
|
|
|
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.
|
|
|
|
|
*/
|
|
|
|
|
void
|
|
|
|
|
gtk_icon_view_set_margin (GtkIconView *icon_view,
|
2020-07-24 13:54:49 +00:00
|
|
|
|
int 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.
|
|
|
|
|
*
|
2014-02-19 23:49:43 +00:00
|
|
|
|
* Returns: the space at the borders
|
2005-03-17 03:23:23 +00:00
|
|
|
|
*/
|
2020-07-24 13:54:49 +00:00
|
|
|
|
int
|
2004-12-14 06:39:45 +00:00
|
|
|
|
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
|
2014-02-07 18:01:26 +00:00
|
|
|
|
* around each of the icon view’s items.
|
2009-08-07 03:56:30 +00:00
|
|
|
|
*/
|
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,
|
2020-07-24 13:54:49 +00:00
|
|
|
|
int item_padding)
|
2009-08-07 03:56:30 +00:00
|
|
|
|
{
|
|
|
|
|
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.
|
|
|
|
|
*
|
2014-02-19 23:49:43 +00:00
|
|
|
|
* Returns: the padding around items
|
2009-08-07 03:56:30 +00:00
|
|
|
|
*/
|
2020-07-24 13:54:49 +00:00
|
|
|
|
int
|
2009-08-07 03:56:30 +00:00
|
|
|
|
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,
|
2014-02-07 18:32:47 +00:00
|
|
|
|
* since the data doesn’t result from a drop.
|
2005-05-06 04:14:32 +00:00
|
|
|
|
*/
|
|
|
|
|
static void
|
2018-05-16 02:50:24 +00:00
|
|
|
|
set_status_pending (GdkDrop *drop,
|
2005-05-06 04:14:32 +00:00
|
|
|
|
GdkDragAction suggested_action)
|
|
|
|
|
{
|
2018-05-16 02:50:24 +00:00
|
|
|
|
g_object_set_data (G_OBJECT (drop),
|
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
|
2018-05-16 02:50:24 +00:00
|
|
|
|
get_status_pending (GdkDrop *drop)
|
2005-05-06 04:14:32 +00:00
|
|
|
|
{
|
2018-05-16 02:50:24 +00:00
|
|
|
|
return GPOINTER_TO_INT (g_object_get_data (G_OBJECT (drop),
|
2005-05-06 04:14:32 +00:00
|
|
|
|
"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");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
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
|
2018-05-16 02:50:24 +00:00
|
|
|
|
set_dest_row (GdkDrop *drop,
|
2005-05-06 04:14:32 +00:00
|
|
|
|
GtkTreeModel *model,
|
|
|
|
|
GtkTreePath *dest_row,
|
|
|
|
|
gboolean empty_view_drop,
|
|
|
|
|
gboolean drop_append_mode)
|
|
|
|
|
{
|
|
|
|
|
DestRow *dr;
|
|
|
|
|
|
|
|
|
|
if (!dest_row)
|
|
|
|
|
{
|
2018-05-16 02:50:24 +00:00
|
|
|
|
g_object_set_data_full (G_OBJECT (drop),
|
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;
|
2018-05-16 02:50:24 +00:00
|
|
|
|
g_object_set_data_full (G_OBJECT (drop),
|
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*
|
2018-05-16 02:50:24 +00:00
|
|
|
|
get_dest_row (GdkDrop *drop)
|
2005-05-06 04:14:32 +00:00
|
|
|
|
{
|
|
|
|
|
DestRow *dr;
|
|
|
|
|
|
2018-05-16 02:50:24 +00:00
|
|
|
|
dr = g_object_get_data (G_OBJECT (drop), "gtk-icon-view-dest-row");
|
2005-05-06 04:14:32 +00:00
|
|
|
|
|
|
|
|
|
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,
|
2020-07-24 18:40:36 +00:00
|
|
|
|
const char *signal)
|
2005-05-06 04:14:32 +00:00
|
|
|
|
{
|
|
|
|
|
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 "
|
2020-09-12 16:01:04 +00:00
|
|
|
|
"your handler should do. (gtkiconview.c is in the GTK source "
|
|
|
|
|
"code.) If you're using GTK from a language other than C, "
|
2005-05-06 04:14:32 +00:00
|
|
|
|
"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
|
2015-05-21 12:16:13 +00:00
|
|
|
|
gtk_icon_view_autoscroll (GtkIconView *icon_view)
|
2005-05-06 04:14:32 +00:00
|
|
|
|
{
|
2020-07-24 13:54:49 +00:00
|
|
|
|
int px, py, width, height;
|
|
|
|
|
int hoffset, voffset;
|
2005-05-06 04:14:32 +00:00
|
|
|
|
|
2015-05-21 12:16:13 +00:00
|
|
|
|
px = icon_view->priv->event_last_x;
|
|
|
|
|
py = icon_view->priv->event_last_y;
|
2017-06-28 06:19:35 +00:00
|
|
|
|
|
2017-12-06 06:56:12 +00:00
|
|
|
|
width = gtk_widget_get_width (GTK_WIDGET (icon_view));
|
|
|
|
|
height = gtk_widget_get_height (GTK_WIDGET (icon_view));
|
2005-05-06 04:14:32 +00:00
|
|
|
|
|
|
|
|
|
/* see if we are near the edge. */
|
2012-03-03 20:17:32 +00:00
|
|
|
|
voffset = py - 2 * SCROLL_EDGE_SIZE;
|
2005-05-06 04:14:32 +00:00
|
|
|
|
if (voffset > 0)
|
2012-03-03 20:17:32 +00:00
|
|
|
|
voffset = MAX (py - (height - 2 * SCROLL_EDGE_SIZE), 0);
|
2005-05-06 04:14:32 +00:00
|
|
|
|
|
2012-03-03 20:17:32 +00:00
|
|
|
|
hoffset = px - 2 * SCROLL_EDGE_SIZE;
|
2005-05-06 04:14:32 +00:00
|
|
|
|
if (hoffset > 0)
|
2012-03-03 20:17:32 +00:00
|
|
|
|
hoffset = MAX (px - (width - 2 * SCROLL_EDGE_SIZE), 0);
|
2005-05-06 04:14:32 +00:00
|
|
|
|
|
|
|
|
|
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
|
2015-05-21 12:16:13 +00:00
|
|
|
|
drag_scroll_timeout (gpointer data)
|
2005-05-06 04:14:32 +00:00
|
|
|
|
{
|
2015-05-21 12:16:13 +00:00
|
|
|
|
gtk_icon_view_autoscroll (data);
|
2005-05-06 04:14:32 +00:00
|
|
|
|
|
|
|
|
|
return TRUE;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static gboolean
|
2020-02-29 02:47:17 +00:00
|
|
|
|
set_destination (GtkIconView *icon_view,
|
|
|
|
|
GtkDropTargetAsync *dest,
|
2020-07-24 13:54:49 +00:00
|
|
|
|
int x,
|
|
|
|
|
int y,
|
2020-02-29 02:47:17 +00:00
|
|
|
|
GdkDragAction *suggested_action,
|
|
|
|
|
GType *target)
|
2005-05-06 04:14:32 +00:00
|
|
|
|
{
|
|
|
|
|
GtkWidget *widget;
|
|
|
|
|
GtkTreePath *path = NULL;
|
|
|
|
|
GtkIconViewDropPosition pos;
|
|
|
|
|
GtkIconViewDropPosition old_pos;
|
|
|
|
|
GtkTreePath *old_dest_path = NULL;
|
2020-02-18 00:41:42 +00:00
|
|
|
|
GdkContentFormats *formats;
|
2005-05-06 04:14:32 +00:00
|
|
|
|
gboolean can_drop = FALSE;
|
|
|
|
|
|
|
|
|
|
widget = GTK_WIDGET (icon_view);
|
|
|
|
|
|
|
|
|
|
*suggested_action = 0;
|
2020-02-18 00:41:42 +00:00
|
|
|
|
*target = G_TYPE_INVALID;
|
2005-05-06 04:14:32 +00:00
|
|
|
|
|
|
|
|
|
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 */
|
|
|
|
|
}
|
|
|
|
|
|
2020-02-29 02:47:17 +00:00
|
|
|
|
formats = gtk_drop_target_async_get_formats (dest);
|
2020-02-18 00:41:42 +00:00
|
|
|
|
*target = gdk_content_formats_match_gtype (formats, formats);
|
|
|
|
|
if (*target == G_TYPE_INVALID)
|
2005-05-06 04:14:32 +00:00
|
|
|
|
return FALSE;
|
|
|
|
|
|
|
|
|
|
if (!gtk_icon_view_get_dest_item_at_pos (icon_view, x, y, &path, &pos))
|
|
|
|
|
{
|
2020-07-24 13:54:49 +00:00
|
|
|
|
int n_children;
|
2005-05-06 04:14:32 +00:00
|
|
|
|
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)
|
|
|
|
|
{
|
2018-05-17 02:51:18 +00:00
|
|
|
|
*suggested_action = GDK_ACTION_ALL;
|
2005-05-06 04:14:32 +00:00
|
|
|
|
|
|
|
|
|
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
|
2018-01-02 04:48:32 +00:00
|
|
|
|
gtk_icon_view_maybe_begin_drag (GtkIconView *icon_view,
|
|
|
|
|
double x,
|
|
|
|
|
double y,
|
|
|
|
|
GdkDevice *device)
|
2005-05-06 04:14:32 +00:00
|
|
|
|
{
|
|
|
|
|
GtkTreePath *path = NULL;
|
|
|
|
|
GtkTreeModel *model;
|
|
|
|
|
gboolean retval = FALSE;
|
2020-01-07 00:10:15 +00:00
|
|
|
|
GdkContentProvider *content;
|
|
|
|
|
GdkPaintable *icon;
|
|
|
|
|
GtkIconViewItem *item;
|
|
|
|
|
GdkSurface *surface;
|
|
|
|
|
GdkDrag *drag;
|
2005-05-06 04:14:32 +00:00
|
|
|
|
|
|
|
|
|
if (!icon_view->priv->source_set)
|
|
|
|
|
goto out;
|
|
|
|
|
|
2018-01-02 04:48:32 +00:00
|
|
|
|
if (icon_view->priv->pressed_button < 0)
|
2005-05-06 04:14:32 +00:00
|
|
|
|
goto out;
|
|
|
|
|
|
2020-12-25 17:57:48 +00:00
|
|
|
|
if (!gtk_drag_check_threshold_double (GTK_WIDGET (icon_view),
|
|
|
|
|
icon_view->priv->press_start_x,
|
|
|
|
|
icon_view->priv->press_start_y,
|
|
|
|
|
x, y))
|
2005-05-06 04:14:32 +00:00
|
|
|
|
goto out;
|
|
|
|
|
|
|
|
|
|
model = gtk_icon_view_get_model (icon_view);
|
|
|
|
|
|
|
|
|
|
if (model == NULL)
|
|
|
|
|
goto out;
|
|
|
|
|
|
|
|
|
|
icon_view->priv->pressed_button = -1;
|
|
|
|
|
|
2020-01-07 00:10:15 +00:00
|
|
|
|
item = _gtk_icon_view_get_item_at_coords (icon_view,
|
|
|
|
|
icon_view->priv->press_start_x,
|
|
|
|
|
icon_view->priv->press_start_y,
|
|
|
|
|
TRUE,
|
|
|
|
|
NULL);
|
2005-05-06 04:14:32 +00:00
|
|
|
|
|
2020-01-07 00:10:15 +00:00
|
|
|
|
if (item == NULL)
|
2005-05-06 04:14:32 +00:00
|
|
|
|
goto out;
|
|
|
|
|
|
2020-01-07 00:10:15 +00:00
|
|
|
|
path = gtk_tree_path_new_from_indices (item->index, -1);
|
|
|
|
|
|
2005-05-06 04:14:32 +00:00
|
|
|
|
if (!GTK_IS_TREE_DRAG_SOURCE (model) ||
|
2019-12-31 22:04:01 +00:00
|
|
|
|
!gtk_tree_drag_source_row_draggable (GTK_TREE_DRAG_SOURCE (model), path))
|
2005-05-06 04:14:32 +00:00
|
|
|
|
goto out;
|
|
|
|
|
|
|
|
|
|
/* FIXME Check whether we're a start button, if not return FALSE and
|
|
|
|
|
* free path
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
/* Now we can begin the drag */
|
2018-01-02 04:48:32 +00:00
|
|
|
|
|
2005-05-06 04:14:32 +00:00
|
|
|
|
retval = TRUE;
|
|
|
|
|
|
2020-01-07 00:10:15 +00:00
|
|
|
|
surface = gtk_native_get_surface (gtk_widget_get_native (GTK_WIDGET (icon_view)));
|
2018-01-02 04:48:32 +00:00
|
|
|
|
|
2020-02-18 00:41:42 +00:00
|
|
|
|
content = gtk_icon_view_drag_data_get (icon_view, path);
|
|
|
|
|
if (content == NULL)
|
|
|
|
|
goto out;
|
2005-05-06 04:14:32 +00:00
|
|
|
|
|
2020-01-07 00:10:15 +00:00
|
|
|
|
drag = gdk_drag_begin (surface,
|
|
|
|
|
device,
|
|
|
|
|
content,
|
|
|
|
|
icon_view->priv->source_actions,
|
|
|
|
|
icon_view->priv->press_start_x,
|
|
|
|
|
icon_view->priv->press_start_y);
|
2005-05-06 04:14:32 +00:00
|
|
|
|
|
2020-02-11 17:24:01 +00:00
|
|
|
|
g_object_unref (content);
|
2005-05-06 04:14:32 +00:00
|
|
|
|
|
2020-01-07 00:10:15 +00:00
|
|
|
|
g_signal_connect (drag, "dnd-finished", G_CALLBACK (gtk_icon_view_dnd_finished_cb), icon_view);
|
2005-05-06 04:14:32 +00:00
|
|
|
|
|
2020-01-07 00:10:15 +00:00
|
|
|
|
icon_view->priv->source_item = gtk_tree_row_reference_new (model, path);
|
2005-05-06 04:14:32 +00:00
|
|
|
|
|
2013-08-07 08:57:33 +00:00
|
|
|
|
x = icon_view->priv->press_start_x - item->cell_area.x + icon_view->priv->item_padding;
|
|
|
|
|
y = icon_view->priv->press_start_y - item->cell_area.y + icon_view->priv->item_padding;
|
2005-05-06 04:14:32 +00:00
|
|
|
|
|
|
|
|
|
icon = gtk_icon_view_create_drag_icon (icon_view, path);
|
2020-01-07 00:10:15 +00:00
|
|
|
|
gtk_drag_icon_set_from_paintable (drag, icon, x, y);
|
|
|
|
|
g_object_unref (icon);
|
2005-05-06 04:14:32 +00:00
|
|
|
|
|
2020-01-07 00:10:15 +00:00
|
|
|
|
icon_view->priv->drag = drag;
|
2005-05-06 04:14:32 +00:00
|
|
|
|
|
2020-01-07 00:10:15 +00:00
|
|
|
|
g_object_unref (drag);
|
|
|
|
|
|
|
|
|
|
out:
|
|
|
|
|
if (path)
|
|
|
|
|
gtk_tree_path_free (path);
|
|
|
|
|
|
|
|
|
|
return retval;
|
2005-05-06 04:14:32 +00:00
|
|
|
|
}
|
|
|
|
|
|
2020-01-07 00:10:15 +00:00
|
|
|
|
/* Source side drag signals */
|
2020-02-18 00:41:42 +00:00
|
|
|
|
static GdkContentProvider *
|
|
|
|
|
gtk_icon_view_drag_data_get (GtkIconView *icon_view,
|
|
|
|
|
GtkTreePath *source_row)
|
2005-05-06 04:14:32 +00:00
|
|
|
|
{
|
2020-02-18 00:41:42 +00:00
|
|
|
|
GdkContentProvider *content;
|
2005-05-06 04:14:32 +00:00
|
|
|
|
GtkTreeModel *model;
|
|
|
|
|
|
|
|
|
|
model = gtk_icon_view_get_model (icon_view);
|
|
|
|
|
|
|
|
|
|
if (model == NULL)
|
2019-12-31 22:04:01 +00:00
|
|
|
|
return NULL;
|
2005-05-06 04:14:32 +00:00
|
|
|
|
|
2008-09-04 00:12:06 +00:00
|
|
|
|
if (!icon_view->priv->source_set)
|
2019-12-31 22:04:01 +00:00
|
|
|
|
return NULL;
|
2005-05-06 04:14:32 +00:00
|
|
|
|
|
|
|
|
|
/* We can implement the GTK_TREE_MODEL_ROW target generically for
|
2017-11-18 01:19:53 +00:00
|
|
|
|
* any model; for DragSource models there are some other formats
|
2005-05-06 04:14:32 +00:00
|
|
|
|
* we also support.
|
|
|
|
|
*/
|
|
|
|
|
|
2020-02-18 00:41:42 +00:00
|
|
|
|
if (GTK_IS_TREE_DRAG_SOURCE (model))
|
|
|
|
|
content = gtk_tree_drag_source_drag_data_get (GTK_TREE_DRAG_SOURCE (model), source_row);
|
|
|
|
|
else
|
|
|
|
|
content = NULL;
|
2005-05-06 04:14:32 +00:00
|
|
|
|
|
|
|
|
|
/* If drag_data_get does nothing, try providing row data. */
|
2020-02-18 00:41:42 +00:00
|
|
|
|
if (content == NULL)
|
|
|
|
|
content = gtk_tree_create_row_drag_content (model, source_row);
|
2005-05-06 04:14:32 +00:00
|
|
|
|
|
2020-02-18 00:41:42 +00:00
|
|
|
|
return content;
|
2005-05-06 04:14:32 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void
|
2020-01-07 00:10:15 +00:00
|
|
|
|
gtk_icon_view_dnd_finished_cb (GdkDrag *drag,
|
|
|
|
|
GtkWidget *widget)
|
2005-05-06 04:14:32 +00:00
|
|
|
|
{
|
|
|
|
|
GtkTreeModel *model;
|
|
|
|
|
GtkIconView *icon_view;
|
|
|
|
|
GtkTreePath *source_row;
|
|
|
|
|
|
2020-01-07 00:10:15 +00:00
|
|
|
|
if (gdk_drag_get_selected_action (drag) != GDK_ACTION_MOVE)
|
2020-01-06 18:28:25 +00:00
|
|
|
|
return;
|
|
|
|
|
|
2005-05-06 04:14:32 +00:00
|
|
|
|
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;
|
|
|
|
|
|
2020-01-07 00:10:15 +00:00
|
|
|
|
source_row = gtk_tree_row_reference_get_path (icon_view->priv->source_item);
|
2005-05-06 04:14:32 +00:00
|
|
|
|
if (source_row == NULL)
|
|
|
|
|
return;
|
|
|
|
|
|
2019-12-31 22:04:01 +00:00
|
|
|
|
gtk_tree_drag_source_drag_data_delete (GTK_TREE_DRAG_SOURCE (model), source_row);
|
2005-05-06 04:14:32 +00:00
|
|
|
|
|
|
|
|
|
gtk_tree_path_free (source_row);
|
|
|
|
|
|
2020-01-07 00:10:15 +00:00
|
|
|
|
g_clear_pointer (&icon_view->priv->source_item, gtk_tree_row_reference_free);
|
|
|
|
|
icon_view->priv->drag = NULL;
|
2005-05-06 04:14:32 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Target side drag signals */
|
|
|
|
|
static void
|
2020-02-29 02:47:17 +00:00
|
|
|
|
gtk_icon_view_drag_leave (GtkDropTargetAsync *dest,
|
|
|
|
|
GdkDrop *drop,
|
|
|
|
|
GtkIconView *icon_view)
|
2005-05-06 04:14:32 +00:00
|
|
|
|
{
|
|
|
|
|
/* unset any highlight row */
|
|
|
|
|
gtk_icon_view_set_drag_dest_item (icon_view,
|
|
|
|
|
NULL,
|
|
|
|
|
GTK_ICON_VIEW_DROP_LEFT);
|
|
|
|
|
|
|
|
|
|
remove_scroll_timeout (icon_view);
|
|
|
|
|
}
|
|
|
|
|
|
2020-02-29 02:47:17 +00:00
|
|
|
|
static GdkDragAction
|
|
|
|
|
gtk_icon_view_drag_motion (GtkDropTargetAsync *dest,
|
|
|
|
|
GdkDrop *drop,
|
|
|
|
|
double x,
|
|
|
|
|
double y,
|
|
|
|
|
GtkIconView *icon_view)
|
2005-05-06 04:14:32 +00:00
|
|
|
|
{
|
|
|
|
|
GtkTreePath *path = NULL;
|
|
|
|
|
GtkIconViewDropPosition pos;
|
|
|
|
|
GdkDragAction suggested_action = 0;
|
2020-02-18 00:41:42 +00:00
|
|
|
|
GType target;
|
2005-05-06 04:14:32 +00:00
|
|
|
|
gboolean empty;
|
2020-02-29 02:47:17 +00:00
|
|
|
|
GdkDragAction result;
|
2005-05-06 04:14:32 +00:00
|
|
|
|
|
2020-01-02 06:00:44 +00:00
|
|
|
|
if (!set_destination (icon_view, dest, x, y, &suggested_action, &target))
|
2020-02-29 02:47:17 +00:00
|
|
|
|
return 0;
|
2015-05-21 12:16:13 +00:00
|
|
|
|
|
2005-05-06 04:14:32 +00:00
|
|
|
|
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. */
|
2020-02-29 02:47:17 +00:00
|
|
|
|
result = 0;
|
2005-05-06 04:14:32 +00:00
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
if (icon_view->priv->scroll_timeout_id == 0)
|
|
|
|
|
{
|
2018-02-02 14:51:47 +00:00
|
|
|
|
icon_view->priv->scroll_timeout_id = g_timeout_add (50, drag_scroll_timeout, icon_view);
|
2019-02-05 10:26:20 +00:00
|
|
|
|
g_source_set_name_by_id (icon_view->priv->scroll_timeout_id, "[gtk] drag_scroll_timeout");
|
2005-05-06 04:14:32 +00:00
|
|
|
|
}
|
|
|
|
|
|
2020-02-18 00:41:42 +00:00
|
|
|
|
if (target == GTK_TYPE_TREE_ROW_DATA)
|
2005-05-06 04:14:32 +00:00
|
|
|
|
{
|
|
|
|
|
/* Request data so we can use the source row when
|
|
|
|
|
* determining whether to accept the drop
|
|
|
|
|
*/
|
2018-05-17 02:51:18 +00:00
|
|
|
|
set_status_pending (drop, suggested_action);
|
2020-02-18 00:41:42 +00:00
|
|
|
|
gdk_drop_read_value_async (drop, target, G_PRIORITY_DEFAULT, NULL, gtk_icon_view_drag_data_received, icon_view);
|
2005-05-06 04:14:32 +00:00
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
2018-05-17 02:51:18 +00:00
|
|
|
|
set_status_pending (drop, 0);
|
2005-05-06 04:14:32 +00:00
|
|
|
|
}
|
2020-02-29 02:47:17 +00:00
|
|
|
|
result = suggested_action;
|
2005-05-06 04:14:32 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (path)
|
|
|
|
|
gtk_tree_path_free (path);
|
2020-02-29 02:47:17 +00:00
|
|
|
|
|
|
|
|
|
return result;
|
2005-05-06 04:14:32 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static gboolean
|
2020-02-29 02:47:17 +00:00
|
|
|
|
gtk_icon_view_drag_drop (GtkDropTargetAsync *dest,
|
|
|
|
|
GdkDrop *drop,
|
|
|
|
|
double x,
|
|
|
|
|
double y,
|
|
|
|
|
GtkIconView *icon_view)
|
2005-05-06 04:14:32 +00:00
|
|
|
|
{
|
|
|
|
|
GtkTreePath *path;
|
|
|
|
|
GdkDragAction suggested_action = 0;
|
2020-02-18 00:41:42 +00:00
|
|
|
|
GType target = G_TYPE_INVALID;
|
2005-05-06 04:14:32 +00:00
|
|
|
|
GtkTreeModel *model;
|
|
|
|
|
gboolean drop_append_mode;
|
|
|
|
|
|
|
|
|
|
model = gtk_icon_view_get_model (icon_view);
|
|
|
|
|
|
2020-01-02 06:00:44 +00:00
|
|
|
|
remove_scroll_timeout (icon_view);
|
2005-05-06 04:14:32 +00:00
|
|
|
|
|
|
|
|
|
if (!icon_view->priv->dest_set)
|
|
|
|
|
return FALSE;
|
|
|
|
|
|
2020-02-29 02:47:17 +00:00
|
|
|
|
if (!check_model_dnd (model, GTK_TYPE_TREE_DRAG_DEST, "drop"))
|
2005-05-06 04:14:32 +00:00
|
|
|
|
return FALSE;
|
|
|
|
|
|
2020-01-02 06:00:44 +00:00
|
|
|
|
if (!set_destination (icon_view, dest, x, y, &suggested_action, &target))
|
2005-05-06 04:14:32 +00:00
|
|
|
|
return FALSE;
|
|
|
|
|
|
|
|
|
|
path = get_logical_destination (icon_view, &drop_append_mode);
|
|
|
|
|
|
2020-02-18 00:41:42 +00:00
|
|
|
|
if (target != G_TYPE_INVALID && path != NULL)
|
2005-05-06 04:14:32 +00:00
|
|
|
|
{
|
|
|
|
|
/* in case a motion had requested drag data, change things so we
|
|
|
|
|
* treat drag data receives as a drop.
|
|
|
|
|
*/
|
2018-05-17 02:51:18 +00:00
|
|
|
|
set_status_pending (drop, 0);
|
|
|
|
|
set_dest_row (drop, model, path,
|
2005-05-06 04:14:32 +00:00
|
|
|
|
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);
|
|
|
|
|
|
2020-02-18 00:41:42 +00:00
|
|
|
|
if (target != G_TYPE_INVALID)
|
2005-05-06 04:14:32 +00:00
|
|
|
|
{
|
2020-02-18 00:41:42 +00:00
|
|
|
|
gdk_drop_read_value_async (drop, target, G_PRIORITY_DEFAULT, NULL, gtk_icon_view_drag_data_received, icon_view);
|
2005-05-06 04:14:32 +00:00
|
|
|
|
return TRUE;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
return FALSE;
|
|
|
|
|
}
|
|
|
|
|
|
2018-05-17 02:51:18 +00:00
|
|
|
|
static GdkDragAction
|
2019-12-31 22:04:01 +00:00
|
|
|
|
gtk_icon_view_get_action (GtkWidget *widget,
|
2018-05-17 02:51:18 +00:00
|
|
|
|
GdkDrop *drop)
|
|
|
|
|
{
|
2019-12-31 22:04:01 +00:00
|
|
|
|
GtkIconView *iconview = GTK_ICON_VIEW (widget);
|
2018-06-29 17:34:14 +00:00
|
|
|
|
GdkDrag *drag = gdk_drop_get_drag (drop);
|
2018-05-17 02:51:18 +00:00
|
|
|
|
GdkDragAction actions;
|
|
|
|
|
|
|
|
|
|
actions = gdk_drop_get_actions (drop);
|
|
|
|
|
|
2020-01-07 00:10:15 +00:00
|
|
|
|
if (drag == iconview->priv->drag &&
|
2018-05-17 02:51:18 +00:00
|
|
|
|
actions & GDK_ACTION_MOVE)
|
|
|
|
|
return GDK_ACTION_MOVE;
|
|
|
|
|
|
|
|
|
|
if (actions & GDK_ACTION_COPY)
|
|
|
|
|
return GDK_ACTION_COPY;
|
|
|
|
|
|
|
|
|
|
if (actions & GDK_ACTION_MOVE)
|
|
|
|
|
return GDK_ACTION_MOVE;
|
|
|
|
|
|
|
|
|
|
if (actions & GDK_ACTION_LINK)
|
|
|
|
|
return GDK_ACTION_LINK;
|
|
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
2005-05-06 04:14:32 +00:00
|
|
|
|
static void
|
2020-01-03 07:22:56 +00:00
|
|
|
|
gtk_icon_view_drag_data_received (GObject *source,
|
|
|
|
|
GAsyncResult *result,
|
|
|
|
|
gpointer data)
|
2005-05-06 04:14:32 +00:00
|
|
|
|
{
|
2020-01-03 07:22:56 +00:00
|
|
|
|
GtkIconView *icon_view = data;
|
2020-02-18 00:41:42 +00:00
|
|
|
|
GdkDrop *drop = GDK_DROP (source);
|
2005-05-06 04:14:32 +00:00
|
|
|
|
GtkTreePath *path;
|
|
|
|
|
GtkTreeModel *model;
|
|
|
|
|
GtkTreePath *dest_row;
|
|
|
|
|
GdkDragAction suggested_action;
|
|
|
|
|
gboolean drop_append_mode;
|
2020-02-18 00:41:42 +00:00
|
|
|
|
const GValue *value;
|
2020-01-03 07:22:56 +00:00
|
|
|
|
|
2020-02-18 00:41:42 +00:00
|
|
|
|
value = gdk_drop_read_value_finish (drop, result, NULL);
|
|
|
|
|
if (!value)
|
2020-01-03 07:22:56 +00:00
|
|
|
|
return;
|
|
|
|
|
|
2005-05-06 04:14:32 +00:00
|
|
|
|
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"))
|
2020-02-18 00:41:42 +00:00
|
|
|
|
return;
|
2005-05-06 04:14:32 +00:00
|
|
|
|
|
|
|
|
|
if (!icon_view->priv->dest_set)
|
2020-02-18 00:41:42 +00:00
|
|
|
|
return;
|
2005-05-06 04:14:32 +00:00
|
|
|
|
|
2018-05-16 02:50:24 +00:00
|
|
|
|
suggested_action = get_status_pending (drop);
|
2005-05-06 04:14:32 +00:00
|
|
|
|
|
|
|
|
|
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,
|
2020-02-18 00:41:42 +00:00
|
|
|
|
value))
|
2005-05-06 04:14:32 +00:00
|
|
|
|
suggested_action = 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
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);
|
2020-02-18 00:41:42 +00:00
|
|
|
|
return;
|
2005-05-06 04:14:32 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2018-05-16 02:50:24 +00:00
|
|
|
|
dest_row = get_dest_row (drop);
|
2005-05-06 04:14:32 +00:00
|
|
|
|
|
|
|
|
|
if (dest_row == NULL)
|
2020-02-18 00:41:42 +00:00
|
|
|
|
return;
|
2005-05-06 04:14:32 +00:00
|
|
|
|
|
2020-02-18 00:41:42 +00:00
|
|
|
|
suggested_action = gtk_icon_view_get_action (GTK_WIDGET (icon_view), drop);
|
2018-05-17 02:51:18 +00:00
|
|
|
|
|
2020-02-18 00:41:42 +00:00
|
|
|
|
if (suggested_action &&
|
|
|
|
|
!gtk_tree_drag_dest_drag_data_received (GTK_TREE_DRAG_DEST (model),
|
|
|
|
|
dest_row,
|
|
|
|
|
value))
|
|
|
|
|
suggested_action = 0;
|
2005-05-06 04:14:32 +00:00
|
|
|
|
|
2018-05-17 02:51:18 +00:00
|
|
|
|
gdk_drop_finish (drop, suggested_action);
|
2005-05-06 04:14:32 +00:00
|
|
|
|
|
|
|
|
|
gtk_tree_path_free (dest_row);
|
|
|
|
|
|
|
|
|
|
/* drop dest_row */
|
2018-05-16 02:50:24 +00:00
|
|
|
|
set_dest_row (drop, NULL, NULL, FALSE, FALSE);
|
2005-05-06 04:14:32 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Drag-and-Drop support */
|
2019-12-31 22:04:01 +00:00
|
|
|
|
|
2005-05-06 04:14:32 +00:00
|
|
|
|
/**
|
|
|
|
|
* gtk_icon_view_enable_model_drag_source:
|
2012-07-02 06:19:06 +00:00
|
|
|
|
* @icon_view: a #GtkIconView
|
2005-05-06 04:14:32 +00:00
|
|
|
|
* @start_button_mask: Mask of allowed buttons to start drag
|
2017-11-18 01:19:53 +00:00
|
|
|
|
* @formats: the formats that the drag will support
|
2005-05-06 04:14:32 +00:00
|
|
|
|
* @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
|
|
|
|
**/
|
2020-01-07 00:10:15 +00:00
|
|
|
|
void
|
2005-05-06 04:14:32 +00:00
|
|
|
|
gtk_icon_view_enable_model_drag_source (GtkIconView *icon_view,
|
|
|
|
|
GdkModifierType start_button_mask,
|
2017-11-18 01:19:53 +00:00
|
|
|
|
GdkContentFormats *formats,
|
2005-05-06 04:14:32 +00:00
|
|
|
|
GdkDragAction actions)
|
|
|
|
|
{
|
2020-01-07 00:10:15 +00:00
|
|
|
|
g_return_if_fail (GTK_IS_ICON_VIEW (icon_view));
|
2005-05-06 04:14:32 +00:00
|
|
|
|
|
2020-01-07 00:10:15 +00:00
|
|
|
|
icon_view->priv->source_formats = gdk_content_formats_ref (formats);
|
2005-05-06 04:14:32 +00:00
|
|
|
|
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
|
2017-11-18 01:19:53 +00:00
|
|
|
|
* @formats: the formats that the drag will support
|
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
|
|
|
|
**/
|
2020-02-28 03:19:36 +00:00
|
|
|
|
void
|
2017-11-18 01:19:53 +00:00
|
|
|
|
gtk_icon_view_enable_model_drag_dest (GtkIconView *icon_view,
|
|
|
|
|
GdkContentFormats *formats,
|
|
|
|
|
GdkDragAction actions)
|
2005-05-06 04:14:32 +00:00
|
|
|
|
{
|
2020-01-07 22:29:44 +00:00
|
|
|
|
GtkCssNode *widget_node;
|
2005-05-06 04:14:32 +00:00
|
|
|
|
|
2020-02-28 03:19:36 +00:00
|
|
|
|
g_return_if_fail (GTK_IS_ICON_VIEW (icon_view));
|
|
|
|
|
|
2020-02-29 02:47:17 +00:00
|
|
|
|
icon_view->priv->dest = gtk_drop_target_async_new (gdk_content_formats_ref (formats), actions);
|
2020-01-02 06:00:44 +00:00
|
|
|
|
g_signal_connect (icon_view->priv->dest, "drag-leave", G_CALLBACK (gtk_icon_view_drag_leave), icon_view);
|
2020-02-29 02:47:17 +00:00
|
|
|
|
g_signal_connect (icon_view->priv->dest, "drag-enter", G_CALLBACK (gtk_icon_view_drag_motion), icon_view);
|
2020-01-11 02:56:26 +00:00
|
|
|
|
g_signal_connect (icon_view->priv->dest, "drag-motion", G_CALLBACK (gtk_icon_view_drag_motion), icon_view);
|
2020-02-29 02:47:17 +00:00
|
|
|
|
g_signal_connect (icon_view->priv->dest, "drop", G_CALLBACK (gtk_icon_view_drag_drop), icon_view);
|
2020-01-06 05:12:21 +00:00
|
|
|
|
gtk_widget_add_controller (GTK_WIDGET (icon_view), GTK_EVENT_CONTROLLER (icon_view->priv->dest));
|
2005-05-06 04:14:32 +00:00
|
|
|
|
|
|
|
|
|
icon_view->priv->dest_actions = actions;
|
|
|
|
|
|
|
|
|
|
icon_view->priv->dest_set = TRUE;
|
|
|
|
|
|
|
|
|
|
unset_reorderable (icon_view);
|
2020-01-02 06:00:44 +00:00
|
|
|
|
|
2020-01-07 22:29:44 +00:00
|
|
|
|
widget_node = gtk_widget_get_css_node (GTK_WIDGET (icon_view));
|
|
|
|
|
icon_view->priv->dndnode = gtk_css_node_new ();
|
2020-01-23 23:43:26 +00:00
|
|
|
|
gtk_css_node_set_name (icon_view->priv->dndnode, g_quark_from_static_string ("dndtarget"));
|
2020-01-07 22:29:44 +00:00
|
|
|
|
gtk_css_node_set_parent (icon_view->priv->dndnode, widget_node);
|
|
|
|
|
gtk_css_node_set_state (icon_view->priv->dndnode, gtk_css_node_get_state (widget_node));
|
|
|
|
|
g_object_unref (icon_view->priv->dndnode);
|
2005-05-06 04:14:32 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 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
|
|
|
|
**/
|
|
|
|
|
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)
|
|
|
|
|
{
|
2020-01-07 00:10:15 +00:00
|
|
|
|
g_clear_pointer (&icon_view->priv->source_formats, gdk_content_formats_unref);
|
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
|
|
|
|
**/
|
|
|
|
|
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)
|
|
|
|
|
{
|
2020-01-06 05:12:21 +00:00
|
|
|
|
gtk_widget_remove_controller (GTK_WIDGET (icon_view), GTK_EVENT_CONTROLLER (icon_view->priv->dest));
|
2020-01-02 06:00:44 +00:00
|
|
|
|
icon_view->priv->dest = NULL;
|
2008-11-03 18:40:56 +00:00
|
|
|
|
icon_view->priv->dest_set = FALSE;
|
2020-01-07 22:29:44 +00:00
|
|
|
|
|
|
|
|
|
gtk_css_node_set_parent (icon_view->priv->dndnode, NULL);
|
|
|
|
|
icon_view->priv->dndnode = NULL;
|
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.
|
|
|
|
|
*/
|
|
|
|
|
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
|
|
|
|
{
|
2020-07-24 13:54:49 +00:00
|
|
|
|
int n_children;
|
2005-05-06 04:14:32 +00:00
|
|
|
|
|
|
|
|
|
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.
|
|
|
|
|
**/
|
|
|
|
|
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.
|
|
|
|
|
*
|
2014-02-19 23:49:43 +00:00
|
|
|
|
* Returns: whether there is an item at the given position.
|
2005-05-06 04:14:32 +00:00
|
|
|
|
**/
|
|
|
|
|
gboolean
|
|
|
|
|
gtk_icon_view_get_dest_item_at_pos (GtkIconView *icon_view,
|
2020-07-24 13:54:49 +00:00
|
|
|
|
int drag_x,
|
|
|
|
|
int drag_y,
|
2005-05-06 04:14:32 +00:00
|
|
|
|
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);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (path)
|
|
|
|
|
*path = NULL;
|
|
|
|
|
|
2011-12-18 15:16:34 +00:00
|
|
|
|
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.
|
|
|
|
|
*
|
2014-02-19 23:49:43 +00:00
|
|
|
|
* Returns: (transfer full): a newly-allocated surface of the drag icon.
|
2005-05-06 04:14:32 +00:00
|
|
|
|
**/
|
2018-03-26 03:21:18 +00:00
|
|
|
|
GdkPaintable *
|
2005-05-06 04:14:32 +00:00
|
|
|
|
gtk_icon_view_create_drag_icon (GtkIconView *icon_view,
|
|
|
|
|
GtkTreePath *path)
|
|
|
|
|
{
|
|
|
|
|
GtkWidget *widget;
|
2018-03-11 02:14:09 +00:00
|
|
|
|
GtkSnapshot *snapshot;
|
2018-03-26 03:21:18 +00:00
|
|
|
|
GdkPaintable *paintable;
|
2005-05-06 04:14:32 +00:00
|
|
|
|
GList *l;
|
2020-07-24 13:54:49 +00:00
|
|
|
|
int index;
|
2005-05-06 04:14:32 +00:00
|
|
|
|
|
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);
|
|
|
|
|
|
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)
|
2018-03-26 03:21:18 +00:00
|
|
|
|
{
|
2018-04-24 01:17:23 +00:00
|
|
|
|
snapshot = gtk_snapshot_new ();
|
2018-03-26 03:21:18 +00:00
|
|
|
|
gtk_icon_view_snapshot_item (icon_view, snapshot, item,
|
|
|
|
|
icon_view->priv->item_padding,
|
|
|
|
|
icon_view->priv->item_padding,
|
|
|
|
|
FALSE);
|
2018-04-02 04:15:50 +00:00
|
|
|
|
paintable = gtk_snapshot_free_to_paintable (snapshot, NULL);
|
2018-03-26 03:21:18 +00:00
|
|
|
|
|
|
|
|
|
return paintable;
|
|
|
|
|
}
|
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().
|
|
|
|
|
*
|
2014-02-19 23:49:43 +00:00
|
|
|
|
* Returns: %TRUE if the list can be reordered.
|
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;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 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.
|
|
|
|
|
**/
|
|
|
|
|
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)
|
|
|
|
|
{
|
2020-02-18 00:41:42 +00:00
|
|
|
|
GdkContentFormats *formats = gdk_content_formats_new_for_gtype (GTK_TYPE_TREE_ROW_DATA);
|
2005-05-06 04:14:32 +00:00
|
|
|
|
gtk_icon_view_enable_model_drag_source (icon_view,
|
|
|
|
|
GDK_BUTTON1_MASK,
|
2017-11-18 01:19:53 +00:00
|
|
|
|
formats,
|
2005-05-06 04:14:32 +00:00
|
|
|
|
GDK_ACTION_MOVE);
|
|
|
|
|
gtk_icon_view_enable_model_drag_dest (icon_view,
|
2017-11-18 01:19:53 +00:00
|
|
|
|
formats,
|
2005-05-06 04:14:32 +00:00
|
|
|
|
GDK_ACTION_MOVE);
|
2017-11-18 01:19:53 +00:00
|
|
|
|
gdk_content_formats_unref (formats);
|
2005-05-06 04:14:32 +00:00
|
|
|
|
}
|
|
|
|
|
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");
|
|
|
|
|
}
|
|
|
|
|
|
2013-01-18 05:59:55 +00:00
|
|
|
|
/**
|
|
|
|
|
* gtk_icon_view_set_activate_on_single_click:
|
|
|
|
|
* @icon_view: a #GtkIconView
|
2013-02-02 03:53:35 +00:00
|
|
|
|
* @single: %TRUE to emit item-activated on a single click
|
2013-01-18 05:59:55 +00:00
|
|
|
|
*
|
2013-02-02 03:53:35 +00:00
|
|
|
|
* Causes the #GtkIconView::item-activated signal to be emitted on
|
|
|
|
|
* a single click instead of a double click.
|
2013-01-18 05:59:55 +00:00
|
|
|
|
**/
|
|
|
|
|
void
|
2013-02-02 03:53:35 +00:00
|
|
|
|
gtk_icon_view_set_activate_on_single_click (GtkIconView *icon_view,
|
|
|
|
|
gboolean single)
|
2013-01-18 05:59:55 +00:00
|
|
|
|
{
|
|
|
|
|
g_return_if_fail (GTK_IS_ICON_VIEW (icon_view));
|
|
|
|
|
|
2013-02-02 03:53:35 +00:00
|
|
|
|
single = single != FALSE;
|
2013-01-18 05:59:55 +00:00
|
|
|
|
|
2013-02-02 03:53:35 +00:00
|
|
|
|
if (icon_view->priv->activate_on_single_click == single)
|
2013-01-18 05:59:55 +00:00
|
|
|
|
return;
|
|
|
|
|
|
2013-02-02 03:53:35 +00:00
|
|
|
|
icon_view->priv->activate_on_single_click = single;
|
2013-01-18 05:59:55 +00:00
|
|
|
|
g_object_notify (G_OBJECT (icon_view), "activate-on-single-click");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* gtk_icon_view_get_activate_on_single_click:
|
|
|
|
|
* @icon_view: a #GtkIconView
|
|
|
|
|
*
|
|
|
|
|
* Gets the setting set by gtk_icon_view_set_activate_on_single_click().
|
|
|
|
|
*
|
2014-02-19 23:49:43 +00:00
|
|
|
|
* Returns: %TRUE if item-activated will be emitted on a single click
|
2013-01-18 05:59:55 +00:00
|
|
|
|
**/
|
|
|
|
|
gboolean
|
2013-02-02 03:53:35 +00:00
|
|
|
|
gtk_icon_view_get_activate_on_single_click (GtkIconView *icon_view)
|
2013-01-18 05:59:55 +00:00
|
|
|
|
{
|
|
|
|
|
g_return_val_if_fail (GTK_IS_ICON_VIEW (icon_view), FALSE);
|
|
|
|
|
|
|
|
|
|
return icon_view->priv->activate_on_single_click;
|
|
|
|
|
}
|
|
|
|
|
|
2011-07-25 03:04:02 +00:00
|
|
|
|
static gboolean
|
2019-08-29 13:21:20 +00:00
|
|
|
|
gtk_icon_view_buildable_custom_tag_start (GtkBuildable *buildable,
|
|
|
|
|
GtkBuilder *builder,
|
|
|
|
|
GObject *child,
|
2020-07-24 18:40:36 +00:00
|
|
|
|
const char *tagname,
|
2019-08-29 13:21:20 +00:00
|
|
|
|
GtkBuildableParser *parser,
|
|
|
|
|
gpointer *data)
|
2011-07-25 03:04:02 +00:00
|
|
|
|
{
|
|
|
|
|
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,
|
2020-07-24 18:40:36 +00:00
|
|
|
|
const char *tagname,
|
2018-10-07 22:34:43 +00:00
|
|
|
|
gpointer data)
|
2011-07-25 03:04:02 +00:00
|
|
|
|
{
|
|
|
|
|
if (!_gtk_cell_layout_buildable_custom_tag_end (buildable, builder,
|
|
|
|
|
child, tagname, data))
|
|
|
|
|
parent_buildable_iface->custom_tag_end (buildable, builder,
|
|
|
|
|
child, tagname, data);
|
|
|
|
|
}
|