Sign in Join

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

Mailing lists / fpc-pascal / 2008-07

{$R file} support on non-Windows targets

25 messages · 12 people · –

Reply by email Subscribe to this list Your subscription

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

Craig Peterson

Does any version of FPC support the {$R file} syntax for resources on non-Windows targets? I'd prefer that to Lazarus's LResources unit. I have the impression that some work on it was done as part of Simon Kissel's CrossFPC project, but I haven't been able to verify that. Was work done and never completed? Is it a TODO that just doesn't have anyone to work on it?

Thanks,
Craig Peterson
Scooter Software

Michael Van Canneyt
to Craig Peterson
Craig Peterson wrote 5 lines
Does any version of FPC support the {$R file} syntax for resources on non-Windows targets? I'd prefer that to Lazarus's LResources unit. I have the impression that some work on it was done as part of Simon Kissel's CrossFPC project, but I haven't been able to verify that. Was work done and never completed? Is it a TODO that just doesn't have anyone to work on it?

All targets in 2.3.1 now support {$R file} syntax.

Michael.

Felipe Monteiro de Carvalho
to Michael Van Canneyt
Michael Van Canneyt wrote
All targets in 2.3.1 now support {$R file} syntax.

So I assume we have a cross-platform resource compiler now, so is windres unnecessary? Was pre-processing also implemented?

Also, how do you access the resources? With TResourceStream?

thanks,

Felipe Monteiro de Carvalho
Giulio Bernardi
to Felipe Monteiro de Carvalho

Felipe Monteiro de Carvalho ha scritto:

Show quoted text 6 lines
On Wed, Jul 9, 2008 at 2:20 PM, Michael Van Canneyt wrote: > All targets in 2.3.1 now support {$R file} syntax. So I assume we have a cross-platform resource compiler now, so is windres unnecessary? Was pre-processing also implemented?

No. To compile .rc files to .res you still need windres. In general you can compile and run it fine on little endian machines, but it doesn't work (at least, it didn't work 6 months ago, don't know if newer versions are endian safe) on big endian machines.
So there is still no .rc compiler. However the 2.3.1 fpcres is able to compile dfm/lfm/xfm files.

Also, how do you access the resources? With TResourceStream?

With RTL functions like FindResource, LoadResource and so on. TResourceStream uses these functions.

Giulio

Graeme Geldenhuys
to Craig Peterson: Does any version of FPC support the {$R file} syntax for resources on non-Windows…

2008/7/9 Craig Peterson :

Thanks, Craig Peterson Scooter Software

Is this Scooter Software that brought the awesome Beyond Compare 2 to Windows users? If so, I sure hope the query is because work on BC 2.xx or 3.x involves other platforms like Linux. ;-)

If not, it's ok, BC2 works very nice via Linux + WINE.

Regards,
- Graeme -

_______________________________________________
fpGUI - a cross-platform Free Pascal GUI toolkit
http://opensoft.homeip.net/fpgui/

Craig Peterson
to Graeme Geldenhuys
Is this Scooter Software that brought the awesome Beyond Compare 2 to Windows users? If so, I sure hope the query is because work on BC 2.xx or 3.x involves other platforms like Linux. ;-)

Yes it is, and you must not be on the beta list. ;-) V3 is in public beta and the Linux port is already available. We're currently using Kylix, but we're looking into swapping out the compiler for FPC first, with a transition from CLX to LCL sometime later.

http://www.scootersoftware.com/beta3/

Regards,
Craig Peterson
Scooter Software

Graeme Geldenhuys
to Craig Peterson

2008/7/9 Craig Peterson :

Yes it is, and you must not be on the beta list. ;-) V3 is in public beta and the Linux port is already available. We're currently using Kylix, but we're looking into swapping out the compiler for FPC first, with a transition from CLX to LCL sometime later.

My day is just getting better, Thanks Craig! :-) I'll try and download the beta now. I'm a Linux junkie, but there are 3 Windows products I can't do without. Beyond Compare 2, Total Commander and PINS. Hopefully soon, that will be down to only 2 Windows products. ;-)

Keep up the good work!

Regards,
- Graeme -

