[kazehakase-svn] [3264] * src/kz-window.[ch]: kz_window_move_tab() needs source and

Zurück zum Archiv-Index

svnno****@sourc***** svnno****@sourc*****
Thu Oct 4 13:39:34 JST 2007


Revision: 3264
          http://svn.sourceforge.jp/cgi-bin/viewcvs.cgi?root=kazehakase&view=rev&rev=3264
Author:   ikezoe
Date:     2007-10-04 13:39:33 +0900 (Thu, 04 Oct 2007)

Log Message:
-----------
* src/kz-window.[ch]: kz_window_move_tab() needs source and
destination Kzwindow.
* src/kz-notebook.c: (drag_data_received): Use kz_window_move_tab()
instead of kz_notebook_move_tab().

Modified Paths:
--------------
    kazehakase/trunk/ChangeLog
    kazehakase/trunk/src/kz-notebook.c
    kazehakase/trunk/src/kz-window.c
    kazehakase/trunk/src/kz-window.h

Modified: kazehakase/trunk/ChangeLog
===================================================================
--- kazehakase/trunk/ChangeLog	2007-10-04 03:22:37 UTC (rev 3263)
+++ kazehakase/trunk/ChangeLog	2007-10-04 04:39:33 UTC (rev 3264)
@@ -2,6 +2,10 @@
 
 	* src/kz-notebook.c: Set detachable and reorderable when page-added
 	signal is caught.
+	* src/kz-window.[ch]: kz_window_move_tab() needs source and
+	destination Kzwindow.
+	* src/kz-notebook.c: (drag_data_received): Use kz_window_move_tab()
+	instead of kz_notebook_move_tab().
 
 2007-10-04  Kouhei Sutou  <kou****@cozmi*****>
 

Modified: kazehakase/trunk/src/kz-notebook.c
===================================================================
--- kazehakase/trunk/src/kz-notebook.c	2007-10-04 03:22:37 UTC (rev 3263)
+++ kazehakase/trunk/src/kz-notebook.c	2007-10-04 04:39:33 UTC (rev 3264)
@@ -309,11 +309,13 @@
 	{
 		GtkWidget *src_notebook;
 		GtkWidget **child;
+		KzWindow *src_window, *dest_window;
 
 		child = (void*) seldata->data;
 		src_notebook = gtk_drag_get_source_widget(context);
-		kz_notebook_move_tab(KZ_NOTEBOOK(src_notebook),
-				     KZ_NOTEBOOK(widget), *child);
+		src_window = KZ_NOTEBOOK_GET_PRIVATE(src_notebook)->kz;
+		dest_window = KZ_NOTEBOOK_GET_PRIVATE(widget)->kz;
+		kz_window_move_tab(src_window, dest_window, *child);
 		gtk_drag_finish(context, TRUE, TRUE, time);
 		break;
 	}

Modified: kazehakase/trunk/src/kz-window.c
===================================================================
--- kazehakase/trunk/src/kz-window.c	2007-10-04 03:22:37 UTC (rev 3263)
+++ kazehakase/trunk/src/kz-window.c	2007-10-04 04:39:33 UTC (rev 3264)
@@ -948,48 +948,46 @@
 
 /* FIXME!! It's a hacky way. */
 void
