Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Populating XUL tree from RDF data source

42 views
Skip to first unread message

Praetorian

unread,
Jul 6, 2008, 8:28:13 PM7/6/08
to
Hi,
I am creating a XULrunner application that contains a tree view. The
content of this tree is generated by a C++ DLL (I need low-level
access to the Windows API and so it cannot be done from Javascript).
Is there a way for me to populate the tree view directly from the C++
function?
Or do I have to create an RDF file from C++ and have Javascript add
the data source? If this is the only way then could someone also point
me to a C++ library that can generate RDF files? I found Brahms
(http://tinyurl.com/yyvskf) from Googling but couldn't figure out
whether it's what I'm looking for.

Thanks for your help,
Ashish.

Christophe Charron

unread,
Jul 7, 2008, 2:41:33 AM7/7/08
to

Hi,
I'm not responding to your question but just warning about adding a
rdf datasource in a tree.
Depends how you add your data source : I found a blocking(for me) bug
described here : https://bugzilla.mozilla.org/show_bug.cgi?id=441785

--
Cordially,
Christophe Charron

Philip Chee

unread,
Jul 7, 2008, 4:03:48 AM7/7/08
to

You don't actually have to create a physical rdf file. You could get
your C++ DLL to generate an in memory rdf datasource. You could look at
the Firefox 2.0 bookmarks code to see how the C++ source takes
bookmarks.html and synthesizes a rdf:bookmarks datasource.

Phil

--
Philip Chee <phi...@aleytys.pc.my>, <phili...@gmail.com>
http://flashblock.mozdev.org/ http://xsidebar.mozdev.org
Guard us from the she-wolf and the wolf, and guard us from the thief,
oh Night, and so be good for us to pass.
[ ]Cut my pizza in six slices, please; I can't eat eight.
* TagZilla 0.066.6

Neil

unread,
Jul 7, 2008, 6:30:37 AM7/7/08
to
Praetorian wrote:

>I am creating a XULrunner application that contains a tree view. The content of this tree is generated by a C++ DLL (I need low-level access to the Windows API and so it cannot be done from Javascript). Is there a way for me to populate the tree view directly from the C++ function?
>

You can create a component that implements the nsITreeView interface,
then create an instance of your component and set it as the view of the
tree in question. Note that this could get quite hard depending on the
structure of your tree.

--
Warning: May contain traces of nuts.

Praetorian

unread,
Jul 7, 2008, 11:33:36 AM7/7/08
to

Thanks for replying everyone, I really appreciate your help.

Neil, the tree is quite simple, it'll have a variable number of parent
nodes and the number of children per parent can also vary but it'll
never be more than 2 levels deep. Do you know of any examples that
implement the nsITreeView interface in C++? Or does the Firefox 2
bookmarks implementation suggestion by Phil an example of this?

Ashish.

Neil

unread,
Jul 7, 2008, 6:43:42 PM7/7/08
to
Praetorian wrote:

>Do you know of any examples that implement the nsITreeView interface in C++?
>

I don't know of any good or even relevant examples - many trees, whether
implemented C++ or JS, are flat; the notable exception is the mailnews
threaded view, but even that's simplified because you can only expand or
collapse top-level entries.

>Or does the Firefox 2 bookmarks implementation suggestion by Phil an example of this?
>
>

No, because it's using an RDF tree builder, and that's scary code ;-)

0 new messages