[fpc-pascal] Re: MacMode More Info / which compatibility mode and object class type to use with Mac OS X, XCode and Carbon

Tomas Hajny XHajT03 at mbox.vol.cz
Mon Apr 13 09:11:37 CEST 2009


On Sat, April 11, 2009 23:16, Pierre Paré wrote:
> Thank for you answers and the links
>
> I did subscribe to the list but it seems I needed to complete the
> process with a confirmation.
> The FPC list and wiki servers are presently not responding ; my
> confirmation is bouncing back.

Please, try again; there should be no problem at the moment.


 .
 .
> I wrongly assumed, since the installation into XCode had made it
> MacMode by default
>    	target build option FPC_COMMON_OPTIONS = -Mmacpas -Sgi
>   that it was necessary ;

I guess that this setting is there because most XCode users are expected
to know the older Pascal compilers for MacOS and thus used to the macpas
syntax / features.


 .
 .
> I still intend to use XCode since it's the prefered IDE to develop on
> Mac and that enventualy I'll want to use Carbon (baby steps) and
> eventualy Cocoa ; I'll probably need to learn ObjC to get there. I'm
 .
 .
> I will eventualy use the Carbon framework.  Is the MacPas mode still a
> choice or is mandatory to use the Carbon framework ?

Different modules (units and the main program) may be compiled in
different modes. This means that you can use Carbon framework (accessible
via unit MacOSAll compiled in MacPas mode) in programs / units compiled in
fpc or objfpc mode.


> ----  the longer version of my thougth process at the end, for short,
> here is the conclusion  -------
>
> Then to eventualy continue to program with Carbon framework, I will
> need to
> 	to interface smoothly with MacOSAll Carbon framework which is
> compiled MacPas mode,
> 	encapsulate the procedural nature of the Carbon library in FPC
> objects or classes.
>
> The question becomes then
> 		Will an objFPC compiled program be able to use the MacPas compiled
> MacOSAll unit  ?

Yes, it will.


>   If it can, I guess I may choose to use either FPC objects or
> classes.  To which the answer seems yes.

Yes.


> But if the MacPas mode is necessary or better to interface with the
> MacPas compiled Carbon framework
> or if Carbon does contain objects to be compatible with,
> or if I choose to stay in MacPas mode
> the question remains : which one does the MacPas compatibility mode
> uses :
> 	static FPC object or dynamic FPC class ,
> 	with base object framework objects Unit of Classes unit
> so that my objects remains compatible with the Carbon framework ?
>
> It seems to be implemented as a class type and compatible with units
> that uses class type but uses the object type syntax.

I don't feel confident enough to answer this (or the more detailed
questions from your e-mail) because I've never used MacPas myself,
although I believe that your findings are mostly correct.


> P.S. Is it my Mail program who send the message in HTML ?

Well, yes, your message came as "multipart/alternative", i.e. including
both HTML and plain text versions.


 .
 .
> 	The programer's manual has some information on modes and MacPas mode
> but
> 		seems outdated : use Mac instead of MacPas
> 		much on macros nothing on object model
>
> 	The unit reference doesn't specify much which units to use on
> differents platforms and/or modes but the user's manual does but not
> for OS X
 .
 .

I suggest to file a bug report pointing out the necessary improvements in
our documentation.

Tomas





More information about the fpc-pascal mailing list