-kz_window_move_tab (KzWindow *kz, GtkWidget *widget)
+kz_window_move_tab (KzWindow *src_kz, KzWindow *dest_kz, GtkWidget *widget)
 {
-	GtkNotebook *src_notebook;
+	GtkNotebook *src_notebook, *dest_notebook;
 	GtkWidget *label;
-	KzWindow *src_kz;
 	KzEmbed *kzembed;
 	KzTabLabel *new_kztab;
 	GNode *node, *child;
-	KzWindowPrivate *priv, *src_priv;
+	KzWindowPrivate *dest_priv, *src_priv;
 
-	g_return_if_fail(KZ_IS_WINDOW(kz));
+	g_return_if_fail(KZ_IS_WINDOW(src_kz));
+	g_return_if_fail(KZ_IS_WINDOW(dest_kz));
 	g_return_if_fail(KZ_IS_EMBED(widget));
 
-	priv = KZ_WINDOW_GET_PRIVATE(kz);
-	kzembed = KZ_EMBED(widget);
+	dest_priv = KZ_WINDOW_GET_PRIVATE(dest_kz);
+	src_priv = KZ_WINDOW_GET_PRIVATE(src_kz);
 
-	src_kz = KZ_WINDOW(KZ_GET_WINDOW_FROM_TAB(widget));
-	if (!src_kz) return;
+	src_notebook = GTK_NOTEBOOK(src_kz->notebook);
+	dest_notebook = GTK_NOTEBOOK(dest_kz->notebook);
 
-	src_priv = KZ_WINDOW_GET_PRIVATE(src_kz);
-	label = gtk_notebook_get_tab_label(GTK_NOTEBOOK(kz->notebook),
-					   widget);
+	kzembed = KZ_EMBED(widget);
 
+	label = gtk_notebook_get_tab_label(dest_notebook, widget);
+
 	/* the kzembed is already the kz's child */
 	if (label) return;
 
-	src_notebook = GTK_NOTEBOOK(src_kz->notebook);
-	label = gtk_notebook_get_tab_label(src_notebook,
-					   widget);
+	label = gtk_notebook_get_tab_label(src_notebook, widget);
 	g_return_if_fail(label);
 
 	/* create new tab label */
-	new_kztab = KZ_TAB_LABEL(kz_tab_label_new(kz, kzembed));
+	new_kztab = KZ_TAB_LABEL(kz_tab_label_new(dest_kz, kzembed));
 
 	/* move the page to this window */
 	kz_window_unset_cur_embed_callbacks(src_kz, kzembed);
 	kz_window_unset_embed_callbacks(src_kz, kzembed);
 
-	kz_notebook_move_tab(KZ_NOTEBOOK(kz->notebook), KZ_NOTEBOOK(src_kz->notebook), widget);
+	kz_notebook_move_tab(KZ_NOTEBOOK(src_notebook), KZ_NOTEBOOK(dest_notebook), widget);
 
-	kz_bookmark_prepend(kz->tabs, new_kztab->history);
-	kz_window_set_embed_callbacks(kz, kzembed);
+	kz_bookmark_prepend(dest_kz->tabs, new_kztab->history);
+	kz_window_set_embed_callbacks(dest_kz, kzembed);
 
 	/* move tab tree */
 	node = g_node_find(src_priv->tab_tree,
@@ -1009,14 +1007,14 @@
 
 		/* move node */
 		g_node_unlink(node);
-		if (!priv->tab_tree)
-			priv->tab_tree = g_node_new(NULL);
-		g_node_append(priv->tab_tree, node);
+		if (!dest_priv->tab_tree)
+			dest_priv->tab_tree = g_node_new(NULL);
+		g_node_append(dest_priv->tab_tree, node);
 		
 		g_signal_emit(src_kz,
 			      kz_window_signals[REMOVE_TAB_SIGNAL],
 			      0, kzembed);
-		g_signal_emit(kz,
+		g_signal_emit(dest_kz,
 			      kz_window_signals[APPEND_TAB_SIGNAL],
 			      0, kzembed, NULL);
 	}

Modified: kazehakase/trunk/src/kz-window.h
===================================================================
--- kazehakase/trunk/src/kz-window.h	2007-10-04 03:22:37 UTC (rev 3263)
+++ kazehakase/trunk/src/kz-window.h	2007-10-04 04:39:33 UTC (rev 3264)
@@ -105,7 +105,8 @@
 void              kz_window_close_tab                (KzWindow    *kz,
 						      GtkWidget   *widget);
 void              kz_window_close_all_tab            (KzWindow    *kz);
-void		  kz_window_move_tab 		     (KzWindow    *kz,
+void		  kz_window_move_tab 		     (KzWindow    *src_kz,
+						      KzWindow    *dest_kz,
 						      GtkWidget   *widget);
 void		  kz_window_restore_tabs	     (KzWindow    *kz,
 						      KzBookmark  *tabs);




More information about the Kazehakase-cvs mailing list
Zurück zum Archiv-Index