[Gambas-user] Big change in revision #5382

Rolf-Werner Eilert eilert-sprachen at ...221...
Wed Nov 28 08:43:58 CET 2012


Hi Benoit,

Am 27.11.2012 19:48, schrieb Benoît Minisini:
> Hi,
>
> I have removed the old Draw class and replaced it with a new Draw class
> implemented in Gambas inside the gb.gui.base component, that emulates
> the old Draw class by using the Paint class.

Sounds like an interesting approach. Does it include Printer functionality?

>
> I'm starting to remove as much X11 specific code as possible in the
> Gambas source code, and the Draw class was completely based on the old
> deprecated X11 drawing API of GTK+, so...
>
> Many new methods were added to the Paint class to help the
> implementation of the Draw emulation class.

Wow... you invest a lot of time in this, don't you.

>
> Of course (!) expect some quirks:
>
> - The emulation is not perfect yet, and it won't be 100% compatible
> pixel to pixel.
>
> - Expect some performance loss, even if I try to avoid them as much as
> possible.
>
> - Drawing lines with Cairo is a lot slower that drawing lines with X11,
> even if antialiasing is disabled.
>
> - There is a bug at the moment if you imbricate calls to Paint.Begin()
> on the same device. It should work, but apparently it does not...
>
> - Source code clean-up is not finished.
>
> But there is one good news: if you have old printing code from Gambas 2
> based on the Draw class, you can now use it directly in Gambas 3 without
> having anything to change (theoritically).

Ah, here we go - it does include printing, right? Well, now I have a 
question about implementation:

In the Gambas2 Draw there was no (or I didn't use) an own event loop, 
but the coder had to call Begin and End and all the Drawing procedures 
by code.

In the Gambas3 Paint class, there is an event loop which is called once 
and running through several events.

How do you cope with this issue when emulating the Draw things? Does it 
call a Paint class event loop? And when the interpreter is within that 
loop, how can it know which Draw command is to follow next while that 
code is somewhere else?

Anyway, I find the new Paint class very useful, and it makes handling 
easier to overlook. But it will take some serious revamping of my 
printing organisation, as it is based on this eventloop scheme.

>
> All that is an investment to the future, when Wayland will replace X11.
>
> Regards,
>

Oops :-) My understanding of this was that Wayland is still kinda 
experimental playground and is not yet regarded as a serious follower of 
X11 (even if "one day"). Maybe I've missed some recent news here?

Regards

Rolf




More information about the User mailing list