2011-12-18 15:16:34 +00:00
|
|
|
/* gtkiconview.h
|
|
|
|
* Copyright (C) 2002, 2004 Anders Carlsson <andersca@gnome.org>
|
|
|
|
*
|
|
|
|
* 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/>.
|
2011-12-18 15:16:34 +00:00
|
|
|
*/
|
|
|
|
|
2022-10-07 21:47:28 +00:00
|
|
|
#include "gtk/deprecated/gtkiconview.h"
|
2015-11-10 05:55:57 +00:00
|
|
|
#include "gtk/gtkcssnodeprivate.h"
|
2018-01-02 04:48:32 +00:00
|
|
|
#include "gtk/gtkeventcontrollermotion.h"
|
2019-12-31 22:04:01 +00:00
|
|
|
#include "gtk/gtkdragsource.h"
|
2020-02-29 02:47:17 +00:00
|
|
|
#include "gtk/gtkdroptargetasync.h"
|
|
|
|
#include "gtk/gtkgestureclick.h"
|
2011-12-18 15:16:34 +00:00
|
|
|
|
|
|
|
#ifndef __GTK_ICON_VIEW_PRIVATE_H__
|
|
|
|
#define __GTK_ICON_VIEW_PRIVATE_H__
|
|
|
|
|
|
|
|
typedef struct _GtkIconViewItem GtkIconViewItem;
|
|
|
|
struct _GtkIconViewItem
|
|
|
|
{
|
|
|
|
GdkRectangle cell_area;
|
|
|
|
|
2020-07-24 13:54:49 +00:00
|
|
|
int index;
|
2017-06-27 09:11:57 +00:00
|
|
|
|
2020-07-24 13:54:49 +00:00
|
|
|
int row, col;
|
2011-12-18 15:16:34 +00:00
|
|
|
|
|
|
|
guint selected : 1;
|
|
|
|
guint selected_before_rubberbanding : 1;
|
|
|
|
|
|
|
|
};
|
|
|
|
|
2019-05-28 23:30:02 +00:00
|
|
|
typedef struct _GtkIconViewClass GtkIconViewClass;
|
|
|
|
typedef struct _GtkIconViewPrivate GtkIconViewPrivate;
|
|
|
|
|
|
|
|
struct _GtkIconView
|
|
|
|
{
|
2020-05-07 04:47:25 +00:00
|
|
|
GtkWidget parent;
|
2019-05-28 23:30:02 +00:00
|
|
|
|
|
|
|
GtkIconViewPrivate *priv;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct _GtkIconViewClass
|
|
|
|
{
|
2020-05-07 04:47:25 +00:00
|
|
|
GtkWidgetClass parent_class;
|
2019-05-28 23:30:02 +00:00
|
|
|
|
|
|
|
void (* item_activated) (GtkIconView *icon_view,
|
|
|
|
GtkTreePath *path);
|
|
|
|
void (* selection_changed) (GtkIconView *icon_view);
|
|
|
|
|
|
|
|
void (* select_all) (GtkIconView *icon_view);
|
|
|
|
void (* unselect_all) (GtkIconView *icon_view);
|
|
|
|
void (* select_cursor_item) (GtkIconView *icon_view);
|
|
|
|
void (* toggle_cursor_item) (GtkIconView *icon_view);
|
|
|
|
gboolean (* 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);
|
2019-05-28 23:30:02 +00:00
|
|
|
gboolean (* activate_cursor_item) (GtkIconView *icon_view);
|
|
|
|
};
|
|
|
|
|
2011-12-18 15:16:34 +00:00
|
|
|
struct _GtkIconViewPrivate
|
|
|
|
{
|
|
|
|
GtkCellArea *cell_area;
|
|
|
|
GtkCellAreaContext *cell_area_context;
|
|
|
|
|
|
|
|
gulong add_editable_id;
|
|
|
|
gulong remove_editable_id;
|
2012-05-07 23:53:48 +00:00
|
|
|
gulong context_changed_id;
|
|
|
|
|
|
|
|
GPtrArray *row_contexts;
|
2011-12-18 15:16:34 +00:00
|
|
|
|
2020-07-24 13:54:49 +00:00
|
|
|
int width, height;
|
2017-06-27 09:11:57 +00:00
|
|
|
double mouse_x;
|
|
|
|
double mouse_y;
|
2011-12-18 15:16:34 +00:00
|
|
|
|
|
|
|
GtkSelectionMode selection_mode;
|
|
|
|
|
|
|
|
GList *children;
|
|
|
|
|
|
|
|
GtkTreeModel *model;
|
|
|
|
|
|
|
|
GList *items;
|
|
|
|
|
2018-03-11 12:56:21 +00:00
|
|
|
GtkEventController *key_controller;
|
2017-09-13 15:58:45 +00:00
|
|
|
|
2011-12-18 15:16:34 +00:00
|
|
|
GtkAdjustment *hadjustment;
|
|
|
|
GtkAdjustment *vadjustment;
|
|
|
|
|
2020-07-24 13:54:49 +00:00
|
|
|
int rubberband_x1, rubberband_y1;
|
|
|
|
int rubberband_x2, rubberband_y2;
|
2011-12-18 15:16:34 +00:00
|
|
|
GdkDevice *rubberband_device;
|
2015-11-10 05:55:57 +00:00
|
|
|
GtkCssNode *rubberband_node;
|
2011-12-18 15:16:34 +00:00
|
|
|
|
|
|
|
guint scroll_timeout_id;
|
2020-07-24 13:54:49 +00:00
|
|
|
int scroll_value_diff;
|
|
|
|
int event_last_x, event_last_y;
|
2011-12-18 15:16:34 +00:00
|
|
|
|
|
|
|
GtkIconViewItem *anchor_item;
|
|
|
|
GtkIconViewItem *cursor_item;
|
|
|
|
|
|
|
|
GtkIconViewItem *last_single_clicked;
|
|
|
|
GtkIconViewItem *last_prelight;
|
|
|
|
|
|
|
|
GtkOrientation item_orientation;
|
|
|
|
|
2020-07-24 13:54:49 +00:00
|
|
|
int columns;
|
|
|
|
int item_width;
|
|
|
|
int spacing;
|
|
|
|
int row_spacing;
|
|
|
|
int column_spacing;
|
|
|
|
int margin;
|
|
|
|
int item_padding;
|
2011-12-18 15:16:34 +00:00
|
|
|
|
2020-07-24 13:54:49 +00:00
|
|
|
int text_column;
|
|
|
|
int markup_column;
|
|
|
|
int pixbuf_column;
|
|
|
|
int tooltip_column;
|
2011-12-18 15:16:34 +00:00
|
|
|
|
|
|
|
GtkCellRenderer *pixbuf_cell;
|
|
|
|
GtkCellRenderer *text_cell;
|
|
|
|
|
|
|
|
/* Drag-and-drop. */
|
|
|
|
GdkModifierType start_button_mask;
|
2020-07-24 13:54:49 +00:00
|
|
|
int pressed_button;
|
2020-12-25 17:57:48 +00:00
|
|
|
double press_start_x;
|
|
|
|
double press_start_y;
|
2011-12-18 15:16:34 +00:00
|
|
|
|
2020-01-07 00:10:15 +00:00
|
|
|
GdkContentFormats *source_formats;
|
2020-02-29 02:47:17 +00:00
|
|
|
GtkDropTargetAsync *dest;
|
2020-01-07 22:29:44 +00:00
|
|
|
GtkCssNode *dndnode;
|
2019-12-31 22:04:01 +00:00
|
|
|
|
2020-01-07 00:10:15 +00:00
|
|
|
GdkDrag *drag;
|
|
|
|
|
2011-12-18 15:16:34 +00:00
|
|
|
GdkDragAction source_actions;
|
|
|
|
GdkDragAction dest_actions;
|
|
|
|
|
2020-01-07 00:10:15 +00:00
|
|
|
GtkTreeRowReference *source_item;
|
2011-12-18 15:16:34 +00:00
|
|
|
GtkTreeRowReference *dest_item;
|
|
|
|
GtkIconViewDropPosition dest_pos;
|
|
|
|
|
|
|
|
/* scroll to */
|
|
|
|
GtkTreeRowReference *scroll_to_path;
|
2020-07-24 20:25:56 +00:00
|
|
|
float scroll_to_row_align;
|
|
|
|
float scroll_to_col_align;
|
2011-12-18 15:16:34 +00:00
|
|
|
guint scroll_to_use_align : 1;
|
|
|
|
|
|
|
|
guint source_set : 1;
|
|
|
|
guint dest_set : 1;
|
|
|
|
guint reorderable : 1;
|
|
|
|
guint empty_view_drop :1;
|
2013-01-18 05:59:55 +00:00
|
|
|
guint activate_on_single_click : 1;
|
2011-12-18 15:16:34 +00:00
|
|
|
|
|
|
|
guint modify_selection_pressed : 1;
|
|
|
|
guint extend_selection_pressed : 1;
|
|
|
|
|
|
|
|
guint draw_focus : 1;
|
|
|
|
|
|
|
|
/* GtkScrollablePolicy needs to be checked when
|
|
|
|
* driving the scrollable adjustment values */
|
|
|
|
guint hscroll_policy : 1;
|
|
|
|
guint vscroll_policy : 1;
|
|
|
|
|
|
|
|
guint doing_rubberband : 1;
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
void _gtk_icon_view_set_cell_data (GtkIconView *icon_view,
|
|
|
|
GtkIconViewItem *item);
|
|
|
|
void _gtk_icon_view_set_cursor_item (GtkIconView *icon_view,
|
|
|
|
GtkIconViewItem *item,
|
|
|
|
GtkCellRenderer *cursor_cell);
|
|
|
|
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);
|
|
|
|
void _gtk_icon_view_select_item (GtkIconView *icon_view,
|
|
|
|
GtkIconViewItem *item);
|
|
|
|
void _gtk_icon_view_unselect_item (GtkIconView *icon_view,
|
|
|
|
GtkIconViewItem *item);
|
|
|
|
|
|
|
|
G_END_DECLS
|
|
|
|
|
|
|
|
#endif /* __GTK_ICON_VIEW_PRIVATE_H__ */
|