[Lazarus] Problems with Lazarus - off-topic question

Sven Barth pascaldragon at googlemail.com
Tue Feb 19 10:27:07 CET 2013


On 19.02.2013 10:22, Chavoux Luyt wrote:
> Hi Mattias
>
> On 19 February 2013 11:12, Mattias Gaertner <nc-gaertnma at netcologne.de
> <mailto:nc-gaertnma at netcologne.de>> wrote:
>
>     <snip>
>     On some Linux the QT version is faster. Unfortunately there is no
>     debian package for that. But compiling it is easy.
>
> Is there anywhere where it is explained how this was done? The original
> Delphi language was pretty much a Pascal wrapper around the Windows API
> (that would probably just convert the Pascal-style calls to (far)
> c-style calls and then link to the various windows .dll's)?

Huh? Calls to the Windows API functions are basically just (in assembly 
language) CALLs with the parameters set up in the way the function 
expects it (told to the compiler by the calling convention). And the 
called function is located in a DLL which is loaded on process startup 
through Windows' dynamic loader.

> How does
> this convert into QT (or GTK for that matter)? Is there a document that
> explains this? I assume this translation and linking is done by Lazarus
> and is not built into fpc?

For GTK it is the same as for the Windows API. For Qt the C++ based API 
first needs to be converted to a flat C style API (this is done through 
a library written in C++ called libQt4Pas) and then we have the same 
situation as above.

If you want to take a look at the API bindings just look at
$fpcsrc/rtl/win/windows.pp for the Windows API
and
$fpcsrc/packages/gtk2/src for the GTK+ API.

Regards,
Sven




More information about the Lazarus mailing list