[lazarus] gtk interface clean up

Mattias Gaertner nc-gaertnma at netcologne.de
Sun Aug 17 09:02:33 EDT 2003

On Sun, 17 Aug 2003 11:52:25 +0200
Jeroen van Iddekinge <iddekingej at lycos.com> wrote:

> Hi,
> I downloaded lazarus again after a long time, and I noticed that much 
> was inproved.. it looks verry good....thanx...
> But I noticed that some cleanup was possible for the Gtk Interface, so 
> there is also a patch with this email.
> There is still more  possible , but the patch was allready big enough.  
> Plz comment...
> (p.s. Yesterday I also tried to send this patch but i think something 
> went wrong and the list never recieved mine email. )
> I have also some questions:
> * Does the win32 interface also have a message queue like the Gtk 
> interface? And if not
>   should it also have one (for combining paint messages?)
> * Why is there  a FinalizePaintTagMessage in PeekMessage for LM_GTKPaint 
> and not for LM_Paint?
> * What is the difference between LM_GtkPaint and LM_Paint

The paint messages are special messages in the gtk1 intf because double
buffering is a feature of gtk2. Therefore the paint message handing will be
different in the gtk2 intf. Probably without a queue.

When the gtk sends an expose/draw event to the gtk intf, it creates a
LM_GtkPaint message and deletes old paint messages already in the queue. 
When the queue is handled and the LM_GtkPaint is popped from the queue, it
is converted into a LM_Paint message. The LCL can only understand LM_Paint
messages. The LM_GtkPaint contains some more information, like the exposed
area. This way, paint messages for small areas are kept small. A single
LM_GtkPaint can result in several LM_Paint messages for csDesigning control.

> Changes:
> * Cleaned up some code in GTk interface
> * new unit with TGtkMessageQueue/TGtkMessageQueueItem
>   - Moved code from Interface to this unit.
>   - Removed duplicate code such as:
>      * Hash calculation for fPaintMessage
>      * destroy/removal of messages
>      * IsPaintMessageCheck
>       etc...
>    - moved  fPaintMessage to  TGTkMessageQueue (more transparant
>    handeling)- Make adding/removel of  message queue less error prone.
>       etc.. etc..

Sounds like some central parts of the gtk intf. I will need some time to
test the changes ..


More information about the Lazarus mailing list