Skip to content

Latest commit

 

History

History
576 lines (403 loc) · 15.6 KB

carbon.rst

File metadata and controls

576 lines (403 loc) · 15.6 KB

Mac OS Toolbox Modules

These are a set of modules that provide interfaces to various legacy Mac OS toolboxes. If applicable the module will define a number of Python objects for the various structures declared by the toolbox, and operations will be implemented as methods of the object. Other operations will be implemented as functions in the module. Not all operations possible in C will also be possible in Python (callbacks are often a problem), and parameters will occasionally be different in Python (input and output buffers, especially). All methods and functions have a __doc__ string describing their arguments and return values, and for additional description you are referred to Inside Macintosh or similar works.

These modules all live in a package called Carbon. Despite that name they are not all part of the Carbon framework: CF is really in the CoreFoundation framework and Qt is in the QuickTime framework. The normal use pattern is :

from Carbon import AE

Note

Most of the OS X APIs that these modules use are deprecated or removed in recent versions of OS X. Many are not available when Python is executing in 64-bit mode. The Carbon modules have been removed in Python 3. You should avoid using them in Python 2.

Carbon.AE --- Apple Events

Carbon.AE

Carbon.AH --- Apple Help

Carbon.AH

Carbon.App --- Appearance Manager

Carbon.App

Carbon.Appearance --- Appearance Manager constants

Carbon.Appearance

Carbon.CF --- Core Foundation

Carbon.CF

The CFBase, CFArray, CFData, CFDictionary, CFString and CFURL objects are supported, some only partially.

Carbon.CG --- Core Graphics

Carbon.CG

Carbon.CarbonEvt --- Carbon Event Manager

Carbon.CarbonEvt

Carbon.CarbonEvents --- Carbon Event Manager constants

Carbon.CarbonEvents

Carbon.Cm --- Component Manager

Carbon.Cm

Carbon.Components --- Component Manager constants

Carbon.Components

Carbon.ControlAccessor --- Control Manager accssors

Carbon.ControlAccessor

Carbon.Controls --- Control Manager constants

Carbon.Controls

Carbon.CoreFounation --- CoreFounation constants

Carbon.CoreFounation

Carbon.CoreGraphics --- CoreGraphics constants

Carbon.CoreGraphics

Carbon.Ctl --- Control Manager

Carbon.Ctl

Carbon.Dialogs --- Dialog Manager constants

Carbon.Dialogs

Carbon.Dlg --- Dialog Manager

Carbon.Dlg

Carbon.Drag --- Drag and Drop Manager

Carbon.Drag

Carbon.Dragconst --- Drag and Drop Manager constants

Carbon.Dragconst

Carbon.Events --- Event Manager constants

Carbon.Events

Carbon.Evt --- Event Manager

Carbon.Evt

Carbon.File --- File Manager

Carbon.File

Carbon.Files --- File Manager constants

Carbon.Files

Carbon.Fm --- Font Manager

Carbon.Fm

Carbon.Folder --- Folder Manager

Carbon.Folder

Carbon.Folders --- Folder Manager constants

Carbon.Folders

Carbon.Fonts --- Font Manager constants

Carbon.Fonts

Carbon.Help --- Help Manager

Carbon.Help

Carbon.IBCarbon --- Carbon InterfaceBuilder

Carbon.IBCarbon

Carbon.IBCarbonRuntime --- Carbon InterfaceBuilder constants

Carbon.IBCarbonRuntime

Carbon.Icn --- Carbon Icon Manager

Carbon.Icns

Carbon.Icons --- Carbon Icon Manager constants

Carbon.Icons

Carbon.Launch --- Carbon Launch Services

Carbon.Launch

Carbon.LaunchServices --- Carbon Launch Services constants

Carbon.LaunchServices

Carbon.List --- List Manager

Carbon.List

Carbon.Lists --- List Manager constants

Carbon.Lists

Carbon.MacHelp --- Help Manager constants

Carbon.MacHelp

Carbon.MediaDescr --- Parsers and generators for Quicktime Media descriptors

Carbon.MediaDescr

Carbon.Menu --- Menu Manager

Carbon.Menu

Carbon.Menus --- Menu Manager constants

Carbon.Menus

Carbon.Mlte --- MultiLingual Text Editor

Carbon.Mlte

Carbon.OSA --- Carbon OSA Interface

Carbon.OSA

Carbon.OSAconst --- Carbon OSA Interface constants

Carbon.OSAconst

Carbon.QDOffscreen --- QuickDraw Offscreen constants

Carbon.QDOffscreen

Carbon.Qd --- QuickDraw

Carbon.Qd

Carbon.Qdoffs --- QuickDraw Offscreen

Carbon.Qdoffs

Carbon.Qt --- QuickTime

Carbon.Qt

Carbon.QuickDraw --- QuickDraw constants

Carbon.QuickDraw

Carbon.QuickTime --- QuickTime constants

Carbon.QuickTime

Carbon.Res --- Resource Manager and Handles

Carbon.Res

Carbon.Resources --- Resource Manager and Handles constants

Carbon.Resources

Carbon.Scrap --- Scrap Manager

Carbon.Scrap

This module is only fully available on Mac OS 9 and earlier under classic PPC MacPython. Very limited functionality is available under Carbon MacPython.

single: Scrap Manager

The Scrap Manager supports the simplest form of cut & paste operations on the Macintosh. It can be use for both inter- and intra-application clipboard operations.

The Scrap module provides low-level access to the functions of the Scrap Manager. It contains the following functions:

InfoScrap()

Return current information about the scrap. The information is encoded as a tuple containing the fields (size, handle, count, state, path).

Field Meaning
size Size of the scrap in bytes.
handle Resource object representing the scrap.
count Serial number of the scrap contents.
state Integer; positive if in memory, 0 if on disk, negative if uninitialized.
path Filename of the scrap when stored on disk.
Scrap Manager

Apple's documentation for the Scrap Manager gives a lot of useful information about using the Scrap Manager in applications.

Carbon.Snd --- Sound Manager

Carbon.Snd

Carbon.Sound --- Sound Manager constants

Carbon.Sound

Carbon.TE --- TextEdit

Carbon.TE

Carbon.TextEdit --- TextEdit constants

Carbon.TextEdit

Carbon.Win --- Window Manager

Carbon.Win

Carbon.Windows --- Window Manager constants

Carbon.Windows