[kazehakase-svn] [3247] * src/kz-window.[ch], src/kz-notebook.[ch]: Remove needless functions

Back to archive index

svnno****@sourc***** svnno****@sourc*****
Wed Oct 3 11:21:59 JST 2007


Revision: 3247
          http://svn.sourceforge.jp/cgi-bin/viewcvs.cgi?root=kazehakase&view=rev&rev=3247
Author:   ikezoe
Date:     2007-10-03 11:21:58 +0900 (Wed, 03 Oct 2007)

Log Message:
-----------
* src/kz-window.[ch], src/kz-notebook.[ch]: Remove needless functions
due to the last commit.

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

Modified: kazehakase/trunk/ChangeLog
===================================================================
--- kazehakase/trunk/ChangeLog	2007-10-03 01:49:04 UTC (rev 3246)
+++ kazehakase/trunk/ChangeLog	2007-10-03 02:21:58 UTC (rev 3247)
@@ -2,6 +2,8 @@
 
 	* src/kz-notebook.c, src/kz-tab-label.c: Use DnD function of
 	GtkNotebook itself.
+	* src/kz-window.[ch], src/kz-notebook.[ch]: Remove needless functions
+	due to the last commit.
 
 2007-09-29  Kouhei Sutou  <kou****@cozmi*****>
 

Modified: kazehakase/trunk/src/kz-notebook.c
===================================================================
--- kazehakase/trunk/src/kz-notebook.c	2007-10-03 01:49:04 UTC (rev 3246)
+++ kazehakase/trunk/src/kz-notebook.c	2007-10-03 02:21:58 UTC (rev 3247)
@@ -42,7 +42,7 @@
 
 static GtkTargetEntry url_drag_types [] =
 {
-        { "GTK_NOTEBOOK_TAB", GTK_TARGET_OTHER_APP, TARGET_GTK_NOTEBOOK_TAB},
+        { "GTK_NOTEBOOK_TAB", GTK_TARGET_SAME_APP,  TARGET_GTK_NOTEBOOK_TAB},
         { "_NETSCAPE_URL",    GTK_TARGET_OTHER_APP, TARGET_NETSCAPE_URL},
 	{ "text/uri-list",    GTK_TARGET_OTHER_APP, TARGET_TEXT_URI_LIST},
 	{ "text/plain",       GTK_TARGET_OTHER_APP, TARGET_TEXT_PLAIN},
@@ -599,34 +599,6 @@
 	return TRUE;
 }
 
-GtkWidget *
-kz_notebook_reorder_tab (KzNotebook *notebook, GtkWidget *widget, gint pos)
-{
-	gint n_pages, cur_pos, sib_pos = pos;
-	GtkWidget *sibtab = NULL;
-
-	n_pages = gtk_notebook_get_n_pages(GTK_NOTEBOOK(notebook));
-	g_return_val_if_fail(pos >= 0 && pos < n_pages, NULL);
-
-	cur_pos = gtk_notebook_page_num(GTK_NOTEBOOK(notebook), widget);
-	if (cur_pos == pos)
-		return NULL;
-
-	if (cur_pos < pos)
-		sib_pos = sib_pos + 1;
-
-	if (sib_pos < n_pages)
-	{
-		sibtab = gtk_notebook_get_tab_label(GTK_NOTEBOOK(notebook),
-					gtk_notebook_get_nth_page(GTK_NOTEBOOK(notebook), sib_pos));
-	}
-
-	gtk_notebook_reorder_child (GTK_NOTEBOOK(notebook),
-				    widget, pos);
-
-	return sibtab;
-}
-
 void
 kz_notebook_next_tab (KzNotebook *notebook)
 {

Modified: kazehakase/trunk/src/kz-notebook.h
===================================================================
--- kazehakase/trunk/src/kz-notebook.h	2007-10-03 01:49:04 UTC (rev 3246)
+++ kazehakase/trunk/src/kz-notebook.h	2007-10-03 02:21:58 UTC (rev 3247)
@@ -54,9 +54,6 @@
 					       GtkWidget  *widget);
 void	    kz_notebook_next_tab	      (KzNotebook *notebook);
 void	    kz_notebook_prev_tab	      (KzNotebook *notebook);
