Wow a trip down memory lane...

On Thu, 29 Mar 2001, Andre Poenitz wrote:

> > Kalle> What could be done would be something like this:
> >
> >   #ifdef XFORMS
> >     typedef FL_OBJECT* WidgetPtr;
> >   #elif defined QT
> >     typedef QWidget* WidgetPtr;
> >   #endif
>
> This should get encapsulated in a real class, say "Widget", with different
> implementaions for Qt, xforms, etc.
>
> > Kalle> and then:
> >
> >   int getChoiceItem( WidgetPtr choice )
> >   {
> >   #ifdef XFORMS
> >     return fl_get_object( choice );
> >   #elif QT
> >     ASSERT( choice->isA( "QComboBox" ) );
> >     return static_cast<QComboBox*>( choice )->currentItem();
> >   #endif
> >   }

This looks very similar to the first suggested implementation for GUII
that was rejected before any more code than the above was written.  It
lasted a couple of hours before its ashen hulk sunk below the waves.

See the GUII History part 1 article at
        http://www.lyx.org/news/20010117.php3



> -------------------- widget_xform ---------------
> class Widget {
>   [...]
>   int getChoiceItem() const {
>      return fl_get_object( me_ );
>   }
> private:
>   FL_OBJECT * me_;
> };
> -------------------- widget_xform ---------------
>
> -------------------- widget_qt ---------------
> class Widget {
>   [...]
>   int getChoiceItem() const {
>      ASSERT( choice->isA( "QComboBox" ) );
>      return static_cast<QComboBox*>( me_ )->currentItem();
>   }
> private:
>   QWidget* me_;
> };
> -------------------- widget_qt ---------------
>
> You could even hide the different implementations using the pimpl idiom,
> so the choice which gui you want can be made at link time by simply linking
> the desired pimpl.o


Still tripping down memory lane...

Suggested/rejected GUII implementation number two.  Both of the above
cases just end up being yet another restrictive cross-platform toolkit.
We don't need that. If you want one of those then just create a port to
the cross-platform toolkit of your choice and use that.

See the above mentioned article for links to the archive.  You'll have to
read though some of the threads yourself but it will save a bit of
bandwidth here if you do.

That doesn't mean we can't do some sensible merging of code in specific
cases such as the button controller.  But please remember those wise
words of Morticia Addams:
        "Too much of a good thing can be bad for you."

Allan. (ARRae)

Reply via email to