comparison src/view_file.c @ 1453:bc3f5c0432f6

gint -> gboolean where applicable. The end (ouf!).
author zas_
date Mon, 16 Mar 2009 20:39:09 +0000
parents a3d3208b0c50
children 5f49f305a6b6
comparison
equal deleted inserted replaced
1452:67b40740122e 1453:bc3f5c0432f6
36 *----------------------------------------------------------------------------- 36 *-----------------------------------------------------------------------------
37 * misc 37 * misc
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, gboolean 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;
110 *------------------------------------------------------------------- 110 *-------------------------------------------------------------------
111 * keyboard 111 * keyboard
112 *------------------------------------------------------------------- 112 *-------------------------------------------------------------------
113 */ 113 */
114 114
115 static gint vf_press_key_cb(GtkWidget *widget, GdkEventKey *event, gpointer data) 115 static gboolean vf_press_key_cb(GtkWidget *widget, GdkEventKey *event, gpointer data)
116 { 116 {
117 ViewFile *vf = data; 117 ViewFile *vf = data;
118 gboolean ret = FALSE; 118 gboolean ret = FALSE;
119 119
120 switch (vf->type) 120 switch (vf->type)
130 *------------------------------------------------------------------- 130 *-------------------------------------------------------------------
131 * mouse 131 * mouse
132 *------------------------------------------------------------------- 132 *-------------------------------------------------------------------
133 */ 133 */
134 134
135 static gint vf_press_cb(GtkWidget *widget, GdkEventButton *bevent, gpointer data) 135 static gboolean vf_press_cb(GtkWidget *widget, GdkEventButton *bevent, gpointer data)
136 { 136 {
137 ViewFile *vf = data; 137 ViewFile *vf = data;
138 gboolean ret = FALSE; 138 gboolean ret = FALSE;
139 139
140 switch (vf->type) 140 switch (vf->type)
144 } 144 }
145 145
146 return ret; 146 return ret;
147 } 147 }
148 148
149 static gint vf_release_cb(GtkWidget *widget, GdkEventButton *bevent, gpointer data) 149 static gboolean vf_release_cb(GtkWidget *widget, GdkEventButton *bevent, gpointer data)
150 { 150 {
151 ViewFile *vf = data; 151 ViewFile *vf = data;
152 gboolean ret = FALSE; 152 gboolean ret = FALSE;
153 153
154 switch (vf->type) 154 switch (vf->type)
164 /* 164 /*
165 *----------------------------------------------------------------------------- 165 *-----------------------------------------------------------------------------
166 * selections 166 * selections
167 *----------------------------------------------------------------------------- 167 *-----------------------------------------------------------------------------
168 */ 168 */
169
170 gboolean vf_index_is_selected(ViewFile *vf, gint row)
171 {
172 gboolean ret = FALSE;
173
174 switch (vf->type)
175 {
176 case FILEVIEW_LIST: ret = vflist_index_is_selected(vf, row); break;
177 case FILEVIEW_ICON: ret = vficon_index_is_selected(vf, row); break;
178 }
179
180 return ret;
181 }
182
169 183
170 guint vf_selection_count(ViewFile *vf, gint64 *bytes) 184 guint vf_selection_count(ViewFile *vf, gint64 *bytes)
171 { 185 {
172 guint count = 0; 186 guint count = 0;
173 187
483 GtkWidget *vf_pop_menu(ViewFile *vf) 497 GtkWidget *vf_pop_menu(ViewFile *vf)
484 { 498 {
485 GtkWidget *menu; 499 GtkWidget *menu;
486 GtkWidget *item; 500 GtkWidget *item;
487 GtkWidget *submenu; 501 GtkWidget *submenu;
488 gint active = 0; 502 gboolean active = FALSE;
489 503
490 switch (vf->type) 504 switch (vf->type)
491 { 505 {
492 case FILEVIEW_LIST: 506 case FILEVIEW_LIST:
493 vflist_color_set(vf, VFLIST(vf)->click_fd, TRUE); 507 vflist_color_set(vf, VFLIST(vf)->click_fd, TRUE);
599 menu_item_add_stock(menu, _("Re_fresh"), GTK_STOCK_REFRESH, G_CALLBACK(vf_pop_menu_refresh_cb), vf); 613 menu_item_add_stock(menu, _("Re_fresh"), GTK_STOCK_REFRESH, G_CALLBACK(vf_pop_menu_refresh_cb), vf);
600 614
601 return menu; 615 return menu;
602 } 616 }
603 617
604 gint vf_refresh(ViewFile *vf) 618 gboolean vf_refresh(ViewFile *vf)
605 { 619 {
606 gboolean ret = FALSE; 620 gboolean ret = FALSE;
607 621
608 switch (vf->type) 622 switch (vf->type)
609 { 623 {
612 } 626 }
613 627
614 return ret; 628 return ret;
615 } 629 }
616 630
617 gint vf_set_fd(ViewFile *vf, FileData *dir_fd) 631 gboolean vf_set_fd(ViewFile *vf, FileData *dir_fd)
618 { 632 {
619 gboolean ret = FALSE; 633 gboolean ret = FALSE;
620 634
621 switch (vf->type) 635 switch (vf->type)
622 { 636 {
737 { 751 {
738 vf->func_thumb_status = func; 752 vf->func_thumb_status = func;
739 vf->data_thumb_status = data; 753 vf->data_thumb_status = data;
740 } 754 }
741 755
742 void vf_thumb_set(ViewFile *vf, gint enable) 756 void vf_thumb_set(ViewFile *vf, gboolean enable)
743 { 757 {
744 switch (vf->type) 758 switch (vf->type)
745 { 759 {
746 case FILEVIEW_LIST: vflist_thumb_set(vf, enable); break; 760 case FILEVIEW_LIST: vflist_thumb_set(vf, enable); break;
747 case FILEVIEW_ICON: /*vficon_thumb_set(vf, enable);*/ break; 761 case FILEVIEW_ICON: /*vficon_thumb_set(vf, enable);*/ break;
748 } 762 }
749 } 763 }
750 764
751 void vf_marks_set(ViewFile *vf, gint enable) 765 void vf_marks_set(ViewFile *vf, gboolean enable)
752 { 766 {
753 if (vf->marks_enabled == enable) return; 767 if (vf->marks_enabled == enable) return;
754 768
755 vf->marks_enabled = enable; 769 vf->marks_enabled = enable;
756 770
793 *----------------------------------------------------------------------------- 807 *-----------------------------------------------------------------------------
794 * maintenance (for rename, move, remove) 808 * maintenance (for rename, move, remove)
795 *----------------------------------------------------------------------------- 809 *-----------------------------------------------------------------------------
796 */ 810 */
797 811
798 static gint vf_refresh_idle_cb(gpointer data) 812 static gboolean vf_refresh_idle_cb(gpointer data)
799 { 813 {
800 ViewFile *vf = data; 814 ViewFile *vf = data;
801 815
802 vf_refresh(vf); 816 vf_refresh(vf);
803 vf->refresh_idle_id = -1; 817 vf->refresh_idle_id = -1;