changeset 978:9ff64efe11eb

Replace macros VDLIST_INFO() and VDTREE_INFO() by shorter VDLIST() and VDTREE(). VDLIST_INFO(vd, part) becomes VDLIST(vd)->part.
author zas_
date Thu, 21 Aug 2008 22:47:49 +0000
parents 1f634178a14f
children 8732c06d8aeb
files src/view_dir_list.c src/view_dir_tree.c
diffstat 2 files changed, 23 insertions(+), 23 deletions(-) [+]
line wrap: on
line diff
--- a/src/view_dir_list.c	Thu Aug 21 22:36:20 2008 +0000
+++ b/src/view_dir_list.c	Thu Aug 21 22:47:49 2008 +0000
@@ -28,7 +28,7 @@
 #include <gdk/gdkkeysyms.h> /* for keyboard values */
 
 
-#define VDLIST_INFO(_vd_, _part_) (((ViewDirInfoList *)(_vd_->info))->_part_)
+#define VDLIST(_vf_) ((ViewDirInfoList *)(_vf_->info))
 
 
 /*
@@ -71,7 +71,7 @@
 		}
 
 	n = 0;
-	work = VDLIST_INFO(vd, list);
+	work = VDLIST(vd)->list;
 	while (work)
 		{
 		FileData *fd = work->data;
@@ -135,7 +135,7 @@
 {
 	FileData *fd;
 
-	fd = g_list_nth_data(VDLIST_INFO(vd, list), row);
+	fd = g_list_nth_data(VDLIST(vd)->list, row);
 
 	if (fd) return fd->path;
 
@@ -153,10 +153,10 @@
 	gint ret;
 	FileData *fd;
 
-	old_list = VDLIST_INFO(vd, list);
+	old_list = VDLIST(vd)->list;
 
-	ret = filelist_read(vd->dir_fd, NULL, &VDLIST_INFO(vd, list));
-	VDLIST_INFO(vd, list) = filelist_sort(VDLIST_INFO(vd, list), SORT_NAME, TRUE);
+	ret = filelist_read(vd->dir_fd, NULL, &VDLIST(vd)->list);
+	VDLIST(vd)->list = filelist_sort(VDLIST(vd)->list, SORT_NAME, TRUE);
 
 	/* add . and .. */
 
@@ -164,7 +164,7 @@
 		{
 		filepath = g_build_filename(vd->dir_fd->path, "..", NULL);
 		fd = file_data_new_simple(filepath);
-		VDLIST_INFO(vd, list) = g_list_prepend(VDLIST_INFO(vd, list), fd);
+		VDLIST(vd)->list = g_list_prepend(VDLIST(vd)->list, fd);
 		g_free(filepath);
 		}
 
@@ -172,7 +172,7 @@
 		{
 		filepath = g_build_filename(vd->dir_fd->path, ".", NULL);
 		fd = file_data_new_simple(filepath);
-		VDLIST_INFO(vd, list) = g_list_prepend(VDLIST_INFO(vd, list), fd);
+		VDLIST(vd)->list = g_list_prepend(VDLIST(vd)->list, fd);
 		g_free(filepath);
 	}
 
@@ -181,7 +181,7 @@
 
 	valid = gtk_tree_model_iter_children(GTK_TREE_MODEL(store), &iter, NULL);
 
