 |
 |
newbie developer confused.?
|
 |
|
 |
|
Mac Enthusiast
Join Date: Jan 2001
Location: ny ny usa
Status:
Offline
|
|
I am cool with the concept of Cocoa and Carbon being two seperate application environments. I am having trouble figuring out where stuff like CoreFoundation, CoreServices and CoreApplicationServices fit with cocoa and cabron. Carbon and Cocoa have two syntax's and structural differences. Carbon strucured, Cocoa object oriented. carbon C, Cocoa Objective C. So how does one access these low level services from the high level application environments? For instance how would I access HFS+ functions from within a Cocoa environment?
|
|
'Satisfy the urge and discover the need' Q-Tip
|
| |
|
|
|
 |
|
 |
|
Mac Enthusiast
Join Date: Feb 2000
Location: Storrs,Connecticut, USA
Status:
Offline
|
|
I ahven't looked at them extensively, but you can use anything in Core Applications services and the like in Cocoa or Carbon. All they are, or at least the ones that I have used, are C functions. Objective C is 100% compatible with C. C++ isn't, structures are a little bit different, but they should still work there too. For example, just call a few CG functions from an Objective C method and they should work.
|
|
|
| |
|
|
|
 |
|
 |
|
Grizzled Veteran
Join Date: Apr 2001
Status:
Offline
|
|
It gets a bit confusing:
Foundation is a set of Obj C (or Java) objects that provide important services and data structures for the AppKit (the interface-related part of Cocoa). Things like NSArray, NSString, etc, are part of foundation. The "NS" prefix should be a hint that they're part of Cocoa and can't be accessed from Carbon.
However, Core Foundation is a set of C-based structures and routines that both Cocoa and Carbon can make use of. The "CF" prefix in the core foundation is your clue that either Carbon or Cocoa can access it.
Hope this helps.
Wade
|
|
|
| |
|
|
|
 |
|
 |
|
Mac Enthusiast
Join Date: Jan 2001
Location: ny ny usa
Status:
Offline
|
|
Getting more confussed
Cocoa and Carbon appear to be built on top of CoreServices, CoreFoundation and CoreApplicationServices. CoreServices appears to contain a lot of Carbon stuff like thread manager, MultiProcessing Services and FileManager to name a few. Does that mean that I can call those API from Cocoa apps? I know that Cocoa has NS Thread but still the question remains can I call CoreServices and CoreApplicationServices functions from a Cocoa app. It just looks like they are part of Carbon.
Forget about CoreFoundation for the moment I am interested in CoreServices and CoreApplicationServices.
Also the Documentation seems to be broken into 5 sections, carbon, Cocoa, Kernel, Networking and CoreFoundation. There is no section for CoreApplicationServices or CoreServices.
[This message has been edited by muchfresh (edited 04-19-2001).]
|
|
'Satisfy the urge and discover the need' Q-Tip
|
| |
|
|
|
 |
|
 |
|
Addicted to MacNN
Join Date: Mar 2000
Location: London, UK
Status:
Offline
|
|
You can call Cocoa code from Carbon and vice versa.
Read System Overview and possibly the Kernel Environment to get to know more about what's going on in OS X.
|
|
|
| |
|
|
|
 |
|
 |
|
Junior Member
Join Date: Apr 2001
Location: Sunnyvale, CA
Status:
Offline
|
|
Originally posted by Angus_D:
You can call Cocoa code from Carbon and vice versa.
Woa, can you give me some more specific references/details? Last I heard, there are features in Cocoa that can't be used in Carbon. Docklets and opaque windows are a couple of examples that come to mind...
|
|
|
| |
|
|
|
 |
|
 |
|
Addicted to MacNN
Join Date: Mar 2000
Location: London, UK
Status:
Offline
|
|
Opaque windows? They're part of Carbon by default... I don't know what you mean... Opaque dragging?
As for Docklets... well you can write bridging code, and any valid C carbon will compile with the ObjC compiler, since ObjC is a superset of C. You just need to link against Carbon.framework.....
Mixing C++ with ObjC is messy and requires bridging, there's an example on developer.apple.com/samplecode
|
|
|
| |
|
|
|
 |
 |
|
 |
|
|
|
|
|

|
|
 |
Forum Rules
|
 |
 |
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
|
HTML code is Off
|
|
|
|
|
|
 |
 |
 |
 |
|
 |
|