Chapter 9. Using the Carbon Frameworks

Much of the technology behind the Carbon frameworks has been around a long time, well before Mac OS X was conceived. The first Macintosh computers shipped with an operating system that provided windows, menus, and controls to application programmers. The API in that first system evolved over time to include new functionality such as color, sound, power management, and later Internet networking and multimedia support. The System 6 and System 7 software lines gave way to Mac OS 8 and Mac OS 9 before ultimately the original Mac OS was officially retired in 2002. Even so, most of the APIs from traditional Mac OS live on in Mac OS X, repackaged into the Carbon frameworks.

The API at the center of the traditional Mac OS was referred to as the Macintosh Toolbox. Originally Macintosh software was written directly against the Toolbox API using a programming language called Pascal. Later Apple provided a C interface to the Toolbox that could be used by C and C++ programmers, but even to this day you can find evidence of its Pascal heritage.

The Macintosh Toolbox provides a fairly low-level interface to its functionality. You are responsible for handling most aspects of your program's operation. For example, when your program receives an event, you must figure out what the event means and then respond to that event appropriately. As a result, you are responsible for providing a lot of infrastructure code that may not be entirely relevant to the problem ...

Get Beginning Mac OS® X Programming now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.