comparison src/view_file.c @ 1347:79937bc55f3a

Add missing space between switch and first parenthesis.
author zas_
date Sat, 28 Feb 2009 20:52:51 +0000
parents 55ea4962887a
children 249bf204004a
comparison
equal deleted inserted replaced
1346:c9949c19a6d0 1347:79937bc55f3a
38 *----------------------------------------------------------------------------- 38 *-----------------------------------------------------------------------------
39 */ 39 */
40 40
41 void vf_sort_set(ViewFile *vf, SortType type, gint ascend) 41 void vf_sort_set(ViewFile *vf, SortType type, gint ascend)
42 { 42 {
43 switch(vf->type) 43 switch (vf->type)
44 { 44 {
45 case FILEVIEW_LIST: vflist_sort_set(vf, type, ascend); break; 45 case FILEVIEW_LIST: vflist_sort_set(vf, type, ascend); break;
46 case FILEVIEW_ICON: vficon_sort_set(vf, type, ascend); break; 46 case FILEVIEW_ICON: vficon_sort_set(vf, type, ascend); break;
47 } 47 }
48 } 48 }
55 55
56 FileData *vf_index_get_data(ViewFile *vf, gint row) 56 FileData *vf_index_get_data(ViewFile *vf, gint row)
57 { 57 {
58 FileData *fd = NULL; 58 FileData *fd = NULL;
59 59
60 switch(vf->type) 60 switch (vf->type)
61 { 61 {
62 case FILEVIEW_LIST: fd = vflist_index_get_data(vf, row); break; 62 case FILEVIEW_LIST: fd = vflist_index_get_data(vf, row); break;
63 case FILEVIEW_ICON: fd = vficon_index_get_data(vf, row); break; 63 case FILEVIEW_ICON: fd = vficon_index_get_data(vf, row); break;
64 } 64 }
65 65
68 68
69 gint vf_index_by_path(ViewFile *vf, const gchar *path) 69 gint vf_index_by_path(ViewFile *vf, const gchar *path)
70 { 70 {
71 gint index = -1; 71 gint index = -1;
72 72
73 switch(vf->type) 73 switch (vf->type)
74 { 74 {
75 case FILEVIEW_LIST: index = vflist_index_by_path(vf, path); break; 75 case FILEVIEW_LIST: index = vflist_index_by_path(vf, path); break;
76 case FILEVIEW_ICON: index = vficon_index_by_path(vf, path); break; 76 case FILEVIEW_ICON: index = vficon_index_by_path(vf, path); break;
77 } 77 }
78 78
81 81
82 guint vf_count(ViewFile *vf, gint64 *bytes) 82 guint vf_count(ViewFile *vf, gint64 *bytes)
83 { 83 {
84 guint count = 0; 84 guint count = 0;
85 85
86 switch(vf->type) 86 switch (vf->type)
87 { 87 {
88 case FILEVIEW_LIST: count = vflist_count(vf, bytes); break; 88 case FILEVIEW_LIST: count = vflist_count(vf, bytes); break;
89 case FILEVIEW_ICON: count = vficon_count(vf, bytes); break; 89 case FILEVIEW_ICON: count = vficon_count(vf, bytes); break;
90 } 90 }
91 91
94 94
95 GList *vf_get_list(ViewFile *vf) 95 GList *vf_get_list(ViewFile *vf)
96 { 96 {
97 GList *list = NULL; 97 GList *list = NULL;
98 98
99 switch(vf->type) 99 switch (vf->type)
100 { 100 {
101 case FILEVIEW_LIST: list = vflist_get_list(vf); break; 101 case FILEVIEW_LIST: list = vflist_get_list(vf); break;
102 case FILEVIEW_ICON: list = vficon_get_list(vf); break; 102 case FILEVIEW_ICON: list = vficon_get_list(vf); break;
103 } 103 }
104 104
115 static gint vf_press_key_cb(GtkWidget *widget, GdkEventKey *event, gpointer data) 115 static gint vf_press_key_cb(GtkWidget *widget, GdkEventKey *event, gpointer data)
116 { 116 {
117 ViewFile *vf = data; 117 ViewFile *vf = data;
118 gint ret = FALSE; 118 gint ret = FALSE;
119 119
120 switch(vf->type) 120 switch (vf->type)
121 { 121 {
122 case FILEVIEW_LIST: ret = vflist_press_key_cb(widget, event, data); break; 122 case FILEVIEW_LIST: ret = vflist_press_key_cb(widget, event, data); break;
123 case FILEVIEW_ICON: ret = vficon_press_key_cb(widget, event, data); break; 123 case FILEVIEW_ICON: ret = vficon_press_key_cb(widget, event, data); break;
124 } 124 }
125 125
135 static gint vf_press_cb(GtkWidget *widget, GdkEventButton *bevent, gpointer data) 135 static gint vf_press_cb(GtkWidget *widget, GdkEventButton *bevent, gpointer data)
136 { 136 {
137 ViewFile *vf = data; 137 ViewFile *vf = data;
138 gint ret = FALSE; 138 gint ret = FALSE;
139 139
140 switch(vf->type) 140 switch (vf->type)
141 { 141 {
142 case FILEVIEW_LIST: ret = vflist_press_cb(widget, bevent, data); break; 142 case FILEVIEW_LIST: ret = vflist_press_cb(widget, bevent, data); break;
143 case FILEVIEW_ICON: ret = vficon_press_cb(widget, bevent, data); break; 143 case FILEVIEW_ICON: ret = vficon_press_cb(widget, bevent, data); break;
144 } 144 }
145 145
149 static gint vf_release_cb(GtkWidget *widget, GdkEventButton *bevent, gpointer data) 149 static gint vf_release_cb(GtkWidget *widget, GdkEventButton *bevent, gpointer data)
150 { 150 {
151 ViewFile *vf = data; 151 ViewFile *vf = data;
152 gint ret = FALSE; 152 gint ret = FALSE;
153 153
154 switch(vf->type) 154 switch (vf->type)
155 { 155 {
156 case FILEVIEW_LIST: ret = vflist_release_cb(widget, bevent, data); break; 156 case FILEVIEW_LIST: ret = vflist_release_cb(widget, bevent, data); break;
157 case FILEVIEW_ICON: ret = vficon_release_cb(widget, bevent, data); break; 157 case FILEVIEW_ICON: ret = vficon_release_cb(widget, bevent, data); break;
158 } 158 }
159 159
169 169
170 guint vf_selection_count(ViewFile *vf, gint64 *bytes) 170 guint vf_selection_count(ViewFile *vf, gint64 *bytes)
171 { 171 {
172 guint count = 0; 172 guint count = 0;
173 173
174 switch(vf->type) 174 switch (vf->type)
175 { 175 {
176 case FILEVIEW_LIST: count = vflist_selection_count(vf, bytes); break; 176 case FILEVIEW_LIST: count = vflist_selection_count(vf, bytes); break;
177 case FILEVIEW_ICON: count = vficon_selection_count(vf, bytes); break; 177 case FILEVIEW_ICON: count = vficon_selection_count(vf, bytes); break;
178 } 178 }
179 179
182 182
183 GList *vf_selection_get_list(ViewFile *vf) 183 GList *vf_selection_get_list(ViewFile *vf)
184 { 184 {
185 GList *list = NULL; 185 GList *list = NULL;
186 186
187 switch(vf->type) 187 switch (vf->type)
188 { 188 {
189 case FILEVIEW_LIST: list = vflist_selection_get_list(vf); break; 189 case FILEVIEW_LIST: list = vflist_selection_get_list(vf); break;
190 case FILEVIEW_ICON: list = vficon_selection_get_list(vf); break; 190 case FILEVIEW_ICON: list = vficon_selection_get_list(vf); break;
191 } 191 }
192 192
195 195
196 GList *vf_selection_get_list_by_index(ViewFile *vf) 196 GList *vf_selection_get_list_by_index(ViewFile *vf)
197 { 197 {
198 GList *list = NULL; 198 GList *list = NULL;
199 199
200 switch(vf->type) 200 switch (vf->type)
201 { 201 {
202 case FILEVIEW_LIST: list = vflist_selection_get_list_by_index(vf); break; 202 case FILEVIEW_LIST: list = vflist_selection_get_list_by_index(vf); break;
203 case FILEVIEW_ICON: list = vficon_selection_get_list_by_index(vf); break; 203 case FILEVIEW_ICON: list = vficon_selection_get_list_by_index(vf); break;
204 } 204 }
205 205
206 return list; 206 return list;
207 } 207 }
208 208
209 void vf_select_all(ViewFile *vf) 209 void vf_select_all(ViewFile *vf)
210 { 210 {
211 switch(vf->type) 211 switch (vf->type)
212 { 212 {
213 case FILEVIEW_LIST: vflist_select_all(vf); break; 213 case FILEVIEW_LIST: vflist_select_all(vf); break;
214 case FILEVIEW_ICON: vficon_select_all(vf); break; 214 case FILEVIEW_ICON: vficon_select_all(vf); break;
215 } 215 }
216 } 216 }
217 217
218 void vf_select_none(ViewFile *vf) 218 void vf_select_none(ViewFile *vf)
219 { 219 {
220 switch(vf->type) 220 switch (vf->type)
221 { 221 {
222 case FILEVIEW_LIST: vflist_select_none(vf); break; 222 case FILEVIEW_LIST: vflist_select_none(vf); break;
223 case FILEVIEW_ICON: vficon_select_none(vf); break; 223 case FILEVIEW_ICON: vficon_select_none(vf); break;
224 } 224 }
225 } 225 }
226 226
227 void vf_select_invert(ViewFile *vf) 227 void vf_select_invert(ViewFile *vf)
228 { 228 {
229 switch(vf->type) 229 switch (vf->type)
230 { 230 {
231 case FILEVIEW_LIST: vflist_select_invert(vf); break; 231 case FILEVIEW_LIST: vflist_select_invert(vf); break;
232 case FILEVIEW_ICON: vficon_select_invert(vf); break; 232 case FILEVIEW_ICON: vficon_select_invert(vf); break;
233 } 233 }
234 } 234 }
235 235
236 void vf_select_by_fd(ViewFile *vf, FileData *fd) 236 void vf_select_by_fd(ViewFile *vf, FileData *fd)
237 { 237 {
238 switch(vf->type) 238 switch (vf->type)
239 { 239 {
240 case FILEVIEW_LIST: vflist_select_by_fd(vf, fd); break; 240 case FILEVIEW_LIST: vflist_select_by_fd(vf, fd); break;
241 case FILEVIEW_ICON: vficon_select_by_fd(vf, fd); break; 241 case FILEVIEW_ICON: vficon_select_by_fd(vf, fd); break;
242 } 242 }
243 } 243 }
244 244
245 void vf_mark_to_selection(ViewFile *vf, gint mark, MarkToSelectionMode mode) 245 void vf_mark_to_selection(ViewFile *vf, gint mark, MarkToSelectionMode mode)
246 { 246 {
247 switch(vf->type) 247 switch (vf->type)
248 { 248 {
249 case FILEVIEW_LIST: vflist_mark_to_selection(vf, mark, mode); break; 249 case FILEVIEW_LIST: vflist_mark_to_selection(vf, mark, mode); break;
250 case FILEVIEW_ICON: vficon_mark_to_selection(vf, mark, mode); break; 250 case FILEVIEW_ICON: vficon_mark_to_selection(vf, mark, mode); break;
251 } 251 }
252 } 252 }
253 253
254 void vf_selection_to_mark(ViewFile *vf, gint mark, SelectionToMarkMode mode) 254 void vf_selection_to_mark(ViewFile *vf, gint mark, SelectionToMarkMode mode)
255 { 255 {
256 switch(vf->type) 256 switch (vf->type)
257 { 257 {
258 case FILEVIEW_LIST: vflist_selection_to_mark(vf, mark, mode); break; 258 case FILEVIEW_LIST: vflist_selection_to_mark(vf, mark, mode); break;
259 case FILEVIEW_ICON: vficon_selection_to_mark(vf, mark, mode); break; 259 case FILEVIEW_ICON: vficon_selection_to_mark(vf, mark, mode); break;
260 } 260 }
261 } 261 }
267 */ 267 */
268 268
269 269
270 static void vf_dnd_init(ViewFile *vf) 270 static void vf_dnd_init(ViewFile *vf)
271 { 271 {
272 switch(vf->type) 272 switch (vf->type)
273 { 273 {
274 case FILEVIEW_LIST: vflist_dnd_init(vf); break; 274 case FILEVIEW_LIST: vflist_dnd_init(vf); break;
275 case FILEVIEW_ICON: vficon_dnd_init(vf); break; 275 case FILEVIEW_ICON: vficon_dnd_init(vf); break;
276 } 276 }
277 } 277 }
284 284
285 GList *vf_pop_menu_file_list(ViewFile *vf) 285 GList *vf_pop_menu_file_list(ViewFile *vf)
286 { 286 {
287 GList *ret = NULL; 287 GList *ret = NULL;
288 288
289 switch(vf->type) 289 switch (vf->type)
290 { 290 {
291 case FILEVIEW_LIST: ret = vflist_pop_menu_file_list(vf); break; 291 case FILEVIEW_LIST: ret = vflist_pop_menu_file_list(vf); break;
292 case FILEVIEW_ICON: ret = vficon_pop_menu_file_list(vf); break; 292 case FILEVIEW_ICON: ret = vficon_pop_menu_file_list(vf); break;
293 } 293 }
294 294
312 312
313 static void vf_pop_menu_view_cb(GtkWidget *widget, gpointer data) 313 static void vf_pop_menu_view_cb(GtkWidget *widget, gpointer data)
314 { 314 {
315 ViewFile *vf = data; 315 ViewFile *vf = data;
316 316
317 switch(vf->type) 317 switch (vf->type)
318 { 318 {
319 case FILEVIEW_LIST: vflist_pop_menu_view_cb(widget, data); break; 319 case FILEVIEW_LIST: vflist_pop_menu_view_cb(widget, data); break;
320 case FILEVIEW_ICON: vficon_pop_menu_view_cb(widget, data); break; 320 case FILEVIEW_ICON: vficon_pop_menu_view_cb(widget, data); break;
321 } 321 }
322 } 322 }
337 337
338 static void vf_pop_menu_rename_cb(GtkWidget *widget, gpointer data) 338 static void vf_pop_menu_rename_cb(GtkWidget *widget, gpointer data)
339 { 339 {
340 ViewFile *vf = data; 340 ViewFile *vf = data;
341 341
342 switch(vf->type) 342 switch (vf->type)
343 { 343 {
344 case FILEVIEW_LIST: vflist_pop_menu_rename_cb(widget, data); break; 344 case FILEVIEW_LIST: vflist_pop_menu_rename_cb(widget, data); break;
345 case FILEVIEW_ICON: vficon_pop_menu_rename_cb(widget, data); break; 345 case FILEVIEW_ICON: vficon_pop_menu_rename_cb(widget, data); break;
346 } 346 }
347 } 347 }
442 { 442 {
443 ViewFile *vf = data; 443 ViewFile *vf = data;
444 444
445 if (!vf->layout) return; 445 if (!vf->layout) return;
446 446
447 switch(vf->layout->file_view_type) 447 switch (vf->layout->file_view_type)
448 { 448 {
449 case FILEVIEW_LIST: 449 case FILEVIEW_LIST:
450 layout_views_set(vf->layout, vf->layout->options.dir_view_type, FILEVIEW_ICON); 450 layout_views_set(vf->layout, vf->layout->options.dir_view_type, FILEVIEW_ICON);
451 break; 451 break;
452 case FILEVIEW_ICON: 452 case FILEVIEW_ICON:
457 457
458 static void vf_pop_menu_refresh_cb(GtkWidget *widget, gpointer data) 458 static void vf_pop_menu_refresh_cb(GtkWidget *widget, gpointer data)
459 { 459 {
460 ViewFile *vf = data; 460 ViewFile *vf = data;
461 461
462 switch(vf->type) 462 switch (vf->type)
463 { 463 {
464 case FILEVIEW_LIST: vflist_pop_menu_refresh_cb(widget, data); break; 464 case FILEVIEW_LIST: vflist_pop_menu_refresh_cb(widget, data); break;
465 case FILEVIEW_ICON: vficon_pop_menu_refresh_cb(widget, data); break; 465 case FILEVIEW_ICON: vficon_pop_menu_refresh_cb(widget, data); break;
466 } 466 }
467 } 467 }
468 468
469 static void vf_popup_destroy_cb(GtkWidget *widget, gpointer data) 469 static void vf_popup_destroy_cb(GtkWidget *widget, gpointer data)
470 { 470 {
471 ViewFile *vf = data; 471 ViewFile *vf = data;
472 472
473 switch(vf->type) 473 switch (vf->type)
474 { 474 {
475 case FILEVIEW_LIST: vflist_popup_destroy_cb(widget, data); break; 475 case FILEVIEW_LIST: vflist_popup_destroy_cb(widget, data); break;
476 case FILEVIEW_ICON: vficon_popup_destroy_cb(widget, data); break; 476 case FILEVIEW_ICON: vficon_popup_destroy_cb(widget, data); break;
477 } 477 }
478 } 478 }
482 GtkWidget *menu; 482 GtkWidget *menu;
483 GtkWidget *item; 483 GtkWidget *item;
484 GtkWidget *submenu; 484 GtkWidget *submenu;
485 gint active = 0; 485 gint active = 0;
486 486
487 switch(vf->type) 487 switch (vf->type)
488 { 488 {
489 case FILEVIEW_LIST: 489 case FILEVIEW_LIST:
490 vflist_color_set(vf, VFLIST(vf)->click_fd, TRUE); 490 vflist_color_set(vf, VFLIST(vf)->click_fd, TRUE);
491 active = (VFLIST(vf)->click_fd != NULL); 491 active = (VFLIST(vf)->click_fd != NULL);
492 break; 492 break;
578 gtk_menu_item_set_submenu(GTK_MENU_ITEM(item), submenu); 578 gtk_menu_item_set_submenu(GTK_MENU_ITEM(item), submenu);
579 579
580 menu_item_add_check(menu, _("View as _icons"), (vf->type == FILEVIEW_ICON), 580 menu_item_add_check(menu, _("View as _icons"), (vf->type == FILEVIEW_ICON),
581 G_CALLBACK(vf_pop_menu_toggle_view_type_cb), vf); 581 G_CALLBACK(vf_pop_menu_toggle_view_type_cb), vf);
582 582
583 switch(vf->type) 583 switch (vf->type)
584 { 584 {
585 case FILEVIEW_LIST: 585 case FILEVIEW_LIST:
586 menu_item_add_check(menu, _("Show _thumbnails"), VFLIST(vf)->thumbs_enabled, 586 menu_item_add_check(menu, _("Show _thumbnails"), VFLIST(vf)->thumbs_enabled,
587 G_CALLBACK(vflist_pop_menu_thumbs_cb), vf); 587 G_CALLBACK(vflist_pop_menu_thumbs_cb), vf);
588 break; 588 break;
599 599
600 gint vf_refresh(ViewFile *vf) 600 gint vf_refresh(ViewFile *vf)
601 { 601 {
602 gint ret = FALSE; 602 gint ret = FALSE;
603 603
604 switch(vf->type) 604 switch (vf->type)
605 { 605 {
606 case FILEVIEW_LIST: ret = vflist_refresh(vf); break; 606 case FILEVIEW_LIST: ret = vflist_refresh(vf); break;
607 case FILEVIEW_ICON: ret = vficon_refresh(vf); break; 607 case FILEVIEW_ICON: ret = vficon_refresh(vf); break;
608 } 608 }
609 609
612 612
613 gint vf_set_fd(ViewFile *vf, FileData *dir_fd) 613 gint vf_set_fd(ViewFile *vf, FileData *dir_fd)
614 { 614 {
615 gint ret = FALSE; 615 gint ret = FALSE;
616 616
617 switch(vf->type) 617 switch (vf->type)
618 { 618 {
619 case FILEVIEW_LIST: ret = vflist_set_fd(vf, dir_fd); break; 619 case FILEVIEW_LIST: ret = vflist_set_fd(vf, dir_fd); break;
620 case FILEVIEW_ICON: ret = vficon_set_fd(vf, dir_fd); break; 620 case FILEVIEW_ICON: ret = vficon_set_fd(vf, dir_fd); break;
621 } 621 }
622 622
625 625
626 static void vf_destroy_cb(GtkWidget *widget, gpointer data) 626 static void vf_destroy_cb(GtkWidget *widget, gpointer data)
627 { 627 {
628 ViewFile *vf = data; 628 ViewFile *vf = data;
629 629
630 switch(vf->type) 630 switch (vf->type)
631 { 631 {
632 case FILEVIEW_LIST: vflist_destroy_cb(widget, data); break; 632 case FILEVIEW_LIST: vflist_destroy_cb(widget, data); break;
633 case FILEVIEW_ICON: vficon_destroy_cb(widget, data); break; 633 case FILEVIEW_ICON: vficon_destroy_cb(widget, data); break;
634 } 634 }
635 635
709 gtk_widget_show(vf->scrolled); 709 gtk_widget_show(vf->scrolled);
710 710
711 g_signal_connect(G_OBJECT(vf->widget), "destroy", 711 g_signal_connect(G_OBJECT(vf->widget), "destroy",
712 G_CALLBACK(vf_destroy_cb), vf); 712 G_CALLBACK(vf_destroy_cb), vf);
713 713
714 switch(type) 714 switch (type)
715 { 715 {
716 case FILEVIEW_LIST: vf = vflist_new(vf, dir_fd); break; 716 case FILEVIEW_LIST: vf = vflist_new(vf, dir_fd); break;
717 case FILEVIEW_ICON: vf = vficon_new(vf, dir_fd); break; 717 case FILEVIEW_ICON: vf = vficon_new(vf, dir_fd); break;
718 } 718 }
719 719
746 vf->data_thumb_status = data; 746 vf->data_thumb_status = data;
747 } 747 }
748 748
749 void vf_thumb_set(ViewFile *vf, gint enable) 749 void vf_thumb_set(ViewFile *vf, gint enable)
750 { 750 {
751 switch(vf->type) 751 switch (vf->type)
752 { 752 {
753 case FILEVIEW_LIST: vflist_thumb_set(vf, enable); break; 753 case FILEVIEW_LIST: vflist_thumb_set(vf, enable); break;
754 case FILEVIEW_ICON: /*vficon_thumb_set(vf, enable);*/ break; 754 case FILEVIEW_ICON: /*vficon_thumb_set(vf, enable);*/ break;
755 } 755 }
756 } 756 }
759 { 759 {
760 if (vf->marks_enabled == enable) return; 760 if (vf->marks_enabled == enable) return;
761 761
762 vf->marks_enabled = enable; 762 vf->marks_enabled = enable;
763 763
764 switch(vf->type) 764 switch (vf->type)
765 { 765 {
766 case FILEVIEW_LIST: vflist_marks_set(vf, enable); break; 766 case FILEVIEW_LIST: vflist_marks_set(vf, enable); break;
767 case FILEVIEW_ICON: vficon_marks_set(vf, enable); break; 767 case FILEVIEW_ICON: vficon_marks_set(vf, enable); break;
768 } 768 }
769 if (enable) 769 if (enable)