gnash-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Gnash-dev] Generic tree structure for passing info to GUIs ?


From: Chad Musick
Subject: Re: [Gnash-dev] Generic tree structure for passing info to GUIs ?
Date: Sun, 12 Aug 2007 06:33:15 +0900
User-agent: Thunderbird 2.0.0.6 (Windows/20070728)

strk wrote:
Is there a best practice to pass hierarchical sets of parameters
around ? I'd need this for a new View->MovieInfo menu itam.

The idea is that the VM would implement an:

         InfoObject VM::getMovieInfo() const;

Where InfoObject is the hierarchical thing.
An initial layout for the InfoObject for movie information would be:

        VM Version : SWF#
        Loaded Movies:
                _level0
                        URL : <url>
                        Type : SWF
                        Version : <number>
                _level1
                        URL : <url>
                        Type : SWF
                        Version : SWF#
                ...
                _level0.mc4.image
                        URL : <url>
                        Type : bitmap
                ...

The point is I don't want to define the whole structure right now, but
rather have the liberty of changing it arbitrarely w/out touching the
code in the GUI everytime. So the GUI would have a function like:

        void Gui::showInfo(InfoObject& o);

Which would show whatever it gets passed (initially for movie information,
but eventually for every kind of thing, like we may add DisplayList info).

So, back to the question : is there a best practice for this kind of extendible
structure (XML-like) or should we forge one ourselves ?
Take a look at http://www.aei.mpg.de/~peekas/tree/ which is an STL style tree class, released under the GPL. By creating a parameter class, you could have a tree of parameters. It also shouldn't be hard to tag the nodes with names in the tree and use those to find things, rather than relying solely on the iterators provided.

Chad Musick





reply via email to

[Prev in Thread] Current Thread [Next in Thread]