[lazarus] CVS Updates

Andrew Johnson acjgenius at earthlink.net
Fri Oct 3 21:02:40 EDT 2003


On Fri, 2003-10-03 at 20:39, Marc Weustink wrote:
> At 02:27 4-10-2003, Andrew Johnson wrote:
> >On Fri, 2003-10-03 at 20:21, Marc Weustink wrote:
> >however there _is_ also the issue that because DoubleBuffering needs to
> >be done in the interface for GTK(I think), aka think GTK2, that it
> >probably means it somehow needs to be done within the win32 interface
> >itself.
> >
> >If this can be worked out for Win32 the issue is moot anyway. But that
> >will require quite a bit of thought and possibly reconsidering how
> >DoubleBuffering should be done overall.
> 
> Hmm.. indeed. First, where do we want doublebuffering to be handled. Should 
> it be part of the interface or should it be part of the LCL.
> 

its a tricky question, because GTK2 automatically does doublebuffering,
which means sometimes we have to manage it and do it ourselves. So on
that note I would say defintely use or at least initiate it in the
interface if at all possible.

> When is it used ? Only while in the LM_PAINT message ?

well it should be whenever it can be. No matter how its done in VCL :D

In the VCL it is only handled in the paint message yes. In GTK2 its
almost always used by default but because of the having to handle it
ourselves for custom widgets then likely as far as its concerned it will
also only be in the Paint message, however it is done from
beginpaint/endpaint so anywhere that uses those functions will
automatically get it in GTK2. 

So I suppose one way would be to make each interface BeginPaint always
return a  DoubleBuffer DC, and EndPaint bitblt it to the real one, much
like I am essentially doing for gtk2 by calling its own native begin and
end paint methods. This would allow it to be done anywhere those
functions are called, and since they should be being used by the LCL
whenever a paint message doesn't pass its own DC that might allow us to
do this. It would of course mean not actually using the native win32
BeginPaint/EndPaint(or not returning handling things the same way), and
would require caching and keeping track of the extra info somehow, and
thus in all the win32 functions have offset functions to move to
relative position if a buffered dc(aka in the cache). Maybe this is too
complicated though...

Andrew






More information about the Lazarus mailing list