Georg Brandl | 8ec7f65 | 2007-08-15 14:28:01 +0000 | [diff] [blame] | 1 | |
| 2 | .. _toolbox: |
| 3 | |
| 4 | ********************* |
| 5 | MacOS Toolbox Modules |
| 6 | ********************* |
| 7 | |
| 8 | There are a set of modules that provide interfaces to various MacOS toolboxes. |
| 9 | If applicable the module will define a number of Python objects for the various |
| 10 | structures declared by the toolbox, and operations will be implemented as |
| 11 | methods of the object. Other operations will be implemented as functions in the |
| 12 | module. Not all operations possible in C will also be possible in Python |
| 13 | (callbacks are often a problem), and parameters will occasionally be different |
| 14 | in Python (input and output buffers, especially). All methods and functions |
| 15 | have a :attr:`__doc__` string describing their arguments and return values, and |
| 16 | for additional description you are referred to `Inside Macintosh |
| 17 | <http://developer.apple.com/documentation/macos8/mac8.html>`_ or similar works. |
| 18 | |
| 19 | These modules all live in a package called :mod:`Carbon`. Despite that name they |
| 20 | are not all part of the Carbon framework: CF is really in the CoreFoundation |
| 21 | framework and Qt is in the QuickTime framework. The normal use pattern is :: |
| 22 | |
| 23 | from Carbon import AE |
| 24 | |
| 25 | **Warning!** These modules are not yet documented. If you wish to contribute |
| 26 | documentation of any of these modules, please get in touch with docs@python.org. |
| 27 | |
| 28 | |
| 29 | :mod:`Carbon.AE` --- Apple Events |
| 30 | ================================= |
| 31 | |
| 32 | .. module:: Carbon.AE |
| 33 | :platform: Mac |
| 34 | :synopsis: Interface to the Apple Events toolbox. |
| 35 | |
| 36 | |
| 37 | |
| 38 | :mod:`Carbon.AH` --- Apple Help |
| 39 | =============================== |
| 40 | |
| 41 | .. module:: Carbon.AH |
| 42 | :platform: Mac |
| 43 | :synopsis: Interface to the Apple Help manager. |
| 44 | |
| 45 | |
| 46 | |
| 47 | :mod:`Carbon.App` --- Appearance Manager |
| 48 | ======================================== |
| 49 | |
| 50 | .. module:: Carbon.App |
| 51 | :platform: Mac |
| 52 | :synopsis: Interface to the Appearance Manager. |
| 53 | |
| 54 | |
| 55 | |
| 56 | :mod:`Carbon.CF` --- Core Foundation |
| 57 | ==================================== |
| 58 | |
| 59 | .. module:: Carbon.CF |
| 60 | :platform: Mac |
| 61 | :synopsis: Interface to the Core Foundation. |
| 62 | |
| 63 | |
| 64 | The ``CFBase``, ``CFArray``, ``CFData``, ``CFDictionary``, ``CFString`` and |
| 65 | ``CFURL`` objects are supported, some only partially. |
| 66 | |
| 67 | |
| 68 | :mod:`Carbon.CG` --- Core Graphics |
| 69 | ================================== |
| 70 | |
| 71 | .. module:: Carbon.CG |
| 72 | :platform: Mac |
| 73 | :synopsis: Interface to the Component Manager. |
| 74 | |
| 75 | |
| 76 | |
| 77 | :mod:`Carbon.CarbonEvt` --- Carbon Event Manager |
| 78 | ================================================ |
| 79 | |
| 80 | .. module:: Carbon.CarbonEvt |
| 81 | :platform: Mac |
| 82 | :synopsis: Interface to the Carbon Event Manager. |
| 83 | |
| 84 | |
| 85 | |
| 86 | :mod:`Carbon.Cm` --- Component Manager |
| 87 | ====================================== |
| 88 | |
| 89 | .. module:: Carbon.Cm |
| 90 | :platform: Mac |
| 91 | :synopsis: Interface to the Component Manager. |
| 92 | |
| 93 | |
| 94 | |
| 95 | :mod:`Carbon.Ctl` --- Control Manager |
| 96 | ===================================== |
| 97 | |
| 98 | .. module:: Carbon.Ctl |
| 99 | :platform: Mac |
| 100 | :synopsis: Interface to the Control Manager. |
| 101 | |
| 102 | |
| 103 | |
| 104 | :mod:`Carbon.Dlg` --- Dialog Manager |
| 105 | ==================================== |
| 106 | |
| 107 | .. module:: Carbon.Dlg |
| 108 | :platform: Mac |
| 109 | :synopsis: Interface to the Dialog Manager. |
| 110 | |
| 111 | |
| 112 | |
| 113 | :mod:`Carbon.Evt` --- Event Manager |
| 114 | =================================== |
| 115 | |
| 116 | .. module:: Carbon.Evt |
| 117 | :platform: Mac |
| 118 | :synopsis: Interface to the classic Event Manager. |
| 119 | |
| 120 | |
| 121 | |
| 122 | :mod:`Carbon.Fm` --- Font Manager |
| 123 | ================================= |
| 124 | |
| 125 | .. module:: Carbon.Fm |
| 126 | :platform: Mac |
| 127 | :synopsis: Interface to the Font Manager. |
| 128 | |
| 129 | |
| 130 | |
| 131 | :mod:`Carbon.Folder` --- Folder Manager |
| 132 | ======================================= |
| 133 | |
| 134 | .. module:: Carbon.Folder |
| 135 | :platform: Mac |
| 136 | :synopsis: Interface to the Folder Manager. |
| 137 | |
| 138 | |
| 139 | |
| 140 | :mod:`Carbon.Help` --- Help Manager |
| 141 | =================================== |
| 142 | |
| 143 | .. module:: Carbon.Help |
| 144 | :platform: Mac |
| 145 | :synopsis: Interface to the Carbon Help Manager. |
| 146 | |
| 147 | |
| 148 | |
| 149 | :mod:`Carbon.List` --- List Manager |
| 150 | =================================== |
| 151 | |
| 152 | .. module:: Carbon.List |
| 153 | :platform: Mac |
| 154 | :synopsis: Interface to the List Manager. |
| 155 | |
| 156 | |
| 157 | |
| 158 | :mod:`Carbon.Menu` --- Menu Manager |
| 159 | =================================== |
| 160 | |
| 161 | .. module:: Carbon.Menu |
| 162 | :platform: Mac |
| 163 | :synopsis: Interface to the Menu Manager. |
| 164 | |
| 165 | |
| 166 | |
| 167 | :mod:`Carbon.Mlte` --- MultiLingual Text Editor |
| 168 | =============================================== |
| 169 | |
| 170 | .. module:: Carbon.Mlte |
| 171 | :platform: Mac |
| 172 | :synopsis: Interface to the MultiLingual Text Editor. |
| 173 | |
| 174 | |
| 175 | |
| 176 | :mod:`Carbon.Qd` --- QuickDraw |
| 177 | ============================== |
| 178 | |
| 179 | .. module:: Carbon.Qd |
| 180 | :platform: Mac |
| 181 | :synopsis: Interface to the QuickDraw toolbox. |
| 182 | |
| 183 | |
| 184 | |
| 185 | :mod:`Carbon.Qdoffs` --- QuickDraw Offscreen |
| 186 | ============================================ |
| 187 | |
| 188 | .. module:: Carbon.Qdoffs |
| 189 | :platform: Mac |
| 190 | :synopsis: Interface to the QuickDraw Offscreen APIs. |
| 191 | |
| 192 | |
| 193 | |
| 194 | :mod:`Carbon.Qt` --- QuickTime |
| 195 | ============================== |
| 196 | |
| 197 | .. module:: Carbon.Qt |
| 198 | :platform: Mac |
| 199 | :synopsis: Interface to the QuickTime toolbox. |
| 200 | |
| 201 | |
| 202 | |
| 203 | :mod:`Carbon.Res` --- Resource Manager and Handles |
| 204 | ================================================== |
| 205 | |
| 206 | .. module:: Carbon.Res |
| 207 | :platform: Mac |
| 208 | :synopsis: Interface to the Resource Manager and Handles. |
| 209 | |
| 210 | |
| 211 | |
| 212 | :mod:`Carbon.Scrap` --- Scrap Manager |
| 213 | ===================================== |
| 214 | |
| 215 | .. module:: Carbon.Scrap |
| 216 | :platform: Mac |
| 217 | :synopsis: The Scrap Manager provides basic services for implementing cut & paste and |
| 218 | clipboard operations. |
| 219 | |
| 220 | |
| 221 | This module is only fully available on MacOS9 and earlier under classic PPC |
| 222 | MacPython. Very limited functionality is available under Carbon MacPython. |
| 223 | |
| 224 | .. index:: single: Scrap Manager |
| 225 | |
| 226 | The Scrap Manager supports the simplest form of cut & paste operations on the |
| 227 | Macintosh. It can be use for both inter- and intra-application clipboard |
| 228 | operations. |
| 229 | |
| 230 | The :mod:`Scrap` module provides low-level access to the functions of the Scrap |
| 231 | Manager. It contains the following functions: |
| 232 | |
| 233 | |
| 234 | .. function:: InfoScrap() |
| 235 | |
| 236 | Return current information about the scrap. The information is encoded as a |
| 237 | tuple containing the fields ``(size, handle, count, state, path)``. |
| 238 | |
| 239 | +----------+---------------------------------------------+ |
| 240 | | Field | Meaning | |
| 241 | +==========+=============================================+ |
| 242 | | *size* | Size of the scrap in bytes. | |
| 243 | +----------+---------------------------------------------+ |
| 244 | | *handle* | Resource object representing the scrap. | |
| 245 | +----------+---------------------------------------------+ |
| 246 | | *count* | Serial number of the scrap contents. | |
| 247 | +----------+---------------------------------------------+ |
| 248 | | *state* | Integer; positive if in memory, ``0`` if on | |
| 249 | | | disk, negative if uninitialized. | |
| 250 | +----------+---------------------------------------------+ |
| 251 | | *path* | Filename of the scrap when stored on disk. | |
| 252 | +----------+---------------------------------------------+ |
| 253 | |
| 254 | |
| 255 | .. seealso:: |
| 256 | |
| 257 | `Scrap Manager <http://developer.apple.com/documentation/mac/MoreToolbox/MoreToolbox-109.html>`_ |
| 258 | Apple's documentation for the Scrap Manager gives a lot of useful information |
| 259 | about using the Scrap Manager in applications. |
| 260 | |
| 261 | |
| 262 | |
| 263 | :mod:`Carbon.Snd` --- Sound Manager |
| 264 | =================================== |
| 265 | |
| 266 | .. module:: Carbon.Snd |
| 267 | :platform: Mac |
| 268 | :synopsis: Interface to the Sound Manager. |
| 269 | |
| 270 | |
| 271 | |
| 272 | :mod:`Carbon.TE` --- TextEdit |
| 273 | ============================= |
| 274 | |
| 275 | .. module:: Carbon.TE |
| 276 | :platform: Mac |
| 277 | :synopsis: Interface to TextEdit. |
| 278 | |
| 279 | |
| 280 | |
| 281 | :mod:`Carbon.Win` --- Window Manager |
| 282 | ==================================== |
| 283 | |
| 284 | .. module:: Carbon.Win |
| 285 | :platform: Mac |
| 286 | :synopsis: Interface to the Window Manager. |
| 287 | |
| 288 | |