Xcode 5 and externals

External developers... This forum's for you!

Xcode 5 and externals

Postby bmartin » Thu Jan 23, 2014 9:00 am

Hi all,

I've been away for some time it seems. I see SuperCard is compatible with Mac OS 10.9 (Mavericks), which is awesome! So has External development caught up? Is it as easy as importing some framework into Xcode 5 to start developing externals now?

Thanks,
Bruce Martin

Mac Os 10.6.3
2.8 Ghz Intel Core 2 Duo
4GB 1067 MHz DDR3
User avatar
bmartin
 
Posts: 149
Joined: Mon Jul 07, 2008 7:26 am
Location: Stroudsburg, PA

Re: Xcode 5 and externals

Postby Dan_Kelleher » Thu Jan 23, 2014 9:48 am

Hi Bruce,
I've been away too so I can't answer you in a useful way but it's nice to see you back.
-Dan
Daniel.Kelleher@umassmed.edu
SC4.7.3 OSX 10.7.2 Mac Pro
User avatar
Dan_Kelleher
 
Posts: 438
Joined: Sun Jul 06, 2008 2:45 pm
Location: Worcester (wouster as in would) Massachusetts USA

Re: Xcode 5 and externals

Postby sctell » Thu Jan 23, 2014 11:59 pm

Firstly, it is possible.
That's the good news out of the way.

Xcode 5 does not come with the necessary SDK for SC external development.

You need MacOSX10.6.sdk. I downloaded it from Apple some time ago.

You have to place it within the Xcode Package and every time Apple updates Xcode you have to do it again.

You then have to tweak some settings in the Xcode external project.

If you are really interested in doing this I can cobble together some instructions that seem to have worked for me.

It would be better though if Mark could put together some "official" method???? ;)

All the best

Terry
sctell
 
Posts: 1128
Joined: Sun Jul 06, 2008 10:41 am

Re: Xcode 5 and externals

Postby bmartin » Fri Jan 24, 2014 3:43 am

Thanks Terry,

I'm glad to see some progress on the externals front. I've been busy splitting my time up between PHP web development iOS development and Linux system administration, oh and SVN keeper. I've taken a liking to Objective-C. I can appreciate the challenge of keeping a product up to date with the latest from Apple. I could imagine the challenge a product like SuperCard would have.

An official document, wiki, would be nice to have.

I haven't officially jumped back into SuperCard yet, time never seems to be in abundance. So I guess my question was more of an exploratory question to see if I can utilize some new skills with SuperCard.
Bruce Martin

Mac Os 10.6.3
2.8 Ghz Intel Core 2 Duo
4GB 1067 MHz DDR3
User avatar
bmartin
 
Posts: 149
Joined: Mon Jul 07, 2008 7:26 am
Location: Stroudsburg, PA

Re: Xcode 5 and externals

Postby witness » Sun Jan 26, 2014 4:56 pm

FWIW, I built an XFcn today against the 10.9 SDK. It's my objc XFCn. The things I had to do was:

1. In Build Settings, set the valid architecture to "32-bit Intel", so it doesn't try to build for PowerPC or 64-bit.
2. In the SuperCard.h header, replace #pragma align=mac68k with #pragma pack(push,2) and #pragma align=reset with #pragma pack(pop) like the Quickdraw.h header uses it.

That was pretty much all. If you want to see my project file and headers, the external's source code is here:

https://github.com/uliwitness/objc

and the SCParamBlock class I use to make coding easier here:

https://github.com/uliwitness/UliKit

(You need to copy UliKit into the same folder as the objc folder for it to build)
Last edited by witness on Mon Jan 27, 2014 5:18 am, edited 1 time in total.
Cheers,
-- Uli Kusterer
"The Witnesses of TeachText are Everywhere..."
http://www.zathras.de
User avatar
witness
 
Posts: 57
Joined: Thu Jul 17, 2008 2:24 pm

Re: Xcode 5 and externals

Postby sctell » Sun Jan 26, 2014 11:56 pm

Uli,

Can you please explain for the uninitiated what these Pragma calls do?

Can you confirm or clarify a previous assumption of mine that you cannot create SuperCard XCMD's or XFCN's that require Quickdraw commands from Xcode 5 without incorporating the 10.6 SDK?


Thanks

Terry
sctell
 
Posts: 1128
Joined: Sun Jul 06, 2008 10:41 am

Re: Xcode 5 and externals

Postby witness » Mon Jan 27, 2014 5:15 am

sctell wrote:Can you please explain for the uninitiated what these Pragma calls do?


For optimization reasons, when you have variables in a struct, they get 'aligned'. (Some CPUs can read a byte faster when it's at an even memory address, for example). The Intel CPU has different alignment by default than classic MacOS had. So these pragmas tell the compiler to perform the alignment like old MacOS versions used to.

sctell wrote:Can you confirm or clarify a previous assumption of mine that you cannot create SuperCard XCMD's or XFCN's that require Quickdraw commands from Xcode 5 without incorporating the 10.6 SDK?


Yeah, they've pretty much castrated Quickdraw in more recent SDKs. However, a few things are still in the headers, and the actual code is still in the OS. So you could just copy the declarations you need from the old 10.6 header in a header of your own (e.g. "SCQuickdrawCompatibility.h") to keep using it. Apple has only hidden Quickdraw, not removed it.

Also, some types have "opaque" definitions. E.g. GrafPort is still there' but the header doesn't tell you about its contents anymore. However, you can use e.g. QDBeginCGContext() on that context to create a CGContext, use regular Quartz calls to draw in it, then do QDEndCGContext(), and it will copy those drawings into the GrafPort.

What parts of Quickdraw do you still need that cause problems? As I said, my external built fine, but of course it doesn't do graphics.
Cheers,
-- Uli Kusterer
"The Witnesses of TeachText are Everywhere..."
http://www.zathras.de
User avatar
witness
 
Posts: 57
Joined: Thu Jul 17, 2008 2:24 pm


Return to Xcode and the Internals Toolbox

Who is online

Users browsing this forum: No registered users and 1 guest

cron