_______________________________________________
fpGUI - a cross-platform Free Pascal GUI toolkit
http://opensoft.homeip.net/fpgui/

Paul Ishenin
to Michael Van Canneyt: All targets in 2.3.1 now support {$R file} syntax. Michael.
Michael Van Canneyt wrote 11 lines
On Wed, 9 Jul 2008, Craig Peterson wrote: > Does any version of FPC support the {$R file} syntax for resources on > non-Windows targets? I'd prefer that to Lazarus's LResources unit. I have > the impression that some work on it was done as part of Simon Kissel's > CrossFPC project, but I haven't been able to verify that. Was work done and > never completed? Is it a TODO that just doesn't have anyone to work on it? > All targets in 2.3.1 now support {$R file} syntax
And lazarus with fpc 2.3.1 can load forms from native resources. If you
 you will see:
{$IFDEF FPC_HAS_WINLIKERESOURCES}
  {$DEFINE UseRES}
{$ENDIF}

There you can also look how UseRES is used.

Best regards,
Paul Ishenin.

Graeme Geldenhuys
to Giulio Bernardi: Felipe Monteiro de Carvalho ha scritto: No. To compile .rc files to .res you still need…
Giulio Bernardi wrote 7 lines
> So I assume we have a cross-platform resource compiler now, so is > windres unnecessary? Was pre-processing also implemented? No. To compile .rc files to .res you still need windres. In general you can compile and run it fine on little endian machines, but it doesn't work (at least, it didn't work 6 months ago, don't know if newer versions are endian safe) on big endian machines.

So is that the technical issue with cross-platform resource compilers? The endian handling? Or is there some other technical issue? I remember even Kylix didn't have a resource compiler and couldn't understand why. After all, most C/C++ compilers are cross platform and they seem to have resource compilers, so what is wrong with Object Pascal compilers...

Sorry if this is dumb, but I obviously don't understand the full issue here...

Regards,
- Graeme -

_______________________________________________
fpGUI - a cross-platform Free Pascal GUI toolkit
http://opensoft.homeip.net/fpgui/

Giulio Bernardi
to Graeme Geldenhuys

Graeme Geldenhuys ha scritto:

Show quoted text 17 lines
On Wed, Jul 9, 2008 at 8:17 PM, Giulio Bernardi wrote: >> So I assume we have a cross-platform resource compiler now, so is >> windres unnecessary? Was pre-processing also implemented? > No. To compile .rc files to .res you still need windres. In general you can > compile and run it fine on little endian machines, but it doesn't work (at > least, it didn't work 6 months ago, don't know if newer versions are endian > safe) on big endian machines. So is that the technical issue with cross-platform resource compilers? The endian handling? Or is there some other technical issue? I remember even Kylix didn't have a resource compiler and couldn't understand why. After all, most C/C++ compilers are cross platform and they seem to have resource compilers, so what is wrong with Object Pascal compilers... Sorry if this is dumb, but I obviously don't understand the full issue here...

The concept of "resources" is a bit vague when talking about different platforms. Some systems have this concept, some no, and they are all different things, though the basic thing that they provide is a way to embed data in applications.
E.g. windows has it's own definition of resources, classic Mac OS another, Mac OS X another, OS/2 another one, Unix doesn't have "resources", and so on. So a "cross platform resource compiler" is not common because there isn't a standardized resource format. In 2.3.1 we support resources "the windows way" on non-windows systems: the 2.3.1 fpcres is able to convert .res files to object files which will be linked in your application. However we don't have a resource compiler yet (a compiler that is able to compile .rc files to .res files). There is gnu windres though which is able to do this work. Windres can also be compiled on Linux (and on other unixes I think). However, windres isn't endian safe so it's useless on big endian machines: maybe they never thought about the possibility of crosscompilation from, say, linux powerpc to win32. You can of course embed already made .res files, since the 2.3.1 fpcres is endian safe. And it can also compile dfm/lfm/xfm files.

Regarding the fact that most C/C++ compilers have resource compilers... well in general OS vendors provide resource compilers if their system have this concept (rc.exe from microsoft, ReZ from Apple). Moreover some compiler vendor provide their own (brcc32 from borland, wrc from watcom, gorc), but they are not "cross platform", even if wrc is able to compile win32, win16 and os2 resource files for those systems.