-GtkWidget  *kz_notebook_reorder_tab	      (KzNotebook *notebook,
-					       GtkWidget  *widget,
-					       gint        pos);
 gboolean    kz_notebook_scroll_tab	      (KzNotebook *notebook,
 					       GdkScrollDirection direction);
 GtkWidget  *kz_notebook_get_nth_page          (KzNotebook *notebook,

Modified: kazehakase/trunk/src/kz-window.c
===================================================================
--- kazehakase/trunk/src/kz-window.c	2007-10-03 01:49:04 UTC (rev 3246)
+++ kazehakase/trunk/src/kz-window.c	2007-10-03 02:21:58 UTC (rev 3247)
@@ -182,6 +182,10 @@
 static void     cb_clipboard_get_text         (GtkClipboard *clipboard,
 					       const gchar *text,
 					       gpointer data);
+static void     cb_notebook_reorder_page      (GtkNotebook     *notebook,
+					       GtkWidget       *child,
+					       guint            page_num,
+					       KzWindow        *kz);
 static void     cb_notebook_switch_page       (GtkNotebook     *notebook,
 					       GtkNotebookPage *page,
 					       guint            page_num,
@@ -537,6 +541,8 @@
 
 	/* main notebook widget */
 	{
+		g_signal_connect(kz->notebook, "reorder-page", 
+				 G_CALLBACK(cb_notebook_reorder_page), kz);
 		g_signal_connect(kz->notebook, "switch-page", 
 				 G_CALLBACK(cb_notebook_switch_page), kz);
 		g_signal_connect_after(kz->notebook, "switch-page",
@@ -948,32 +954,6 @@
 }
 
 
-void
-kz_window_reorder_tab (KzWindow *kz, GtkWidget *widget, gint pos)
-{
-	KzTabLabel *kztab, *sibtab;
-	KzBookmark *sib_bookmark = NULL;
-
-	g_return_if_fail(KZ_IS_WINDOW(kz));
-	g_return_if_fail(GTK_IS_WIDGET(widget));
-
-	sibtab = KZ_TAB_LABEL(kz_notebook_reorder_tab(KZ_NOTEBOOK(kz->notebook), widget, pos));
-
-	if (sibtab)
-		sib_bookmark = sibtab->history;
-
-	kztab = KZ_TAB_LABEL(gtk_notebook_get_tab_label(GTK_NOTEBOOK(kz->notebook), widget));
-	g_object_ref(kztab->history);
-	kz_bookmark_remove(kz->tabs, kztab->history);
-	kz_bookmark_insert_before(kz->tabs, 
-				  kztab->history,
-				  sib_bookmark);
-	g_object_unref(kztab->history);
-
-	g_signal_emit(kz, kz_window_signals[REORDER_TAB_SIGNAL],
-		      0, widget, pos);
-}
-
 /* FIXME!! It's a hacky way. */
 void
 kz_window_move_tab (KzWindow *kz, GtkWidget *widget)
@@ -1967,6 +1947,15 @@
 
 
 static void
+cb_notebook_reorder_page (GtkNotebook *notebook, GtkWidget *child,
+			  guint page_num, KzWindow *kz)
+{
+	g_signal_emit(kz, kz_window_signals[REORDER_TAB_SIGNAL],
+		      0, child, page_num);
+
+}
+
+static void
 cb_notebook_switch_page (GtkNotebook *notebook, GtkNotebookPage *page,
 			 guint page_num, KzWindow *kz)
 {

Modified: kazehakase/trunk/src/kz-window.h
===================================================================
--- kazehakase/trunk/src/kz-window.h	2007-10-03 01:49:04 UTC (rev 3246)
+++ kazehakase/trunk/src/kz-window.h	2007-10-03 02:21:58 UTC (rev 3247)
@@ -105,9 +105,6 @@
 void              kz_window_close_tab                (KzWindow    *kz,
 						      GtkWidget   *widget);
 void              kz_window_close_all_tab            (KzWindow    *kz);
-void              kz_window_reorder_tab              (KzWindow    *kz,
-						      GtkWidget   *widget,
-						      gint         position);
 void		  kz_window_move_tab 		     (KzWindow    *kz,
 						      GtkWidget   *widget);
 void		  kz_window_restore_tabs	     (KzWindow    *kz,




More information about the Kazehakase-cvs mailing list
Back to archive index