svnno****@sourc*****
svnno****@sourc*****
Wed Apr 4 09:03:32 JST 2007
Revision: 3130 http://svn.sourceforge.jp/cgi-bin/viewcvs.cgi?root=kazehakase&view=rev&rev=3130 Author: ikezoe Date: 2007-04-04 09:03:31 +0900 (Wed, 04 Apr 2007) Log Message: ----------- * module/embed/gecko/kz-gecko-embed.cpp: Do not check lock state in kz_gecko_embed_load_url. * src/kz-embed.c: Check lock state in kz_embed_load_url. * module/embed/gtk-webcore/kz-gtk-webcore.cpp: Implement kz_gtk_webcore_(get|set)_lock(). Though these functions should be implemented in KzEmbed, KzEmbed now has no private structure because it isn't an instance. I have no idea what it should be. Modified Paths: -------------- kazehakase/trunk/ChangeLog kazehakase/trunk/module/embed/gecko/kz-gecko-embed.cpp kazehakase/trunk/module/embed/gtk-webcore/kz-gtk-webcore.cpp kazehakase/trunk/src/kz-embed.c Modified: kazehakase/trunk/ChangeLog =================================================================== --- kazehakase/trunk/ChangeLog 2007-04-03 23:41:09 UTC (rev 3129) +++ kazehakase/trunk/ChangeLog 2007-04-04 00:03:31 UTC (rev 3130) @@ -2,7 +2,14 @@ * module/embed/gecko/kz-gecko-embed.cpp: Remove kz_gecko_embed_go_up(). This function is implemented in kz-embed.c. - + * module/embed/gecko/kz-gecko-embed.cpp: Do not check lock state in + kz_gecko_embed_load_url. + * src/kz-embed.c: Check lock state in kz_embed_load_url. + * module/embed/gtk-webcore/kz-gtk-webcore.cpp: Implement + kz_gtk_webcore_(get|set)_lock(). Though these functions should be implemented + in KzEmbed, KzEmbed now has no private structure because it isn't + an instance. I have no idea what it should be. + 2007-04-03 Hiroyuki Ikezoe <poinc****@ikezo*****> * module/embed/gtk-webcore/Makefile.am: Set G_LOG_DOMAIN. Modified: kazehakase/trunk/module/embed/gecko/kz-gecko-embed.cpp =================================================================== --- kazehakase/trunk/module/embed/gecko/kz-gecko-embed.cpp 2007-04-03 23:41:09 UTC (rev 3129) +++ kazehakase/trunk/module/embed/gecko/kz-gecko-embed.cpp 2007-04-04 00:03:31 UTC (rev 3130) @@ -830,19 +830,8 @@ start_page = g_strdup("about:blank"); } - if (kz_gecko_embed_get_lock(kzembed)) - { - GtkMozEmbed *newembed = NULL; - g_signal_emit_by_name(kzembed, - "new-window", - &newembed, 0); - gtk_moz_embed_load_url(newembed, start_page); - return; - } - else - { - gtk_moz_embed_load_url(GTK_MOZ_EMBED(kzembed), start_page); - } + gtk_moz_embed_load_url(GTK_MOZ_EMBED(kzembed), start_page); + if (priv->location) g_free(priv->location); priv->location = start_page; @@ -2485,7 +2474,7 @@ KzNavi *navi = KZ_NAVI(g_list_nth_data(priv->nav_links[link], 0)); g_return_if_fail(navi); - kz_gecko_embed_load_url(kzembed, navi->uri); + kz_embed_load_url(kzembed, navi->uri); } Modified: kazehakase/trunk/module/embed/gtk-webcore/kz-gtk-webcore.cpp =================================================================== --- kazehakase/trunk/module/embed/gtk-webcore/kz-gtk-webcore.cpp 2007-04-03 23:41:09 UTC (rev 3129) +++ kazehakase/trunk/module/embed/gtk-webcore/kz-gtk-webcore.cpp 2007-04-04 00:03:31 UTC (rev 3130) @@ -43,7 +43,8 @@ gchar *link_message; guint32 button_press_time; - gboolean is_loading; + gboolean is_loading; + gboolean lock; }; #define KZ_GTK_WEBCORE_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE ((obj), KZ_TYPE_GTK_WEBCORE, KzGtkWebcorePrivate)) @@ -115,6 +116,10 @@ static GList *kz_gtk_webcore_get_nav_links (KzEmbed *kzembed, KzEmbedNavLink link); +static gboolean kz_gtk_webcore_get_lock (KzEmbed *kzembed); +static void kz_gtk_webcore_set_lock (KzEmbed *kzembed, + gboolean lock); + static void kz_gtk_webcore_shistory_get_nth (KzEmbed *kzembed, int nth, gboolean is_relative, @@ -298,8 +303,8 @@ iface->go_history_index = NULL; iface->do_command = NULL; iface->can_do_command = NULL; - iface->get_lock = NULL; - iface->set_lock = NULL; + iface->get_lock = kz_gtk_webcore_get_lock; + iface->set_lock = kz_gtk_webcore_set_lock; iface->get_body_text = NULL; #if 0 iface->get_selection_source = NULL; @@ -1299,3 +1304,17 @@ preferences->setWillLoadImagesAutomatically(allow ? true : false); } +static gboolean +kz_gtk_webcore_get_lock (KzEmbed *kzembed) +{ + g_return_val_if_fail(KZ_IS_GTK_WEBCORE(kzembed), FALSE); + return KZ_GTK_WEBCORE_GET_PRIVATE(kzembed)->lock; +} + +static void +kz_gtk_webcore_set_lock (KzEmbed *kzembed, gboolean lock) +{ + g_return_if_fail(KZ_IS_GTK_WEBCORE(kzembed)); + KZ_GTK_WEBCORE_GET_PRIVATE(kzembed)->lock = lock; +} + Modified: kazehakase/trunk/src/kz-embed.c =================================================================== --- kazehakase/trunk/src/kz-embed.c 2007-04-03 23:41:09 UTC (rev 3129) +++ kazehakase/trunk/src/kz-embed.c 2007-04-04 00:03:31 UTC (rev 3130) @@ -361,7 +361,18 @@ { g_return_if_fail(KZ_IS_EMBED(kzembed)); - KZ_EMBED_GET_IFACE(kzembed)->load_url(kzembed, url); + if (kz_embed_get_lock(kzembed)) + { + KzEmbed *newembed = NULL; + g_signal_emit_by_name(kzembed, + "new-window", + &newembed, 0); + KZ_EMBED_GET_IFACE(kzembed)->load_url(newembed, url); + } + else + { + KZ_EMBED_GET_IFACE(kzembed)->load_url(kzembed, url); + } }