|
|
#1 |
|
Hall of Famer
Join Date: Oct 2002
Location: Halifax, Canada
Posts: 4,945
|
Carbon or Cocoa?
Is there a simple test to tell whether an application is Carbon or Cocoa?
__________________
17" MBP, OS X 10.8.3; 27" iMac, OS X 10.8.3 |
|
|
|
|
|
#2 |
|
Site Admin
Join Date: Jan 2002
Location: Montreal
Posts: 31,937
|
1) Why do you care?
2) The question isn't particularly well-defined since it is quite possible for an app to use both Carbon and Cocoa libraries. To look at what libraries are used by a particular executable, you can use 'otool -L' on the command-line. To restrict the results to just the Carbon and Cocoa libraries, pipe the results through grep. For example: Code:
% otool -L iTunes.app/Contents/MacOS/iTunes | egrep -i 'carbon|cocoa'
/System/Library/Frameworks/Carbon.framework/Versions/A/Carbon (compatibility version 2.0.0, current version 128.0.0)
% otool -L Safari.app/Contents/MacOS/Safari | egrep -i 'carbon|cocoa'
/System/Library/Frameworks/Cocoa.framework/Versions/A/Cocoa (compatibility version 1.0.0, current version 11.0.0)
/System/Library/Frameworks/Carbon.framework/Versions/A/Carbon (compatibility version 2.0.0, current version 128.0.0)
3) Perhaps what you are asking is which library is used for the widgets that are used for the user-interface. Even that is not well-defined since I think it is possible (although not likely) for an app to mix & match Carbon & Cocoa widgets. You could go into the Resources sub-folder of the app and then open up the NIB files (e.g. under English.lproj") and look to see what type of widgets are being used. (Click on a part of the window in Interface Builder and then do Command-1 to get the Inspector)
__________________
hayne.net/macosx.html |
|
|
|
|
|
#3 |
|
Hall of Famer
Join Date: Oct 2002
Location: Halifax, Canada
Posts: 4,945
|
Thanks for the methods, Hayne. I care because I was considering whether I could profitably make use of a ~/Library/KeyBindings/DefaultKeyBinding.dict to add features to word processing. Only Cocoa apps are "aware" of KeyBinding.dict files, and I was encouraged by this thread and its links to believe that useful things could be accomplished.
__________________
17" MBP, OS X 10.8.3; 27" iMac, OS X 10.8.3 Last edited by NovaScotian; 11-15-2006 at 07:13 AM. |
|
|
|
|
|
#4 | |||||||||||||||||||||||
|
Site Admin
Join Date: Jan 2002
Location: Montreal
Posts: 31,937
|
More precisely, only the Cocoa text widgets are aware of those files. So what you care about is whether an app is using one of the widgets that uses the Cocoa text system. (It is theoretically possible, although of course very unlikely, for a developer to use a Carbon text widget, or even a home-grown widget, in an app that otherwise uses Cocoa.)
__________________
hayne.net/macosx.html |
|||||||||||||||||||||||
|
|
|
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|