diff src/typedefs.h @ 380:5afe77bb563a

Introduce a new struct ViewDir to handle directory views common data. Specific data is now in ViewDirInfoList and ViewDirInfoTree. Type of directory view can be specified with enum DirViewType. This is saved to rc file as layout.dir_view_type, which replace layout.view_as_tree. Code was modified to reflect these changes. This is a first to move to merge common code of view_dir_list.c and view_dir_tree.c and ease the introduction of new types of directory view.
author zas_
date Wed, 16 Apr 2008 14:45:22 +0000
parents 61a3c8b05b24
children 392dd6541d51
line wrap: on
line diff
--- a/src/typedefs.h	Tue Apr 15 21:49:28 2008 +0000
+++ b/src/typedefs.h	Wed Apr 16 14:45:22 2008 +0000
@@ -14,6 +14,11 @@
 #define TYPEDEFS_H
 
 typedef enum {
+	DIRVIEW_LIST,
+	DIRVIEW_TREE
+} DirViewType;
+
+typedef enum {
 	CMD_COPY = GQ_EDITOR_GENERIC_SLOTS,
 	CMD_MOVE,
 	CMD_RENAME,
@@ -128,8 +133,9 @@
 typedef struct _FileDataChangeInfo FileDataChangeInfo;
 
 typedef struct _LayoutWindow LayoutWindow;
-typedef struct _ViewDirList ViewDirList;
-typedef struct _ViewDirTree ViewDirTree;
+typedef struct _ViewDir ViewDir;
+typedef struct _ViewDirInfoList ViewDirInfoList;
+typedef struct _ViewDirInfoTree ViewDirInfoTree;
 typedef struct _ViewFileList ViewFileList;
 typedef struct _ViewFileIcon ViewFileIcon;
 
@@ -456,11 +462,10 @@
 
 	LayoutLocation dir_location;
 
-	ViewDirList *vdl;
-	ViewDirTree *vdt;
+	ViewDir *vd;
 	GtkWidget *dir_view;
 
-	gint tree_view;
+	DirViewType dir_view_type;
 
 	/* file view */
 
@@ -521,36 +526,11 @@
 	gint bar_exif_advanced;
 };
 
-struct _ViewDirList
+struct _ViewDir
 {
+	DirViewType type;
 	GtkWidget *widget;
-	GtkWidget *listview;
-
-	gchar *path;
-	GList *list;
-
-	FileData *click_fd;
-
-	FileData *drop_fd;
-	GList *drop_list;
-
-	gint drop_scroll_id;
-
-	/* func list */
-	void (*select_func)(ViewDirList *vdl, const gchar *path, gpointer data);
-	gpointer select_data;
-
-	LayoutWindow *layout;
-
-	GtkWidget *popup;
-
-	PixmapFolders *pf;
-};
-
-struct _ViewDirTree
-{
-	GtkWidget *widget;
-	GtkWidget *treeview;
+	GtkWidget *view;
 
 	gchar *path;
 
@@ -558,12 +538,10 @@
 
 	FileData *drop_fd;
 	GList *drop_list;
-
 	gint drop_scroll_id;
-	gint drop_expand_id;
 
 	/* func list */
-	void (*select_func)(ViewDirTree *vdt, const gchar *path, gpointer data);
+	void (*select_func)(ViewDir *vd, const gchar *path, gpointer data);
 	gpointer select_data;
 
 	LayoutWindow *layout;
@@ -572,6 +550,17 @@
 
 	PixmapFolders *pf;
 
+	gpointer info;
+};
+
+struct _ViewDirInfoList
+{
+	GList *list;
+};
+
+struct _ViewDirInfoTree
+{
+	gint drop_expand_id;
 	gint busy_ref;
 };
 
@@ -845,7 +834,7 @@
 		gint style;
 
 		gint view_as_icons;
-		gint view_as_tree;
+		DirViewType dir_view_type;
 		
 		gint show_thumbnails;