Jump to content
Main menu
Main menu
move to sidebar
hide
Navigation
Main page
Recent changes
Random page
Help about MediaWiki
Special pages
Niidae Wiki
Search
Search
Appearance
Create account
Log in
Personal tools
Create account
Log in
Pages for logged out editors
learn more
Contributions
Talk
Editing
Carbon (API)
(section)
Page
Discussion
English
Read
Edit
View history
Tools
Tools
move to sidebar
hide
Actions
Read
Edit
View history
General
What links here
Related changes
Page information
Appearance
move to sidebar
hide
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
==Architecture== Carbon descends from the [[Macintosh Toolbox|Toolbox]], and as such, is composed of "Managers". Each Manager is a functionally related API, defining sets of data structures and functions to manipulate them. Managers are often interdependent or layered. Carbon consists of a broad set of functions for managing files, memory, data, the user interface, and other system services. It is implemented as any other API: in macOS, it is spread over several frameworks (each a structure built around a [[library (computing)|shared library]]), principally <code>Carbon.framework</code>, <code>ApplicationServices.framework</code>, and <code>CoreServices.framework</code>, and in classic Mac OS, it resides in a single shared library named <code>'''CarbonLib'''</code>. Carbon is not a compatibility box; it is a native API for Mac OS X. It sits roughly alongside Cocoa in an architectural diagram. Carbon apps can use all of the native functionality of Mac OS X, and you can mix Carbon and Cocoa windows in the same process. Carbon is compatible with all of the several [[object file|executable format]]s available for PowerPC Mac OS. <!-- I recall that XCOFF applications could be launched in classic Mac OS. Did this continue to work in X? -->Binary compatibility between Mac OS X and previous versions requires use of a [[Preferred Executable Format]] file, which Apple never supported in their [[Xcode]] [[integrated development environment|IDE]]. Newer parts of Carbon tend to be much more object-oriented in their conception, most of them based on [[Core Foundation]]. Some Managers, such as the HIView Manager (a superset of the Control Manager), are implemented in [[C++]], but Carbon remains a [[C (programming language)|C]] API. Some examples of Carbon Managers: * File Manager — manages access to the file system, opening, closing, reading and writing files. * Resource Manager — manages access to chunks of data in the resource fork of a file. Examples of resources include icons, sounds, images, templates for widgets, etc. * Font Manager — manages [[Typeface|font]]s. Deprecated (as part of [[QuickDraw]]) since [[Mac OS X Tiger|Mac OS X v10.4]], in favor of [[Apple Type Services]] (ATS). * [[QuickDraw]] — 2D graphics primitives. Deprecated since [[Mac OS X Tiger|Mac OS X v10.4]], in favor of Quartz 2D. * Carbon Event Manager <!-- NOT to be confused with Event Manager --> — converts user and system activity into events that code can recognise and respond to. * HIObject — a completely new object-oriented API which brings to Carbon an [[Object-oriented programming|OO]] model for building GUIs. This is available in [[Mac OS X v10.2]] or later, and gives Carbon programmers a more powerful API to work with. Starting with [[Mac OS X v10.2]], HIObject is the base class for all GUI elements in Carbon. HIView is supported by [[Interface Builder]], part of Apple's developer tools. Traditionally GUI architectures of this sort have been left to third-party application frameworks to provide. Starting with Mac OS X v10.4, HIObjects are NSObjects and inherit the ability to be serialized into data streams for transport or saving to disk. * HITheme — uses QuickDraw and Quartz to render [[graphical user interface]] (GUI) elements to the screen. HITheme was introduced in [[Mac OS X v10.3]], and Appearance Manager is a compatibility layer on top of HITheme since that version. * HIView Manager — manages creation, drawing, [[hit-testing]], and manipulation of controls. Since Mac OS X v10.2, all controls are HIViews. In Mac OS X v10.4, the Control Manager was renamed HIView Manager. * Window Manager — manages creation, positioning, updating, and manipulation of windows. Since Mac OS X v10.2, windows have a root HIView. * Menu Manager — manages creation, selection, and manipulation of menus. Since Mac OS X v10.2, menus are HIObjects. Since Mac OS X v10.3, menu content may be drawn using HIViews, and all standard menus use HIViews to draw.
Summary:
Please note that all contributions to Niidae Wiki may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see
Encyclopedia:Copyrights
for details).
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Search
Search
Editing
Carbon (API)
(section)
Add topic