Giulio

Graeme Geldenhuys
to Giulio Bernardi
Giulio Bernardi wrote
vendor provide their own (brcc32 from borland, wrc from watcom, gorc), but they are not "cross platform", even if wrc is able to compile win32, win16 and os2 resource files for those systems.

You stole my example! :-) I was just about to mention Watcom's resource compiler. If it works for Win32, Win16 and OS/2, how can it not be cross-platform? Or do you mean not cross-platform, because a .res file compiled under OS/2 cannot be used as-is under Win32? If the latter, would that really be an issue for FPC with a slogan like "write once, compile everywhere". As long as the application is compiled on the platform it needs to run on, the resource will be correct. This excludes cross-compiling, no idea how that works.

Regards,
- Graeme -

_______________________________________________
fpGUI - a cross-platform Free Pascal GUI toolkit
http://opensoft.homeip.net/fpgui/

Giulio Bernardi
to Graeme Geldenhuys

Graeme Geldenhuys ha scritto:

Show quoted text 9 lines
On Thu, Jul 10, 2008 at 9:13 AM, Giulio Bernardi wrote: > vendor provide their own (brcc32 from borland, wrc from watcom, gorc), but > they are not "cross platform", even if wrc is able to compile win32, win16 > and os2 resource files for those systems. You stole my example! :-) I was just about to mention Watcom's resource compiler. If it works for Win32, Win16 and OS/2, how can it not be cross-platform? Or do you mean not cross-platform, because a .res file compiled under OS/2 cannot be used as-is under Win32?

Exactly. E.g. OS/2's .res format is like the win16 one but without support for string IDs (that is, you can't have a os/2 resource named 'MYFORM'). Moreover they have little syntax differences here and there. For what regards wrc, it's simple: you tell wrc you want to compile a win32 rc file, and it will output a win32 .res file. If you tell it to use win16 format, .rc file must use that syntax and it will be compiled as a win16 resource.
So you can't use wrc to compile a win32 rc file to a os2 res file: it's like to have three separate resource compilers in one.

Show quoted text 6 lines
If the latter, would that really be an issue for FPC with a slogan like "write once, compile everywhere". As long as the application is compiled on the platform it needs to run on, the resource will be correct. This excludes cross-compiling, no idea how that works.

The idea is that we support win32 resources everywhere, since the {$R} stuff comes from delphi, where it's used for win32 resources. At the moment, winlike resources aren't supported on os/2 or classic mac os because one might want to use their platform-specific resources. One idea I have is to add something like {$resmode native/win32} (example case: lazarus starts using resources, someone decides to port lazarus to os/2, we have a problem. With the switch a program could contain both win32 resources used by lazarus and os2 resources like the program icon and so on).

Giulio

Joost van der Sluis
to Graeme Geldenhuys: 2008/7/9 Craig Peterson : My day is just getting better, Thanks Craig! :-) I'll try and…

Op woensdag 09-07-2008 om 23:23 uur [tijdzone +0200], schreef Graeme Geldenhuys:

Show quoted text 5 lines
My day is just getting better, Thanks Craig! :-) I'll try and download the beta now. I'm a Linux junkie, but there are 3 Windows products I can't do without. Beyond Compare 2, Total Commander and PINS. Hopefully soon, that will be down to only 2 Windows products. ;-)

Total Commander?!? You mean Tux Commander (tuxcmd.sourceforge.net), latest version also written in fpc.

Joost

German Gentile
to Joost van der Sluis

2008/7/13 Joost van der Sluis :

Show quoted text 8 lines
Op woensdag 09-07-2008 om 23:23 uur [tijdzone +0200], schreef Graeme Geldenhuys: > My day is just getting better, Thanks Craig! :-) I'll try and > download the beta now. I'm a Linux junkie, but there are 3 Windows > products I can't do without. Beyond Compare 2, Total Commander and > PINS. Hopefully soon, that will be down to only 2 Windows products. > ;-)

Beyond compare already have a linux version (BC 3) and work like a sharm.

HTH

Donald Shimoda

http://donaldshimoda.blogspot.com

