svnno****@sourc*****
svnno****@sourc*****
Fri Sep 4 09:29:12 JST 2009
Revision: 3823 http://sourceforge.jp/projects/kazehakase/svn/view?view=rev&revision=3823 Author: ikezoe Date: 2009-09-04 09:29:12 +0900 (Fri, 04 Sep 2009) Log Message: ----------- * src/kz-embed.[ch]: Remove get_title interface. Modified Paths: -------------- kazehakase/trunk/ChangeLog kazehakase/trunk/dbus/kz-dbus-embed-agent.c kazehakase/trunk/module/embed/gecko/kz-gecko-embed.cpp kazehakase/trunk/module/embed/ie/kz-ie.c kazehakase/trunk/module/embed/moz-web-view/kz-moz-web-view.c kazehakase/trunk/module/embed/per-process/kz-dbus-embed-delegate.c kazehakase/trunk/module/embed/webkit-gtk/kz-webkit-gtk.c kazehakase/trunk/src/kz-embed.c kazehakase/trunk/src/kz-embed.h Modified: kazehakase/trunk/ChangeLog =================================================================== --- kazehakase/trunk/ChangeLog 2009-09-04 00:28:36 UTC (rev 3822) +++ kazehakase/trunk/ChangeLog 2009-09-04 00:29:12 UTC (rev 3823) @@ -11,6 +11,7 @@ * src/kz-web.c: Fix crash when viewing source. * src/bookmarks/kz-bookmark-bar.c, src/bookmarks/kz-bookmark-item.c: KzEmbed -> KzWeb. + * src/kz-embed.[ch]: Remove get_title interface. 2009-09-02 Hiroyuki Ikezoe <poinc****@ikezo*****> Modified: kazehakase/trunk/dbus/kz-dbus-embed-agent.c =================================================================== --- kazehakase/trunk/dbus/kz-dbus-embed-agent.c 2009-09-04 00:28:36 UTC (rev 3822) +++ kazehakase/trunk/dbus/kz-dbus-embed-agent.c 2009-09-04 00:29:12 UTC (rev 3823) @@ -395,7 +395,6 @@ iface->view_current_page_source_in_new = NULL; iface->is_loading = NULL; - iface->get_title = NULL; iface->get_location = NULL; iface->get_progress = NULL; iface->can_cut_selection = NULL; Modified: kazehakase/trunk/module/embed/gecko/kz-gecko-embed.cpp =================================================================== --- kazehakase/trunk/module/embed/gecko/kz-gecko-embed.cpp 2009-09-04 00:28:36 UTC (rev 3822) +++ kazehakase/trunk/module/embed/gecko/kz-gecko-embed.cpp 2009-09-04 00:29:12 UTC (rev 3823) @@ -122,9 +122,8 @@ gint cur_requests; gint total_requests; - /* location and title */ + /* location */ gchar *location; - gchar *title; gint load_started; /* count of currently active connections */ gint load_percent; @@ -215,7 +214,6 @@ (KzEmbed *kzembed, KzEmbed *new_embed); static gboolean is_loading (KzEmbed *kzembed); -static const gchar *get_title (KzEmbed *kzembed); static const gchar *get_location (KzEmbed *kzembed); static gdouble get_progress (KzEmbed *kzembed); static gboolean can_cut_selection (KzEmbed *kzembed); @@ -414,7 +412,6 @@ iface->view_current_page_source_in_new = view_current_page_source_in_new; iface->is_loading = is_loading; - iface->get_title = get_title; iface->get_location = get_location; iface->get_progress = get_progress; iface->can_cut_selection = can_cut_selection; @@ -557,7 +554,6 @@ KzGeckoEmbedPrivate *priv = KZ_GECKO_EMBED_GET_PRIVATE (kzembed); priv->location = NULL; - priv->title = NULL; priv->load_started = 0; priv->load_percent = 0; priv->bytes_loaded = 0; @@ -600,13 +596,8 @@ { KzGeckoEmbedPrivate *priv = KZ_GECKO_EMBED_GET_PRIVATE (object); - if (priv->location) - g_free(priv->location); + g_free(priv->location); priv->location = NULL; - - if (priv->title) - g_free(priv->title); - priv->title = NULL; if (G_OBJECT_CLASS (kz_gecko_embed_parent_class)->dispose) G_OBJECT_CLASS (kz_gecko_embed_parent_class)->dispose(object); @@ -810,13 +801,6 @@ } -static const gchar * -get_title (KzEmbed *kzembed) -{ - g_return_val_if_fail(KZ_IS_GECKO_EMBED(kzembed), NULL); - return KZ_GECKO_EMBED_GET_PRIVATE(kzembed)->title; -} - static gdouble get_progress (KzEmbed *kzembed) { @@ -890,18 +874,16 @@ static void kz_gecko_embed_title (GtkMozEmbed *embed) { + gchar *title; g_return_if_fail(KZ_IS_GECKO_EMBED(embed)); - KzGeckoEmbedPrivate *priv = KZ_GECKO_EMBED_GET_PRIVATE(embed); + title = gtk_moz_embed_get_title(embed); - g_free(priv->title); + g_signal_emit_by_name(embed, "kz-title", title); - priv->title = gtk_moz_embed_get_title(embed); - - g_signal_emit_by_name(embed, "kz-title", priv->title); - if (((GtkMozEmbedClass*)kz_gecko_embed_parent_class)->title) ((GtkMozEmbedClass*)kz_gecko_embed_parent_class)->title(embed); + g_free(title); } static void @@ -994,7 +976,7 @@ if (KZ_GET_SEARCH) { - const gchar *title = get_title(KZ_EMBED(kzembed)); + gchar *title = gtk_moz_embed_get_title(GTK_MOZ_EMBED(kzembed)); nsCOMPtr<nsIDOMNode> node = do_QueryInterface(domDoc); nsCOMPtr<nsIDOMSerializer> serializer; @@ -1012,6 +994,7 @@ kz_search_register_document(search, uri, title, cValue.get(), last_modified); g_object_unref(search); } + g_free(title); #endif } } Modified: kazehakase/trunk/module/embed/ie/kz-ie.c =================================================================== --- kazehakase/trunk/module/embed/ie/kz-ie.c 2009-09-04 00:28:36 UTC (rev 3822) +++ kazehakase/trunk/module/embed/ie/kz-ie.c 2009-09-04 00:29:12 UTC (rev 3823) @@ -39,7 +39,6 @@ glong current_progress; glong max_progress; gchar *location; - gchar *title; }; #define KZ_IE_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE ((obj), KZ_TYPE_IE, KzIEPrivate)) @@ -76,7 +75,6 @@ /* embed iface */ static void kz_ie_load_uri (KzEmbed *kzembed, const gchar *uri); -static const gchar *kz_ie_get_title (KzEmbed *kzembed); static const gchar *kz_ie_get_location (KzEmbed *kzembed); static gdouble kz_ie_get_progress (KzEmbed *kzembed); static void kz_ie_reload (KzEmbed *kzembed, @@ -226,7 +224,6 @@ iface->view_current_page_source_in_new = NULL; iface->is_loading = kz_ie_is_loading; - iface->get_title = kz_ie_get_title; iface->get_location = kz_ie_get_location; iface->get_progress = kz_ie_get_progress; iface->can_cut_selection = kz_ie_can_cut_selection; @@ -302,7 +299,6 @@ KzIEPrivate *priv = KZ_IE_GET_PRIVATE (ie); priv->location = NULL; - priv->title = NULL; priv->current_progress = 0; priv->max_progress =0; @@ -315,12 +311,8 @@ { KzIEPrivate *priv = KZ_IE_GET_PRIVATE(object); - if (priv->location) - g_free(priv->location); - if (priv->title) - g_free(priv->title); + g_free(priv->location); priv->location = NULL; - priv->title = NULL; if (G_OBJECT_CLASS(kz_ie_parent_class)->dispose) G_OBJECT_CLASS(kz_ie_parent_class)->dispose(object); @@ -339,8 +331,7 @@ { KzIEPrivate *priv = KZ_IE_GET_PRIVATE(ieembed); - if (priv->location) - g_free(priv->location); + g_free(priv->location); priv->location = g_strdup(location); g_signal_emit_by_name(ieembed, "kz-location", location); } @@ -348,11 +339,6 @@ static void kz_ie_embed_title (GtkIEEmbed *ieembed, const gchar *title) { - KzIEPrivate *priv = KZ_IE_GET_PRIVATE(ieembed); - - if (priv->title) - g_free(priv->title); - priv->title = g_strdup(title); g_signal_emit_by_name(ieembed, "kz-title", title); } @@ -496,14 +482,6 @@ } static const gchar * -kz_ie_get_title (KzEmbed *kzembed) -{ - g_return_val_if_fail(KZ_IS_IE(kzembed), NULL); - - return KZ_IE_GET_PRIVATE(kzembed)->title; -} - -static const gchar * kz_ie_get_location (KzEmbed *kzembed) { g_return_val_if_fail(KZ_IS_IE(kzembed), NULL); @@ -822,7 +800,8 @@ GList *children, *bookmark_node; GList *backward_history, *forward_history; gint current_position = 0; - const gchar *uri, *title; + const gchar *uri; + gchar *title; backward_history = gtk_ie_embed_get_backward_history(GTK_IE_EMBED(kzembed)); forward_history = gtk_ie_embed_get_forward_history(GTK_IE_EMBED(kzembed)); @@ -834,8 +813,9 @@ history); uri = KZ_IE_GET_PRIVATE(kzembed)->location; - title = KZ_IE_GET_PRIVATE(kzembed)->title; + title = gtk_ie_embed_get_title(GTK_IE_EMBED(kzembed)); merge_to_bookmark_list(uri, title, &bookmark_node, history); + g_free(title); merge_ie_history_list_to_bookmark_list(forward_history, &bookmark_node, Modified: kazehakase/trunk/module/embed/moz-web-view/kz-moz-web-view.c =================================================================== --- kazehakase/trunk/module/embed/moz-web-view/kz-moz-web-view.c 2009-09-04 00:28:36 UTC (rev 3822) +++ kazehakase/trunk/module/embed/moz-web-view/kz-moz-web-view.c 2009-09-04 00:29:12 UTC (rev 3823) @@ -32,7 +32,6 @@ { gint progress; gchar *location; - gchar *title; gchar *link_message; gboolean is_loading; }; @@ -80,7 +79,6 @@ static void paste (KzEmbed *kzembed); static void select_all (KzEmbed *kzembed); static gdouble get_progress (KzEmbed *kzembed); -static const gchar *get_title (KzEmbed *kzembed); static const gchar *get_location (KzEmbed *kzembed); static gboolean selection_is_collapsed (KzEmbed *kzembed); static gboolean is_loading (KzEmbed *kzembed); @@ -165,7 +163,6 @@ iface->view_current_page_source_in_new = NULL; iface->is_loading = is_loading; - iface->get_title = get_title; iface->get_location = get_location; iface->get_progress = get_progress; iface->can_cut_selection = can_cut_selection; @@ -244,7 +241,6 @@ KzMozWebViewPrivate *priv = KZ_MOZ_WEB_VIEW_GET_PRIVATE(webkit); priv->location = NULL; - priv->title = NULL; priv->link_message = NULL; priv->progress = 0; @@ -256,14 +252,9 @@ kz_moz_web_view_dispose (GObject *object) { KzMozWebViewPrivate *priv = KZ_MOZ_WEB_VIEW_GET_PRIVATE(object); - if (priv->location) - g_free(priv->location); - if (priv->title) - g_free(priv->title); - if (priv->link_message) - g_free(priv->link_message); + g_free(priv->location); + g_free(priv->link_message); priv->location = NULL; - priv->title = NULL; priv->link_message = NULL; if (G_OBJECT_CLASS(kz_moz_web_view_parent_class)->dispose) @@ -397,14 +388,6 @@ } static const gchar * -get_title (KzEmbed *kzembed) -{ - g_return_val_if_fail(KZ_IS_MOZ_WEB_VIEW(kzembed), NULL); - - return moz_web_view_get_title(MOZ_WEB_VIEW(kzembed)); -} - -static const gchar * get_location (KzEmbed *kzembed) { g_return_val_if_fail(KZ_IS_MOZ_WEB_VIEW(kzembed), NULL); Modified: kazehakase/trunk/module/embed/per-process/kz-dbus-embed-delegate.c =================================================================== --- kazehakase/trunk/module/embed/per-process/kz-dbus-embed-delegate.c 2009-09-04 00:28:36 UTC (rev 3822) +++ kazehakase/trunk/module/embed/per-process/kz-dbus-embed-delegate.c 2009-09-04 00:29:12 UTC (rev 3823) @@ -56,7 +56,6 @@ DBusGProxy *proxy; GPid process_id; guint watch_id; - gchar *title; gchar *location; gchar *link_message; gdouble progress; @@ -105,7 +104,6 @@ gboolean backward); static void zoom (KzEmbed *embed, gdouble zoom); -static const gchar *get_title (KzEmbed *embed); static const gchar *get_location (KzEmbed *embed); static gdouble get_progress (KzEmbed *embed); static void set_history (KzEmbed *embed, @@ -278,11 +276,6 @@ static void cb_title (DBusGProxy *proxy, const gchar *title, KzDBusEmbedDelegate *object) { - KzDBusEmbedDelegatePrivate *priv = KZ_DBUS_EMBED_DELEGATE_GET_PRIVATE(object); - - g_free(priv->title); - priv->title = g_strdup(title); - g_signal_emit_by_name(object, "kz-title", title); } @@ -404,7 +397,6 @@ iface->view_current_page_source_in_new = NULL; iface->is_loading = NULL; - iface->get_title = get_title; iface->get_location = get_location; iface->get_progress = get_progress; iface->can_cut_selection = can_cut_selection; @@ -544,11 +536,9 @@ priv->watch_id = 0; } - g_free(priv->title); g_free(priv->location); g_free(priv->socket_address); g_free(priv->link_message); - priv->title = NULL; priv->location = NULL; priv->socket_address = NULL; priv->link_message = NULL; @@ -617,7 +607,6 @@ priv->connection = NULL; priv->proxy = NULL; priv->process_id = -1; - priv->title = NULL; priv->location = NULL; priv->progress = 0.0; priv->link_message = NULL; @@ -805,12 +794,6 @@ } static const gchar * -get_title (KzEmbed *embed) -{ - return KZ_DBUS_EMBED_DELEGATE_GET_PRIVATE(embed)->title; -} - -static const gchar * get_location (KzEmbed *embed) { return KZ_DBUS_EMBED_DELEGATE_GET_PRIVATE(embed)->location; Modified: kazehakase/trunk/module/embed/webkit-gtk/kz-webkit-gtk.c =================================================================== --- kazehakase/trunk/module/embed/webkit-gtk/kz-webkit-gtk.c 2009-09-04 00:28:36 UTC (rev 3822) +++ kazehakase/trunk/module/embed/webkit-gtk/kz-webkit-gtk.c 2009-09-04 00:29:12 UTC (rev 3823) @@ -33,7 +33,6 @@ WebKitWebView *web_view; gint progress; gchar *location; - gchar *title; gchar *link_message; gboolean is_loading; }; @@ -76,7 +75,6 @@ static void paste (KzEmbed *kzembed); static void select_all (KzEmbed *kzembed); static gdouble get_progress (KzEmbed *kzembed); -static const gchar *get_title (KzEmbed *kzembed); static const gchar *get_location (KzEmbed *kzembed); static gboolean selection_is_collapsed (KzEmbed *kzembed); static gboolean is_loading (KzEmbed *kzembed); @@ -214,7 +212,6 @@ iface->view_current_page_source_in_new = NULL; iface->is_loading = is_loading; - iface->get_title = get_title; iface->get_location = get_location; iface->get_progress = get_progress; iface->can_cut_selection = can_cut_selection; @@ -325,7 +322,6 @@ KzWebKitGtkPrivate *priv = KZ_WEBKIT_GTK_GET_PRIVATE(webkit); priv->location = NULL; - priv->title = NULL; priv->link_message = NULL; priv->progress = 0; @@ -337,14 +333,9 @@ dispose (GObject *object) { KzWebKitGtkPrivate *priv = KZ_WEBKIT_GTK_GET_PRIVATE(object); - if (priv->location) - g_free(priv->location); - if (priv->title) - g_free(priv->title); - if (priv->link_message) - g_free(priv->link_message); + g_free(priv->location); + g_free(priv->link_message); priv->location = NULL; - priv->title = NULL; priv->link_message = NULL; if (G_OBJECT_CLASS(kz_webkit_gtk_parent_class)->dispose) @@ -475,14 +466,6 @@ } static const gchar * -get_title (KzEmbed *kzembed) -{ - g_return_val_if_fail(KZ_IS_WEBKIT_GTK(kzembed), NULL); - - return KZ_WEBKIT_GTK_GET_PRIVATE(kzembed)->title; -} - -static const gchar * get_location (KzEmbed *kzembed) { g_return_val_if_fail(KZ_IS_WEBKIT_GTK(kzembed), NULL); @@ -629,7 +612,7 @@ if (!current_item) { current_item = webkit_web_history_item_new_with_data(priv->location, - priv->title); + webkit_web_view_get_title(priv->web_view)); } return current_item; @@ -778,11 +761,6 @@ const gchar* title, gpointer data) { - KzWebKitGtkPrivate *priv = KZ_WEBKIT_GTK_GET_PRIVATE(data); - if (priv->title) - g_free(priv->title); - priv->title = g_strdup(title); - g_signal_emit_by_name(data, "kz-title", title); } @@ -804,8 +782,7 @@ { KzWebKitGtkPrivate *priv = KZ_WEBKIT_GTK_GET_PRIVATE(data); const gchar* location = webkit_web_frame_get_uri(frame); - if (priv->location) - g_free(priv->location); + g_free(priv->location); priv->location = g_strdup(location); g_signal_emit_by_name(data, "kz-location", location); } Modified: kazehakase/trunk/src/kz-embed.c =================================================================== --- kazehakase/trunk/src/kz-embed.c 2009-09-04 00:28:36 UTC (rev 3822) +++ kazehakase/trunk/src/kz-embed.c 2009-09-04 00:29:12 UTC (rev 3823) @@ -434,17 +434,6 @@ const gchar * -kz_embed_get_title (KzEmbed *kzembed) -{ - g_return_val_if_fail(KZ_IS_EMBED(kzembed), NULL); - if (!KZ_EMBED_GET_IFACE(kzembed)->get_title) - return NULL; - - return KZ_EMBED_GET_IFACE(kzembed)->get_title(kzembed); -} - - -const gchar * kz_embed_get_location (KzEmbed *kzembed) { g_return_val_if_fail(KZ_IS_EMBED(kzembed), NULL); Modified: kazehakase/trunk/src/kz-embed.h =================================================================== --- kazehakase/trunk/src/kz-embed.h 2009-09-04 00:28:36 UTC (rev 3822) +++ kazehakase/trunk/src/kz-embed.h 2009-09-04 00:29:12 UTC (rev 3823) @@ -88,7 +88,6 @@ gboolean (*is_loading) (KzEmbed *kzembed); - const gchar *(*get_title) (KzEmbed *kzembed); const gchar *(*get_location) (KzEmbed *kzembed); gdouble (*get_progress) (KzEmbed *kzembed); @@ -292,7 +291,6 @@ gboolean kz_embed_is_loading (KzEmbed *kzembed); -const gchar *kz_embed_get_title (KzEmbed *kzembed); const gchar *kz_embed_get_location (KzEmbed *kzembed); gdouble kz_embed_get_progress (KzEmbed *kzembed);