svnno****@sourc*****
svnno****@sourc*****
Sat Feb 14 16:33:02 JST 2009
Revision: 3685 http://svn.sourceforge.jp/view?root=kazehakase&view=rev&rev=3685 Author: ikezoe Date: 2009-02-14 16:33:02 +0900 (Sat, 14 Feb 2009) Log Message: ----------- * src/kz-window.[ch], src/kz-notebook.[ch]: XX_close_tab needs KzEmbed instead of GtkWidget. Modified Paths: -------------- kazehakase/trunk/ChangeLog kazehakase/trunk/src/actions/kz-actions-tab.c kazehakase/trunk/src/actions/kz-actions.c kazehakase/trunk/src/kz-notebook.c kazehakase/trunk/src/kz-notebook.h kazehakase/trunk/src/kz-tab-label.c kazehakase/trunk/src/kz-window.c kazehakase/trunk/src/kz-window.h Modified: kazehakase/trunk/ChangeLog =================================================================== --- kazehakase/trunk/ChangeLog 2009-02-14 06:25:00 UTC (rev 3684) +++ kazehakase/trunk/ChangeLog 2009-02-14 07:33:02 UTC (rev 3685) @@ -19,6 +19,8 @@ * src/kz-app.[ch]: kz_app_get_window_from_tab ->kz_app_get_window_from_embed. * src/kz-embed.[ch]: Remove ensure_title interface. + * src/kz-window.[ch], src/kz-notebook.[ch]: XX_close_tab needs KzEmbed + instead of GtkWidget. 2009-02-13 Hiroyuki Ikezoe <poinc****@ikezo*****> Modified: kazehakase/trunk/src/actions/kz-actions-tab.c =================================================================== --- kazehakase/trunk/src/actions/kz-actions-tab.c 2009-02-14 06:25:00 UTC (rev 3684) +++ kazehakase/trunk/src/actions/kz-actions-tab.c 2009-02-14 07:33:02 UTC (rev 3685) @@ -88,7 +88,7 @@ kztab = g_object_get_qdata(G_OBJECT(kz), kztab_quark); g_return_if_fail(KZ_IS_TAB_LABEL(kztab)); - kz_window_close_tab(kztab->kz, GTK_WIDGET(kztab->kzembed)); + kz_window_close_tab(kztab->kz, kztab->kzembed); } enum { @@ -176,7 +176,7 @@ GtkWidget *widget = node->data; if (widget != GTK_WIDGET(kzembed)) - kz_window_close_tab(kz, widget); + kz_window_close_tab(kz, KZ_EMBED(widget)); } g_list_free(list); } @@ -210,7 +210,7 @@ target = g_strsplit(kz_embed_get_location(embed), "/", 0); if(!(strcmp(src[2] , target[2]))) - kz_window_close_tab(kz, GTK_WIDGET(embed)); + kz_window_close_tab(kz, embed); g_strfreev(target); } g_strfreev(src); Modified: kazehakase/trunk/src/actions/kz-actions.c =================================================================== --- kazehakase/trunk/src/actions/kz-actions.c 2009-02-14 06:25:00 UTC (rev 3684) +++ kazehakase/trunk/src/actions/kz-actions.c 2009-02-14 07:33:02 UTC (rev 3685) @@ -114,7 +114,7 @@ { KzEmbed *embed = KZ_WINDOW_CURRENT_EMBED(kz); if (embed) - kz_window_close_tab(kz, GTK_WIDGET(embed)); + kz_window_close_tab(kz, embed); } Modified: kazehakase/trunk/src/kz-notebook.c =================================================================== --- kazehakase/trunk/src/kz-notebook.c 2009-02-14 06:25:00 UTC (rev 3684) +++ kazehakase/trunk/src/kz-notebook.c 2009-02-14 07:33:02 UTC (rev 3685) @@ -27,6 +27,7 @@ #include "gtk-utils.h" #include "kz-tab-label.h" #include "kz-actions.h" +#include "kz-bin.h" static const gpointer KZ_NOTEBOOK_GROUP = "KzNotebookGroup"; @@ -325,7 +326,7 @@ KzTabLabel *tab; gchar *title; KzNotebookPrivate *priv = KZ_NOTEBOOK_GET_PRIVATE(notebook); - KzEmbed *kzembed = KZ_EMBED(gtk_notebook_get_nth_page(notebook, page_num)); + KzEmbed *kzembed = kz_notebook_get_nth_embed(KZ_NOTEBOOK(notebook), page_num); title = kz_embed_ensure_title(kzembed); if (title) @@ -523,7 +524,7 @@ } gboolean -kz_notebook_close_tab (KzNotebook *notebook, GtkWidget *widget) +kz_notebook_close_tab (KzNotebook *notebook, KzEmbed *embed) { gchar *ret_page = NULL; KzTabLabel *kztab = NULL; @@ -531,17 +532,16 @@ KzNotebookPrivate *priv = KZ_NOTEBOOK_GET_PRIVATE(notebook); KzWindow *kz = priv->kz; GNode *node, *child; - GtkWidget *current = gtk_notebook_get_nth_page(GTK_NOTEBOOK(notebook), - gtk_notebook_get_current_page(GTK_NOTEBOOK(notebook))); - kztab = KZ_TAB_LABEL(gtk_notebook_get_tab_label(GTK_NOTEBOOK(notebook), - widget)); + KzEmbed *current = kz_notebook_get_nth_embed(notebook, + gtk_notebook_get_current_page(GTK_NOTEBOOK(notebook))); + kztab = kz_notebook_get_tab_label(KZ_NOTEBOOK(notebook), embed); if (kztab && kz_tab_label_get_lock(kztab)) { /* kztab is locked, so return without closing tab */ return FALSE; } - else if (current != widget) + else if (current != embed) { /* close tab which is not current , so there is nothing to consider */ goto CLOSE_TAB; @@ -592,9 +592,9 @@ g_free(ret_page); CLOSE_TAB: - priv->view_hist = g_list_remove(priv->view_hist, widget); + priv->view_hist = g_list_remove(priv->view_hist, embed); node = g_node_find(priv->tab_tree, - G_IN_ORDER, G_TRAVERSE_ALL, widget); + G_IN_ORDER, G_TRAVERSE_ALL, embed); if (node) { /* move children */ @@ -609,7 +609,7 @@ g_node_destroy(node); } - gtk_widget_destroy(widget); + gtk_widget_destroy(GTK_WIDGET(embed)); if (kz && gtk_notebook_get_n_pages(GTK_NOTEBOOK(notebook)) == 0) { @@ -632,13 +632,13 @@ for (i = num - 1; i >= 0; i--) { - GtkWidget *widget = gtk_notebook_get_nth_page(GTK_NOTEBOOK(notebook), i); + KzEmbed *embed = kz_notebook_get_nth_embed(notebook, i); if (i == pos) continue; if (i > pos && condition == KZ_NOTEBOOK_CLOSE_BACKWARD) continue; if (i < pos && condition == KZ_NOTEBOOK_CLOSE_FORWARD) continue; - kz_notebook_close_tab(notebook, widget); + kz_notebook_close_tab(notebook, embed); } return TRUE; } Modified: kazehakase/trunk/src/kz-notebook.h =================================================================== --- kazehakase/trunk/src/kz-notebook.h 2009-02-14 06:25:00 UTC (rev 3684) +++ kazehakase/trunk/src/kz-notebook.h 2009-02-14 07:33:02 UTC (rev 3685) @@ -52,7 +52,7 @@ KzEmbed *embed, KzTabLabel *label); gboolean kz_notebook_close_tab (KzNotebook *notebook, - GtkWidget *widget); + KzEmbed *embed); gboolean kz_notebook_close_tabs (KzNotebook *notebook, KzNotebookCloseCondition condition, gint pos); Modified: kazehakase/trunk/src/kz-tab-label.c =================================================================== --- kazehakase/trunk/src/kz-tab-label.c 2009-02-14 06:25:00 UTC (rev 3684) +++ kazehakase/trunk/src/kz-tab-label.c 2009-02-14 07:33:02 UTC (rev 3685) @@ -622,7 +622,7 @@ #endif if (event->button == 2) { - kz_window_close_tab(kztab->kz, GTK_WIDGET(kztab->kzembed)); + kz_window_close_tab(kztab->kz, kztab->kzembed); } if (event->type == GDK_2BUTTON_PRESS) { @@ -822,7 +822,7 @@ cb_close_button_clicked (GtkWidget *button, KzTabLabel *kztab) { g_return_if_fail(KZ_IS_TAB_LABEL(kztab)); - kz_window_close_tab(kztab->kz, GTK_WIDGET(kztab->kzembed)); + kz_window_close_tab(kztab->kz, kztab->kzembed); } static void Modified: kazehakase/trunk/src/kz-window.c =================================================================== --- kazehakase/trunk/src/kz-window.c 2009-02-14 06:25:00 UTC (rev 3684) +++ kazehakase/trunk/src/kz-window.c 2009-02-14 07:33:02 UTC (rev 3685) @@ -927,12 +927,12 @@ void -kz_window_close_tab (KzWindow *kz, GtkWidget *widget) +kz_window_close_tab (KzWindow *kz, KzEmbed *embed) { g_return_if_fail(KZ_IS_WINDOW(kz)); - g_return_if_fail(GTK_IS_WIDGET(widget)); + g_return_if_fail(KZ_IS_EMBED(embed)); - kz_notebook_close_tab(KZ_NOTEBOOK(kz->notebook), widget); + kz_notebook_close_tab(KZ_NOTEBOOK(kz->notebook), embed); } @@ -2140,7 +2140,7 @@ kz_window_unset_cur_embed_callbacks(kz, kzembed); kz_window_unset_embed_callbacks(kz, kzembed); - kz_notebook_close_tab(KZ_NOTEBOOK(kz->notebook), GTK_WIDGET(obj)); + kz_notebook_close_tab(KZ_NOTEBOOK(kz->notebook), KZ_EMBED(obj)); kz_statusbar_set_link_text(KZ_STATUSBAR(kz->statusbar), NULL); g_signal_emit(kz, kz_window_signals[REMOVE_TAB_SIGNAL], Modified: kazehakase/trunk/src/kz-window.h =================================================================== --- kazehakase/trunk/src/kz-window.h 2009-02-14 06:25:00 UTC (rev 3684) +++ kazehakase/trunk/src/kz-window.h 2009-02-14 07:33:02 UTC (rev 3685) @@ -104,7 +104,7 @@ const gchar *url, GtkWidget *parent); void kz_window_close_tab (KzWindow *kz, - GtkWidget *widget); + KzEmbed *embed); void kz_window_close_all_tab (KzWindow *kz); void kz_window_move_tab (KzWindow *src_kz, KzWindow *dest_kz,