Re: More on Graphics abstraction (was Re: [ROOT] Qt ROOT)

From: Fons Rademakers (Fons.Rademakers@cern.ch)
Date: Tue Oct 23 2001 - 18:36:07 MEST


Hi Christian,

  this kind of factory approach is exatcly what we use for the higher
level GUI components like TCanvas, TBrowser, etc., see TGuiFactory and
the TRootGuiFactory which creates the browser and canvas with TG look
and feel (TRootCanvas, TRootBrowser, etc). Using the high level QtROOT
interface of GSI somebody can then provide a TQtGuiFactory which will
create TQtCanvas, TQtBrowser, etc. This would be more effective then
to provide a low level interface like you describe (besides the most
difficult thing in such an interface is to properly abstract the layout 
management classes in a portable way).

Cheers, Fons.



Christian Holm Christensen wrote:
> 
> Hi Bret et al,
> 
> On Tue, 23 Oct 2001 10:07:45 -0400
> Brett Viren <bv@bnl.gov> wrote
> concerning "Re: [ROOT] Qt ROOT":
> > Christian Holm Christensen writes:
> >  > All though it may seem like reinventing the wheel, and without knowing
> >  > a lot about it, I think ROOT would benefiet from being able to use
> >  > various graphics abstraction layers like GNOME and Qt, and I think
> >  > that was what Valery was suggesting and working on (but I may be
> >  > wrong).
> >
> > I have a couple points about this.
> >
> > First, one thing to add to your ASCII UML is a "TPostScript" low level
> > GUI so as to allow scalable/printable output of the entire
> > application.
> 
> Ok, I should have put some more '...' in that diagram, since, after
> all, that's what it's all about: Code reuse and extensibility :-)
> 
> > Second, I actually prefer the approach that QtROOT takes (replace high
> > level GUI code instead of providing low level implementation).
> 
> Which however has the disadvantage that you write code explicitly for
> Qt, Gtk, X11, Win32, AtheOS, MacOS, ladida, rather than writting for
> all of them at once, not caring what the user really prefers.
> 
> > This approach lets you write Qt code directly.  You don't need to go
> > through the TG classes nor rely on Rt for sig/slot.
> 
> Well, that's really the point of it: Rely on one API - not 4, 5, or
> 6.
> 
> > You can benefit from a library which has had thousands of eyes on
> > its design and implementation, which is thoroughly documented, and
> > which is quite frankly much much more easy to work with than TG +
> > Rt.
> 
> Well, the idea was to have something like
> 
>   class TGButton {
>   private:
>     TGVirtualButton*  fImplmentation;
>     ...
>   public:
>     TGButton(...) {
>       fImplmentation = TVirtualX::Instance()->MakeButton(...);
>       ...
>     }
>     ...
>   };
> 
>   class TQt {
>   public:
>     TGQtButton* MakeButton(...);
>     ...
>   };
> 
>   class TGQtButton : public TGVirtualButton {
>   private:
>     QtButton fLowLevel;
>     ...
>   };
> 
> and so you will use the QtButton/Gtk::Button/ladida (stable)
> implementation, and if you need additional elements, all you need to
> do is make the wrapper and methods in the interfaces.  Drawing the
> stuff is done by the backend.
> 
> > I wait eagerly for QtROOT to be finished so I can look through it and
> > steal all their hard work for GtkROOT!
> 
> The fact that you can probably do that, really implies (at least to
> me) that a 'backend' implmentation is possible, although, as I said
> needs a big effort.
> 
> Also, a second thing to learn from that is that OpenSource (as defined
> by the OSD) is a Good Thing!
> 
> I do realise that by the time ROOT started thier GUI stuff, Qt, Gtk,
> and so on were not nearly as complete as these libraries are today,
> and hence the option of using those libraries was not really there.
> In that context, ROOT was very good at providing a nice abstract GUI
> library, which in many respects were ahead of Qt and Gtk.
> 
> Today, some 4-5 years down the line, things look different (very
> different - heck, most my friends think I'm running Windoze with some
> weird skin, when I'm really using GNOME), and maybe it's time to
> revisit the approach.
> 
> Yours,
> 
> Christian Holm Christensen -------------------------------------------
> Address: Sankt Hansgade 23, 1. th.           Phone:  (+45) 35 35 96 91
>          DK-2200 Copenhagen N                Cell:   (+45) 28 82 16 23
>          Denmark                             Office: (+45) 353  25 305
> Email:   cholm@nbi.dk                        Web:    www.nbi.dk/~cholm

-- 
Org:    CERN, European Laboratory for Particle Physics.
Mail:   1211 Geneve 23, Switzerland
E-Mail: Fons.Rademakers@cern.ch              Phone: +41 22 7679248
WWW:    http://root.cern.ch/~rdm/            Fax:   +41 22 7679480



This archive was generated by hypermail 2b29 : Tue Jan 01 2002 - 17:51:04 MET