gnome-build project trees



Jeroen asked me to send some thoughts about the implementation of the
project trees to the list, so here they are.

Currently we have two trees, a target tree and a directory tree.  They
both convey the same sort of information, but in a different order.  I
don't think this is necessarily the best way to present this
information, but that's a discussion for another time.

Currently each tree implements a GtkTreeView with its own
implementations of everything (there are some shared functions in some
files).

The way I think we should lay this out is to create a GbfProjectTree
class.  This would have all the gui interaction and presentation of the
project trees.  Then each potential view (directory tree, target tree,
whatever) could just supply a model for the view that the view
understands.

There are a few ways the model could be structured.  The first is the
easiest - decide on a model format with all the possible attributes, and
have each tree fill them in.  Things like icon, text, etc.  

The second is probably more interesting, which is that the model could
just export one or two columns, with the actual objects stored in
columns.  The view would then use cell-data functions to extract the
data from these objects.  This has two advantages:
 * implementing new models is simple, they just need to present a
GtkTreeStore with a the tree structure they want.
 * We would then be free to add new treeviews that interpret the model
data differently.  (if the first suggestion is used, this is still
possible, but will involve exporting large chunks of the underlying
objects into the tree store).

Does this make sense?

-dave
-- 
Dave Camp <dave ximian com>




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