[lazarus] My opinions
Florian Klaempfl
Florian.Klaempfl at gmx.de
Sat Oct 23 14:40:18 EDT 1999
Cliff Baeseman schrieb:
>
> We had actually considered such a proposal before but the messaging solution
> works in all cases no matter what the GUI rendering engine is. In the case
> of QT where I need a extern C call anyhow the messaging solution works just
> fine and frankly I do not see how it could be done any other way.
>
> Take for instance last night I said ok lets integrate my QT Engine into the
> LCL. I first copied the GTK interface object and then wacked out all of the
> code. I put in one define in the interface unit and bang QT was in there. I
> then ran the hello world example with no gui interface code. It ran so then
> I just put a trace in the IntSendMessage to see what messages where being
> passed. I placed in the code to call my QT engine and in about ten minutes I
> had the whole deal running.
>
> This does allow for us to change code in only one place and all of the GUI
> code interacts in one place. Say for instance that Delphi had originally
> been built on top of this idea. They could have had delphi running on linux
> in very short order. I have absolutely no doubt in my mind that I can
> support any rendering kit in thais manner.
>
> The fact of the matter is yes it is a lot more difficult to program in this
> manner but the extreme flexibility is worth it.
>
Sorry, but I don't see the use of the messages (which are also
very slow, imagagine you draw something using single
drawpixel calls, e.g. when decompressiong an image)! Ok, lets keep
the interface object, but why do you need to send messages?
Let's stay at the TCanvas example:
TCanvas could call DrawRect directly. Even more you could define some
TGTKGraphicsInterface which bases on a TAbstractGraphicsInterface
TAbstractGraphicsInterface implements all (most?)
drawing routines in a Delphi compatible way using only DrawPixel which
must be implemented in TGTKGraphicsInterface. If you want more
speed you can still implement DrawLine, DrawRect using GUI
depended stuff in TGTKGraphicsInterface (or if you want to
avoid rewriting line drawing routines).
More information about the Lazarus
mailing list