Jump To:
Leopard Sample Code
Carbon is a set of C APIs offering developers an advanced user interface tool kit, event handling, the Quartz 2D graphics library, and multiprocessing support. Developers have access to other C and C++ APIs, including the OpenGL drawing system and the Mach microkernel.

A guided introduction and learning path for developers new to Carbon.   Essential information for developers using procedural C.   C API references organized by framework.
Document Descriptions
On Off
Display

Sorted by
Title
Sort by
Topic
Sort by
Date
ABPresence (HTML) (DMG) (ZIP)
Displays a list of all the people in your Address Book and their iChat status.
Apple Applications, Interapplication Communication 2006-08-04
AddNibToNav (HTML) (DMG) (ZIP)
Shows how to create a custom area, instantiated from a nib file, in a Navigation Services dialog.
File Management, Human Interface Toolbox 2004-01-22
AddressBookCarbon (HTML) (DMG) (ZIP)
Demonstrates some basic manipulations of the Mac OS X 10.2.x (and beyond) Address Book API.
Interapplication Communication 2003-01-14
AddressBookCocoa (HTML) (DMG) (ZIP)
Demonstrates some basic manipulations of the Mac OS X 10.2.x (and beyond) Address Book API.
Interapplication Communication 2003-01-14
AESendThreadSafe (HTML) (DMG) (ZIP)
Demonstrates how to send Apple events from threads other than the main thread.
Interapplication Communication 2007-03-09
aglClipBufferRect (HTML) (DMG) (ZIP)
Shows the use of clip regions and buffer rects in AGL.
Games, Graphics & Imaging 2003-01-14
AGLSurfaceTexture (HTML) (DMG) (ZIP)
Example of render to texture/texture from surface using aglSurfaceTexture.
Games, Graphics & Imaging 2003-07-07
AlbumToSlideshow (HTML) (DMG) (ZIP)
Demonstrates using CF and NSXML to create Final Cut Pro XML.
Core Foundation 2008-05-15
AppleScriptRunner (HTML) (DMG) (ZIP)
How to send mail and execute other AppleScripts from a Carbon application.
User Experience 2006-07-31
AsyncPB (HTML) (DMG) (ZIP)
Deprecated - Describes how to chain File System calls from an interrupt handler like a Time Manager task.
File Management 2003-10-27
ATSUICurveAccessDemo (HTML) (DMG) (ZIP)
Demonstrates low-level ATSUI APIs which allow access to raw glyph curve data.
Internationalization, Text & Fonts 2003-01-14
ATSUIDirectAccessDemo (HTML) (DMG) (ZIP)
Demonstrates some basic manipulations of the ATSUI DirectAccess api.
Text & Fonts 2003-01-14
audioburntest (HTML) (DMG) (ZIP)
Uses the DRTrackCallbackProc and track properties to create a RedBook audio CD from AIFF files.
File Management 2003-01-14
AudioDeviceNotify (HTML) (DMG) (ZIP)
Demonstrates how to enumerate audio devices attached to the system and how to handle device notifications
Audio 2006-04-21
AudioQueueTest (HTML) (DMG) (ZIP)
Demonstrates AudioQueue, an audio playback API introduced in Mac OS X 10.5
Audio 2006-08-01
BackgroundExporter (HTML) (DMG) (ZIP)
Demonstrates techniques which can be used to export QuickTime movies in a separate export process.
QuickTime 2005-07-22
BasicDataBrowser (HTML) (DMG) (ZIP)
Shows how to create a basic, functional data browser.
Human Interface Toolbox, User Experience 2003-05-08
BasicInputMethod (HTML) (DMG) (ZIP)
An input method implemented as a text service component for Mac OS X.
Interapplication Communication, Text & Fonts 2003-01-14
BasicPlugIn (HTML) (DMG) (ZIP)
Uses the CFPlugin to locate, load, execute plugin. Derived from the SillyBalls sample.
Core Foundation, Runtime Architecture 2003-07-28
BrideOfMungGrab (HTML) (DMG) (ZIP)
Demonstrates the use of overlay windows and CG to draw text on captured video.
QuickTime 2005-08-12
BSDLLCTest (HTML) (DMG) (ZIP)
Program sample demonstrates how to send and receive raw LLC Ethernet packets.
Apple Applications, Events & Other Input, Networking, Performance, Security 2003-06-12
bulkerase (HTML) (DMG) (ZIP)
Demonstrates how to erase media using the DiscRecording framework.
File Management 2003-01-14
Calculator (HTML) (DMG) (ZIP)
Implements a simple "four-banger" calculator.
User Experience 2003-01-30
CalendarView (HTML) (DMG) (ZIP)
Shows how to subclass HIView using C, as well as drawing and hit testing.
Human Interface Toolbox 2003-01-30
CallMachOFramework (HTML) (DMG) (ZIP)
Shows two ways of calling a Mach-O framework from a CFM application on Mac OS X.
Runtime Architecture 2003-07-17
Carbon GLSnapshot (HTML) (DMG) (ZIP)
Demonstrates the use of OpenGL with Quicktime to capture OpenGL content.
Games, Graphics & Imaging, QuickTime 2003-07-07
Carbon Porting Tutorial (HTML) (DMG) (ZIP)
Porting a simple application from Mac OS 9 to Mac OS X
Porting 2006-07-25
CarbonCocoa_PictureCursor (HTML) (DMG) (ZIP)
Demonstrates how to use NSCursor from a Carbon based application.
Human Interface Toolbox, Porting, User Experience 2007-01-12
CarbonCocoaCoreImageTab (HTML) (DMG) (ZIP)
Carbon-based application creates a Cocoa-based web window which used CoreImage filters to transition between tabbed WebViews
Human Interface Toolbox, Internet & Web 2006-07-25
CarbonCocoaTempConverter (HTML) (DMG) (ZIP)
Demonstrates how to integrate Carbon and Cocoa user interfaces in the same Cocoa application.
Events & Other Input 2008-03-10
CarbonCustomList (HTML) (DMG) (ZIP)
How to implement a custom list using Carbon using CreateCustomList.
User Experience 2003-01-30
CarbonInCocoa (HTML) (DMG) (ZIP)
How to use Carbon GUI code in a Cocoa application.
Events & Other Input 2003-03-26
CarbonMDEF (HTML) (DMG) (ZIP)
A Mac OS X-compatible, Appearance-savvy sample menu definition function (MDEF).
Human Interface Toolbox, User Experience 2003-01-30
CarbonQuartzComposer_TV (HTML) (DMG) (ZIP)
Demonstrates how to integrate Cocoa based QuartzComposer window into a Carbon based application
Graphics & Imaging 2006-10-02
CarbonQuartzDrawingWPrinting (HTML) (DMG) (ZIP)
Deprecated - Demonstrates mixing QuickDraw and Quartz 2D drawing both on screen and during printing.
Graphics & Imaging, Printing 2003-01-14
CarbonSketch (HTML) (DMG) (ZIP)
Core Graphics only example of a Sketch application implemented with HIToolbox. Shows 1x1-CGBitmapContext for hit-testing, printing.
Graphics & Imaging 2005-03-23
CarbonTransparentWindow (HTML) (DMG) (ZIP)
Shows how to handle window transparency for compositing, non-compositing, and custom HIView-based Carbon windows.
Human Interface Toolbox 2005-08-10
CFHostSample (HTML) (DMG) (ZIP)
Uses the CFHost API to do DNS hostname lookups and to determine host reachability.
Networking 2004-04-20
CFM_MachO_CFM (HTML) (DMG) (ZIP)
CFM application calls Mach-O routine, passing in a fixed up CFM function pointer as a callback parameter.
Runtime Architecture 2003-07-17
CFNetworkHTTPDownload (HTML) (DMG) (ZIP)
Demonstrates how to download a URL using CFNetworking.
Networking 2006-01-18
CFPreferences (HTML) (DMG) (ZIP)
Shows how to use the CFPreferences APIs to access user preferences.
Core Foundation 2003-01-14
CFPrefsDumper (HTML) (DMG) (ZIP)
Shows how to use the CFPreferences APIs to access information about the current user preferences.
Core Foundation 2003-01-14
CFPrefTopScores (HTML) (DMG) (ZIP)
How to access globally shared (writable) user preferences without requiring authentication.
Core Foundation, Data Management, Design Guidelines, File Management, Games, Resource Management 2006-10-09
CheckExecutableArchitecture (HTML) (DMG) (ZIP)
Determine whether a particular Mach-O executable contains a version suitable for executing on a given processor architecture.
Runtime Architecture 2006-02-07
CIColorTracking (HTML) (DMG) (ZIP)
An Objective-C applicaton that implements a GPU-based technique to find the location of a uniquely colored object in a scene
Graphics & Imaging 2008-04-24
ClockView (HTML) (DMG) (ZIP)
An HIView sample that uses the HIFramework to implement a scalable analog clock.
Human Interface Toolbox 2003-01-30
Cocoa PDE with Carbon Printing (HTML) (DMG) (ZIP)
Application that uses a Cocoa PDE along with the Carbon Printing APIs.
Printing 2007-07-27
Cocoa_With_Carbon_or_CPP (HTML) (DMG) (ZIP)
Shows how to call Carbon routines and C++ code from within an Objective-C Cocoa program.
User Experience 2007-02-05
CocoaInCarbon (HTML) (DMG) (ZIP)
Demonstrates using Cocoa GUI code in a Carbon application.
Design Guidelines, Runtime Architecture 2005-10-04
ColorBars (HTML) (DMG) (ZIP)
Shows how to enumerate, select, capture, manipulate, draw to, and release displays using the CGDirectDisplay API.
Graphics & Imaging 2003-01-14
ColoredCheckBox (HTML) (DMG) (ZIP)
Demonstrates how to create a colored check box on a gray window backgrounds.
Human Interface Toolbox, User Experience 2003-01-30
ColorSwatchView (HTML) (DMG) (ZIP)
Implements a color well control as an HIView using HIFramework C++ Carbon Event wrapper classes.
Human Interface Toolbox 2003-01-30
ColorSyncDevices (HTML) (DMG) (ZIP)
Demonstrates how to use the new ColorSync Device Support APIs introduced with Mac OS X.
Graphics & Imaging 2003-01-14
ColorSyncDevices-Cocoa (HTML) (DMG) (ZIP)
Demonstrates how to use the new ColorSync Device Manager routines in the Cocoa environment.
Graphics & Imaging 2003-01-14
ComboBoxPrefs (HTML) (DMG) (ZIP)
Use CFPrefs to store URLs to images for use in a browser style combo box.
Graphics & Imaging, Human Interface Toolbox 2005-10-04
ControlBackground (HTML) (DMG) (ZIP)
Shows how to affect the background color of a control when drawing it.
Human Interface Toolbox, User Experience 2003-01-30
CopyBits vs. CopyMask (HTML) (DMG) (ZIP)
Deprecated - CopyBits (using a mask region) vs. CopyMask (using a mask BitMap). Which do you think is faster?
Performance 2003-07-22
CoreTextArc (HTML) (DMG) (ZIP)
Illustrates the use of fonts, lines, and runs in a CoreText text drawing Carbon application.
Text & Fonts 2007-06-04
CoreTextTest (HTML) (DMG) (ZIP)
Shows how to handle the CoreText objects to display text.
Text & Fonts 2006-12-19
CPUGestalt (HTML) (DMG) (ZIP)
Deprecated - Shows how to determine the processor type of the Macintosh you're running on.
Resource Management 2003-10-27
CrossEvents (HTML) (DMG) (ZIP)
Demonstrates how to send CarbonEvents and NSNotifications between Carbon and Cocoa.
Design Guidelines, Events & Other Input, Porting, Process Management 2007-05-31
CryptoSample (HTML) (DMG) (ZIP)
Contains sample code showing symmetric encryption and message digest calculation.
Security 2003-02-06
CTMClip (HTML) (DMG) (ZIP)
Deprecated - Shows how to manipulate the Quartz 2D Current Transform Matrix (CTM) for image drawing with clipping.
Graphics & Imaging 2003-01-14
CTMDemo (HTML) (DMG) (ZIP)
Deprecated - Shows how to manipulate the Quartz 2D Current Transform Matrix (CTM) for image drawing without clipping.
Graphics & Imaging 2003-01-14
Custom_HIView_Tutorial (HTML) (DMG) (ZIP)
Tutorial presenting a step-by-step custom HIView development. All steps are documented and provided as standalone projects.
Human Interface Toolbox 2005-06-01
CustomWindow (HTML) (DMG) (ZIP)
Demonstrates how to create a custom window in Mac OS X.
Human Interface Toolbox, User Experience 2003-01-30
CustomWindowWidget (HTML) (DMG) (ZIP)
Demonstrates two ways of adding a custom window widget to the window frame of a standard document window.
Human Interface Toolbox 2003-01-30
databurntest (HTML) (DMG) (ZIP)
Demonstrates how to create a DRFolderRef and burn it to disc.
File Management 2003-01-14
DialogsToHIViews (HTML) (DMG) (ZIP)
Shows how to convert from an old-style resource-based dialog to a modern nib-based window with HIViews.
Human Interface Toolbox 2005-08-24
DisplayURL (HTML) (DMG) (ZIP)
Parses a passed in path URL into its various components displaying server information.
File Management 2005-10-04
DockBrowser (HTML) (DMG) (ZIP)
Demonstrates how to use CFNetServices to take advantage of Bonjour service discovery and name resolution.
Performance 2005-02-08
DragAndDrop Shell (HTML) (DMG) (ZIP)
A Drag and Drop shell for producing QuickTime drag and drop tools.
Events & Other Input 2003-01-14
DrawSprocketTestOld (HTML) (DMG) (ZIP)
Deprecated - Demonstrates basic implementations of DrawSprocket Functions.
Games 2003-10-14
DRDataBurnCarbonUI (HTML) (DMG) (ZIP)
DRDataBurnCarbonUI shows how to use the standard DiscRecording burn setup and progress panel from Carbon.
File Management 2004-04-09
DREraseCarbonUI (HTML) (DMG) (ZIP)
DREraseCarbonUI shows how to use the DiscRecording erase setup and progress panel from Carbon.
File Management 2004-04-09
DropDraw (HTML) (DMG) (ZIP)
Demonstrates automatic ColorSync color-matching when drawing with QuickTime graphics importers in Panther
QuickTime 2005-08-01
DTSCarbonShell (HTML) (DMG) (ZIP)
Provides a modern Mac OS X Carbon Application Skeleton
Human Interface Toolbox, Text & Fonts, User Experience 2007-09-20
EmbededAppleScripts (HTML) (DMG) (ZIP)
Extending the functionality of your application by adding precompiled AppleScripts.
Interapplication Communication 2003-09-04
EventMonitorTest (HTML) (DMG) (ZIP)
Receive notification of all keyboard, mouse, and tablet events passed to other processes.
Events & Other Input 2005-11-09
FileNotification (HTML) (DMG) (ZIP)
kqueue file notification introduced in 10.3. Notification API to detect file system modifications.
File Management 2005-10-27
filesystem_examples (HTML) (DMG) (ZIP)
Collection of command line tools illustrating filesystem features.
File Management 2006-01-10
FinderDragPro (HTML) (DMG) (ZIP)
Sample file illustrating drag and drop techniques for use with file system objects.
Events & Other Input, File Management, Interapplication Communication, User Experience 2003-01-14
FinderLaunch (HTML) (DMG) (ZIP)
Shows how to open documents by sending Apple Events to the Finder.
File Management, Interapplication Communication, User Experience 2003-10-14
FloatingWindow (HTML) (DMG) (ZIP)
Demonstrates that floating windows are very easy to implement on Mac OS X using Nib files.
Human Interface Toolbox 2003-10-24
Folder Watching (HTML) (DMG) (ZIP)
Demonstrates how a background only application can use Apple events to pass work to another application.
File Management, Interapplication Communication, Process Management 2003-01-14
Fragment Tool (HTML) (DMG) (ZIP)
Demonstrates manipulation of code fragments; combining and separating; viewing and editing information associated with each.
Data Management, Design Guidelines, File Management, Resource Management, Runtime Architecture, Tools, User Experience 2003-01-30
FSCopyObject (HTML) (DMG) (ZIP)
Copy engine for copying files and directories.
File Management 2004-03-19
FSCreateFileAndOpenForkUnicode (HTML) (DMG) (ZIP)
Demonstartes the use of FSCreateFileAndOpenForkUnicode to create a file with restricted access on disk and a read/write access path.
File Management 2005-06-01
FSFileOperation (HTML) (DMG) (ZIP)
This sample shows how to use the FSFileOperation API which supports copying and moving filesystem objects.
File Management 2005-06-06
FSMegaInfo (HTML) (DMG) (ZIP)
Prints information about various file system objects; helpful when debugging VFS plug-ins.
File Management 2008-02-25
FSRemoveInheritedACEs (HTML) (DMG) (ZIP)
Demonstrates manipulating access control lists of existing file system objects using the File Manager.
File Management 2005-06-01
FSReplaceObject (HTML) (DMG) (ZIP)
FSReplaceObject is an example command line tool showing how to exercise the FSReplaceObject and FSPathReplaceObject related APIs.
File Management 2007-02-14
FullScreen (HTML) (DMG) (ZIP)
Shows how to use BeginFullScreen and EndFullScreen to enter and exit full-screen mode.
Graphics & Imaging 2003-01-14
GetDragHiliteColor (HTML) (DMG) (ZIP)
Shows how to obtain the color that Drag Manager uses to hilite regions when calling ShowDragHilite.
Human Interface Toolbox, User Experience 2003-01-30
GetHWEthernetAddr (HTML) (DMG) (ZIP)
Deprecated - Shows how to obtain the hardware Ethernet address of a machine.
Networking 2003-01-14
GetMACAddressSample (HTML) (DMG) (ZIP)
Demonstrates how to retrieve the MAC address for each Ethernet interface from the Mac OS X I/O Registry.
Networking, Security 2003-01-14
GetPrimaryMACAddress (HTML) (DMG) (ZIP)
Demonstrates retrieving the MAC address of the built-in Ethernet controller. Useful for uniquely identifying a Macintosh system.
Networking, Security 2005-10-27
GetSetOptions (HTML) (DMG) (ZIP)
Demonstrates a variety of uses of Open Transport's option management routines.
Networking 2003-01-14
GLCarbon1ContextPbuffer (HTML) (DMG) (ZIP)
Demostrates using OpenGL pixel buffers with a single shared context.
Graphics & Imaging 2004-03-26
GLCarbonSharedPbuffer (HTML) (DMG) (ZIP)
Demostrates sharing a single OpenGL pixel buffer with multiple other contexts.
Graphics & Imaging 2004-03-26