Mercurial > geeqie.yaz
annotate src/view_file.c @ 601:93c6dc4c537b
Add a way to invert the current selection.
An item labeled "Invert selection" was added to the Select submenu
in the main menu.
author | zas_ |
---|---|
date | Wed, 07 May 2008 22:48:30 +0000 |
parents | 3da75054d4e1 |
children | 6e9413e92be5 |
rev | line source |
---|---|
554
2da72a136070
Prepare merging of some parts of view_file_list and view_file_icon and
zas_
parents:
diff
changeset
|
1 /* |
2da72a136070
Prepare merging of some parts of view_file_list and view_file_icon and
zas_
parents:
diff
changeset
|
2 * Geeqie |
2da72a136070
Prepare merging of some parts of view_file_list and view_file_icon and
zas_
parents:
diff
changeset
|
3 * Copyright (C) 2008 The Geeqie Team |
2da72a136070
Prepare merging of some parts of view_file_list and view_file_icon and
zas_
parents:
diff
changeset
|
4 * |
2da72a136070
Prepare merging of some parts of view_file_list and view_file_icon and
zas_
parents:
diff
changeset
|
5 * Author: Laurent Monin |
2da72a136070
Prepare merging of some parts of view_file_list and view_file_icon and
zas_
parents:
diff
changeset
|
6 * |
2da72a136070
Prepare merging of some parts of view_file_list and view_file_icon and
zas_
parents:
diff
changeset
|
7 * This software is released under the GNU General Public License (GNU GPL). |
2da72a136070
Prepare merging of some parts of view_file_list and view_file_icon and
zas_
parents:
diff
changeset
|
8 * Please read the included file COPYING for more information. |
2da72a136070
Prepare merging of some parts of view_file_list and view_file_icon and
zas_
parents:
diff
changeset
|
9 * This software comes with no warranty of any kind, use at your own risk! |
2da72a136070
Prepare merging of some parts of view_file_list and view_file_icon and
zas_
parents:
diff
changeset
|
10 */ |
2da72a136070
Prepare merging of some parts of view_file_list and view_file_icon and
zas_
parents:
diff
changeset
|
11 |
2da72a136070
Prepare merging of some parts of view_file_list and view_file_icon and
zas_
parents:
diff
changeset
|
12 #include "main.h" |
2da72a136070
Prepare merging of some parts of view_file_list and view_file_icon and
zas_
parents:
diff
changeset
|
13 #include "view_file.h" |
2da72a136070
Prepare merging of some parts of view_file_list and view_file_icon and
zas_
parents:
diff
changeset
|
14 |
2da72a136070
Prepare merging of some parts of view_file_list and view_file_icon and
zas_
parents:
diff
changeset
|
15 #include "debug.h" |
2da72a136070
Prepare merging of some parts of view_file_list and view_file_icon and
zas_
parents:
diff
changeset
|
16 #include "view_file_list.h" |
2da72a136070
Prepare merging of some parts of view_file_list and view_file_icon and
zas_
parents:
diff
changeset
|
17 #include "view_file_icon.h" |
2da72a136070
Prepare merging of some parts of view_file_list and view_file_icon and
zas_
parents:
diff
changeset
|
18 |
560 | 19 |
573
2996f1bbc305
Drop ViewFileList, use ViewFile and ViewFileInfoList instead.
zas_
parents:
572
diff
changeset
|
20 /* |
2996f1bbc305
Drop ViewFileList, use ViewFile and ViewFileInfoList instead.
zas_
parents:
572
diff
changeset
|
21 *----------------------------------------------------------------------------- |
2996f1bbc305
Drop ViewFileList, use ViewFile and ViewFileInfoList instead.
zas_
parents:
572
diff
changeset
|
22 * misc |
2996f1bbc305
Drop ViewFileList, use ViewFile and ViewFileInfoList instead.
zas_
parents:
572
diff
changeset
|
23 *----------------------------------------------------------------------------- |
2996f1bbc305
Drop ViewFileList, use ViewFile and ViewFileInfoList instead.
zas_
parents:
572
diff
changeset
|
24 */ |
2996f1bbc305
Drop ViewFileList, use ViewFile and ViewFileInfoList instead.
zas_
parents:
572
diff
changeset
|
25 |
2996f1bbc305
Drop ViewFileList, use ViewFile and ViewFileInfoList instead.
zas_
parents:
572
diff
changeset
|
26 void vf_sort_set(ViewFile *vf, SortType type, gint ascend) |
2996f1bbc305
Drop ViewFileList, use ViewFile and ViewFileInfoList instead.
zas_
parents:
572
diff
changeset
|
27 { |
2996f1bbc305
Drop ViewFileList, use ViewFile and ViewFileInfoList instead.
zas_
parents:
572
diff
changeset
|
28 switch(vf->type) |
2996f1bbc305
Drop ViewFileList, use ViewFile and ViewFileInfoList instead.
zas_
parents:
572
diff
changeset
|
29 { |
2996f1bbc305
Drop ViewFileList, use ViewFile and ViewFileInfoList instead.
zas_
parents:
572
diff
changeset
|
30 case FILEVIEW_LIST: vflist_sort_set(vf, type, ascend); break; |
574
3da75054d4e1
Drop ViewFileIcon, use ViewFile and ViewFileInfoIcon instead.
zas_
parents:
573
diff
changeset
|
31 case FILEVIEW_ICON: vficon_sort_set(vf, type, ascend); break; |
573
2996f1bbc305
Drop ViewFileList, use ViewFile and ViewFileInfoList instead.
zas_
parents:
572
diff
changeset
|
32 } |
2996f1bbc305
Drop ViewFileList, use ViewFile and ViewFileInfoList instead.
zas_
parents:
572
diff
changeset
|
33 } |
2996f1bbc305
Drop ViewFileList, use ViewFile and ViewFileInfoList instead.
zas_
parents:
572
diff
changeset
|
34 |
2996f1bbc305
Drop ViewFileList, use ViewFile and ViewFileInfoList instead.
zas_
parents:
572
diff
changeset
|
35 /* |
2996f1bbc305
Drop ViewFileList, use ViewFile and ViewFileInfoList instead.
zas_
parents:
572
diff
changeset
|
36 *----------------------------------------------------------------------------- |
2996f1bbc305
Drop ViewFileList, use ViewFile and ViewFileInfoList instead.
zas_
parents:
572
diff
changeset
|
37 * row stuff |
2996f1bbc305
Drop ViewFileList, use ViewFile and ViewFileInfoList instead.
zas_
parents:
572
diff
changeset
|
38 *----------------------------------------------------------------------------- |
2996f1bbc305
Drop ViewFileList, use ViewFile and ViewFileInfoList instead.
zas_
parents:
572
diff
changeset
|
39 */ |
560 | 40 |
573
2996f1bbc305
Drop ViewFileList, use ViewFile and ViewFileInfoList instead.
zas_
parents:
572
diff
changeset
|
41 FileData *vf_index_get_data(ViewFile *vf, gint row) |
2996f1bbc305
Drop ViewFileList, use ViewFile and ViewFileInfoList instead.
zas_
parents:
572
diff
changeset
|
42 { |
2996f1bbc305
Drop ViewFileList, use ViewFile and ViewFileInfoList instead.
zas_
parents:
572
diff
changeset
|
43 FileData *fd = NULL; |
2996f1bbc305
Drop ViewFileList, use ViewFile and ViewFileInfoList instead.
zas_
parents:
572
diff
changeset
|
44 |
2996f1bbc305
Drop ViewFileList, use ViewFile and ViewFileInfoList instead.
zas_
parents:
572
diff
changeset
|
45 switch(vf->type) |
2996f1bbc305
Drop ViewFileList, use ViewFile and ViewFileInfoList instead.
zas_
parents:
572
diff
changeset
|
46 { |
2996f1bbc305
Drop ViewFileList, use ViewFile and ViewFileInfoList instead.
zas_
parents:
572
diff
changeset
|
47 case FILEVIEW_LIST: fd = vflist_index_get_data(vf, row); break; |
574
3da75054d4e1
Drop ViewFileIcon, use ViewFile and ViewFileInfoIcon instead.
zas_
parents:
573
diff
changeset
|
48 case FILEVIEW_ICON: fd = vficon_index_get_data(vf, row); break; |
573
2996f1bbc305
Drop ViewFileList, use ViewFile and ViewFileInfoList instead.
zas_
parents:
572
diff
changeset
|
49 } |
560 | 50 |
573
2996f1bbc305
Drop ViewFileList, use ViewFile and ViewFileInfoList instead.
zas_
parents:
572
diff
changeset
|
51 return fd; |
2996f1bbc305
Drop ViewFileList, use ViewFile and ViewFileInfoList instead.
zas_
parents:
572
diff
changeset
|
52 } |
2996f1bbc305
Drop ViewFileList, use ViewFile and ViewFileInfoList instead.
zas_
parents:
572
diff
changeset
|
53 |
2996f1bbc305
Drop ViewFileList, use ViewFile and ViewFileInfoList instead.
zas_
parents:
572
diff
changeset
|
54 gchar *vf_index_get_path(ViewFile *vf, gint row) |
2996f1bbc305
Drop ViewFileList, use ViewFile and ViewFileInfoList instead.
zas_
parents:
572
diff
changeset
|
55 { |
2996f1bbc305
Drop ViewFileList, use ViewFile and ViewFileInfoList instead.
zas_
parents:
572
diff
changeset
|
56 gchar *path = NULL; |
2996f1bbc305
Drop ViewFileList, use ViewFile and ViewFileInfoList instead.
zas_
parents:
572
diff
changeset
|
57 |
2996f1bbc305
Drop ViewFileList, use ViewFile and ViewFileInfoList instead.
zas_
parents:
572
diff
changeset
|
58 switch(vf->type) |
2996f1bbc305
Drop ViewFileList, use ViewFile and ViewFileInfoList instead.
zas_
parents:
572
diff
changeset
|
59 { |
2996f1bbc305
Drop ViewFileList, use ViewFile and ViewFileInfoList instead.
zas_
parents:
572
diff
changeset
|
60 case FILEVIEW_LIST: path = vflist_index_get_path(vf, row); break; |
574
3da75054d4e1
Drop ViewFileIcon, use ViewFile and ViewFileInfoIcon instead.
zas_
parents:
573
diff
changeset
|
61 case FILEVIEW_ICON: path = vficon_index_get_path(vf, row); break; |
573
2996f1bbc305
Drop ViewFileList, use ViewFile and ViewFileInfoList instead.
zas_
parents:
572
diff
changeset
|
62 } |
560 | 63 |
573
2996f1bbc305
Drop ViewFileList, use ViewFile and ViewFileInfoList instead.
zas_
parents:
572
diff
changeset
|
64 return path; |
2996f1bbc305
Drop ViewFileList, use ViewFile and ViewFileInfoList instead.
zas_
parents:
572
diff
changeset
|
65 } |
2996f1bbc305
Drop ViewFileList, use ViewFile and ViewFileInfoList instead.
zas_
parents:
572
diff
changeset
|
66 |
2996f1bbc305
Drop ViewFileList, use ViewFile and ViewFileInfoList instead.
zas_
parents:
572
diff
changeset
|
67 gint vf_index_by_path(ViewFile *vf, const gchar *path) |
2996f1bbc305
Drop ViewFileList, use ViewFile and ViewFileInfoList instead.
zas_
parents:
572
diff
changeset
|
68 { |
2996f1bbc305
Drop ViewFileList, use ViewFile and ViewFileInfoList instead.
zas_
parents:
572
diff
changeset
|
69 gint index = -1; |
560 | 70 |
573
2996f1bbc305
Drop ViewFileList, use ViewFile and ViewFileInfoList instead.
zas_
parents:
572
diff
changeset
|
71 switch(vf->type) |
2996f1bbc305
Drop ViewFileList, use ViewFile and ViewFileInfoList instead.
zas_
parents:
572
diff
changeset
|
72 { |
2996f1bbc305
Drop ViewFileList, use ViewFile and ViewFileInfoList instead.
zas_
parents:
572
diff
changeset
|
73 case FILEVIEW_LIST: index = vflist_index_by_path(vf, path); break; |
574
3da75054d4e1
Drop ViewFileIcon, use ViewFile and ViewFileInfoIcon instead.
zas_
parents:
573
diff
changeset
|
74 case FILEVIEW_ICON: index = vficon_index_by_path(vf, path); break; |
573
2996f1bbc305
Drop ViewFileList, use ViewFile and ViewFileInfoList instead.
zas_
parents:
572
diff
changeset
|
75 } |
2996f1bbc305
Drop ViewFileList, use ViewFile and ViewFileInfoList instead.
zas_
parents:
572
diff
changeset
|
76 |
2996f1bbc305
Drop ViewFileList, use ViewFile and ViewFileInfoList instead.
zas_
parents:
572
diff
changeset
|
77 return index; |
2996f1bbc305
Drop ViewFileList, use ViewFile and ViewFileInfoList instead.
zas_
parents:
572
diff
changeset
|
78 } |
2996f1bbc305
Drop ViewFileList, use ViewFile and ViewFileInfoList instead.
zas_
parents:
572
diff
changeset
|
79 |
2996f1bbc305
Drop ViewFileList, use ViewFile and ViewFileInfoList instead.
zas_
parents:
572
diff
changeset
|
80 gint vf_count(ViewFile *vf, gint64 *bytes) |
2996f1bbc305
Drop ViewFileList, use ViewFile and ViewFileInfoList instead.
zas_
parents:
572
diff
changeset
|
81 { |
2996f1bbc305
Drop ViewFileList, use ViewFile and ViewFileInfoList instead.
zas_
parents:
572
diff
changeset
|
82 gint count = 0; |
560 | 83 |
573
2996f1bbc305
Drop ViewFileList, use ViewFile and ViewFileInfoList instead.
zas_
parents:
572
diff
changeset
|
84 switch(vf->type) |
2996f1bbc305
Drop ViewFileList, use ViewFile and ViewFileInfoList instead.
zas_
parents:
572
diff
changeset
|
85 { |
2996f1bbc305
Drop ViewFileList, use ViewFile and ViewFileInfoList instead.
zas_
parents:
572
diff
changeset
|
86 case FILEVIEW_LIST: count = vflist_count(vf, bytes); break; |
574
3da75054d4e1
Drop ViewFileIcon, use ViewFile and ViewFileInfoIcon instead.
zas_
parents:
573
diff
changeset
|
87 case FILEVIEW_ICON: count = vficon_count(vf, bytes); break; |
573
2996f1bbc305
Drop ViewFileList, use ViewFile and ViewFileInfoList instead.
zas_
parents:
572
diff
changeset
|
88 } |
2996f1bbc305
Drop ViewFileList, use ViewFile and ViewFileInfoList instead.
zas_
parents:
572
diff
changeset
|
89 |
2996f1bbc305
Drop ViewFileList, use ViewFile and ViewFileInfoList instead.
zas_
parents:
572
diff
changeset
|
90 return count; |
2996f1bbc305
Drop ViewFileList, use ViewFile and ViewFileInfoList instead.
zas_
parents:
572
diff
changeset
|
91 } |
2996f1bbc305
Drop ViewFileList, use ViewFile and ViewFileInfoList instead.
zas_
parents:
572
diff
changeset
|
92 |
2996f1bbc305
Drop ViewFileList, use ViewFile and ViewFileInfoList instead.
zas_
parents:
572
diff
changeset
|
93 GList *vf_get_list(ViewFile *vf) |
2996f1bbc305
Drop ViewFileList, use ViewFile and ViewFileInfoList instead.
zas_
parents:
572
diff
changeset
|
94 { |
2996f1bbc305
Drop ViewFileList, use ViewFile and ViewFileInfoList instead.
zas_
parents:
572
diff
changeset
|
95 GList *list = NULL; |
560 | 96 |
573
2996f1bbc305
Drop ViewFileList, use ViewFile and ViewFileInfoList instead.
zas_
parents:
572
diff
changeset
|
97 switch(vf->type) |
2996f1bbc305
Drop ViewFileList, use ViewFile and ViewFileInfoList instead.
zas_
parents:
572
diff
changeset
|
98 { |
2996f1bbc305
Drop ViewFileList, use ViewFile and ViewFileInfoList instead.
zas_
parents:
572
diff
changeset
|
99 case FILEVIEW_LIST: list = vflist_get_list(vf); break; |
574
3da75054d4e1
Drop ViewFileIcon, use ViewFile and ViewFileInfoIcon instead.
zas_
parents:
573
diff
changeset
|
100 case FILEVIEW_ICON: list = vficon_get_list(vf); break; |
573
2996f1bbc305
Drop ViewFileList, use ViewFile and ViewFileInfoList instead.
zas_
parents:
572
diff
changeset
|
101 } |
560 | 102 |
573
2996f1bbc305
Drop ViewFileList, use ViewFile and ViewFileInfoList instead.
zas_
parents:
572
diff
changeset
|
103 return list; |
2996f1bbc305
Drop ViewFileList, use ViewFile and ViewFileInfoList instead.
zas_
parents:
572
diff
changeset
|
104 } |
2996f1bbc305
Drop ViewFileList, use ViewFile and ViewFileInfoList instead.
zas_
parents:
572
diff
changeset
|
105 |
2996f1bbc305
Drop ViewFileList, use ViewFile and ViewFileInfoList instead.
zas_
parents:
572
diff
changeset
|
106 |
2996f1bbc305
Drop ViewFileList, use ViewFile and ViewFileInfoList instead.
zas_
parents:
572
diff
changeset
|
107 /* |
2996f1bbc305
Drop ViewFileList, use ViewFile and ViewFileInfoList instead.
zas_
parents:
572
diff
changeset
|
108 *------------------------------------------------------------------- |
2996f1bbc305
Drop ViewFileList, use ViewFile and ViewFileInfoList instead.
zas_
parents:
572
diff
changeset
|
109 * keyboard |
2996f1bbc305
Drop ViewFileList, use ViewFile and ViewFileInfoList instead.
zas_
parents:
572
diff
changeset
|
110 *------------------------------------------------------------------- |
2996f1bbc305
Drop ViewFileList, use ViewFile and ViewFileInfoList instead.
zas_
parents:
572
diff
changeset
|
111 */ |
572 | 112 |
113 static gint vf_press_key_cb(GtkWidget *widget, GdkEventKey *event, gpointer data) | |
114 { | |
573
2996f1bbc305
Drop ViewFileList, use ViewFile and ViewFileInfoList instead.
zas_
parents:
572
diff
changeset
|
115 ViewFile *vf = data; |
572 | 116 gint ret = FALSE; |
117 | |
573
2996f1bbc305
Drop ViewFileList, use ViewFile and ViewFileInfoList instead.
zas_
parents:
572
diff
changeset
|
118 switch(vf->type) |
2996f1bbc305
Drop ViewFileList, use ViewFile and ViewFileInfoList instead.
zas_
parents:
572
diff
changeset
|
119 { |
2996f1bbc305
Drop ViewFileList, use ViewFile and ViewFileInfoList instead.
zas_
parents:
572
diff
changeset
|
120 case FILEVIEW_LIST: ret = vflist_press_key_cb(widget, event, data); break; |
574
3da75054d4e1
Drop ViewFileIcon, use ViewFile and ViewFileInfoIcon instead.
zas_
parents:
573
diff
changeset
|
121 case FILEVIEW_ICON: ret = vficon_press_key_cb(widget, event, data); break; |
573
2996f1bbc305
Drop ViewFileList, use ViewFile and ViewFileInfoList instead.
zas_
parents:
572
diff
changeset
|
122 } |
2996f1bbc305
Drop ViewFileList, use ViewFile and ViewFileInfoList instead.
zas_
parents:
572
diff
changeset
|
123 |
2996f1bbc305
Drop ViewFileList, use ViewFile and ViewFileInfoList instead.
zas_
parents:
572
diff
changeset
|
124 return ret; |
2996f1bbc305
Drop ViewFileList, use ViewFile and ViewFileInfoList instead.
zas_
parents:
572
diff
changeset
|
125 } |
2996f1bbc305
Drop ViewFileList, use ViewFile and ViewFileInfoList instead.
zas_
parents:
572
diff
changeset
|
126 |
2996f1bbc305
Drop ViewFileList, use ViewFile and ViewFileInfoList instead.
zas_
parents:
572
diff
changeset
|
127 /* |
2996f1bbc305
Drop ViewFileList, use ViewFile and ViewFileInfoList instead.
zas_
parents:
572
diff
changeset
|
128 *------------------------------------------------------------------- |
2996f1bbc305
Drop ViewFileList, use ViewFile and ViewFileInfoList instead.
zas_
parents:
572
diff
changeset
|
129 * mouse |
2996f1bbc305
Drop ViewFileList, use ViewFile and ViewFileInfoList instead.
zas_
parents:
572
diff
changeset
|
130 *------------------------------------------------------------------- |
2996f1bbc305
Drop ViewFileList, use ViewFile and ViewFileInfoList instead.
zas_
parents:
572
diff
changeset
|
131 */ |
2996f1bbc305
Drop ViewFileList, use ViewFile and ViewFileInfoList instead.
zas_
parents:
572
diff
changeset
|
132 |
2996f1bbc305
Drop ViewFileList, use ViewFile and ViewFileInfoList instead.
zas_
parents:
572
diff
changeset
|
133 static gint vf_press_cb(GtkWidget *widget, GdkEventButton *bevent, gpointer data) |
2996f1bbc305
Drop ViewFileList, use ViewFile and ViewFileInfoList instead.
zas_
parents:
572
diff
changeset
|
134 { |
2996f1bbc305
Drop ViewFileList, use ViewFile and ViewFileInfoList instead.
zas_
parents:
572
diff
changeset
|
135 ViewFile *vf = data; |
2996f1bbc305
Drop ViewFileList, use ViewFile and ViewFileInfoList instead.
zas_
parents:
572
diff
changeset
|
136 gint ret = FALSE; |
2996f1bbc305
Drop ViewFileList, use ViewFile and ViewFileInfoList instead.
zas_
parents:
572
diff
changeset
|
137 |
2996f1bbc305
Drop ViewFileList, use ViewFile and ViewFileInfoList instead.
zas_
parents:
572
diff
changeset
|
138 switch(vf->type) |
2996f1bbc305
Drop ViewFileList, use ViewFile and ViewFileInfoList instead.
zas_
parents:
572
diff
changeset
|
139 { |
2996f1bbc305
Drop ViewFileList, use ViewFile and ViewFileInfoList instead.
zas_
parents:
572
diff
changeset
|
140 case FILEVIEW_LIST: ret = vflist_press_cb(widget, bevent, data); break; |
574
3da75054d4e1
Drop ViewFileIcon, use ViewFile and ViewFileInfoIcon instead.
zas_
parents:
573
diff
changeset
|
141 case FILEVIEW_ICON: ret = vficon_press_cb(widget, bevent, data); break; |
573
2996f1bbc305
Drop ViewFileList, use ViewFile and ViewFileInfoList instead.
zas_
parents:
572
diff
changeset
|
142 } |
2996f1bbc305
Drop ViewFileList, use ViewFile and ViewFileInfoList instead.
zas_
parents:
572
diff
changeset
|
143 |
572 | 144 return ret; |
145 } | |
146 | |
573
2996f1bbc305
Drop ViewFileList, use ViewFile and ViewFileInfoList instead.
zas_
parents:
572
diff
changeset
|
147 static gint vf_release_cb(GtkWidget *widget, GdkEventButton *bevent, gpointer data) |
572 | 148 { |
573
2996f1bbc305
Drop ViewFileList, use ViewFile and ViewFileInfoList instead.
zas_
parents:
572
diff
changeset
|
149 ViewFile *vf = data; |
572 | 150 gint ret = FALSE; |
151 | |
573
2996f1bbc305
Drop ViewFileList, use ViewFile and ViewFileInfoList instead.
zas_
parents:
572
diff
changeset
|
152 switch(vf->type) |
2996f1bbc305
Drop ViewFileList, use ViewFile and ViewFileInfoList instead.
zas_
parents:
572
diff
changeset
|
153 { |
2996f1bbc305
Drop ViewFileList, use ViewFile and ViewFileInfoList instead.
zas_
parents:
572
diff
changeset
|
154 case FILEVIEW_LIST: ret = vflist_release_cb(widget, bevent, data); break; |
574
3da75054d4e1
Drop ViewFileIcon, use ViewFile and ViewFileInfoIcon instead.
zas_
parents:
573
diff
changeset
|
155 case FILEVIEW_ICON: ret = vficon_release_cb(widget, bevent, data); break; |
573
2996f1bbc305
Drop ViewFileList, use ViewFile and ViewFileInfoList instead.
zas_
parents:
572
diff
changeset
|
156 } |
2996f1bbc305
Drop ViewFileList, use ViewFile and ViewFileInfoList instead.
zas_
parents:
572
diff
changeset
|
157 |
572 | 158 return ret; |
159 } | |
160 | |
573
2996f1bbc305
Drop ViewFileList, use ViewFile and ViewFileInfoList instead.
zas_
parents:
572
diff
changeset
|
161 |
2996f1bbc305
Drop ViewFileList, use ViewFile and ViewFileInfoList instead.
zas_
parents:
572
diff
changeset
|
162 /* |
2996f1bbc305
Drop ViewFileList, use ViewFile and ViewFileInfoList instead.
zas_
parents:
572
diff
changeset
|
163 *----------------------------------------------------------------------------- |
2996f1bbc305
Drop ViewFileList, use ViewFile and ViewFileInfoList instead.
zas_
parents:
572
diff
changeset
|
164 * selections |
2996f1bbc305
Drop ViewFileList, use ViewFile and ViewFileInfoList instead.
zas_
parents:
572
diff
changeset
|
165 *----------------------------------------------------------------------------- |
2996f1bbc305
Drop ViewFileList, use ViewFile and ViewFileInfoList instead.
zas_
parents:
572
diff
changeset
|
166 */ |
2996f1bbc305
Drop ViewFileList, use ViewFile and ViewFileInfoList instead.
zas_
parents:
572
diff
changeset
|
167 |
2996f1bbc305
Drop ViewFileList, use ViewFile and ViewFileInfoList instead.
zas_
parents:
572
diff
changeset
|
168 gint vf_selection_count(ViewFile *vf, gint64 *bytes) |
2996f1bbc305
Drop ViewFileList, use ViewFile and ViewFileInfoList instead.
zas_
parents:
572
diff
changeset
|
169 { |
2996f1bbc305
Drop ViewFileList, use ViewFile and ViewFileInfoList instead.
zas_
parents:
572
diff
changeset
|
170 gint count = 0; |
2996f1bbc305
Drop ViewFileList, use ViewFile and ViewFileInfoList instead.
zas_
parents:
572
diff
changeset
|
171 |
2996f1bbc305
Drop ViewFileList, use ViewFile and ViewFileInfoList instead.
zas_
parents:
572
diff
changeset
|
172 switch(vf->type) |
2996f1bbc305
Drop ViewFileList, use ViewFile and ViewFileInfoList instead.
zas_
parents:
572
diff
changeset
|
173 { |
2996f1bbc305
Drop ViewFileList, use ViewFile and ViewFileInfoList instead.
zas_
parents:
572
diff
changeset
|
174 case FILEVIEW_LIST: count = vflist_selection_count(vf, bytes); break; |
574
3da75054d4e1
Drop ViewFileIcon, use ViewFile and ViewFileInfoIcon instead.
zas_
parents:
573
diff
changeset
|
175 case FILEVIEW_ICON: count = vficon_selection_count(vf, bytes); break; |
573
2996f1bbc305
Drop ViewFileList, use ViewFile and ViewFileInfoList instead.
zas_
parents:
572
diff
changeset
|
176 } |
2996f1bbc305
Drop ViewFileList, use ViewFile and ViewFileInfoList instead.
zas_
parents:
572
diff
changeset
|
177 |
2996f1bbc305
Drop ViewFileList, use ViewFile and ViewFileInfoList instead.
zas_
parents:
572
diff
changeset
|
178 return count; |
2996f1bbc305
Drop ViewFileList, use ViewFile and ViewFileInfoList instead.
zas_
parents:
572
diff
changeset
|
179 } |
2996f1bbc305
Drop ViewFileList, use ViewFile and ViewFileInfoList instead.
zas_
parents:
572
diff
changeset
|
180 |
2996f1bbc305
Drop ViewFileList, use ViewFile and ViewFileInfoList instead.
zas_
parents:
572
diff
changeset
|
181 GList *vf_selection_get_list(ViewFile *vf) |
2996f1bbc305
Drop ViewFileList, use ViewFile and ViewFileInfoList instead.
zas_
parents:
572
diff
changeset
|
182 { |
2996f1bbc305
Drop ViewFileList, use ViewFile and ViewFileInfoList instead.
zas_
parents:
572
diff
changeset
|
183 GList *list = NULL; |
2996f1bbc305
Drop ViewFileList, use ViewFile and ViewFileInfoList instead.
zas_
parents:
572
diff
changeset
|
184 |
2996f1bbc305
Drop ViewFileList, use ViewFile and ViewFileInfoList instead.
zas_
parents:
572
diff
changeset
|
185 switch(vf->type) |
2996f1bbc305
Drop ViewFileList, use ViewFile and ViewFileInfoList instead.
zas_
parents:
572
diff
changeset
|
186 { |
2996f1bbc305
Drop ViewFileList, use ViewFile and ViewFileInfoList instead.
zas_
parents:
572
diff
changeset
|
187 case FILEVIEW_LIST: list = vflist_selection_get_list(vf); break; |
574
3da75054d4e1
Drop ViewFileIcon, use ViewFile and ViewFileInfoIcon instead.
zas_
parents:
573
diff
changeset
|
188 case FILEVIEW_ICON: list = vficon_selection_get_list(vf); break; |
573
2996f1bbc305
Drop ViewFileList, use ViewFile and ViewFileInfoList instead.
zas_
parents:
572
diff
changeset
|
189 } |
2996f1bbc305
Drop ViewFileList, use ViewFile and ViewFileInfoList instead.
zas_
parents:
572
diff
changeset
|
190 |
2996f1bbc305
Drop ViewFileList, use ViewFile and ViewFileInfoList instead.
zas_
parents:
572
diff
changeset
|
191 return list; |
2996f1bbc305
Drop ViewFileList, use ViewFile and ViewFileInfoList instead.
zas_
parents:
572
diff
changeset
|
192 } |
2996f1bbc305
Drop ViewFileList, use ViewFile and ViewFileInfoList instead.
zas_
parents:
572
diff
changeset
|
193 |
2996f1bbc305
Drop ViewFileList, use ViewFile and ViewFileInfoList instead.
zas_
parents:
572
diff
changeset
|
194 GList *vf_selection_get_list_by_index(ViewFile *vf) |
2996f1bbc305
Drop ViewFileList, use ViewFile and ViewFileInfoList instead.
zas_
parents:
572
diff
changeset
|
195 { |
2996f1bbc305
Drop ViewFileList, use ViewFile and ViewFileInfoList instead.
zas_
parents:
572
diff
changeset
|
196 GList *list = NULL; |
2996f1bbc305
Drop ViewFileList, use ViewFile and ViewFileInfoList instead.
zas_
parents:
572
diff
changeset
|
197 |
2996f1bbc305
Drop ViewFileList, use ViewFile and ViewFileInfoList instead.
zas_
parents:
572
diff
changeset
|
198 switch(vf->type) |
2996f1bbc305
Drop ViewFileList, use ViewFile and ViewFileInfoList instead.
zas_
parents:
572
diff
changeset
|
199 { |
2996f1bbc305
Drop ViewFileList, use ViewFile and ViewFileInfoList instead.
zas_
parents:
572
diff
changeset
|
200 case FILEVIEW_LIST: list = vflist_selection_get_list_by_index(vf); break; |
574
3da75054d4e1
Drop ViewFileIcon, use ViewFile and ViewFileInfoIcon instead.
zas_
parents:
573
diff
changeset
|
201 case FILEVIEW_ICON: list = vficon_selection_get_list_by_index(vf); break; |
573
2996f1bbc305
Drop ViewFileList, use ViewFile and ViewFileInfoList instead.
zas_
parents:
572
diff
changeset
|
202 } |
2996f1bbc305
Drop ViewFileList, use ViewFile and ViewFileInfoList instead.
zas_
parents:
572
diff
changeset
|
203 |
2996f1bbc305
Drop ViewFileList, use ViewFile and ViewFileInfoList instead.
zas_
parents:
572
diff
changeset
|
204 return list; |
2996f1bbc305
Drop ViewFileList, use ViewFile and ViewFileInfoList instead.
zas_
parents:
572
diff
changeset
|
205 } |
2996f1bbc305
Drop ViewFileList, use ViewFile and ViewFileInfoList instead.
zas_
parents:
572
diff
changeset
|
206 |
2996f1bbc305
Drop ViewFileList, use ViewFile and ViewFileInfoList instead.
zas_
parents:
572
diff
changeset
|
207 void vf_select_all(ViewFile *vf) |
572 | 208 { |
573
2996f1bbc305
Drop ViewFileList, use ViewFile and ViewFileInfoList instead.
zas_
parents:
572
diff
changeset
|
209 switch(vf->type) |
2996f1bbc305
Drop ViewFileList, use ViewFile and ViewFileInfoList instead.
zas_
parents:
572
diff
changeset
|
210 { |
2996f1bbc305
Drop ViewFileList, use ViewFile and ViewFileInfoList instead.
zas_
parents:
572
diff
changeset
|
211 case FILEVIEW_LIST: vflist_select_all(vf); break; |
574
3da75054d4e1
Drop ViewFileIcon, use ViewFile and ViewFileInfoIcon instead.
zas_
parents:
573
diff
changeset
|
212 case FILEVIEW_ICON: vficon_select_all(vf); break; |
573
2996f1bbc305
Drop ViewFileList, use ViewFile and ViewFileInfoList instead.
zas_
parents:
572
diff
changeset
|
213 } |
2996f1bbc305
Drop ViewFileList, use ViewFile and ViewFileInfoList instead.
zas_
parents:
572
diff
changeset
|
214 } |
2996f1bbc305
Drop ViewFileList, use ViewFile and ViewFileInfoList instead.
zas_
parents:
572
diff
changeset
|
215 |
2996f1bbc305
Drop ViewFileList, use ViewFile and ViewFileInfoList instead.
zas_
parents:
572
diff
changeset
|
216 void vf_select_none(ViewFile *vf) |
2996f1bbc305
Drop ViewFileList, use ViewFile and ViewFileInfoList instead.
zas_
parents:
572
diff
changeset
|
217 { |
2996f1bbc305
Drop ViewFileList, use ViewFile and ViewFileInfoList instead.
zas_
parents:
572
diff
changeset
|
218 switch(vf->type) |
2996f1bbc305
Drop ViewFileList, use ViewFile and ViewFileInfoList instead.
zas_
parents:
572
diff
changeset
|
219 { |
2996f1bbc305
Drop ViewFileList, use ViewFile and ViewFileInfoList instead.
zas_
parents:
572
diff
changeset
|
220 case FILEVIEW_LIST: vflist_select_none(vf); break; |
574
3da75054d4e1
Drop ViewFileIcon, use ViewFile and ViewFileInfoIcon instead.
zas_
parents:
573
diff
changeset
|
221 case FILEVIEW_ICON: vficon_select_none(vf); break; |
573
2996f1bbc305
Drop ViewFileList, use ViewFile and ViewFileInfoList instead.
zas_
parents:
572
diff
changeset
|
222 } |
2996f1bbc305
Drop ViewFileList, use ViewFile and ViewFileInfoList instead.
zas_
parents:
572
diff
changeset
|
223 } |
2996f1bbc305
Drop ViewFileList, use ViewFile and ViewFileInfoList instead.
zas_
parents:
572
diff
changeset
|
224 |
601 | 225 void vf_select_invert(ViewFile *vf) |
226 { | |
227 switch(vf->type) | |
228 { | |
229 case FILEVIEW_LIST: vflist_select_invert(vf); break; | |
230 case FILEVIEW_ICON: vficon_select_invert(vf); break; | |
231 } | |
232 } | |
233 | |
573
2996f1bbc305
Drop ViewFileList, use ViewFile and ViewFileInfoList instead.
zas_
parents:
572
diff
changeset
|
234 void vf_select_by_fd(ViewFile *vf, FileData *fd) |
2996f1bbc305
Drop ViewFileList, use ViewFile and ViewFileInfoList instead.
zas_
parents:
572
diff
changeset
|
235 { |
2996f1bbc305
Drop ViewFileList, use ViewFile and ViewFileInfoList instead.
zas_
parents:
572
diff
changeset
|
236 switch(vf->type) |
2996f1bbc305
Drop ViewFileList, use ViewFile and ViewFileInfoList instead.
zas_
parents:
572
diff
changeset
|
237 { |
2996f1bbc305
Drop ViewFileList, use ViewFile and ViewFileInfoList instead.
zas_
parents:
572
diff
changeset
|
238 case FILEVIEW_LIST: vflist_select_by_fd(vf, fd); break; |
574
3da75054d4e1
Drop ViewFileIcon, use ViewFile and ViewFileInfoIcon instead.
zas_
parents:
573
diff
changeset
|
239 case FILEVIEW_ICON: vficon_select_by_fd(vf, fd); break; |
573
2996f1bbc305
Drop ViewFileList, use ViewFile and ViewFileInfoList instead.
zas_
parents:
572
diff
changeset
|
240 } |
2996f1bbc305
Drop ViewFileList, use ViewFile and ViewFileInfoList instead.
zas_
parents:
572
diff
changeset
|
241 } |
572 | 242 |
573
2996f1bbc305
Drop ViewFileList, use ViewFile and ViewFileInfoList instead.
zas_
parents:
572
diff
changeset
|
243 void vf_mark_to_selection(ViewFile *vf, gint mark, MarkToSelectionMode mode) |
2996f1bbc305
Drop ViewFileList, use ViewFile and ViewFileInfoList instead.
zas_
parents:
572
diff
changeset
|
244 { |
2996f1bbc305
Drop ViewFileList, use ViewFile and ViewFileInfoList instead.
zas_
parents:
572
diff
changeset
|
245 switch(vf->type) |
2996f1bbc305
Drop ViewFileList, use ViewFile and ViewFileInfoList instead.
zas_
parents:
572
diff
changeset
|
246 { |
2996f1bbc305
Drop ViewFileList, use ViewFile and ViewFileInfoList instead.
zas_
parents:
572
diff
changeset
|
247 case FILEVIEW_LIST: vflist_mark_to_selection(vf, mark, mode); break; |
574
3da75054d4e1
Drop ViewFileIcon, use ViewFile and ViewFileInfoIcon instead.
zas_
parents:
573
diff
changeset
|
248 case FILEVIEW_ICON: vficon_mark_to_selection(vf, mark, mode); break; |
573
2996f1bbc305
Drop ViewFileList, use ViewFile and ViewFileInfoList instead.
zas_
parents:
572
diff
changeset
|
249 } |
572 | 250 } |
251 | |
573
2996f1bbc305
Drop ViewFileList, use ViewFile and ViewFileInfoList instead.
zas_
parents:
572
diff
changeset
|
252 void vf_selection_to_mark(ViewFile *vf, gint mark, SelectionToMarkMode mode) |
2996f1bbc305
Drop ViewFileList, use ViewFile and ViewFileInfoList instead.
zas_
parents:
572
diff
changeset
|
253 { |
2996f1bbc305
Drop ViewFileList, use ViewFile and ViewFileInfoList instead.
zas_
parents:
572
diff
changeset
|
254 switch(vf->type) |
2996f1bbc305
Drop ViewFileList, use ViewFile and ViewFileInfoList instead.
zas_
parents:
572
diff
changeset
|
255 { |
2996f1bbc305
Drop ViewFileList, use ViewFile and ViewFileInfoList instead.
zas_
parents:
572
diff
changeset
|
256 case FILEVIEW_LIST: vflist_selection_to_mark(vf, mark, mode); break; |
574
3da75054d4e1
Drop ViewFileIcon, use ViewFile and ViewFileInfoIcon instead.
zas_
parents:
573
diff
changeset
|
257 case FILEVIEW_ICON: vficon_selection_to_mark(vf, mark, mode); break; |
573
2996f1bbc305
Drop ViewFileList, use ViewFile and ViewFileInfoList instead.
zas_
parents:
572
diff
changeset
|
258 } |
2996f1bbc305
Drop ViewFileList, use ViewFile and ViewFileInfoList instead.
zas_
parents:
572
diff
changeset
|
259 } |
2996f1bbc305
Drop ViewFileList, use ViewFile and ViewFileInfoList instead.
zas_
parents:
572
diff
changeset
|
260 |
2996f1bbc305
Drop ViewFileList, use ViewFile and ViewFileInfoList instead.
zas_
parents:
572
diff
changeset
|
261 /* |
2996f1bbc305
Drop ViewFileList, use ViewFile and ViewFileInfoList instead.
zas_
parents:
572
diff
changeset
|
262 *----------------------------------------------------------------------------- |
2996f1bbc305
Drop ViewFileList, use ViewFile and ViewFileInfoList instead.
zas_
parents:
572
diff
changeset
|
263 * dnd |
2996f1bbc305
Drop ViewFileList, use ViewFile and ViewFileInfoList instead.
zas_
parents:
572
diff
changeset
|
264 *----------------------------------------------------------------------------- |
2996f1bbc305
Drop ViewFileList, use ViewFile and ViewFileInfoList instead.
zas_
parents:
572
diff
changeset
|
265 */ |
2996f1bbc305
Drop ViewFileList, use ViewFile and ViewFileInfoList instead.
zas_
parents:
572
diff
changeset
|
266 |
2996f1bbc305
Drop ViewFileList, use ViewFile and ViewFileInfoList instead.
zas_
parents:
572
diff
changeset
|
267 |
572 | 268 static void vf_dnd_init(ViewFile *vf) |
269 { | |
573
2996f1bbc305
Drop ViewFileList, use ViewFile and ViewFileInfoList instead.
zas_
parents:
572
diff
changeset
|
270 switch(vf->type) |
2996f1bbc305
Drop ViewFileList, use ViewFile and ViewFileInfoList instead.
zas_
parents:
572
diff
changeset
|
271 { |
2996f1bbc305
Drop ViewFileList, use ViewFile and ViewFileInfoList instead.
zas_
parents:
572
diff
changeset
|
272 case FILEVIEW_LIST: vflist_dnd_init(vf); break; |
574
3da75054d4e1
Drop ViewFileIcon, use ViewFile and ViewFileInfoIcon instead.
zas_
parents:
573
diff
changeset
|
273 case FILEVIEW_ICON: vficon_dnd_init(vf); break; |
573
2996f1bbc305
Drop ViewFileList, use ViewFile and ViewFileInfoList instead.
zas_
parents:
572
diff
changeset
|
274 } |
572 | 275 } |
276 | |
277 gint vf_refresh(ViewFile *vf) | |
278 { | |
573
2996f1bbc305
Drop ViewFileList, use ViewFile and ViewFileInfoList instead.
zas_
parents:
572
diff
changeset
|
279 gint ret = FALSE; |
2996f1bbc305
Drop ViewFileList, use ViewFile and ViewFileInfoList instead.
zas_
parents:
572
diff
changeset
|
280 |
2996f1bbc305
Drop ViewFileList, use ViewFile and ViewFileInfoList instead.
zas_
parents:
572
diff
changeset
|
281 switch(vf->type) |
2996f1bbc305
Drop ViewFileList, use ViewFile and ViewFileInfoList instead.
zas_
parents:
572
diff
changeset
|
282 { |
2996f1bbc305
Drop ViewFileList, use ViewFile and ViewFileInfoList instead.
zas_
parents:
572
diff
changeset
|
283 case FILEVIEW_LIST: ret = vflist_refresh(vf); break; |
574
3da75054d4e1
Drop ViewFileIcon, use ViewFile and ViewFileInfoIcon instead.
zas_
parents:
573
diff
changeset
|
284 case FILEVIEW_ICON: ret = vficon_refresh(vf); break; |
573
2996f1bbc305
Drop ViewFileList, use ViewFile and ViewFileInfoList instead.
zas_
parents:
572
diff
changeset
|
285 } |
572 | 286 |
287 return ret; | |
288 } | |
289 | |
290 gint vf_set_path(ViewFile *vf, const gchar *path) | |
291 { | |
573
2996f1bbc305
Drop ViewFileList, use ViewFile and ViewFileInfoList instead.
zas_
parents:
572
diff
changeset
|
292 gint ret = FALSE; |
2996f1bbc305
Drop ViewFileList, use ViewFile and ViewFileInfoList instead.
zas_
parents:
572
diff
changeset
|
293 |
2996f1bbc305
Drop ViewFileList, use ViewFile and ViewFileInfoList instead.
zas_
parents:
572
diff
changeset
|
294 switch(vf->type) |
2996f1bbc305
Drop ViewFileList, use ViewFile and ViewFileInfoList instead.
zas_
parents:
572
diff
changeset
|
295 { |
2996f1bbc305
Drop ViewFileList, use ViewFile and ViewFileInfoList instead.
zas_
parents:
572
diff
changeset
|
296 case FILEVIEW_LIST: ret = vflist_set_path(vf, path); break; |
574
3da75054d4e1
Drop ViewFileIcon, use ViewFile and ViewFileInfoIcon instead.
zas_
parents:
573
diff
changeset
|
297 case FILEVIEW_ICON: ret = vficon_set_path(vf, path); break; |
573
2996f1bbc305
Drop ViewFileList, use ViewFile and ViewFileInfoList instead.
zas_
parents:
572
diff
changeset
|
298 } |
2996f1bbc305
Drop ViewFileList, use ViewFile and ViewFileInfoList instead.
zas_
parents:
572
diff
changeset
|
299 |
2996f1bbc305
Drop ViewFileList, use ViewFile and ViewFileInfoList instead.
zas_
parents:
572
diff
changeset
|
300 return ret; |
572 | 301 } |
302 | |
303 static void vf_destroy_cb(GtkWidget *widget, gpointer data) | |
304 { | |
305 ViewFile *vf = data; | |
306 | |
573
2996f1bbc305
Drop ViewFileList, use ViewFile and ViewFileInfoList instead.
zas_
parents:
572
diff
changeset
|
307 switch(vf->type) |
2996f1bbc305
Drop ViewFileList, use ViewFile and ViewFileInfoList instead.
zas_
parents:
572
diff
changeset
|
308 { |
2996f1bbc305
Drop ViewFileList, use ViewFile and ViewFileInfoList instead.
zas_
parents:
572
diff
changeset
|
309 case FILEVIEW_LIST: vflist_destroy_cb(widget, data); break; |
2996f1bbc305
Drop ViewFileList, use ViewFile and ViewFileInfoList instead.
zas_
parents:
572
diff
changeset
|
310 case FILEVIEW_ICON: vficon_destroy_cb(widget, data); break; |
2996f1bbc305
Drop ViewFileList, use ViewFile and ViewFileInfoList instead.
zas_
parents:
572
diff
changeset
|
311 } |
2996f1bbc305
Drop ViewFileList, use ViewFile and ViewFileInfoList instead.
zas_
parents:
572
diff
changeset
|
312 |
572 | 313 if (vf->popup) |
314 { | |
315 g_signal_handlers_disconnect_matched(G_OBJECT(vf->popup), G_SIGNAL_MATCH_DATA, | |
316 0, 0, 0, NULL, vf); | |
317 gtk_widget_destroy(vf->popup); | |
318 } | |
319 | |
320 g_free(vf->path); | |
573
2996f1bbc305
Drop ViewFileList, use ViewFile and ViewFileInfoList instead.
zas_
parents:
572
diff
changeset
|
321 g_free(vf->info); |
572 | 322 g_free(vf); |
323 } | |
324 | |
325 ViewFile *vf_new(FileViewType type, const gchar *path) | |
326 { | |
327 ViewFile *vf; | |
328 | |
329 vf = g_new0(ViewFile, 1); | |
573
2996f1bbc305
Drop ViewFileList, use ViewFile and ViewFileInfoList instead.
zas_
parents:
572
diff
changeset
|
330 vf->type = type; |
572 | 331 |
573
2996f1bbc305
Drop ViewFileList, use ViewFile and ViewFileInfoList instead.
zas_
parents:
572
diff
changeset
|
332 vf->info = NULL; |
572 | 333 vf->path = NULL; |
334 vf->list = NULL; | |
335 | |
336 vf->sort_method = SORT_NAME; | |
337 vf->sort_ascend = TRUE; | |
338 | |
339 vf->thumbs_running = FALSE; | |
340 vf->thumbs_count = 0; | |
341 vf->thumbs_loader = NULL; | |
342 vf->thumbs_filedata = NULL; | |
343 | |
344 vf->popup = NULL; | |
345 | |
346 vf->widget = gtk_scrolled_window_new(NULL, NULL); | |
347 gtk_scrolled_window_set_shadow_type(GTK_SCROLLED_WINDOW(vf->widget), GTK_SHADOW_IN); | |
348 gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(vf->widget), | |
349 GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC); | |
573
2996f1bbc305
Drop ViewFileList, use ViewFile and ViewFileInfoList instead.
zas_
parents:
572
diff
changeset
|
350 |
572 | 351 g_signal_connect(G_OBJECT(vf->widget), "destroy", |
352 G_CALLBACK(vf_destroy_cb), vf); | |
353 | |
573
2996f1bbc305
Drop ViewFileList, use ViewFile and ViewFileInfoList instead.
zas_
parents:
572
diff
changeset
|
354 switch(type) |
2996f1bbc305
Drop ViewFileList, use ViewFile and ViewFileInfoList instead.
zas_
parents:
572
diff
changeset
|
355 { |
2996f1bbc305
Drop ViewFileList, use ViewFile and ViewFileInfoList instead.
zas_
parents:
572
diff
changeset
|
356 case FILEVIEW_LIST: vf = vflist_new(vf, path); break; |
574
3da75054d4e1
Drop ViewFileIcon, use ViewFile and ViewFileInfoIcon instead.
zas_
parents:
573
diff
changeset
|
357 case FILEVIEW_ICON: vf = vficon_new(vf, path); break; |
573
2996f1bbc305
Drop ViewFileList, use ViewFile and ViewFileInfoList instead.
zas_
parents:
572
diff
changeset
|
358 } |
2996f1bbc305
Drop ViewFileList, use ViewFile and ViewFileInfoList instead.
zas_
parents:
572
diff
changeset
|
359 |
574
3da75054d4e1
Drop ViewFileIcon, use ViewFile and ViewFileInfoIcon instead.
zas_
parents:
573
diff
changeset
|
360 vf_dnd_init(vf); |
3da75054d4e1
Drop ViewFileIcon, use ViewFile and ViewFileInfoIcon instead.
zas_
parents:
573
diff
changeset
|
361 |
572 | 362 g_signal_connect(G_OBJECT(vf->listview), "key_press_event", |
363 G_CALLBACK(vf_press_key_cb), vf); | |
364 g_signal_connect(G_OBJECT(vf->listview), "button_press_event", | |
365 G_CALLBACK(vf_press_cb), vf); | |
366 g_signal_connect(G_OBJECT(vf->listview), "button_release_event", | |
367 G_CALLBACK(vf_release_cb), vf); | |
368 | |
369 gtk_container_add(GTK_CONTAINER(vf->widget), vf->listview); | |
370 gtk_widget_show(vf->listview); | |
371 | |
372 if (path) vf_set_path(vf, path); | |
373 | |
374 return vf; | |
375 } | |
376 | |
377 void vf_set_status_func(ViewFile *vf, void (*func)(ViewFile *vf, gpointer data), gpointer data) | |
378 { | |
379 vf->func_status = func; | |
380 vf->data_status = data; | |
381 } | |
382 | |
383 void vf_set_thumb_status_func(ViewFile *vf, void (*func)(ViewFile *vf, gdouble val, const gchar *text, gpointer data), gpointer data) | |
384 { | |
385 vf->func_thumb_status = func; | |
386 vf->data_thumb_status = data; | |
387 } | |
388 | |
573
2996f1bbc305
Drop ViewFileList, use ViewFile and ViewFileInfoList instead.
zas_
parents:
572
diff
changeset
|
389 void vf_thumb_set(ViewFile *vf, gint enable) |
2996f1bbc305
Drop ViewFileList, use ViewFile and ViewFileInfoList instead.
zas_
parents:
572
diff
changeset
|
390 { |
2996f1bbc305
Drop ViewFileList, use ViewFile and ViewFileInfoList instead.
zas_
parents:
572
diff
changeset
|
391 switch(vf->type) |
2996f1bbc305
Drop ViewFileList, use ViewFile and ViewFileInfoList instead.
zas_
parents:
572
diff
changeset
|
392 { |
2996f1bbc305
Drop ViewFileList, use ViewFile and ViewFileInfoList instead.
zas_
parents:
572
diff
changeset
|
393 case FILEVIEW_LIST: vflist_thumb_set(vf, enable); break; |
2996f1bbc305
Drop ViewFileList, use ViewFile and ViewFileInfoList instead.
zas_
parents:
572
diff
changeset
|
394 case FILEVIEW_ICON: /*vficon_thumb_set(vf, enable);*/ break; |
2996f1bbc305
Drop ViewFileList, use ViewFile and ViewFileInfoList instead.
zas_
parents:
572
diff
changeset
|
395 } |
2996f1bbc305
Drop ViewFileList, use ViewFile and ViewFileInfoList instead.
zas_
parents:
572
diff
changeset
|
396 } |
2996f1bbc305
Drop ViewFileList, use ViewFile and ViewFileInfoList instead.
zas_
parents:
572
diff
changeset
|
397 |
2996f1bbc305
Drop ViewFileList, use ViewFile and ViewFileInfoList instead.
zas_
parents:
572
diff
changeset
|
398 void vf_marks_set(ViewFile *vf, gint enable) |
2996f1bbc305
Drop ViewFileList, use ViewFile and ViewFileInfoList instead.
zas_
parents:
572
diff
changeset
|
399 { |
2996f1bbc305
Drop ViewFileList, use ViewFile and ViewFileInfoList instead.
zas_
parents:
572
diff
changeset
|
400 switch(vf->type) |
2996f1bbc305
Drop ViewFileList, use ViewFile and ViewFileInfoList instead.
zas_
parents:
572
diff
changeset
|
401 { |
2996f1bbc305
Drop ViewFileList, use ViewFile and ViewFileInfoList instead.
zas_
parents:
572
diff
changeset
|
402 case FILEVIEW_LIST: vflist_marks_set(vf, enable); break; |
2996f1bbc305
Drop ViewFileList, use ViewFile and ViewFileInfoList instead.
zas_
parents:
572
diff
changeset
|
403 case FILEVIEW_ICON: /*vficon_marks_set(vf, enable);*/ break; |
2996f1bbc305
Drop ViewFileList, use ViewFile and ViewFileInfoList instead.
zas_
parents:
572
diff
changeset
|
404 } |
2996f1bbc305
Drop ViewFileList, use ViewFile and ViewFileInfoList instead.
zas_
parents:
572
diff
changeset
|
405 } |
2996f1bbc305
Drop ViewFileList, use ViewFile and ViewFileInfoList instead.
zas_
parents:
572
diff
changeset
|
406 |
572 | 407 void vf_set_layout(ViewFile *vf, LayoutWindow *layout) |
408 { | |
409 vf->layout = layout; | |
410 } | |
573
2996f1bbc305
Drop ViewFileList, use ViewFile and ViewFileInfoList instead.
zas_
parents:
572
diff
changeset
|
411 |
2996f1bbc305
Drop ViewFileList, use ViewFile and ViewFileInfoList instead.
zas_
parents:
572
diff
changeset
|
412 /* |
2996f1bbc305
Drop ViewFileList, use ViewFile and ViewFileInfoList instead.
zas_
parents:
572
diff
changeset
|
413 *----------------------------------------------------------------------------- |
2996f1bbc305
Drop ViewFileList, use ViewFile and ViewFileInfoList instead.
zas_
parents:
572
diff
changeset
|
414 * maintenance (for rename, move, remove) |
2996f1bbc305
Drop ViewFileList, use ViewFile and ViewFileInfoList instead.
zas_
parents:
572
diff
changeset
|
415 *----------------------------------------------------------------------------- |
2996f1bbc305
Drop ViewFileList, use ViewFile and ViewFileInfoList instead.
zas_
parents:
572
diff
changeset
|
416 */ |
2996f1bbc305
Drop ViewFileList, use ViewFile and ViewFileInfoList instead.
zas_
parents:
572
diff
changeset
|
417 |
2996f1bbc305
Drop ViewFileList, use ViewFile and ViewFileInfoList instead.
zas_
parents:
572
diff
changeset
|
418 gint vf_maint_renamed(ViewFile *vf, FileData *fd) |
2996f1bbc305
Drop ViewFileList, use ViewFile and ViewFileInfoList instead.
zas_
parents:
572
diff
changeset
|
419 { |
2996f1bbc305
Drop ViewFileList, use ViewFile and ViewFileInfoList instead.
zas_
parents:
572
diff
changeset
|
420 gint ret = FALSE; |
2996f1bbc305
Drop ViewFileList, use ViewFile and ViewFileInfoList instead.
zas_
parents:
572
diff
changeset
|
421 |
2996f1bbc305
Drop ViewFileList, use ViewFile and ViewFileInfoList instead.
zas_
parents:
572
diff
changeset
|
422 switch(vf->type) |
2996f1bbc305
Drop ViewFileList, use ViewFile and ViewFileInfoList instead.
zas_
parents:
572
diff
changeset
|
423 { |
2996f1bbc305
Drop ViewFileList, use ViewFile and ViewFileInfoList instead.
zas_
parents:
572
diff
changeset
|
424 case FILEVIEW_LIST: ret = vflist_maint_renamed(vf, fd); break; |
574
3da75054d4e1
Drop ViewFileIcon, use ViewFile and ViewFileInfoIcon instead.
zas_
parents:
573
diff
changeset
|
425 case FILEVIEW_ICON: ret = vficon_maint_renamed(vf, fd); break; |
573
2996f1bbc305
Drop ViewFileList, use ViewFile and ViewFileInfoList instead.
zas_
parents:
572
diff
changeset
|
426 } |
2996f1bbc305
Drop ViewFileList, use ViewFile and ViewFileInfoList instead.
zas_
parents:
572
diff
changeset
|
427 |
2996f1bbc305
Drop ViewFileList, use ViewFile and ViewFileInfoList instead.
zas_
parents:
572
diff
changeset
|
428 return ret; |
2996f1bbc305
Drop ViewFileList, use ViewFile and ViewFileInfoList instead.
zas_
parents:
572
diff
changeset
|
429 } |
2996f1bbc305
Drop ViewFileList, use ViewFile and ViewFileInfoList instead.
zas_
parents:
572
diff
changeset
|
430 |
2996f1bbc305
Drop ViewFileList, use ViewFile and ViewFileInfoList instead.
zas_
parents:
572
diff
changeset
|
431 gint vf_maint_removed(ViewFile *vf, FileData *fd, GList *ignore_list) |
2996f1bbc305
Drop ViewFileList, use ViewFile and ViewFileInfoList instead.
zas_
parents:
572
diff
changeset
|
432 { |
2996f1bbc305
Drop ViewFileList, use ViewFile and ViewFileInfoList instead.
zas_
parents:
572
diff
changeset
|
433 gint ret = FALSE; |
2996f1bbc305
Drop ViewFileList, use ViewFile and ViewFileInfoList instead.
zas_
parents:
572
diff
changeset
|
434 |
2996f1bbc305
Drop ViewFileList, use ViewFile and ViewFileInfoList instead.
zas_
parents:
572
diff
changeset
|
435 switch(vf->type) |
2996f1bbc305
Drop ViewFileList, use ViewFile and ViewFileInfoList instead.
zas_
parents:
572
diff
changeset
|
436 { |
2996f1bbc305
Drop ViewFileList, use ViewFile and ViewFileInfoList instead.
zas_
parents:
572
diff
changeset
|
437 case FILEVIEW_LIST: ret = vflist_maint_removed(vf, fd, ignore_list); break; |
574
3da75054d4e1
Drop ViewFileIcon, use ViewFile and ViewFileInfoIcon instead.
zas_
parents:
573
diff
changeset
|
438 case FILEVIEW_ICON: ret = vficon_maint_removed(vf, fd, ignore_list); break; |
573
2996f1bbc305
Drop ViewFileList, use ViewFile and ViewFileInfoList instead.
zas_
parents:
572
diff
changeset
|
439 } |
2996f1bbc305
Drop ViewFileList, use ViewFile and ViewFileInfoList instead.
zas_
parents:
572
diff
changeset
|
440 |
2996f1bbc305
Drop ViewFileList, use ViewFile and ViewFileInfoList instead.
zas_
parents:
572
diff
changeset
|
441 return ret; |
2996f1bbc305
Drop ViewFileList, use ViewFile and ViewFileInfoList instead.
zas_
parents:
572
diff
changeset
|
442 } |
2996f1bbc305
Drop ViewFileList, use ViewFile and ViewFileInfoList instead.
zas_
parents:
572
diff
changeset
|
443 |
2996f1bbc305
Drop ViewFileList, use ViewFile and ViewFileInfoList instead.
zas_
parents:
572
diff
changeset
|
444 gint vf_maint_moved(ViewFile *vf, FileData *fd, GList *ignore_list) |
2996f1bbc305
Drop ViewFileList, use ViewFile and ViewFileInfoList instead.
zas_
parents:
572
diff
changeset
|
445 { |
2996f1bbc305
Drop ViewFileList, use ViewFile and ViewFileInfoList instead.
zas_
parents:
572
diff
changeset
|
446 gint ret = FALSE; |
2996f1bbc305
Drop ViewFileList, use ViewFile and ViewFileInfoList instead.
zas_
parents:
572
diff
changeset
|
447 |
2996f1bbc305
Drop ViewFileList, use ViewFile and ViewFileInfoList instead.
zas_
parents:
572
diff
changeset
|
448 switch(vf->type) |
2996f1bbc305
Drop ViewFileList, use ViewFile and ViewFileInfoList instead.
zas_
parents:
572
diff
changeset
|
449 { |
2996f1bbc305
Drop ViewFileList, use ViewFile and ViewFileInfoList instead.
zas_
parents:
572
diff
changeset
|
450 case FILEVIEW_LIST: ret = vflist_maint_moved(vf, fd, ignore_list); break; |
574
3da75054d4e1
Drop ViewFileIcon, use ViewFile and ViewFileInfoIcon instead.
zas_
parents:
573
diff
changeset
|
451 case FILEVIEW_ICON: ret = vficon_maint_moved(vf, fd, ignore_list); break; |
573
2996f1bbc305
Drop ViewFileList, use ViewFile and ViewFileInfoList instead.
zas_
parents:
572
diff
changeset
|
452 } |
2996f1bbc305
Drop ViewFileList, use ViewFile and ViewFileInfoList instead.
zas_
parents:
572
diff
changeset
|
453 |
2996f1bbc305
Drop ViewFileList, use ViewFile and ViewFileInfoList instead.
zas_
parents:
572
diff
changeset
|
454 return ret; |
2996f1bbc305
Drop ViewFileList, use ViewFile and ViewFileInfoList instead.
zas_
parents:
572
diff
changeset
|
455 } |