Move third-party sources to separate sub-directory
[geeqie.git] / src / view-dir.h
1 /*
2  * Copyright (C) 2008 - 2016 The Geeqie Team
3  *
4  * Author: Laurent Monin
5  *
6  * This program is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation; either version 2 of the License, or
9  * (at your option) any later version.
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License along
17  * with this program; if not, write to the Free Software Foundation, Inc.,
18  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
19  */
20
21 #ifndef VIEW_DIR_H
22 #define VIEW_DIR_H
23
24 #include <gdk-pixbuf/gdk-pixbuf.h>
25 #include <gdk/gdk.h>
26 #include <glib.h>
27 #include <gtk/gtk.h>
28
29 #include "typedefs.h"
30
31 struct FileData;
32 struct LayoutWindow;
33
34 enum {
35         DIR_COLUMN_POINTER = 0,
36         DIR_COLUMN_ICON,
37         DIR_COLUMN_NAME,
38         DIR_COLUMN_COLOR,
39         DIR_COLUMN_DATE,
40         DIR_COLUMN_LINK,
41         DIR_COLUMN_COUNT
42 };
43
44 struct PixmapFolders
45 {
46         GdkPixbuf *close;
47         GdkPixbuf *open;
48         GdkPixbuf *deny;
49         GdkPixbuf *parent;
50         GdkPixbuf *link;
51         GdkPixbuf *read_only;
52 };
53
54 struct ViewDir
55 {
56         DirViewType type;
57         gpointer info;
58
59         GtkWidget *widget;
60         GtkWidget *view;
61
62         FileData *dir_fd;
63
64         FileData *click_fd;
65
66         FileData *drop_fd;
67         GList *drop_list;
68         guint drop_scroll_id; /**< event source id */
69
70         /* func list */
71         void (*select_func)(ViewDir *vd, FileData *fd, gpointer data);
72         gpointer select_data;
73
74         void (*dnd_drop_update_func)(ViewDir *vd);
75         void (*dnd_drop_leave_func)(ViewDir *vd);
76
77         LayoutWindow *layout;
78
79         GtkWidget *popup;
80
81         PixmapFolders *pf;
82 };
83
84 ViewDir *vd_new(LayoutWindow *lw);
85
86 void vd_set_select_func(ViewDir *vdl, void (*func)(ViewDir *vdl, FileData *fd, gpointer data), gpointer data);
87
88 gboolean vd_set_fd(ViewDir *vdl, FileData *dir_fd);
89 void vd_refresh(ViewDir *vdl);
90 gboolean vd_find_row(ViewDir *vd, FileData *fd, GtkTreeIter *iter);
91
92 void vd_color_set(ViewDir *vd, FileData *fd, gint color_set);
93 void vd_popup_destroy_cb(GtkWidget *widget, gpointer data);
94
95 GtkWidget *vd_drop_menu(ViewDir *vd, gint active);
96 GtkWidget *vd_pop_menu(ViewDir *vd, FileData *fd);
97
98 void vd_new_folder(ViewDir *vd, FileData *dir_fd);
99
100 void vd_dnd_drop_scroll_cancel(ViewDir *vd);
101 void vd_dnd_init(ViewDir *vd);
102
103 void vd_activate_cb(GtkTreeView *tview, GtkTreePath *tpath, GtkTreeViewColumn *column, gpointer data);
104 void vd_color_cb(GtkTreeViewColumn *tree_column, GtkCellRenderer *cell, GtkTreeModel *tree_model, GtkTreeIter *iter, gpointer data);
105
106 gboolean vd_release_cb(GtkWidget *widget, GdkEventButton *bevent, gpointer data);
107 gboolean vd_press_key_cb(GtkWidget *widget, GdkEventKey *event, gpointer data);
108 gboolean vd_press_cb(GtkWidget *widget,  GdkEventButton *bevent, gpointer data);
109
110 #endif
111 /* vim: set shiftwidth=8 softtabstop=0 cindent cinoptions={1s: */