Boost logo

Boost :

Subject: Re: [boost] Thoughts for a GUI (Primitives) Library
From: Germán Diago (germandiago_at_[hidden])
Date: 2010-09-10 10:55:07


I'm in the way of implementing a prototype to see what you all think
(I already have some code, but it's not ready to be shown).
It will take some weeks to launch because I'm a little busy with other
things, but I can say I'll launch it as soon as it's ready.

My prototype will be a very simple program (a currency converter). The
main goal of this prototype is to see how it feels a generic
programming approach to gui programming. I can say what I've done for now.

I have a gui_controller class template. This class runs the main loop
and delegates some operations to a backend. The backend can be
replaced.
The backend I'm using now is Gtkmm under linux, just for testing
purposes, because it's what I'm used to.

I have a view class. A view class shows a concrete type of data, just
one type (for now). How the view shows the data is done in the
following way:

template <class DataToShow>
class view {
public:
         typedef typename generic_view_type<DataToShow>::type generic_view_t;

         typedef typename concrete_view_type<generic_view_t>::type
concrete_view_t;
.....
private:
    std::unique_ptr<concrete_view_t> view_;
};

The generic_view_t is a tag type, which can be one of label, entry,
button... But it's platform independent. The
concrete_view_type<generic_view_t> metafunction maps this view to a
real framework widget. Say qt, gtkmm, wxwidgets, MFC.

This is a simple way to keep independent generic and concrete types.
Concrete types could be anything, even they needn't to be
widgets, if that's required.

The controller should instantiate views when there is a need. All
views can be instantiated when needed. They are held in a type
erasable called any_view.

That's what I have for now (more or less). My plans are, for now, to
make a complete working example with the minimum requirements
implemented to see how it feels. Other things to consider once this is
done:

- Containers.
- Command pattern.
- Layout distribution.
- String encoding?.

See you. Thanks for your time.


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk