? lib/egg/libegg.la
Index: ChangeLog
===================================================================
RCS file: /cvs/gnome/epiphany/ChangeLog,v
retrieving revision 1.3287
diff -p -u -B -r1.3287 ChangeLog
--- ChangeLog	18 Oct 2006 09:08:03 -0000	1.3287
+++ ChangeLog	21 Oct 2006 20:59:46 -0000
@@ -1,3 +1,14 @@
+2006-10-20  Eric Butler  <eric@extremeboredom.net>
+
+	* src/ephy-embed.h:
+	Add search_link entry to _EphyEmbedIface
+
+	* src/ephy-embed.c:
+	Add ge-search-link signal
+
+	* embed/mozilla/EphyBrowser.cs: 
+	Fire ge-search-link signal for opensearch tags
+
 2006-10-18  Wouter Bolsterlee  <wbolster@gnome.org>
 
 	* src/ephy-dbus.c: (ephy_dbus_shutdown):
Index: embed/ephy-embed.c
===================================================================
RCS file: /cvs/gnome/epiphany/embed/ephy-embed.c,v
retrieving revision 1.73
diff -p -u -B -r1.73 ephy-embed.c
--- embed/ephy-embed.c	13 Sep 2006 11:34:13 -0000	1.73
+++ embed/ephy-embed.c	21 Oct 2006 20:59:47 -0000
@@ -132,6 +132,28 @@ ephy_embed_base_init (gpointer g_class)
 			      1,
 			      G_TYPE_STRING | G_SIGNAL_TYPE_STATIC_SCOPE);
 /**
+ * EphyEmbed::ge-search-link:
+ * @embed:
+ * @type: the mime-type of the search description
+ * @title: the title of the news feed
+ * @address: the URL to @embed's web site's search description
+ *
+ * The ::ge_rss signal is emitted when @embed discovers that a search
+ * description is available for the site it is visiting.
+ **/
+		g_signal_new ("ge_search_link",
+			      EPHY_TYPE_EMBED,
+			      G_SIGNAL_RUN_FIRST,
+			      G_STRUCT_OFFSET (EphyEmbedIface, search_link),
+			      NULL, NULL,
+			      ephy_marshal_VOID__STRING_STRING_STRING,
+			      G_TYPE_NONE,
+			      3,
+			      G_TYPE_STRING | G_SIGNAL_TYPE_STATIC_SCOPE,
+			      G_TYPE_STRING | G_SIGNAL_TYPE_STATIC_SCOPE,
+			      G_TYPE_STRING | G_SIGNAL_TYPE_STATIC_SCOPE);
+
+/**
  * EphyEmbed::ge-feed-link:
  * @embed:
  * @type: the mime-type of the news feed
Index: embed/ephy-embed.h
===================================================================
RCS file: /cvs/gnome/epiphany/embed/ephy-embed.h,v
retrieving revision 1.64
diff -p -u -B -r1.64 ephy-embed.h
--- embed/ephy-embed.h	13 Sep 2006 11:34:13 -0000	1.64
+++ embed/ephy-embed.h	21 Oct 2006 20:59:47 -0000
@@ -121,6 +121,10 @@ struct _EphyEmbedIface
 					 const char *type,
 					 const char *title,
 					 const char *address);
+	void	 (* search_link)	(EphyEmbed *embed,
+					 const char *type,
+					 const char *title,
+					 const char *address);
 	void	 (* location)		(EphyEmbed *embed,
 					 const char *location);
 	void	 (* net_state)		(EphyEmbed *embed,
Index: embed/mozilla/EphyBrowser.cpp
===================================================================
RCS file: /cvs/gnome/epiphany/embed/mozilla/EphyBrowser.cpp,v
retrieving revision 1.110
diff -p -u -B -r1.110 EphyBrowser.cpp
--- embed/mozilla/EphyBrowser.cpp	13 Sep 2006 11:34:14 -0000	1.110
+++ embed/mozilla/EphyBrowser.cpp	21 Oct 2006 20:59:48 -0000
@@ -221,6 +221,39 @@ EphyDOMLinkEventListener::HandleEvent (n
 		/* ok, we accept this as a valid favicon for this site */
 		g_signal_emit_by_name (mOwner->mEmbed, "ge_favicon", spec.get());
 	}
+	else if (g_ascii_strcasecmp (rel.get (), "search") == 0)
+	{
+		linkElement->GetAttribute (NS_LITERAL_STRING ("type"), value);
+
+		nsCString cTypeVal;
+		NS_UTF16ToCString (value, NS_CSTRING_ENCODING_UTF8, cTypeVal);
+
+		if (g_ascii_strcasecmp (cTypeVal.get (),
+		    "application/opensearchdescription+xml") == 0)
+		{
+			rv = linkElement->GetAttribute (NS_LITERAL_STRING ("href"), value);
+			if (NS_FAILED (rv) || !value.Length()) return NS_ERROR_FAILURE;
+
+			nsCString cLink;
+			NS_UTF16ToCString (value, NS_CSTRING_ENCODING_UTF8, cLink);
+
+			nsCOMPtr<nsIURI> docUri;
+			rv = GetDocURI (linkElement, getter_AddRefs (docUri));
+			NS_ENSURE_TRUE (NS_SUCCEEDED (rv) && docUri, NS_ERROR_FAILURE);
+
+			nsCString resolvedLink;
+			rv = docUri->Resolve (cLink, resolvedLink);
+			NS_ENSURE_SUCCESS (rv, NS_ERROR_FAILURE);
+
+			linkElement->GetAttribute (NS_LITERAL_STRING ("title"), value);
+
+			nsCString cTitle;
+			NS_UTF16ToCString (value, NS_CSTRING_ENCODING_UTF8, cTitle);
+
+			g_signal_emit_by_name (mOwner->mEmbed, "ge_search_link",
+					       cTypeVal.get(), cTitle.get(), resolvedLink.get());
+		}
+	}
 	else if (g_ascii_strcasecmp (rel.get (), "alternate") == 0)
 	{
 		linkElement->GetAttribute (NS_LITERAL_STRING ("type"), value);
