[fpc-devel] Delphi smart-linking perspective ( Language change and implementation ... )

Martin Friebe fpc at mfriebe.de
Mon Jun 1 12:20:17 CEST 2009


Marc Weustink wrote:
> Marco van de Voort wrote:
>> In our previous episode, Florian Klaempfl said:
>>>>>> Also note that WPO can do little about published methods (since 
>>>>>> it must assume that these can all be called via RTTI).
>>>>> Maybe the IDE can feedback some info about used classes and methods?
>>>> In time, a pascal analyser would be a good thing to have. I think 
>>>> analysis
>>>> of smartlinking is more something for an analyzer than the compiler 
>>>> itself
>>>> (though the compiler could generate certain datafiles obviously).
>>> This won't help lazarus. For lazarus, also the contents of the lfms is
>>> important.
>>
>> Yeah, I got it when I saw Jonas' reply. The IDE could list all visual
>> components in forms in a file and hand it to the compiler. And a 
>> "custom"
>> list could allow additional streaming types (for users code)
>
> All components are already sortof reported :)
> In order to get streamed, each component must have a member variable 
> in the owning form.
> However what is needed is a list of properties touched in the lfm 
> (setting control.caption or control.font.color for instance).
>
Unfortunately, thanks to RTTI this isn't enough.

Because any published property can be changed to any value, even:
- if it is not referred in the code
- if it is not in any LFM
The code could read some kind of .ini file (or worse ask the user to 
input a property name and value (ouch)) and use RTTI to find and set the 
property.

As a result, any code that can be triggered by a puplished property must 
be included.
This means:
- drag and dock manager (since they are enabled by setting a boolean 
property)
- probably a lot of image code
- many others

The only way round this, is to break compatibility with the VCL. If 
drag/dock (just a random picked example) were components, that must be 
put on the form or otherwise can not be used, then they would not need 
to be included.

With graphics a lot of image-format readers are registered, if the unit 
is used. Again the issue is to find if they could be used in some 
automated way...

Martin








More information about the fpc-devel mailing list