Graeme Geldenhuys
to Joost van der Sluis: Op woensdag 09-07-2008 om 23:23 uur [tijdzone +0200], schreef Graeme Geldenhuys: Total…
Joost van der Sluis wrote
Total Commander?!? You mean Tux Commander (tuxcmd.sourceforge.net), latest version also written in fpc.

Last time I tried Tux Commander, it didn't come close to Total Commander. Maybe I give it another try as it's been a few months.

Regards,
- Graeme -

_______________________________________________
fpGUI - a cross-platform Free Pascal GUI toolkit
http://opensoft.homeip.net/fpgui/

German Gentile
to Graeme Geldenhuys

2008/7/13 Graeme Geldenhuys :

Show quoted text 6 lines
On Sun, Jul 13, 2008 at 9:56 PM, Joost van der Sluis wrote: Last time I tried Tux Commander, it didn't come close to Total Commander. Maybe I give it another try as it's been a few months. _______________________________________________ fpGUI - a cross-platform Free Pascal GUI toolkit http://opensoft.homeip.net/fpgui/

Big OT, your site is not working. I wanna try fpgui on lazarus.

Besty regards.

Donald Shimoda

http://donaldshimoda.blogspot.com/

Valdas Jankūnas
to Graeme Geldenhuys: Last time I tried Tux Commander, it didn't come close to Total Commander. Maybe I give…

Graeme Geldenhuys rašė:

Show quoted text 6 lines
On Sun, Jul 13, 2008 at 9:56 PM, Joost van der Sluis wrote: > Total Commander?!? You mean Tux Commander (tuxcmd.sourceforge.net), > latest version also written in fpc. Last time I tried Tux Commander, it didn't come close to Total Commander. Maybe I give it another try as it's been a few months.

