Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-devel / 2007-10

Resource handling library

3 messages · 2 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Giulio Bernardi

Hi,
I was curious about resource support in FPC, and after investigating a bit I wrote a library to handle resources. It provides classes to deal with some common resource types, and readers and writers for various file formats (res, coff, elf).
There could be various uses, for example:
- lazarus could use it to directly write version information and icon on windows, or to store lazarus resources in real resources as delphi does (even if I don't know if there will be improvements in doing this).
- it can be used for a resource editor or for the icon editor
- it can serve as a backend for a resource compiler. Using the library I wrote a sort of replacement for fpcres, and with some modifications here and there in fpc I had resources working for elf on all targets (tested i386, x86_64, powerpc, arm, it should work on other platforms too but I couldn't test because of compiler or qemu problems). Moreover it solves some problems in current fpc support for resources in elf and makes it easy to improve the format of elf resources. If core devels are interested, may I talk to one of them by private mail? (IIRC Michael Van Canneyt was involved with resources?)

bye
Giulio

Reply by email

Vincent Snijders
to Giulio Bernardi
Giulio Bernardi wrote 19 lines
Hi, I was curious about resource support in FPC, and after investigating a bit I wrote a library to handle resources. It provides classes to deal with some common resource types, and readers and writers for various file formats (res, coff, elf). There could be various uses, for example: - lazarus could use it to directly write version information and icon on windows, or to store lazarus resources in real resources as delphi does (even if I don't know if there will be improvements in doing this). - it can be used for a resource editor or for the icon editor - it can serve as a backend for a resource compiler. Using the library I wrote a sort of replacement for fpcres, and with some modifications here and there in fpc I had resources working for elf on all targets (tested i386, x86_64, powerpc, arm, it should work on other platforms too but I couldn't test because of compiler or qemu problems). Moreover it solves some problems in current fpc support for resources in elf and makes it easy to improve the format of elf resources. If core devels are interested, may I talk to one of them by private mail? (IIRC Michael Van Canneyt was involved with resources?)

One of the reason Lazarus does not use resources like Delphi, is that there is no support for Mac OS X yet (elf is supported by fpcres, as you mentioned). Does your library support that?

Vincent

Reply by email

Giulio Bernardi
to Vincent Snijders
One of the reason Lazarus does not use resources like Delphi, is that there is no support for Mac OS X yet (elf is supported by fpcres, as you mentioned). Does your library support that?

No because I thought that on os x it was better to store resources as files inside the app bundle since it's more "native" (even if no one forbids us to store them in mach-o files). The latter could be useful for console applications, though. Moreover, I am afraid that lipo could "double" resources when making an universal binary since it includes both the ppc and i386 executable, while using app bundles you can store resources only once (however I couldn't check).
Since the library can be easily extended with a new writer, it should be doable without many problems.

bye,
Giulio

Reply by email