Georg Brandl | 8ec7f65 | 2007-08-15 14:28:01 +0000 | [diff] [blame] | 1 | |
| 2 | .. _toolbox: |
| 3 | |
Georg Brandl | 9af9498 | 2008-09-13 17:41:16 +0000 | [diff] [blame] | 4 | ********************** |
| 5 | Mac OS Toolbox Modules |
| 6 | ********************** |
Georg Brandl | 8ec7f65 | 2007-08-15 14:28:01 +0000 | [diff] [blame] | 7 | |
Georg Brandl | 9af9498 | 2008-09-13 17:41:16 +0000 | [diff] [blame] | 8 | There are a set of modules that provide interfaces to various Mac OS toolboxes. |
Georg Brandl | 8ec7f65 | 2007-08-15 14:28:01 +0000 | [diff] [blame] | 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 | |
Benjamin Peterson | 2368193 | 2008-05-12 21:42:13 +0000 | [diff] [blame] | 25 | .. warning:: |
| 26 | |
| 27 | The Carbon modules are removed in 3.0. |
Georg Brandl | 8ec7f65 | 2007-08-15 14:28:01 +0000 | [diff] [blame] | 28 | |
| 29 | |
| 30 | :mod:`Carbon.AE` --- Apple Events |
| 31 | ================================= |
| 32 | |
| 33 | .. module:: Carbon.AE |
| 34 | :platform: Mac |
| 35 | :synopsis: Interface to the Apple Events toolbox. |
Benjamin Peterson | 2368193 | 2008-05-12 21:42:13 +0000 | [diff] [blame] | 36 | :deprecated: |
Georg Brandl | 8ec7f65 | 2007-08-15 14:28:01 +0000 | [diff] [blame] | 37 | |
| 38 | |
| 39 | |
| 40 | :mod:`Carbon.AH` --- Apple Help |
| 41 | =============================== |
| 42 | |
| 43 | .. module:: Carbon.AH |
| 44 | :platform: Mac |
| 45 | :synopsis: Interface to the Apple Help manager. |
Benjamin Peterson | 2368193 | 2008-05-12 21:42:13 +0000 | [diff] [blame] | 46 | :deprecated: |
Georg Brandl | 8ec7f65 | 2007-08-15 14:28:01 +0000 | [diff] [blame] | 47 | |
| 48 | |
| 49 | |
| 50 | :mod:`Carbon.App` --- Appearance Manager |
| 51 | ======================================== |
| 52 | |
| 53 | .. module:: Carbon.App |
| 54 | :platform: Mac |
| 55 | :synopsis: Interface to the Appearance Manager. |
Benjamin Peterson | 2368193 | 2008-05-12 21:42:13 +0000 | [diff] [blame] | 56 | :deprecated: |
Georg Brandl | 8ec7f65 | 2007-08-15 14:28:01 +0000 | [diff] [blame] | 57 | |
| 58 | |
| 59 | |
| 60 | :mod:`Carbon.CF` --- Core Foundation |
| 61 | ==================================== |
| 62 | |
| 63 | .. module:: Carbon.CF |
| 64 | :platform: Mac |
| 65 | :synopsis: Interface to the Core Foundation. |
Benjamin Peterson | 2368193 | 2008-05-12 21:42:13 +0000 | [diff] [blame] | 66 | :deprecated: |
Georg Brandl | 8ec7f65 | 2007-08-15 14:28:01 +0000 | [diff] [blame] | 67 | |
| 68 | |
| 69 | The ``CFBase``, ``CFArray``, ``CFData``, ``CFDictionary``, ``CFString`` and |
| 70 | ``CFURL`` objects are supported, some only partially. |
| 71 | |
| 72 | |
| 73 | :mod:`Carbon.CG` --- Core Graphics |
| 74 | ================================== |
| 75 | |
| 76 | .. module:: Carbon.CG |
| 77 | :platform: Mac |
Georg Brandl | 0c65fe6 | 2008-05-01 18:24:32 +0000 | [diff] [blame] | 78 | :synopsis: Interface to Core Graphics. |
Benjamin Peterson | 2368193 | 2008-05-12 21:42:13 +0000 | [diff] [blame] | 79 | :deprecated: |
Georg Brandl | 8ec7f65 | 2007-08-15 14:28:01 +0000 | [diff] [blame] | 80 | |
| 81 | |
| 82 | |
| 83 | :mod:`Carbon.CarbonEvt` --- Carbon Event Manager |
| 84 | ================================================ |
| 85 | |
| 86 | .. module:: Carbon.CarbonEvt |
| 87 | :platform: Mac |
| 88 | :synopsis: Interface to the Carbon Event Manager. |
Benjamin Peterson | 2368193 | 2008-05-12 21:42:13 +0000 | [diff] [blame] | 89 | :deprecated: |
Georg Brandl | 8ec7f65 | 2007-08-15 14:28:01 +0000 | [diff] [blame] | 90 | |
| 91 | |
| 92 | |
| 93 | :mod:`Carbon.Cm` --- Component Manager |
| 94 | ====================================== |
| 95 | |
| 96 | .. module:: Carbon.Cm |
| 97 | :platform: Mac |
| 98 | :synopsis: Interface to the Component Manager. |
Benjamin Peterson | 2368193 | 2008-05-12 21:42:13 +0000 | [diff] [blame] | 99 | :deprecated: |
Georg Brandl | 8ec7f65 | 2007-08-15 14:28:01 +0000 | [diff] [blame] | 100 | |
| 101 | |
| 102 | |
| 103 | :mod:`Carbon.Ctl` --- Control Manager |
| 104 | ===================================== |
| 105 | |
| 106 | .. module:: Carbon.Ctl |
| 107 | :platform: Mac |
| 108 | :synopsis: Interface to the Control Manager. |
Benjamin Peterson | 2368193 | 2008-05-12 21:42:13 +0000 | [diff] [blame] | 109 | :deprecated: |
Georg Brandl | 8ec7f65 | 2007-08-15 14:28:01 +0000 | [diff] [blame] | 110 | |
| 111 | |
| 112 | |
| 113 | :mod:`Carbon.Dlg` --- Dialog Manager |
| 114 | ==================================== |
| 115 | |
| 116 | .. module:: Carbon.Dlg |
| 117 | :platform: Mac |
| 118 | :synopsis: Interface to the Dialog Manager. |
Benjamin Peterson | 2368193 | 2008-05-12 21:42:13 +0000 | [diff] [blame] | 119 | :deprecated: |
Georg Brandl | 8ec7f65 | 2007-08-15 14:28:01 +0000 | [diff] [blame] | 120 | |
| 121 | |
| 122 | |
| 123 | :mod:`Carbon.Evt` --- Event Manager |
| 124 | =================================== |
| 125 | |
| 126 | .. module:: Carbon.Evt |
| 127 | :platform: Mac |
| 128 | :synopsis: Interface to the classic Event Manager. |
Benjamin Peterson | 2368193 | 2008-05-12 21:42:13 +0000 | [diff] [blame] | 129 | :deprecated: |
Georg Brandl | 8ec7f65 | 2007-08-15 14:28:01 +0000 | [diff] [blame] | 130 | |
| 131 | |
| 132 | |
| 133 | :mod:`Carbon.Fm` --- Font Manager |
| 134 | ================================= |
| 135 | |
| 136 | .. module:: Carbon.Fm |
| 137 | :platform: Mac |
| 138 | :synopsis: Interface to the Font Manager. |
Benjamin Peterson | 2368193 | 2008-05-12 21:42:13 +0000 | [diff] [blame] | 139 | :deprecated: |
Georg Brandl | 8ec7f65 | 2007-08-15 14:28:01 +0000 | [diff] [blame] | 140 | |
| 141 | |
| 142 | |
| 143 | :mod:`Carbon.Folder` --- Folder Manager |
| 144 | ======================================= |
| 145 | |
| 146 | .. module:: Carbon.Folder |
| 147 | :platform: Mac |
| 148 | :synopsis: Interface to the Folder Manager. |
Benjamin Peterson | 2368193 | 2008-05-12 21:42:13 +0000 | [diff] [blame] | 149 | :deprecated: |
Georg Brandl | 8ec7f65 | 2007-08-15 14:28:01 +0000 | [diff] [blame] | 150 | |
| 151 | |
| 152 | |
| 153 | :mod:`Carbon.Help` --- Help Manager |
| 154 | =================================== |
| 155 | |
| 156 | .. module:: Carbon.Help |
| 157 | :platform: Mac |
| 158 | :synopsis: Interface to the Carbon Help Manager. |
Benjamin Peterson | 2368193 | 2008-05-12 21:42:13 +0000 | [diff] [blame] | 159 | :deprecated: |
Georg Brandl | 8ec7f65 | 2007-08-15 14:28:01 +0000 | [diff] [blame] | 160 | |
| 161 | |
| 162 | |
| 163 | :mod:`Carbon.List` --- List Manager |
| 164 | =================================== |
| 165 | |
| 166 | .. module:: Carbon.List |
| 167 | :platform: Mac |
| 168 | :synopsis: Interface to the List Manager. |
Benjamin Peterson | 2368193 | 2008-05-12 21:42:13 +0000 | [diff] [blame] | 169 | :deprecated: |
Georg Brandl | 8ec7f65 | 2007-08-15 14:28:01 +0000 | [diff] [blame] | 170 | |
| 171 | |
| 172 | |
| 173 | :mod:`Carbon.Menu` --- Menu Manager |
| 174 | =================================== |
| 175 | |
| 176 | .. module:: Carbon.Menu |
| 177 | :platform: Mac |
| 178 | :synopsis: Interface to the Menu Manager. |
Benjamin Peterson | 2368193 | 2008-05-12 21:42:13 +0000 | [diff] [blame] | 179 | :deprecated: |
Georg Brandl | 8ec7f65 | 2007-08-15 14:28:01 +0000 | [diff] [blame] | 180 | |
| 181 | |
| 182 | |
| 183 | :mod:`Carbon.Mlte` --- MultiLingual Text Editor |
| 184 | =============================================== |
| 185 | |
| 186 | .. module:: Carbon.Mlte |
| 187 | :platform: Mac |
| 188 | :synopsis: Interface to the MultiLingual Text Editor. |
Benjamin Peterson | 2368193 | 2008-05-12 21:42:13 +0000 | [diff] [blame] | 189 | :deprecated: |
Georg Brandl | 8ec7f65 | 2007-08-15 14:28:01 +0000 | [diff] [blame] | 190 | |
| 191 | |
| 192 | |
| 193 | :mod:`Carbon.Qd` --- QuickDraw |
| 194 | ============================== |
| 195 | |
| 196 | .. module:: Carbon.Qd |
| 197 | :platform: Mac |
| 198 | :synopsis: Interface to the QuickDraw toolbox. |
Benjamin Peterson | 2368193 | 2008-05-12 21:42:13 +0000 | [diff] [blame] | 199 | :deprecated: |
Georg Brandl | 8ec7f65 | 2007-08-15 14:28:01 +0000 | [diff] [blame] | 200 | |
| 201 | |
| 202 | |
| 203 | :mod:`Carbon.Qdoffs` --- QuickDraw Offscreen |
| 204 | ============================================ |
| 205 | |
| 206 | .. module:: Carbon.Qdoffs |
| 207 | :platform: Mac |
| 208 | :synopsis: Interface to the QuickDraw Offscreen APIs. |
Benjamin Peterson | 2368193 | 2008-05-12 21:42:13 +0000 | [diff] [blame] | 209 | :deprecated: |
Georg Brandl | 8ec7f65 | 2007-08-15 14:28:01 +0000 | [diff] [blame] | 210 | |
| 211 | |
| 212 | |
| 213 | :mod:`Carbon.Qt` --- QuickTime |
| 214 | ============================== |
| 215 | |
| 216 | .. module:: Carbon.Qt |
| 217 | :platform: Mac |
| 218 | :synopsis: Interface to the QuickTime toolbox. |
Benjamin Peterson | 2368193 | 2008-05-12 21:42:13 +0000 | [diff] [blame] | 219 | :deprecated: |
Georg Brandl | 8ec7f65 | 2007-08-15 14:28:01 +0000 | [diff] [blame] | 220 | |
| 221 | |
| 222 | |
| 223 | :mod:`Carbon.Res` --- Resource Manager and Handles |
| 224 | ================================================== |
| 225 | |
| 226 | .. module:: Carbon.Res |
| 227 | :platform: Mac |
| 228 | :synopsis: Interface to the Resource Manager and Handles. |
Benjamin Peterson | 2368193 | 2008-05-12 21:42:13 +0000 | [diff] [blame] | 229 | :deprecated: |
Georg Brandl | 8ec7f65 | 2007-08-15 14:28:01 +0000 | [diff] [blame] | 230 | |
| 231 | |
| 232 | |
| 233 | :mod:`Carbon.Scrap` --- Scrap Manager |
| 234 | ===================================== |
| 235 | |
| 236 | .. module:: Carbon.Scrap |
| 237 | :platform: Mac |
| 238 | :synopsis: The Scrap Manager provides basic services for implementing cut & paste and |
| 239 | clipboard operations. |
Benjamin Peterson | 2368193 | 2008-05-12 21:42:13 +0000 | [diff] [blame] | 240 | :deprecated: |
Georg Brandl | 8ec7f65 | 2007-08-15 14:28:01 +0000 | [diff] [blame] | 241 | |
| 242 | |
Georg Brandl | 9af9498 | 2008-09-13 17:41:16 +0000 | [diff] [blame] | 243 | This module is only fully available on Mac OS 9 and earlier under classic PPC |
Georg Brandl | 8ec7f65 | 2007-08-15 14:28:01 +0000 | [diff] [blame] | 244 | MacPython. Very limited functionality is available under Carbon MacPython. |
| 245 | |
| 246 | .. index:: single: Scrap Manager |
| 247 | |
| 248 | The Scrap Manager supports the simplest form of cut & paste operations on the |
| 249 | Macintosh. It can be use for both inter- and intra-application clipboard |
| 250 | operations. |
| 251 | |
| 252 | The :mod:`Scrap` module provides low-level access to the functions of the Scrap |
| 253 | Manager. It contains the following functions: |
| 254 | |
| 255 | |
| 256 | .. function:: InfoScrap() |
| 257 | |
| 258 | Return current information about the scrap. The information is encoded as a |
| 259 | tuple containing the fields ``(size, handle, count, state, path)``. |
| 260 | |
| 261 | +----------+---------------------------------------------+ |
| 262 | | Field | Meaning | |
| 263 | +==========+=============================================+ |
| 264 | | *size* | Size of the scrap in bytes. | |
| 265 | +----------+---------------------------------------------+ |
| 266 | | *handle* | Resource object representing the scrap. | |
| 267 | +----------+---------------------------------------------+ |
| 268 | | *count* | Serial number of the scrap contents. | |
| 269 | +----------+---------------------------------------------+ |
| 270 | | *state* | Integer; positive if in memory, ``0`` if on | |
| 271 | | | disk, negative if uninitialized. | |
| 272 | +----------+---------------------------------------------+ |
| 273 | | *path* | Filename of the scrap when stored on disk. | |
| 274 | +----------+---------------------------------------------+ |
| 275 | |
| 276 | |
| 277 | .. seealso:: |
| 278 | |
| 279 | `Scrap Manager <http://developer.apple.com/documentation/mac/MoreToolbox/MoreToolbox-109.html>`_ |
| 280 | Apple's documentation for the Scrap Manager gives a lot of useful information |
| 281 | about using the Scrap Manager in applications. |
| 282 | |
| 283 | |
| 284 | |
| 285 | :mod:`Carbon.Snd` --- Sound Manager |
| 286 | =================================== |
| 287 | |
| 288 | .. module:: Carbon.Snd |
| 289 | :platform: Mac |
| 290 | :synopsis: Interface to the Sound Manager. |
Benjamin Peterson | 2368193 | 2008-05-12 21:42:13 +0000 | [diff] [blame] | 291 | :deprecated: |
Georg Brandl | 8ec7f65 | 2007-08-15 14:28:01 +0000 | [diff] [blame] | 292 | |
| 293 | |
| 294 | |
| 295 | :mod:`Carbon.TE` --- TextEdit |
| 296 | ============================= |
| 297 | |
| 298 | .. module:: Carbon.TE |
| 299 | :platform: Mac |
| 300 | :synopsis: Interface to TextEdit. |
Benjamin Peterson | 2368193 | 2008-05-12 21:42:13 +0000 | [diff] [blame] | 301 | :deprecated: |
Georg Brandl | 8ec7f65 | 2007-08-15 14:28:01 +0000 | [diff] [blame] | 302 | |
| 303 | |
| 304 | |
| 305 | :mod:`Carbon.Win` --- Window Manager |
| 306 | ==================================== |
| 307 | |
| 308 | .. module:: Carbon.Win |
| 309 | :platform: Mac |
| 310 | :synopsis: Interface to the Window Manager. |
Benjamin Peterson | 2368193 | 2008-05-12 21:42:13 +0000 | [diff] [blame] | 311 | :deprecated: |