New To Mac-Forums?

Welcome to our community! Join the discussion today by registering your FREE account. If you have any problems with the registration process, please contact us!

Get your questions answered by community gurus Advice and insight from world-class Apple enthusiasts Exclusive access to members-only contests, giveaways and deals

Join today!

 
Start a Discussion
 

Mac-Forums Brief

Subscribe to Mac-Forums Brief to receive special offers from Mac-Forums partners and sponsors

Join the conversation RSS
OS X - Development and Darwin Discussion and questions about development for Mac OS X.

Carbon or not?


Post Reply New Thread Subscribe

 
Thread Tools
A_SN

 
Member Since: Apr 02, 2009
Posts: 6
A_SN is on a distinguished road

A_SN is offline
As some of you may know from my other semi-related thread, I'm a Windows developer and I've set out to port my commercial Windows program to Mac OS X. It's entirely written in C, and the overwhelming majority of the code is platform independent, and using a bunch of open source libraries for that (SDL, Allegro, DevIL, libsndfile, libmpg123..). The problem I'm facing is knowing what to replace the few Windows API calls with, and how to deal with the aspects unique to Mac OS X, e.g. the menus.

The Windows API calls consist in pretty simple stuff, such as a function to pop up an Open dialog, same for a Save dialog, a function to detect how many CPU cores we have (that one's probably in POSIX), a function to copy an image to clipboard.. My program being entirely in C, according to what I've recently read, I should aim to replace my WinAPI calls with Carbon API calls, correct? But here's the problem, I've also read that apparently Carbon is already old and being pushed out, that "it is not a good idea to write new applications using Carbon", and that you can't even build 64-bit apps with it.. Doesn't sound any good to start porting to it against all recommendations..

But on the other hand, what other choice is there? Surely a pure C program can't use Cocoa? What else is there? Or is Carbon a decent choice for the little I need?
QUOTE Thanks
louishen

 
louishen's Avatar
 
Member Since: Oct 22, 2007
Location: London
Posts: 8,951
louishen has a brilliant futurelouishen has a brilliant futurelouishen has a brilliant futurelouishen has a brilliant futurelouishen has a brilliant futurelouishen has a brilliant futurelouishen has a brilliant futurelouishen has a brilliant futurelouishen has a brilliant futurelouishen has a brilliant futurelouishen has a brilliant future
Mac Specs: Mac Mini Core i7 2012 | White 2009 MacBook 2 Ghz | 733 Mhz G4 Quicksilver

louishen is offline
You might want to post that thread in the Apple developer forums as well

Apple - Support - Discussions - Developer Forums

Member of the Month September 2008 & August 2012 | Found advice useful? use the rep system
QUOTE Thanks
A_SN

 
Member Since: Apr 02, 2009
Posts: 6
A_SN is on a distinguished road

A_SN is offline
Quote:
Originally Posted by louishen View Post
You might want to post that thread in the Apple developer forums as well

Apple - Support - Discussions - Developer Forums
Oh thanks, just done
QUOTE Thanks
xstep

 
xstep's Avatar
 
Member Since: Jun 25, 2005
Location: On the road
Posts: 3,231
xstep is a name known to allxstep is a name known to allxstep is a name known to allxstep is a name known to allxstep is a name known to allxstep is a name known to allxstep is a name known to all
Mac Specs: 2011 MBP, i7, 16GB RAM, MBP 2.16Ghz Core Duo, 2GB ram, Dual 867Mhz MDD, 1.75GB ram, ATI 9800 Pro vid

xstep is offline
You'll definitely get great answers from the Apple developer forums.

Sounds like you have some code separation between the underlying C code and your GUI presentation code. Given that, I think you'll find using XCode and Interface Builder a fine solution which is also the long term solution. Apple has effectively announced the death of Carbon.

There is one blog out there by a guy who compares Windows and Cocoa coding & ideas. Unfortunately, for the life of me, I can' remember it. It is something I run a cross via other sites linking to it.

CameraTime - Time lapse photography for novice and advanced users.

When asking questions, post the version of your software. You'll receive better answers.

Please post your results to the thread as it is good feedback.
QUOTE Thanks
xstep

 
xstep's Avatar
 
Member Since: Jun 25, 2005
Location: On the road
Posts: 3,231
xstep is a name known to allxstep is a name known to allxstep is a name known to allxstep is a name known to allxstep is a name known to allxstep is a name known to allxstep is a name known to all
Mac Specs: 2011 MBP, i7, 16GB RAM, MBP 2.16Ghz Core Duo, 2GB ram, Dual 867Mhz MDD, 1.75GB ram, ATI 9800 Pro vid

xstep is offline
Quote:
Originally Posted by xstep View Post
There is one blog out there by a guy who compares Windows and Cocoa coding & ideas. Unfortunately, for the life of me, I can' remember it.
Here it is COCOA [The .NET Addict's Blog]. I've linked specifically to the Cocoa tag as there are other things there.

CameraTime - Time lapse photography for novice and advanced users.

When asking questions, post the version of your software. You'll receive better answers.

Please post your results to the thread as it is good feedback.
QUOTE Thanks
DairyKnight

 
DairyKnight's Avatar
 
Member Since: Apr 27, 2009
Posts: 3
DairyKnight is on a distinguished road

DairyKnight is offline
You can mix C with Objective C code. Cocoa is a better choice.
QUOTE Thanks

Post Reply New Thread Subscribe


« Running object file on commandline | compiling Linux app for OS X »
Thread Tools

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off
Forum Jump

Similar Threads
Thread
Thread Starter
Forum
Replies
Last Post
Carbon framework on XCode Rafi Shalom OS X - Development and Darwin 1 04-17-2008 02:14 PM
Ways to tell the difference between a Cocoa app and a Carbon app remain OS X - Apps and Games 0 05-22-2007 09:55 AM
Silver Carbon Macbook manguyen Schweb's Lounge 22 03-03-2007 07:47 PM
LMSetWindowList() replacement in Carbon presenter OS X - Development and Darwin 0 06-22-2005 06:07 AM
Javascript crashes IE 5.2.3 on Mac OS X alatoum Web Design and Hosting 2 05-12-2005 05:23 PM

All times are GMT -4. The time now is 01:53 PM.

Powered by vBulletin
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
X

Welcome to Mac-Forums.com

Create your username to jump into the discussion!

New members like you have made this community the ultimate source for your Mac since 2003!


(4 digit year)

Already a member?