Hiroyuki Ikezoe
ikezo****@users*****
Thu Jan 4 11:47:51 JST 2007
Index: kazehakase/src/kz-app.c diff -u kazehakase/src/kz-app.c:1.16 kazehakase/src/kz-app.c:1.17 --- kazehakase/src/kz-app.c:1.16 Tue Jan 2 19:29:05 2007 +++ kazehakase/src/kz-app.c Thu Jan 4 11:47:51 2007 @@ -588,6 +588,28 @@ return KZ_APP_GET_PRIVATE(app)->window_list; } +GtkWidget * +kz_app_get_window_from_tab (KzApp *app, GtkWidget *tab_widget) +{ + KzAppPrivate *priv = KZ_APP_GET_PRIVATE(app); + GList *node; + + for (node = (GList*)priv->window_list; node; node = g_list_next (node)) + { + KzWindow *kz = node->data; + GtkWidget *label; + + if (!KZ_IS_WINDOW(kz)) continue; + + label = gtk_notebook_get_tab_label(GTK_NOTEBOOK(kz->notebook), + tab_widget); + if (label) + return GTK_WIDGET(kz); + } + + return NULL; +} + #if USE_MIGEMO KzMigemo * kz_app_get_migemo (KzApp *app) Index: kazehakase/src/kz-app.h diff -u kazehakase/src/kz-app.h:1.6 kazehakase/src/kz-app.h:1.7 --- kazehakase/src/kz-app.h:1.6 Tue Jan 2 19:29:05 2007 +++ kazehakase/src/kz-app.h Thu Jan 4 11:47:51 2007 @@ -69,15 +69,16 @@ KZ_UI_LEVEL_ALL = 0xFFFF } KzUILevel; -KzUILevel kz_app_get_ui_level (KzApp *app); -KzFavicon *kz_app_get_favicon (KzApp *app); -KzSearch *kz_app_get_search (KzApp *app); -KzRootBookmark *kz_app_get_root_bookmark (KzApp *app); -KzProfile *kz_app_get_profile (KzApp *app); -KzProfile *kz_app_get_proxy (KzApp *app); -const GList *kz_app_get_window_list (KzApp *app); +KzUILevel kz_app_get_ui_level (KzApp *app); +KzFavicon *kz_app_get_favicon (KzApp *app); +KzSearch *kz_app_get_search (KzApp *app); +KzRootBookmark *kz_app_get_root_bookmark (KzApp *app); +KzProfile *kz_app_get_profile (KzApp *app); +KzProfile *kz_app_get_proxy (KzApp *app); +const GList *kz_app_get_window_list (KzApp *app); +GtkWidget *kz_app_get_window_from_tab (KzApp *app, GtkWidget *tab); #if USE_MIGEMO -KzMigemo *kz_app_get_migemo (KzApp *app); +KzMigemo *kz_app_get_migemo (KzApp *app); #endif G_END_DECLS Index: kazehakase/src/kz-notebook.c diff -u kazehakase/src/kz-notebook.c:1.7 kazehakase/src/kz-notebook.c:1.8 --- kazehakase/src/kz-notebook.c:1.7 Thu Jan 4 11:34:46 2007 +++ kazehakase/src/kz-notebook.c Thu Jan 4 11:47:51 2007 @@ -276,7 +276,7 @@ if (!KZ_IS_TAB_LABEL(src_widget)) return; src_kztab = KZ_TAB_LABEL(src_widget); - src_kz = KZ_WINDOW(kz_window_get_from_tab(GTK_WIDGET(src_kztab->kzembed))); + src_kz = KZ_WINDOW(kz_app_get_window_from_tab(kz_app, GTK_WIDGET(src_kztab->kzembed))); if (kz == src_kz) { gint n; Index: kazehakase/src/kz-window.c diff -u kazehakase/src/kz-window.c:1.297 kazehakase/src/kz-window.c:1.298 --- kazehakase/src/kz-window.c:1.297 Thu Jan 4 11:34:46 2007 +++ kazehakase/src/kz-window.c Thu Jan 4 11:47:51 2007 @@ -797,28 +797,6 @@ } GtkWidget * -kz_window_get_from_tab (GtkWidget *tab_widget) -{ - GList *node; - - for (node = (GList*)KZ_GET_WINDOW_LIST; node; node = g_list_next (node)) - { - KzWindow *kz = node->data; - GtkWidget *label; - - if (!KZ_IS_WINDOW(kz)) continue; - - label = gtk_notebook_get_tab_label(GTK_NOTEBOOK(kz->notebook), - tab_widget); - if (label) - return GTK_WIDGET(kz); - } - - return NULL; -} - - -GtkWidget * kz_window_open_new_tab (KzWindow *kz, const gchar *url) { return kz_window_open_new_tab_with_parent (kz, url, NULL); @@ -1019,7 +997,7 @@ priv = KZ_WINDOW_GET_PRIVATE (kz); kzembed = KZ_EMBED(widget); - src_kz = KZ_WINDOW(kz_window_get_from_tab(widget)); + src_kz = KZ_WINDOW(kz_app_get_window_from_tab(kz_app, widget)); if (!src_kz) return; src_priv = KZ_WINDOW_GET_PRIVATE (src_kz); Index: kazehakase/src/kz-window.h diff -u kazehakase/src/kz-window.h:1.76 kazehakase/src/kz-window.h:1.77 --- kazehakase/src/kz-window.h:1.76 Thu Jan 4 11:29:05 2007 +++ kazehakase/src/kz-window.h Thu Jan 4 11:47:51 2007 @@ -97,7 +97,6 @@ GType kz_window_get_type (void) G_GNUC_CONST; GtkWidget *kz_window_new (const gchar *url); -GtkWidget *kz_window_get_from_tab (GtkWidget *tab_widget); GtkWidget *kz_window_open_new_tab (KzWindow *kz, const gchar *url); GtkWidget *kz_window_open_new_tab_at_tail (KzWindow *kz,