{"id":12,"date":"2005-04-17T22:02:06","date_gmt":"2005-04-17T21:02:06","guid":{"rendered":"https:\/\/raphael.slinckx.net\/blog\/index.php\/2005-04-17\/epiphany-rss-extension-2\/"},"modified":"2006-06-19T22:49:17","modified_gmt":"2006-06-19T20:49:17","slug":"epiphany-rss-extension-2","status":"publish","type":"post","link":"https:\/\/raphael.slinckx.net\/blog\/2005-04-17\/epiphany-rss-extension-2","title":{"rendered":"Epiphany RSS extension"},"content":{"rendered":"<p>Well, another <a href=\"http:\/\/bugzilla.gnome.org\/show_bug.cgi?id=301001\">update<\/a><\/p>\n<p>This one allows to directly subscribe to a feed when right clicking on it&#8217;s link in the page (feature asked by &#8220;nud&#8221; on IRC)<\/p>\n<p>Beside that I started looking at the epiphany-mono package, to allow mono extensions be easily written for epiphany, the binding is quite complete, but very buggy at the moment, so i&#8217;ll help fixing that eventually.<\/p>\n<p>It can be fetched from the gnome cvs:<br \/>\n<code>cvs -d :pserver:anonymous@anoncvs.gnome.org:\/cvs\/gnome co epiphany-mono<\/code><\/p>\n<p>Then the extension itself is something like:<\/p>\n<pre>\r\nusing System;\r\nusing Gtk;\r\nusing Epiphany;\r\n\r\nnamespace EphyRssExtension {\r\n\tpublic class RssExtension : GLib.Object, EphyExtension {\r\n\t\tprivate Hashtable feeds = new Hashtable();\r\n\r\n\t\tpublic RssExtension () : base (IntPtr.Zero) {\r\n\t\t\tConsole.WriteLine (\"New EphyRss Extension\");\r\n\t\t}\r\n\r\n\t\tpublic void AttachWindow (EphyWindow window)\r\n\t\t{\r\n\t\t    Console.WriteLine (\"EphyWindow Attached\");\r\n\t\t    \/\/Do anything you like with he window\r\n\t\t}\r\n\r\n\t\tpublic void DetachWindow (EphyWindow window)\r\n\t\t{\r\n\t\t\tConsole.WriteLine (\"EphyWindow Detached\");\r\n\t\t       \/\/Do anything you like when the window is discarded\r\n\t\t}\r\n\r\n\t\tpublic void DetachTab (EphyWindow window, EphyTab tab)\r\n\t\t{\r\n\t\t    System.Console.WriteLine (\"Detach tab\");\r\n\r\n\t\t    feeds.Remove(tab.Embed);\r\n\t\t    tab.Embed.GeFeedLink -= OnFeedReceived;\r\n\t\t    tab.Embed.GeContentChange -= OnContentChange;\r\n\t\t}\r\n\r\n\t\tpublic void AttachTab (EphyWindow window, EphyTab tab)\r\n\t\t{\r\n\t\t    System.Console.WriteLine (\"Attach tab: {0}\", tab.DocumentType );\r\n\r\n\t\t    feeds[tab.Embed] = new ArrayList();\r\n\t\t    tab.Embed.GeFeedLink += OnFeedReceived;\r\n\t\t    tab.Embed.GeContentChange += OnContentChange;\r\n\t\t}\r\n\r\n\t\tprivate void OnFeedReceived (object o, GeFeedLinkArgs args)\r\n\t\t{\r\n\t\t\tConsole.WriteLine (\"Feed {0}: '{1}' @ {2}\",\r\n                                                args.Type, args.Title, args.Address);\r\n\t\t\tIList l = feeds[o] as IList;\r\n\r\n\t\t\tFeed f = new Feed();\r\n\t\t\tf.Title = args.Title;\r\n\t\t\tf.Type = args.Type;\r\n\t\t\tf.Address = args.Address;\r\n\r\n\t\t\tl.Add(f);\r\n\t\t}\r\n\r\n\t\tprivate void OnContentChange  (object obj, EventArgs args)\r\n\t\t{\r\n\t\t\t(feeds[obj] as IList).Clear ();\r\n\t\t}\r\n\r\n\t\tprivate struct Feed {\r\n\t\t\tpublic string Title;\r\n\t\t\tpublic string Type;\r\n\t\t\tpublic string Address;\r\n\t\t}\r\n\t}\r\n}\r\n<\/pre>\n<p>Which does pretty much nothing except that it stores in a hashtable the feeds corresponding to each opened tabs. It requires now little effort to make a nice gtk UI, like a dialog or integrating menu items or statusbar icons in epiphany via the GtkUiManager.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Well, another update This one allows to directly subscribe to a feed when right clicking on it&#8217;s link in the page (feature asked by &#8220;nud&#8221; on IRC) Beside that I started looking at the epiphany-mono package, to allow mono extensions be easily written for epiphany, the binding is quite complete, but very buggy at the [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4,2],"tags":[],"class_list":["post-12","post","type-post","status-publish","format-standard","hentry","category-planet-gnome","category-software"],"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/raphael.slinckx.net\/blog\/wp-json\/wp\/v2\/posts\/12","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/raphael.slinckx.net\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/raphael.slinckx.net\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/raphael.slinckx.net\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/raphael.slinckx.net\/blog\/wp-json\/wp\/v2\/comments?post=12"}],"version-history":[{"count":0,"href":"https:\/\/raphael.slinckx.net\/blog\/wp-json\/wp\/v2\/posts\/12\/revisions"}],"wp:attachment":[{"href":"https:\/\/raphael.slinckx.net\/blog\/wp-json\/wp\/v2\/media?parent=12"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/raphael.slinckx.net\/blog\/wp-json\/wp\/v2\/categories?post=12"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/raphael.slinckx.net\/blog\/wp-json\/wp\/v2\/tags?post=12"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}