-	work = VDLIST_INFO(vd, list);
+	work = VDLIST(vd)->list;
 	while (work)
 		{
 		gint match;
@@ -328,7 +328,7 @@
 		FileData *found = NULL;
 		GList *work;
 
-		work = VDLIST_INFO(vd, list);
+		work = VDLIST(vd)->list;
 		while (work && !found)
 			{
 			FileData *fd = work->data;
@@ -427,7 +427,7 @@
 	vd_dnd_drop_scroll_cancel(vd);
 	widget_auto_scroll_stop(vd->view);
 
-	filelist_free(VDLIST_INFO(vd, list));
+	filelist_free(VDLIST(vd)->list);
 }
 
 ViewDir *vdlist_new(ViewDir *vd, FileData *dir_fd)
@@ -440,7 +440,7 @@
 	vd->info = g_new0(ViewDirInfoList, 1);
 	vd->type = DIRVIEW_LIST;
 
-	VDLIST_INFO(vd, list) = NULL;
+	VDLIST(vd)->list = NULL;
 
 	store = gtk_list_store_new(5, G_TYPE_POINTER, GDK_TYPE_PIXBUF, G_TYPE_STRING, G_TYPE_BOOLEAN, G_TYPE_STRING);
 	vd->view = gtk_tree_view_new_with_model(GTK_TREE_MODEL(store));
--- a/src/view_dir_tree.c	Thu Aug 21 22:36:20 2008 +0000
+++ b/src/view_dir_tree.c	Thu Aug 21 22:47:49 2008 +0000
@@ -29,7 +29,7 @@
 #include <gdk/gdkkeysyms.h> /* for keyboard values */
 
 
-#define VDTREE_INFO(_vd_, _part_) (((ViewDirInfoTree *)(_vd_->info))->_part_)
+#define VDTREE(_vf_) ((ViewDirInfoTree *)(_vf_->info))
 
 
 typedef struct _PathData PathData;
@@ -62,14 +62,14 @@
 
 static void vdtree_busy_push(ViewDir *vd)
 {
-	if (VDTREE_INFO(vd, busy_ref) == 0) set_cursor(vd->view, GDK_WATCH);
-	VDTREE_INFO(vd, busy_ref)++;
+	if (VDTREE(vd)->busy_ref == 0) set_cursor(vd->view, GDK_WATCH);
+	VDTREE(vd)->busy_ref++;
 }
 
 static void vdtree_busy_pop(ViewDir *vd)
 {
-	if (VDTREE_INFO(vd, busy_ref) == 1) set_cursor(vd->view, -1);
-	if (VDTREE_INFO(vd, busy_ref) > 0) VDTREE_INFO(vd, busy_ref)--;
+	if (VDTREE(vd)->busy_ref == 1) set_cursor(vd->view, -1);
+	if (VDTREE(vd)->busy_ref > 0) VDTREE(vd)->busy_ref--;
 }
 
 gint vdtree_find_row(ViewDir *vd, FileData *fd, GtkTreeIter *iter, GtkTreeIter *parent)
@@ -173,20 +173,20 @@
 		vdtree_expand_by_data(vd, vd->drop_fd, TRUE);
 		}
 
-	VDTREE_INFO(vd, drop_expand_id) = -1;
+	VDTREE(vd)->drop_expand_id = -1;
 	return FALSE;
 }
 
 static void vdtree_dnd_drop_expand_cancel(ViewDir *vd)
 {
-	if (VDTREE_INFO(vd, drop_expand_id) != -1) g_source_remove(VDTREE_INFO(vd, drop_expand_id));
-	VDTREE_INFO(vd, drop_expand_id) = -1;
+	if (VDTREE(vd)->drop_expand_id != -1) g_source_remove(VDTREE(vd)->drop_expand_id);
+	VDTREE(vd)->drop_expand_id = -1;
 }
 
 static void vdtree_dnd_drop_expand(ViewDir *vd)
 {
 	vdtree_dnd_drop_expand_cancel(vd);
-	VDTREE_INFO(vd, drop_expand_id) = g_timeout_add(1000, vdtree_dnd_drop_expand_cb, vd);
+	VDTREE(vd)->drop_expand_id = g_timeout_add(1000, vdtree_dnd_drop_expand_cb, vd);
 }
 
 /*
@@ -943,8 +943,8 @@
 	vd->info = g_new0(ViewDirInfoTree, 1);
 	vd->type = DIRVIEW_TREE;
 
-	VDTREE_INFO(vd, drop_expand_id) = -1;
-	VDTREE_INFO(vd, busy_ref) = 0;
+	VDTREE(vd)->drop_expand_id = -1;
+	VDTREE(vd)->busy_ref = 0;
 
 	vd->dnd_drop_leave_func = vdtree_dnd_drop_expand_cancel;
 	vd->dnd_drop_update_func = vdtree_dnd_drop_expand;