How about Krusader (http://krusader.org/):

"...is an advanced twin panel (commander style) file manager for KDE and other desktops in the *nix world, similar to Midnight or Total Commander..."

Valdas Jankūnas
Graeme Geldenhuys
to German Gentile: 2008/7/13 Graeme Geldenhuys : Big OT, your site is not working. I wanna try fpgui on…
German Gentile wrote
> fpGUI - a cross-platform Free Pascal GUI toolkit > http://opensoft.homeip.net/fpgui/ Big OT, your site is not working. I wanna try fpgui on lazarus.

They were working on our backup generator over the weekend, so we had to power everything down. All is back to normal again. The SubVersion repository is on SourceForge, so you could still have gotten a copy. Sorry for any inconvenience.

Regards,
- Graeme -

_______________________________________________
fpGUI - a cross-platform Free Pascal GUI toolkit
http://opensoft.homeip.net/fpgui/
http://www.sourceforge.net/projects/fpgui/

Graeme Geldenhuys
to Valdas Jankūnas: Graeme Geldenhuys rašė: How about Krusader (http://krusader.org/): "...is an advanced…
Valdas Jankūnas wrote
How about Krusader (http://krusader.org/):

I haven't tried that in years.

I found a project called Double Commander (doublecmd) on SourceForge. It still has many visual issues (it looks quite ugly under GTK1), but it seems to have potential - like it has a couple of nice features like support for Total Commander plugins, very customizable etc... I'll definitely keep my eye on this project.

By the way, it's a Lazarus based project as well! :-)

Regards,
- Graeme -

_______________________________________________
fpGUI - a cross-platform Free Pascal GUI toolkit
http://opensoft.homeip.net/fpgui/

Luiz Americo Pereira Camara
to Graeme Geldenhuys: On Sun, Jul 13, 2008 at 11:47 PM, German Gentile They were working on our backup…
Graeme Geldenhuys wrote 15 lines
On Sun, Jul 13, 2008 at 11:47 PM, German Gentile wrote: >> fpGUI - a cross-platform Free Pascal GUI toolkit >> http://opensoft.homeip.net/fpgui/ >> > Big OT, your site is not working. I wanna try fpgui on lazarus. > They were working on our backup generator over the weekend, so we had to power everything down. All is back to normal again. The SubVersion repository is on SourceForge, so you could still have gotten a copy. Sorry for any inconvenience.

I still can not access the website or the news server

Luiz

Paul Nicholls
to Luiz Americo Pereira Camara

----- Original Message -----

Earlier message 31 lines
From: "Luiz Americo Pereira Camara" To: "FPC-Pascal users discussions" Sent: Tuesday, July 15, 2008 10:23 AM Subject: Re: [fpc-pascal] {$R file} support on non-Windows targets > Graeme Geldenhuys wrote: >> On Sun, Jul 13, 2008 at 11:47 PM, German Gentile >> wrote: >> >>>> fpGUI - a cross-platform Free Pascal GUI toolkit >>>> http://opensoft.homeip.net/fpgui/ >>>> >>> Big OT, your site is not working. I wanna try fpgui on lazarus. >>> >> >> They were working on our backup generator over the weekend, so we had >> to power everything down. All is back to normal again. The SubVersion >> repository is on SourceForge, so you could still have gotten a copy. >> Sorry for any inconvenience. >> >> > > I still can not access the website or the news server > > Luiz Hi Graeme, for your info, I can't access the page either (I'm in Australia, if this helps) cheers, Paul
Graeme Geldenhuys
to Luiz Americo Pereira Camara: I still can not access the website or the news server Luiz

On Tue, Jul 15, 2008 at 2:23 AM, Luiz Americo Pereira Camara >

I still can not access the website or the news server

Sorry Luiz and Paul for the inconvenience...

Our new building is plagued with issues, plus the electritian we have really sucks!!! He can't seem to get things done in one go, so he seems to work in the evenings when we close (17:00), and does little bits at a time. :-( And according to our time zone differences (looking at your emails), that's your guys day time or something. :-(

Hopefully our electricity issues will be resolved by the end of the week. But as I mentioned before, fpGUI code is available on SourceForge, so is not affected by our office outages.

To get the latest code:
svn co https://fpgui.svn.sourceforge.net/svnroot/fpgui/trunk fpgui

For urgent email support, you can email me directly: graemeg dot lists at gmail dot com

or try your luck with the newsgroup sever (lets hope by the end of the week, all issues are resolved).

Regards,
- Graeme -

_______________________________________________
fpGUI - a cross-platform Free Pascal GUI toolkit
http://opensoft.homeip.net/fpgui/

Paul Nicholls
to Graeme Geldenhuys

----- Original Message -----

Earlier message 26 lines
From: "Graeme Geldenhuys" To: "FPC-Pascal users discussions" Sent: Tuesday, July 15, 2008 5:44 PM Subject: Re: [fpc-pascal] {$R file} support on non-Windows targets > On Tue, Jul 15, 2008 at 2:23 AM, Luiz Americo Pereira Camara > >> I still can not access the website or the news server > > Sorry Luiz and Paul for the inconvenience... > > Our new building is plagued with issues, plus the electritian we have > really sucks!!! He can't seem to get things done in one go, so he > seems to work in the evenings when we close (17:00), and does little > bits at a time. :-( And according to our time zone differences > (looking at your emails), that's your guys day time or something. :-( > > Hopefully our electricity issues will be resolved by the end of the > week. But as I mentioned before, fpGUI code is available on > SourceForge, so is not affected by our office outages. > That's ok Graeme, I was just letting you know about your site not working incase it helped :-) cheers, Paul
Florian Klaempfl
to Graeme Geldenhuys: On Tue, Jul 15, 2008 at 2:23 AM, Luiz Americo Pereira Camara > Sorry Luiz and Paul for…
Show quoted text 17 lines
On Tue, Jul 15, 2008 at 2:23 AM, Luiz Americo Pereira Camara > > I still can not access the website or the news server Sorry Luiz and Paul for the inconvenience... Our new building is plagued with issues, plus the electritian we have really sucks!!! He can't seem to get things done in one go, so he seems to work in the evenings when we close (17:00), and does little bits at a time. :-( And according to our time zone differences (looking at your emails), that's your guys day time or something. :-( Hopefully our electricity issues will be resolved by the end of the week. But as I mentioned before, fpGUI code is available on SourceForge, so is not affected by our office outages. To get the latest code: svn co https://fpgui.svn.sourceforge.net/svnroot/fpgui/trunk fpgui

Just in case, it is mirrored at http://svn2.freepascal.org/svn/fpgui