[fpc-pascal] Resource compilation

Giulio Bernardi ugilio at gmail.com
Sat Aug 4 11:06:44 CEST 2018


Hi everybody, I'm just chiming in after quite some years.
Just two notes:

* For lazarus, it shouldn't need to use a real resource compiler for standard
things like icons, manifests etc: see programs res6 and res7 at
https://www.freepascal.org/docs-html/fclres/basic%20usage.html

* For the "real" resource compiler, regarding Martok's comment:

> The more difficult part is implementing the remaining resource access
> classes for fcl-res. Well, not difficult per se, but the
> copy-on-write-sharing thing done there adds a lot of complexity for (IMHO)
> very little benefit and makes it a bit awkward to work with. There's also
> a lot of endian conversions that could probably be factored out.

Actually, fcl-res was designed as a library to be used by a resource compiler,
and I don't think you need to implement new classes at all: once you have
written a parser for .rc files you just have to read the files referred from the
.rc file (icons, raw data etc), create the right kind of resource and add to the
output TResources. IIRC all the standard resource types were already
implemented, so once you write a parser that handles .rc files you should be done.

Giulio


On 04/08/18 09:43, Michael Van Canneyt wrote:
> 
> 
> On Sat, 4 Aug 2018, Marco van de Voort wrote:
> 
>> In our previous episode, Michael Van Canneyt said:
>>> > changes/extensions to fcl-res?
>>>
>>> I think a lot. There is a request in the bugtracker for a resource compiler
>>> since ages.
>>
>> It comes up regularly. Many people don't even pursue it further, and just
>> use resources generator by e.g. an old delphi project if needed.
>>
>> But longterm, we need this for completeness sake.
> 
> Well, I could use it short term too :)
> 
> I imagine lazarus could use it as well to bind icons etc.
> 
> Michael.
> _______________________________________________
> fpc-pascal maillist  -  fpc-pascal at lists.freepascal.org
> http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal




More information about the fpc-pascal mailing list