changeset 634:92208e71673b

Introduce vf_pop_menu_file_list() as a wrapper to vflist_pop_menu_file_list() and vficon_pop_menu_file_list().
author zas_
date Sun, 11 May 2008 23:09:39 +0000
parents fe700864cb5a
children eaca3e910ecd
files src/view_file.c src/view_file.h src/view_file_icon.c src/view_file_icon.h src/view_file_list.c src/view_file_list.h
diffstat 6 files changed, 45 insertions(+), 16 deletions(-) [+]
line wrap: on
line diff
--- a/src/view_file.c	Sun May 11 21:11:54 2008 +0000
+++ b/src/view_file.c	Sun May 11 23:09:39 2008 +0000
@@ -271,6 +271,28 @@
 	}
 }
 
+/*
+ *-----------------------------------------------------------------------------
+ * pop-up menu
+ *-----------------------------------------------------------------------------
+ */
+
+GList *vf_pop_menu_file_list(ViewFile *vf)
+{
+	GList *ret = NULL;
+
+	switch(vf->type)
+	{
+	case FILEVIEW_LIST: ret = vflist_pop_menu_file_list(vf); break;
+	case FILEVIEW_ICON: ret = vficon_pop_menu_file_list(vf); break;
+	}
+
+	return ret;
+}
+
+
+
+
 gint vf_refresh(ViewFile *vf)
 {
 	gint ret = FALSE;
--- a/src/view_file.h	Sun May 11 21:11:54 2008 +0000
+++ b/src/view_file.h	Sun May 11 23:09:39 2008 +0000
@@ -30,6 +30,8 @@
 void vf_marks_set(ViewFile *vf, gint enable);
 void vf_sort_set(ViewFile *vf, SortType type, gint ascend);
 
+GList *vf_pop_menu_file_list(ViewFile *vf);
+
 FileData *vf_index_get_data(ViewFile *vf, gint row);
 gint vf_index_by_path(ViewFile *vf, const gchar *path);
 gint vf_index_by_fd(ViewFile *vf, FileData *in_fd);
--- a/src/view_file_icon.c	Sun May 11 21:11:54 2008 +0000
+++ b/src/view_file_icon.c	Sun May 11 23:09:39 2008 +0000
@@ -164,7 +164,7 @@
  *-----------------------------------------------------------------------------
  */
 
-static GList *vficon_pop_menu_file_list(ViewFile *vf)
+GList *vficon_pop_menu_file_list(ViewFile *vf)
 {
 	if (!VFICON_INFO(vf, click_id)) return NULL;
 
@@ -187,7 +187,7 @@
 
 	if (!vf) return;
 
-	list = vficon_pop_menu_file_list(vf);
+	list = vf_pop_menu_file_list(vf);
 	start_editor_from_filelist(n, list);
 	filelist_free(list);
 }
@@ -196,7 +196,7 @@
 {
 	ViewFile *vf = data;
 
-	info_window_new(NULL, vficon_pop_menu_file_list(vf), NULL);
+	info_window_new(NULL, vf_pop_menu_file_list(vf), NULL);
 }
 
 static void vficon_pop_menu_view_cb(GtkWidget *widget, gpointer data)
@@ -223,35 +223,35 @@
 {
 	ViewFile *vf = data;
 
-	file_util_copy(NULL, vficon_pop_menu_file_list(vf), NULL, vf->listview);
+	file_util_copy(NULL, vf_pop_menu_file_list(vf), NULL, vf->listview);
 }
 
 static void vficon_pop_menu_move_cb(GtkWidget *widget, gpointer data)
 {
 	ViewFile *vf = data;
 
-	file_util_move(NULL, vficon_pop_menu_file_list(vf), NULL, vf->listview);
+	file_util_move(NULL, vf_pop_menu_file_list(vf), NULL, vf->listview);
 }
 
 static void vficon_pop_menu_rename_cb(GtkWidget *widget, gpointer data)
 {
 	ViewFile *vf = data;
 
-	file_util_rename(NULL, vficon_pop_menu_file_list(vf), vf->listview);
+	file_util_rename(NULL, vf_pop_menu_file_list(vf), vf->listview);
 }
 
 static void vficon_pop_menu_delete_cb(GtkWidget *widget, gpointer data)
 {
 	ViewFile *vf = data;
 
-	file_util_delete(NULL, vficon_pop_menu_file_list(vf), vf->listview);
+	file_util_delete(NULL, vf_pop_menu_file_list(vf), vf->listview);
 }
 
 static void vficon_pop_menu_copy_path_cb(GtkWidget *widget, gpointer data)
 {
 	ViewFile *vf = data;
 
-	file_util_copy_path_list_to_clipboard(vficon_pop_menu_file_list(vf));
+	file_util_copy_path_list_to_clipboard(vf_pop_menu_file_list(vf));
 }
 
 static void vficon_pop_menu_sort_cb(GtkWidget *widget, gpointer data)
--- a/src/view_file_icon.h	Sun May 11 21:11:54 2008 +0000
+++ b/src/view_file_icon.h	Sun May 11 23:09:39 2008 +0000
@@ -27,6 +27,9 @@
 
 void vficon_sort_set(ViewFile *vf, SortType type, gint ascend);
 
+GList *vficon_pop_menu_file_list(ViewFile *vf);
+
+
 FileData *vficon_index_get_data(ViewFile *vf, gint row);
 gint vficon_index_by_path(ViewFile *vf, const gchar *path);
 gint vficon_index_by_fd(ViewFile *vf, FileData *in_fd);
--- a/src/view_file_list.c	Sun May 11 21:11:54 2008 +0000
+++ b/src/view_file_list.c	Sun May 11 23:09:39 2008 +0000
@@ -277,7 +277,7 @@
  *-----------------------------------------------------------------------------
  */
 
-static GList *vflist_pop_menu_file_list(ViewFile *vf)
+GList *vflist_pop_menu_file_list(ViewFile *vf)
 {
 	if (!VFLIST_INFO(vf, click_fd)) return NULL;
 
@@ -300,7 +300,7 @@
 
 	if (!vf) return;
 
-	list = vflist_pop_menu_file_list(vf);
+	list = vf_pop_menu_file_list(vf);
 	start_editor_from_filelist(n, list);
 	filelist_free(list);
 }
@@ -309,7 +309,7 @@
 {
 	ViewFile *vf = data;
 
-	info_window_new(NULL, vflist_pop_menu_file_list(vf), NULL);
+	info_window_new(NULL, vf_pop_menu_file_list(vf), NULL);
 }
 
 static void vflist_pop_menu_view_cb(GtkWidget *widget, gpointer data)
@@ -334,21 +334,21 @@
 {
 	ViewFile *vf = data;
 
-	file_util_copy(NULL, vflist_pop_menu_file_list(vf), NULL, vf->listview);
+	file_util_copy(NULL, vf_pop_menu_file_list(vf), NULL, vf->listview);
 }
 
 static void vflist_pop_menu_copy_path_cb(GtkWidget *widget, gpointer data)
 {
 	ViewFile *vf = data;
 
-	file_util_copy_path_list_to_clipboard(vflist_pop_menu_file_list(vf));
+	file_util_copy_path_list_to_clipboard(vf_pop_menu_file_list(vf));
 }
 
 static void vflist_pop_menu_move_cb(GtkWidget *widget, gpointer data)
 {
 	ViewFile *vf = data;
 
-	file_util_move(NULL, vflist_pop_menu_file_list(vf), NULL, vf->listview);
+	file_util_move(NULL, vf_pop_menu_file_list(vf), NULL, vf->listview);
 }
 
 static void vflist_pop_menu_rename_cb(GtkWidget *widget, gpointer data)
@@ -356,7 +356,7 @@
 	ViewFile *vf = data;
 	GList *list;
 
-	list = vflist_pop_menu_file_list(vf);
+	list = vf_pop_menu_file_list(vf);
 	if (options->file_ops.enable_in_place_rename &&
 	    list && !list->next && VFLIST_INFO(vf, click_fd))
 		{
@@ -386,7 +386,7 @@
 {
 	ViewFile *vf = data;
 
-	file_util_delete(NULL, vflist_pop_menu_file_list(vf), vf->listview);
+	file_util_delete(NULL, vf_pop_menu_file_list(vf), vf->listview);
 }
 
 static void vflist_pop_menu_sort_cb(GtkWidget *widget, gpointer data)
--- a/src/view_file_list.h	Sun May 11 21:11:54 2008 +0000
+++ b/src/view_file_list.h	Sun May 11 23:09:39 2008 +0000
@@ -32,6 +32,8 @@
 void vflist_marks_set(ViewFile *vf, gint enable);
 void vflist_sort_set(ViewFile *vf, SortType type, gint ascend);
 
+GList *vflist_pop_menu_file_list(ViewFile *vf);
+
 FileData *vflist_index_get_data(ViewFile *vf, gint row);
 gint vflist_index_by_path(ViewFile *vf, const gchar *path);
 gint vflist_count(ViewFile *vf, gint64 *bytes);