Carbon contains thousands of functions, data structures, and constants, but don’t worry, this book uses only a small number of these. Related functions and data structures are organized into functional groups, usually referred to as managers or services. For example, the Window Manager contains functions and data structures that let you create, remove, and otherwise manipulate application windows.
In this book you’ll use functions from only a handful of these managers and services, most of which are commonly used in all Carbon applications. These interfaces cover the following functionality:
User interface creation and manipulation. That is, handling windows, menus, and other common graphical user interface (GUI) elements.
Event handling. How to find out when something happens and what to do when it does.
Basic string manipulation. How to put together text you want to display in a window.
Basic graphics rendering. How to display the text and windows on a screen.
Printing. How to print the text in a window.
Saving and opening files.
Help. How to implement a simple online help system and how to add informative “help tags” to buttons and other controls.
Storing and accessing resources. Mac OS X has a “bundle” feature that lets you store all the files an application needs in one easily accessible package.
You’ll probably be surprised to see how few functions you need from each manager or service to implement basic functionality. That’s what’s great about Carbon on Mac OS X. The operating system and the development tools you’ll use—Project Builder and Interface Builder—do most of the grunt work for you. For example, you might think you’d have to write a lot of complicated code to allow a user to drag a window around the screen. In actuality, you get this for free: the operating system automatically makes the appropriate calls for you and makes sure the dragged window behaves properly. Of course, if you need to control every aspect of an action or want to add custom features, Carbon lets you do that too. However, if you’re willing to accept the standard behavior—and there is little reason not to—for most user interface elements, you’ll have far less code to write.