comparison src/view_file.c @ 574:3da75054d4e1

Drop ViewFileIcon, use ViewFile and ViewFileInfoIcon instead.
author zas_
date Sun, 04 May 2008 18:45:06 +0000
parents 2996f1bbc305
children 93c6dc4c537b
comparison
equal deleted inserted replaced
573:2996f1bbc305 574:3da75054d4e1
26 void vf_sort_set(ViewFile *vf, SortType type, gint ascend) 26 void vf_sort_set(ViewFile *vf, SortType type, gint ascend)
27 { 27 {
28 switch(vf->type) 28 switch(vf->type)
29 { 29 {
30 case FILEVIEW_LIST: vflist_sort_set(vf, type, ascend); break; 30 case FILEVIEW_LIST: vflist_sort_set(vf, type, ascend); break;
31 case FILEVIEW_ICON: /*vficon_sort_set(vf, type, ascend);*/; break; 31 case FILEVIEW_ICON: vficon_sort_set(vf, type, ascend); break;
32 } 32 }
33 } 33 }
34 34
35 /* 35 /*
36 *----------------------------------------------------------------------------- 36 *-----------------------------------------------------------------------------
43 FileData *fd = NULL; 43 FileData *fd = NULL;
44 44
45 switch(vf->type) 45 switch(vf->type)
46 { 46 {
47 case FILEVIEW_LIST: fd = vflist_index_get_data(vf, row); break; 47 case FILEVIEW_LIST: fd = vflist_index_get_data(vf, row); break;
48 case FILEVIEW_ICON: /*fd = vficon_index_get_data(vf, row);*/; break; 48 case FILEVIEW_ICON: fd = vficon_index_get_data(vf, row); break;
49 } 49 }
50 50
51 return fd; 51 return fd;
52 } 52 }
53 53
56 gchar *path = NULL; 56 gchar *path = NULL;
57 57
58 switch(vf->type) 58 switch(vf->type)
59 { 59 {
60 case FILEVIEW_LIST: path = vflist_index_get_path(vf, row); break; 60 case FILEVIEW_LIST: path = vflist_index_get_path(vf, row); break;
61 case FILEVIEW_ICON: /*path = vficon_index_get_path(vf, row);*/; break; 61 case FILEVIEW_ICON: path = vficon_index_get_path(vf, row); break;
62 } 62 }
63 63
64 return path; 64 return path;
65 } 65 }
66 66
69 gint index = -1; 69 gint index = -1;
70 70
71 switch(vf->type) 71 switch(vf->type)
72 { 72 {
73 case FILEVIEW_LIST: index = vflist_index_by_path(vf, path); break; 73 case FILEVIEW_LIST: index = vflist_index_by_path(vf, path); break;
74 case FILEVIEW_ICON: /*index = vficon_index_by_path(vf, path);*/; break; 74 case FILEVIEW_ICON: index = vficon_index_by_path(vf, path); break;
75 } 75 }
76 76
77 return index; 77 return index;
78 } 78 }
79 79
82 gint count = 0; 82 gint count = 0;
83 83
84 switch(vf->type) 84 switch(vf->type)
85 { 85 {
86 case FILEVIEW_LIST: count = vflist_count(vf, bytes); break; 86 case FILEVIEW_LIST: count = vflist_count(vf, bytes); break;
87 case FILEVIEW_ICON: /*count = vficon_count(vf, bytes);*/; break; 87 case FILEVIEW_ICON: count = vficon_count(vf, bytes); break;
88 } 88 }
89 89
90 return count; 90 return count;
91 } 91 }
92 92
95 GList *list = NULL; 95 GList *list = NULL;
96 96
97 switch(vf->type) 97 switch(vf->type)
98 { 98 {
99 case FILEVIEW_LIST: list = vflist_get_list(vf); break; 99 case FILEVIEW_LIST: list = vflist_get_list(vf); break;
100 case FILEVIEW_ICON: /*list = vficon_get_list(vf);*/; break; 100 case FILEVIEW_ICON: list = vficon_get_list(vf); break;
101 } 101 }
102 102
103 return list; 103 return list;
104 } 104 }
105 105
116 gint ret = FALSE; 116 gint ret = FALSE;
117 117
118 switch(vf->type) 118 switch(vf->type)
119 { 119 {
120 case FILEVIEW_LIST: ret = vflist_press_key_cb(widget, event, data); break; 120 case FILEVIEW_LIST: ret = vflist_press_key_cb(widget, event, data); break;
121 case FILEVIEW_ICON: /*ret = vficon_press_key_cb(widget, event, data)*/; break; 121 case FILEVIEW_ICON: ret = vficon_press_key_cb(widget, event, data); break;
122 } 122 }
123 123
124 return ret; 124 return ret;
125 } 125 }
126 126
136 gint ret = FALSE; 136 gint ret = FALSE;
137 137
138 switch(vf->type) 138 switch(vf->type)
139 { 139 {
140 case FILEVIEW_LIST: ret = vflist_press_cb(widget, bevent, data); break; 140 case FILEVIEW_LIST: ret = vflist_press_cb(widget, bevent, data); break;
141 case FILEVIEW_ICON: /*ret = vficon_press_cb(widget, bevent, data)*/; break; 141 case FILEVIEW_ICON: ret = vficon_press_cb(widget, bevent, data); break;
142 } 142 }
143 143
144 return ret; 144 return ret;
145 } 145 }
146 146
150 gint ret = FALSE; 150 gint ret = FALSE;
151 151
152 switch(vf->type) 152 switch(vf->type)
153 { 153 {
154 case FILEVIEW_LIST: ret = vflist_release_cb(widget, bevent, data); break; 154 case FILEVIEW_LIST: ret = vflist_release_cb(widget, bevent, data); break;
155 case FILEVIEW_ICON: /*ret = vficon_release_cb(widget, bevent, data)*/; break; 155 case FILEVIEW_ICON: ret = vficon_release_cb(widget, bevent, data); break;
156 } 156 }
157 157
158 return ret; 158 return ret;
159 } 159 }
160 160
170 gint count = 0; 170 gint count = 0;
171 171
172 switch(vf->type) 172 switch(vf->type)
173 { 173 {
174 case FILEVIEW_LIST: count = vflist_selection_count(vf, bytes); break; 174 case FILEVIEW_LIST: count = vflist_selection_count(vf, bytes); break;
175 case FILEVIEW_ICON: /*count = vficon_selection_count(vf, bytes)*/; break; 175 case FILEVIEW_ICON: count = vficon_selection_count(vf, bytes); break;
176 } 176 }
177 177
178 return count; 178 return count;
179 } 179 }
180 180
183 GList *list = NULL; 183 GList *list = NULL;
184 184
185 switch(vf->type) 185 switch(vf->type)
186 { 186 {
187 case FILEVIEW_LIST: list = vflist_selection_get_list(vf); break; 187 case FILEVIEW_LIST: list = vflist_selection_get_list(vf); break;
188 case FILEVIEW_ICON: /*list = vficon_selection_get_list(vf)*/; break; 188 case FILEVIEW_ICON: list = vficon_selection_get_list(vf); break;
189 } 189 }
190 190
191 return list; 191 return list;
192 } 192 }
193 193
196 GList *list = NULL; 196 GList *list = NULL;
197 197
198 switch(vf->type) 198 switch(vf->type)
199 { 199 {
200 case FILEVIEW_LIST: list = vflist_selection_get_list_by_index(vf); break; 200 case FILEVIEW_LIST: list = vflist_selection_get_list_by_index(vf); break;
201 case FILEVIEW_ICON: /*list = vficon_selection_get_list_by_index(vf)*/; break; 201 case FILEVIEW_ICON: list = vficon_selection_get_list_by_index(vf); break;
202 } 202 }
203 203
204 return list; 204 return list;
205 } 205 }
206 206
207 void vf_select_all(ViewFile *vf) 207 void vf_select_all(ViewFile *vf)
208 { 208 {
209 switch(vf->type) 209 switch(vf->type)
210 { 210 {
211 case FILEVIEW_LIST: vflist_select_all(vf); break; 211 case FILEVIEW_LIST: vflist_select_all(vf); break;
212 case FILEVIEW_ICON: /*vficon_select_all(vf);*/; break; 212 case FILEVIEW_ICON: vficon_select_all(vf); break;
213 } 213 }
214 } 214 }
215 215
216 void vf_select_none(ViewFile *vf) 216 void vf_select_none(ViewFile *vf)
217 { 217 {
218 switch(vf->type) 218 switch(vf->type)
219 { 219 {
220 case FILEVIEW_LIST: vflist_select_none(vf); break; 220 case FILEVIEW_LIST: vflist_select_none(vf); break;
221 case FILEVIEW_ICON: /*vficon_select_none(vf);*/; break; 221 case FILEVIEW_ICON: vficon_select_none(vf); break;
222 } 222 }
223 } 223 }
224 224
225 void vf_select_by_fd(ViewFile *vf, FileData *fd) 225 void vf_select_by_fd(ViewFile *vf, FileData *fd)
226 { 226 {
227 switch(vf->type) 227 switch(vf->type)
228 { 228 {
229 case FILEVIEW_LIST: vflist_select_by_fd(vf, fd); break; 229 case FILEVIEW_LIST: vflist_select_by_fd(vf, fd); break;
230 case FILEVIEW_ICON: /*vficon_select_by_fd(vf, fd);*/; break; 230 case FILEVIEW_ICON: vficon_select_by_fd(vf, fd); break;
231 } 231 }
232 } 232 }
233 233
234 void vf_mark_to_selection(ViewFile *vf, gint mark, MarkToSelectionMode mode) 234 void vf_mark_to_selection(ViewFile *vf, gint mark, MarkToSelectionMode mode)
235 { 235 {
236 switch(vf->type) 236 switch(vf->type)
237 { 237 {
238 case FILEVIEW_LIST: vflist_mark_to_selection(vf, mark, mode); break; 238 case FILEVIEW_LIST: vflist_mark_to_selection(vf, mark, mode); break;
239 case FILEVIEW_ICON: /*vficon_mark_to_selection(vf, mark, mode);*/; break; 239 case FILEVIEW_ICON: vficon_mark_to_selection(vf, mark, mode); break;
240 } 240 }
241 } 241 }
242 242
243 void vf_selection_to_mark(ViewFile *vf, gint mark, SelectionToMarkMode mode) 243 void vf_selection_to_mark(ViewFile *vf, gint mark, SelectionToMarkMode mode)
244 { 244 {
245 switch(vf->type) 245 switch(vf->type)
246 { 246 {
247 case FILEVIEW_LIST: vflist_selection_to_mark(vf, mark, mode); break; 247 case FILEVIEW_LIST: vflist_selection_to_mark(vf, mark, mode); break;
248 case FILEVIEW_ICON: /*vficon_selection_to_mark(vf, mark, mode);*/; break; 248 case FILEVIEW_ICON: vficon_selection_to_mark(vf, mark, mode); break;
249 } 249 }
250 } 250 }
251 251
252 /* 252 /*
253 *----------------------------------------------------------------------------- 253 *-----------------------------------------------------------------------------
259 static void vf_dnd_init(ViewFile *vf) 259 static void vf_dnd_init(ViewFile *vf)
260 { 260 {
261 switch(vf->type) 261 switch(vf->type)
262 { 262 {
263 case FILEVIEW_LIST: vflist_dnd_init(vf); break; 263 case FILEVIEW_LIST: vflist_dnd_init(vf); break;
264 case FILEVIEW_ICON: /*vficon_dnd_init(vf)*/; break; 264 case FILEVIEW_ICON: vficon_dnd_init(vf); break;
265 } 265 }
266 } 266 }
267 267
268 gint vf_refresh(ViewFile *vf) 268 gint vf_refresh(ViewFile *vf)
269 { 269 {
270 gint ret = FALSE; 270 gint ret = FALSE;
271 271
272 switch(vf->type) 272 switch(vf->type)
273 { 273 {
274 case FILEVIEW_LIST: ret = vflist_refresh(vf); break; 274 case FILEVIEW_LIST: ret = vflist_refresh(vf); break;
275 case FILEVIEW_ICON: /*ret = vficon_refresh(vf)*/; break; 275 case FILEVIEW_ICON: ret = vficon_refresh(vf); break;
276 } 276 }
277 277
278 return ret; 278 return ret;
279 } 279 }
280 280
283 gint ret = FALSE; 283 gint ret = FALSE;
284 284
285 switch(vf->type) 285 switch(vf->type)
286 { 286 {
287 case FILEVIEW_LIST: ret = vflist_set_path(vf, path); break; 287 case FILEVIEW_LIST: ret = vflist_set_path(vf, path); break;
288 case FILEVIEW_ICON: /*ret = vficon_set_path(vf, path)*/; break; 288 case FILEVIEW_ICON: ret = vficon_set_path(vf, path); break;
289 } 289 }
290 290
291 return ret; 291 return ret;
292 } 292 }
293 293
343 G_CALLBACK(vf_destroy_cb), vf); 343 G_CALLBACK(vf_destroy_cb), vf);
344 344
345 switch(type) 345 switch(type)
346 { 346 {
347 case FILEVIEW_LIST: vf = vflist_new(vf, path); break; 347 case FILEVIEW_LIST: vf = vflist_new(vf, path); break;
348 case FILEVIEW_ICON: /*vf = vftree_new(vf, path);*/ break; 348 case FILEVIEW_ICON: vf = vficon_new(vf, path); break;
349 } 349 }
350
351 vf_dnd_init(vf);
350 352
351 g_signal_connect(G_OBJECT(vf->listview), "key_press_event", 353 g_signal_connect(G_OBJECT(vf->listview), "key_press_event",
352 G_CALLBACK(vf_press_key_cb), vf); 354 G_CALLBACK(vf_press_key_cb), vf);
353 g_signal_connect(G_OBJECT(vf->listview), "button_press_event", 355 g_signal_connect(G_OBJECT(vf->listview), "button_press_event",
354 G_CALLBACK(vf_press_cb), vf); 356 G_CALLBACK(vf_press_cb), vf);
356 G_CALLBACK(vf_release_cb), vf); 358 G_CALLBACK(vf_release_cb), vf);
357 359
358 gtk_container_add(GTK_CONTAINER(vf->widget), vf->listview); 360 gtk_container_add(GTK_CONTAINER(vf->widget), vf->listview);
359 gtk_widget_show(vf->listview); 361 gtk_widget_show(vf->listview);
360 362
361 vf_dnd_init(vf);
362
363 if (path) vf_set_path(vf, path); 363 if (path) vf_set_path(vf, path);
364 364
365 return vf; 365 return vf;
366 } 366 }
367 367
411 gint ret = FALSE; 411 gint ret = FALSE;
412 412
413 switch(vf->type) 413 switch(vf->type)
414 { 414 {
415 case FILEVIEW_LIST: ret = vflist_maint_renamed(vf, fd); break; 415 case FILEVIEW_LIST: ret = vflist_maint_renamed(vf, fd); break;
416 case FILEVIEW_ICON: /*ret = vficon_maint_renamed(vf, fd);*/ break; 416 case FILEVIEW_ICON: ret = vficon_maint_renamed(vf, fd); break;
417 } 417 }
418 418
419 return ret; 419 return ret;
420 } 420 }
421 421
424 gint ret = FALSE; 424 gint ret = FALSE;
425 425
426 switch(vf->type) 426 switch(vf->type)
427 { 427 {
428 case FILEVIEW_LIST: ret = vflist_maint_removed(vf, fd, ignore_list); break; 428 case FILEVIEW_LIST: ret = vflist_maint_removed(vf, fd, ignore_list); break;
429 case FILEVIEW_ICON: /*ret = vficon_maint_removed(vf, fd, ignore_list);*/ break; 429 case FILEVIEW_ICON: ret = vficon_maint_removed(vf, fd, ignore_list); break;
430 } 430 }
431 431
432 return ret; 432 return ret;
433 } 433 }
434 434
437 gint ret = FALSE; 437 gint ret = FALSE;
438 438
439 switch(vf->type) 439 switch(vf->type)
440 { 440 {
441 case FILEVIEW_LIST: ret = vflist_maint_moved(vf, fd, ignore_list); break; 441 case FILEVIEW_LIST: ret = vflist_maint_moved(vf, fd, ignore_list); break;
442 case FILEVIEW_ICON: /*ret = vficon_maint_moved(vf, fd, ignore_list);*/ break; 442 case FILEVIEW_ICON: ret = vficon_maint_moved(vf, fd, ignore_list); break;
443 } 443 }
444 444
445 return ret; 445 return ret;
446 } 446 }