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 EventsCarbon.AH
--- Apple HelpCarbon.App
--- Appearance ManagerCarbon.Appearance
--- Appearance Manager constantsCarbon.CF
--- Core FoundationThe CFBase
, CFArray
, CFData
, CFDictionary
, CFString
and
CFURL
objects are supported, some only partially.
Carbon.CG
--- Core GraphicsCarbon.CarbonEvt
--- Carbon Event ManagerCarbon.CarbonEvents
--- Carbon Event Manager constantsCarbon.Cm
--- Component ManagerCarbon.Components
--- Component Manager constantsCarbon.ControlAccessor
--- Control Manager accssorsCarbon.Controls
--- Control Manager constantsCarbon.CoreFounation
--- CoreFounation constantsCarbon.CoreGraphics
--- CoreGraphics constantsCarbon.Ctl
--- Control ManagerCarbon.Dialogs
--- Dialog Manager constantsCarbon.Dlg
--- Dialog ManagerCarbon.Drag
--- Drag and Drop ManagerCarbon.Dragconst
--- Drag and Drop Manager constantsCarbon.Events
--- Event Manager constantsCarbon.Evt
--- Event ManagerCarbon.File
--- File ManagerCarbon.Files
--- File Manager constantsCarbon.Fm
--- Font ManagerCarbon.Folder
--- Folder ManagerCarbon.Folders
--- Folder Manager constantsCarbon.Fonts
--- Font Manager constantsCarbon.Help
--- Help ManagerCarbon.IBCarbon
--- Carbon InterfaceBuilderCarbon.IBCarbonRuntime
--- Carbon InterfaceBuilder constantsCarbon.Icn
--- Carbon Icon ManagerCarbon.Icons
--- Carbon Icon Manager constantsCarbon.Launch
--- Carbon Launch ServicesCarbon.LaunchServices
--- Carbon Launch Services constantsCarbon.List
--- List ManagerCarbon.Lists
--- List Manager constantsCarbon.MacHelp
--- Help Manager constantsCarbon.MediaDescr
--- Parsers and generators for Quicktime Media descriptorsCarbon.Menu
--- Menu ManagerCarbon.Menus
--- Menu Manager constantsCarbon.Mlte
--- MultiLingual Text EditorCarbon.OSA
--- Carbon OSA InterfaceCarbon.OSAconst
--- Carbon OSA Interface constantsCarbon.QDOffscreen
--- QuickDraw Offscreen constantsCarbon.Qd
--- QuickDrawCarbon.Qdoffs
--- QuickDraw OffscreenCarbon.Qt
--- QuickTimeCarbon.QuickDraw
--- QuickDraw constantsCarbon.QuickTime
--- QuickTime constantsCarbon.Res
--- Resource Manager and HandlesCarbon.Resources
--- Resource Manager and Handles constantsCarbon.Scrap
--- Scrap ManagerThis module is only fully available on Mac OS 9 and earlier under classic PPC MacPython. Very limited functionality is available under Carbon MacPython.
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:
Carbon.Scrap.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. |
See also
- 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 ManagerCarbon.Sound
--- Sound Manager constantsCarbon.TE
--- TextEditCarbon.TextEdit
--- TextEdit constantsCarbon.Win
--- Window ManagerCarbon.Windows
--- Window Manager constants