GNOME Bugzilla – Bug 116629
Dashboard crack
Last modified: 2004-12-22 21:47:04 UTC
<Nat> so, basically here's what you guys can do to make me really happy <Nat> 1. provide a simple C library for accessing the url history and the bookmarks. mainly the bookmarks. <Nat> 2. add a little hook so i can plugin in .so's that fire whenever you hit a page, and expose sufficient internal interfaces to the plugin so i can get title, url, and html of the page 'nuff said.
For the sake of mentioning it i'd find this useful for openapplet too :)
Xan, can you explain the use of this stuff ? Prolly the title say it but I dont get it ;)
dashboard is this cool little app that harvests data and provides the user information related to what they are doing. http://www.nat.org/dashboard/
Ok, more information so people who wasn't in the channel can know what the hell I'm talking about. The lines above are what Nat thinks it's needed so Dashboard (http://www.nat.org/dashboard) and Epiphany could cooperate in peace and harmony and rock the world. It's that, basically.
Yay, that's stuff freedesktop people should take in consideration, not stupid xbel crap :) It sounds like a fun project too. Dave, we need to meet and work on an interface I guess, maybe I'll try to think to something ...
A few notes. Plugins ------- For the plugin system, basically I want hooks for the following events: - The browser loads a new page. - Bookmarks change (bookmark added, bookmark deleted, bookmark edited). You can basically create a BrowserPlugin object and the plugin can connect to page_load and bookmark_change signals. From the page_load signal handler I need to be able to get at the url, title, and full page content. From the bookmark_change signal, I just need to get an object which represents the new, changed or deleted bookmark. You can do all this stuff synchronously in the same thread as the rest of the browser, since I'm never going to block. Bookmark Access Library ----------------------- This should be a simple C library I can use to read the bookmarks file. I just want to be able to enumerate the bookmarks as simple structures or objects, so this can be dead simple: typedef struct _Bookmark { char *url; char *title; char **categories; } Bookmark; GList *load_bookmarks (char *path); This is just an example, do it however you want, but for me, this is all I care about. The URL history thing should be just the same.
One thing I just remembered that's very important. I need a way, from within the plugin, of finding out if the browser window/tab for a page load is focused. And I need a focus_changed event, which should give me the url and stuff for the newly-focused tab/window/thing.
Snorp, could you explain what part of this you are/plan to work on ? I dont want to work on stuff that you are already doing.
>This should be a simple C library I can use to read the bookmarks >file What about the let access this data with the epiphany corba interface ? Trying to access the same file would require locks. Also if a way to add bookmarks will be required by dashboard or another application, syncing will be a pain. Obviously the corba interface would require to startup epiphany.
Starting up epiphany - does this mean you need the GUI around? That sounds like a real problem. In the worst case I can just monitor and read whatever file you write out. I don't need to add bookmarks.
> Starting up epiphany - does this mean you need the GUI around? Nope, the process would be started but no windows opened. Something similar to epiphany/galeon --server
Just to chime in, it might be nice to have a simple c api that hides all the corba details from implementor.
Dave, yeah, that would require a library though. Nat, if you are ok with the corba interface please let me know and I'll give a try to implement it in the next days. Otherwise, proposals on how to do it differently are welcome.
Marco: I have only done the frontend code -- it simply passes cluepackets to dashboard every time you open a page. Needs more work though.....see dashboard/frontends/ephy-cvs-dashboard.patch
If you provide me a CORBA interface, I am going to have to write a C wrapper so I can bind it into C#. James - you might want to check out my new version of your patch, which now tries and fails to get the Focused attribute right.
Created attachment 18137 [details] [review] Possible implementation
The patch add a corba interface to let access epiphany resources. Basically: epiphany_resource_select ("Bookmarks"); epiphany_resource_get_description (); A string containing an rdf description of bookmarks is returned. The C library could parse this string and return it with an api like the one Nat described. For OpenApplet pourpouses this should probably be extended with a way to filter elements. Other possible implementation would have been: - The same api Nat proposed but implemented in Corba, with a C wrapper. Disadvantages: You cant add properties without breaking api - a get_n_items, get_propery (prop_name, item_n) api. Disadvantages: What happen if bookmarks are added/remove while you are iterating ? - a C library that reads directly the epiphany xml file. Disadvantages: Locks required, no way to allow to add resources (not requires by dashboard but ...). Opinions ? (The implementation is largely unfinished, but I dont want to waste time on it, if it's not ok ...)
Nat, I'm really a bit lost with this, mainly because I dont exactly understand dashboard architecture. I talked a bit with teuf and it seem that the worst damage we could get by reading the same file is to not be able to write on disk bookmarks from epiphany. Considering that it's probably never going to happen to write/read at the same time, maybe it could be acceptable. Writing a parser for bookmarks in C is trivial, if that's your preferred solution I can do it. I was plannig to find a solution useful for other applications too, but that's harder and would require a lot more thinking ... so I'd prolly give up on it for now.
I didn't say that :) Actually if you save your bookmarks in a temporary file, and then replace the real bookmark file with it, there shouldn't be any issue
Okay, I'm happy to just parse your XML files if you write to them atomically. Sorry about all the confusion on that. I do think you need a simple plugin system though.
I found the bookmarks file; where do you store your URL history? Also - any opinions on a simple plugin system?
Looks like history is in ~/.gnome2/epiphany/ephy-history.xml
Yeah that's the history. For bookmarks please use bookmarks.rdf. About plugins. We sort of planned to have a simple plugin system at some point so I think there is no problem.
I checked in a very simple plugin framework. The sample plugin get notification when bookmarks changes. Now we need to decide the set of api to expose. The worst problem with this is that ephy-shell.c include all services instead of using a base type for them.
The plugin stuff should be done. I'm now installing useful headers and the sample plugin does what you asked.
I guess this can be closed. Dashboard can parse bookmarks/history and we have a plugin system that allows to get the stuff you need.