| 1 |
|
| 2 |
.. _toolbox: |
| 3 |
|
| 4 |
********************** |
| 5 |
Mac OS Toolbox Modules |
| 6 |
********************** |
| 7 |
|
| 8 |
These are a set of modules that provide interfaces to various legacy Mac OS 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/legacy/mac/library/#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 |
.. note:: |
| 26 |
|
| 27 |
Most of the OS X APIs that these modules use are deprecated or removed |
| 28 |
in recent versions of OS X. Many are not available when Python is |
| 29 |
executing in 64-bit mode. The Carbon modules have been removed in |
| 30 |
Python 3. You should avoid using them in Python 2. |
| 31 |
|
| 32 |
|
| 33 |
:mod:`Carbon.AE` --- Apple Events |
| 34 |
================================= |
| 35 |
|
| 36 |
.. module:: Carbon.AE |
| 37 |
:platform: Mac |
| 38 |
:synopsis: Interface to the Apple Events toolbox. |
| 39 |
:deprecated: |
| 40 |
|
| 41 |
|
| 42 |
|
| 43 |
:mod:`Carbon.AH` --- Apple Help |
| 44 |
=============================== |
| 45 |
|
| 46 |
.. module:: Carbon.AH |
| 47 |
:platform: Mac |
| 48 |
:synopsis: Interface to the Apple Help manager. |
| 49 |
:deprecated: |
| 50 |
|
| 51 |
|
| 52 |
|
| 53 |
:mod:`Carbon.App` --- Appearance Manager |
| 54 |
======================================== |
| 55 |
|
| 56 |
.. module:: Carbon.App |
| 57 |
:platform: Mac |
| 58 |
:synopsis: Interface to the Appearance Manager. |
| 59 |
:deprecated: |
| 60 |
|
| 61 |
:mod:`Carbon.Appearance` --- Appearance Manager constants |
| 62 |
========================================================= |
| 63 |
|
| 64 |
.. module:: Carbon.Appearance |
| 65 |
:platform: Mac |
| 66 |
:synopsis: Constant definitions for the interface to the Appearance Manager. |
| 67 |
:deprecated: |
| 68 |
|
| 69 |
|
| 70 |
|
| 71 |
:mod:`Carbon.CF` --- Core Foundation |
| 72 |
==================================== |
| 73 |
|
| 74 |
.. module:: Carbon.CF |
| 75 |
:platform: Mac |
| 76 |
:synopsis: Interface to the Core Foundation. |
| 77 |
:deprecated: |
| 78 |
|
| 79 |
|
| 80 |
The ``CFBase``, ``CFArray``, ``CFData``, ``CFDictionary``, ``CFString`` and |
| 81 |
``CFURL`` objects are supported, some only partially. |
| 82 |
|
| 83 |
|
| 84 |
:mod:`Carbon.CG` --- Core Graphics |
| 85 |
================================== |
| 86 |
|
| 87 |
.. module:: Carbon.CG |
| 88 |
:platform: Mac |
| 89 |
:synopsis: Interface to Core Graphics. |
| 90 |
:deprecated: |
| 91 |
|
| 92 |
|
| 93 |
|
| 94 |
:mod:`Carbon.CarbonEvt` --- Carbon Event Manager |
| 95 |
================================================ |
| 96 |
|
| 97 |
.. module:: Carbon.CarbonEvt |
| 98 |
:platform: Mac |
| 99 |
:synopsis: Interface to the Carbon Event Manager. |
| 100 |
:deprecated: |
| 101 |
|
| 102 |
:mod:`Carbon.CarbonEvents` --- Carbon Event Manager constants |
| 103 |
============================================================= |
| 104 |
|
| 105 |
.. module:: Carbon.CarbonEvents |
| 106 |
:platform: Mac |
| 107 |
:synopsis: Constants for the interface to the Carbon Event Manager. |
| 108 |
:deprecated: |
| 109 |
|
| 110 |
|
| 111 |
|
| 112 |
:mod:`Carbon.Cm` --- Component Manager |
| 113 |
====================================== |
| 114 |
|
| 115 |
.. module:: Carbon.Cm |
| 116 |
:platform: Mac |
| 117 |
:synopsis: Interface to the Component Manager. |
| 118 |
:deprecated: |
| 119 |
|
| 120 |
:mod:`Carbon.Components` --- Component Manager constants |
| 121 |
======================================================== |
| 122 |
|
| 123 |
.. module:: Carbon.Components |
| 124 |
:platform: Mac |
| 125 |
:synopsis: Constants for the interface to the Component Manager. |
| 126 |
:deprecated: |
| 127 |
|
| 128 |
|
| 129 |
:mod:`Carbon.ControlAccessor` --- Control Manager accssors |
| 130 |
=========================================================== |
| 131 |
|
| 132 |
.. module:: Carbon.ControlAccessor |
| 133 |
:platform: Mac |
| 134 |
:synopsis: Accessor functions for the interface to the Control Manager. |
| 135 |
:deprecated: |
| 136 |
|
| 137 |
:mod:`Carbon.Controls` --- Control Manager constants |
| 138 |
==================================================== |
| 139 |
|
| 140 |
.. module:: Carbon.Controls |
| 141 |
:platform: Mac |
| 142 |
:synopsis: Constants for the interface to the Control Manager. |
| 143 |
:deprecated: |
| 144 |
|
| 145 |
:mod:`Carbon.CoreFounation` --- CoreFounation constants |
| 146 |
======================================================= |
| 147 |
|
| 148 |
.. module:: Carbon.CoreFounation |
| 149 |
:platform: Mac |
| 150 |
:synopsis: Constants for the interface to CoreFoundation. |
| 151 |
:deprecated: |
| 152 |
|
| 153 |
:mod:`Carbon.CoreGraphics` --- CoreGraphics constants |
| 154 |
======================================================= |
| 155 |
|
| 156 |
.. module:: Carbon.CoreGraphics |
| 157 |
:platform: Mac |
| 158 |
:synopsis: Constants for the interface to CoreGraphics. |
| 159 |
:deprecated: |
| 160 |
|
| 161 |
:mod:`Carbon.Ctl` --- Control Manager |
| 162 |
===================================== |
| 163 |
|
| 164 |
.. module:: Carbon.Ctl |
| 165 |
:platform: Mac |
| 166 |
:synopsis: Interface to the Control Manager. |
| 167 |
:deprecated: |
| 168 |
|
| 169 |
:mod:`Carbon.Dialogs` --- Dialog Manager constants |
| 170 |
================================================== |
| 171 |
|
| 172 |
.. module:: Carbon.Dialogs |
| 173 |
:platform: Mac |
| 174 |
:synopsis: Constants for the interface to the Dialog Manager. |
| 175 |
:deprecated: |
| 176 |
|
| 177 |
:mod:`Carbon.Dlg` --- Dialog Manager |
| 178 |
==================================== |
| 179 |
|
| 180 |
.. module:: Carbon.Dlg |
| 181 |
:platform: Mac |
| 182 |
:synopsis: Interface to the Dialog Manager. |
| 183 |
:deprecated: |
| 184 |
|
| 185 |
:mod:`Carbon.Drag` --- Drag and Drop Manager |
| 186 |
============================================= |
| 187 |
|
| 188 |
.. module:: Carbon.Drag |
| 189 |
:platform: Mac |
| 190 |
:synopsis: Interface to the Drag and Drop Manager. |
| 191 |
:deprecated: |
| 192 |
|
| 193 |
:mod:`Carbon.Dragconst` --- Drag and Drop Manager constants |
| 194 |
=========================================================== |
| 195 |
|
| 196 |
.. module:: Carbon.Dragconst |
| 197 |
:platform: Mac |
| 198 |
:synopsis: Constants for the interface to the Drag and Drop Manager. |
| 199 |
:deprecated: |
| 200 |
|
| 201 |
:mod:`Carbon.Events` --- Event Manager constants |
| 202 |
================================================ |
| 203 |
|
| 204 |
.. module:: Carbon.Events |
| 205 |
:platform: Mac |
| 206 |
:synopsis: Constants for the interface to the classic Event Manager. |
| 207 |
:deprecated: |
| 208 |
|
| 209 |
:mod:`Carbon.Evt` --- Event Manager |
| 210 |
=================================== |
| 211 |
|
| 212 |
.. module:: Carbon.Evt |
| 213 |
:platform: Mac |
| 214 |
:synopsis: Interface to the classic Event Manager. |
| 215 |
:deprecated: |
| 216 |
|
| 217 |
:mod:`Carbon.File` --- File Manager |
| 218 |
=================================== |
| 219 |
|
| 220 |
.. module:: Carbon.File |
| 221 |
:platform: Mac |
| 222 |
:synopsis: Interface to the File Manager. |
| 223 |
:deprecated: |
| 224 |
|
| 225 |
:mod:`Carbon.Files` --- File Manager constants |
| 226 |
============================================== |
| 227 |
|
| 228 |
.. module:: Carbon.Files |
| 229 |
:platform: Mac |
| 230 |
:synopsis: Constants for the interface to the File Manager. |
| 231 |
:deprecated: |
| 232 |
|
| 233 |
|
| 234 |
:mod:`Carbon.Fm` --- Font Manager |
| 235 |
================================= |
| 236 |
|
| 237 |
.. module:: Carbon.Fm |
| 238 |
:platform: Mac |
| 239 |
:synopsis: Interface to the Font Manager. |
| 240 |
:deprecated: |
| 241 |
|
| 242 |
|
| 243 |
|
| 244 |
:mod:`Carbon.Folder` --- Folder Manager |
| 245 |
======================================= |
| 246 |
|
| 247 |
.. module:: Carbon.Folder |
| 248 |
:platform: Mac |
| 249 |
:synopsis: Interface to the Folder Manager. |
| 250 |
:deprecated: |
| 251 |
|
| 252 |
:mod:`Carbon.Folders` --- Folder Manager constants |
| 253 |
================================================== |
| 254 |
|
| 255 |
.. module:: Carbon.Folders |
| 256 |
:platform: Mac |
| 257 |
:synopsis: Constants for the interface to the Folder Manager. |
| 258 |
:deprecated: |
| 259 |
|
| 260 |
|
| 261 |
:mod:`Carbon.Fonts` --- Font Manager constants |
| 262 |
================================================== |
| 263 |
|
| 264 |
.. module:: Carbon.Fonts |
| 265 |
:platform: Mac |
| 266 |
:synopsis: Constants for the interface to the Font Manager. |
| 267 |
:deprecated: |
| 268 |
|
| 269 |
|
| 270 |
|
| 271 |
:mod:`Carbon.Help` --- Help Manager |
| 272 |
=================================== |
| 273 |
|
| 274 |
.. module:: Carbon.Help |
| 275 |
:platform: Mac |
| 276 |
:synopsis: Interface to the Carbon Help Manager. |
| 277 |
:deprecated: |
| 278 |
|
| 279 |
:mod:`Carbon.IBCarbon` --- Carbon InterfaceBuilder |
| 280 |
================================================== |
| 281 |
|
| 282 |
.. module:: Carbon.IBCarbon |
| 283 |
:platform: Mac |
| 284 |
:synopsis: Interface to the Carbon InterfaceBuilder support libraries. |
| 285 |
:deprecated: |
| 286 |
|
| 287 |
:mod:`Carbon.IBCarbonRuntime` --- Carbon InterfaceBuilder constants |
| 288 |
=================================================================== |
| 289 |
|
| 290 |
.. module:: Carbon.IBCarbonRuntime |
| 291 |
:platform: Mac |
| 292 |
:synopsis: Constants for the interface to the Carbon InterfaceBuilder support libraries. |
| 293 |
:deprecated: |
| 294 |
|
| 295 |
:mod:`Carbon.Icn` --- Carbon Icon Manager |
| 296 |
========================================= |
| 297 |
|
| 298 |
.. module:: Carbon.Icns |
| 299 |
:platform: Mac |
| 300 |
:synopsis: Interface to the Carbon Icon Manager |
| 301 |
:deprecated: |
| 302 |
|
| 303 |
:mod:`Carbon.Icons` --- Carbon Icon Manager constants |
| 304 |
===================================================== |
| 305 |
|
| 306 |
.. module:: Carbon.Icons |
| 307 |
:platform: Mac |
| 308 |
:synopsis: Constants for the interface to the Carbon Icon Manager |
| 309 |
:deprecated: |
| 310 |
|
| 311 |
:mod:`Carbon.Launch` --- Carbon Launch Services |
| 312 |
=============================================== |
| 313 |
|
| 314 |
.. module:: Carbon.Launch |
| 315 |
:platform: Mac |
| 316 |
:synopsis: Interface to the Carbon Launch Services. |
| 317 |
:deprecated: |
| 318 |
|
| 319 |
:mod:`Carbon.LaunchServices` --- Carbon Launch Services constants |
| 320 |
================================================================= |
| 321 |
|
| 322 |
.. module:: Carbon.LaunchServices |
| 323 |
:platform: Mac |
| 324 |
:synopsis: Constants for the interface to the Carbon Launch Services. |
| 325 |
:deprecated: |
| 326 |
|
| 327 |
|
| 328 |
:mod:`Carbon.List` --- List Manager |
| 329 |
=================================== |
| 330 |
|
| 331 |
.. module:: Carbon.List |
| 332 |
:platform: Mac |
| 333 |
:synopsis: Interface to the List Manager. |
| 334 |
:deprecated: |
| 335 |
|
| 336 |
|
| 337 |
|
| 338 |
:mod:`Carbon.Lists` --- List Manager constants |
| 339 |
============================================== |
| 340 |
|
| 341 |
.. module:: Carbon.Lists |
| 342 |
:platform: Mac |
| 343 |
:synopsis: Constants for the interface to the List Manager. |
| 344 |
:deprecated: |
| 345 |
|
| 346 |
:mod:`Carbon.MacHelp` --- Help Manager constants |
| 347 |
================================================ |
| 348 |
|
| 349 |
.. module:: Carbon.MacHelp |
| 350 |
:platform: Mac |
| 351 |
:synopsis: Constants for the interface to the Carbon Help Manager. |
| 352 |
:deprecated: |
| 353 |
|
| 354 |
:mod:`Carbon.MediaDescr` --- Parsers and generators for Quicktime Media descriptors |
| 355 |
=================================================================================== |
| 356 |
|
| 357 |
.. module:: Carbon.MediaDescr |
| 358 |
:platform: Mac |
| 359 |
:synopsis: Parsers and generators for Quicktime Media descriptors |
| 360 |
:deprecated: |
| 361 |
|
| 362 |
|
| 363 |
:mod:`Carbon.Menu` --- Menu Manager |
| 364 |
=================================== |
| 365 |
|
| 366 |
.. module:: Carbon.Menu |
| 367 |
:platform: Mac |
| 368 |
:synopsis: Interface to the Menu Manager. |
| 369 |
:deprecated: |
| 370 |
|
| 371 |
:mod:`Carbon.Menus` --- Menu Manager constants |
| 372 |
============================================== |
| 373 |
|
| 374 |
.. module:: Carbon.Menus |
| 375 |
:platform: Mac |
| 376 |
:synopsis: Constants for the interface to the Menu Manager. |
| 377 |
:deprecated: |
| 378 |
|
| 379 |
|
| 380 |
:mod:`Carbon.Mlte` --- MultiLingual Text Editor |
| 381 |
=============================================== |
| 382 |
|
| 383 |
.. module:: Carbon.Mlte |
| 384 |
:platform: Mac |
| 385 |
:synopsis: Interface to the MultiLingual Text Editor. |
| 386 |
:deprecated: |
| 387 |
|
| 388 |
:mod:`Carbon.OSA` --- Carbon OSA Interface |
| 389 |
========================================== |
| 390 |
|
| 391 |
.. module:: Carbon.OSA |
| 392 |
:platform: Mac |
| 393 |
:synopsis: Interface to the Carbon OSA Library. |
| 394 |
:deprecated: |
| 395 |
|
| 396 |
:mod:`Carbon.OSAconst` --- Carbon OSA Interface constants |
| 397 |
========================================================= |
| 398 |
|
| 399 |
.. module:: Carbon.OSAconst |
| 400 |
:platform: Mac |
| 401 |
:synopsis: Constants for the interface to the Carbon OSA Library. |
| 402 |
:deprecated: |
| 403 |
|
| 404 |
:mod:`Carbon.QDOffscreen` --- QuickDraw Offscreen constants |
| 405 |
=========================================================== |
| 406 |
|
| 407 |
.. module:: Carbon.QDOffscreen |
| 408 |
:platform: Mac |
| 409 |
:synopsis: Constants for the interface to the QuickDraw Offscreen APIs. |
| 410 |
:deprecated: |
| 411 |
|
| 412 |
|
| 413 |
:mod:`Carbon.Qd` --- QuickDraw |
| 414 |
============================== |
| 415 |
|
| 416 |
.. module:: Carbon.Qd |
| 417 |
:platform: Mac |
| 418 |
:synopsis: Interface to the QuickDraw toolbox. |
| 419 |
:deprecated: |
| 420 |
|
| 421 |
|
| 422 |
|
| 423 |
:mod:`Carbon.Qdoffs` --- QuickDraw Offscreen |
| 424 |
============================================ |
| 425 |
|
| 426 |
.. module:: Carbon.Qdoffs |
| 427 |
:platform: Mac |
| 428 |
:synopsis: Interface to the QuickDraw Offscreen APIs. |
| 429 |
:deprecated: |
| 430 |
|
| 431 |
|
| 432 |
|
| 433 |
:mod:`Carbon.Qt` --- QuickTime |
| 434 |
============================== |
| 435 |
|
| 436 |
.. module:: Carbon.Qt |
| 437 |
:platform: Mac |
| 438 |
:synopsis: Interface to the QuickTime toolbox. |
| 439 |
:deprecated: |
| 440 |
|
| 441 |
:mod:`Carbon.QuickDraw` --- QuickDraw constants |
| 442 |
=============================================== |
| 443 |
|
| 444 |
.. module:: Carbon.QuickDraw |
| 445 |
:platform: Mac |
| 446 |
:synopsis: Constants for the interface to the QuickDraw toolbox. |
| 447 |
:deprecated: |
| 448 |
|
| 449 |
:mod:`Carbon.QuickTime` --- QuickTime constants |
| 450 |
=============================================== |
| 451 |
|
| 452 |
.. module:: Carbon.QuickTime |
| 453 |
:platform: Mac |
| 454 |
:synopsis: Constants for the interface to the QuickTime toolbox. |
| 455 |
:deprecated: |
| 456 |
|
| 457 |
|
| 458 |
:mod:`Carbon.Res` --- Resource Manager and Handles |
| 459 |
================================================== |
| 460 |
|
| 461 |
.. module:: Carbon.Res |
| 462 |
:platform: Mac |
| 463 |
:synopsis: Interface to the Resource Manager and Handles. |
| 464 |
:deprecated: |
| 465 |
|
| 466 |
:mod:`Carbon.Resources` --- Resource Manager and Handles constants |
| 467 |
================================================================== |
| 468 |
|
| 469 |
.. module:: Carbon.Resources |
| 470 |
:platform: Mac |
| 471 |
:synopsis: Constants for the interface to the Resource Manager and Handles. |
| 472 |
:deprecated: |
| 473 |
|
| 474 |
|
| 475 |
:mod:`Carbon.Scrap` --- Scrap Manager |
| 476 |
===================================== |
| 477 |
|
| 478 |
.. module:: Carbon.Scrap |
| 479 |
:platform: Mac |
| 480 |
:synopsis: The Scrap Manager provides basic services for implementing cut & paste and |
| 481 |
clipboard operations. |
| 482 |
:deprecated: |
| 483 |
|
| 484 |
|
| 485 |
This module is only fully available on Mac OS 9 and earlier under classic PPC |
| 486 |
MacPython. Very limited functionality is available under Carbon MacPython. |
| 487 |
|
| 488 |
.. index:: single: Scrap Manager |
| 489 |
|
| 490 |
The Scrap Manager supports the simplest form of cut & paste operations on the |
| 491 |
Macintosh. It can be use for both inter- and intra-application clipboard |
| 492 |
operations. |
| 493 |
|
| 494 |
The :mod:`Scrap` module provides low-level access to the functions of the Scrap |
| 495 |
Manager. It contains the following functions: |
| 496 |
|
| 497 |
|
| 498 |
.. function:: InfoScrap() |
| 499 |
|
| 500 |
Return current information about the scrap. The information is encoded as a |
| 501 |
tuple containing the fields ``(size, handle, count, state, path)``. |
| 502 |
|
| 503 |
+----------+---------------------------------------------+ |
| 504 |
| Field | Meaning | |
| 505 |
+==========+=============================================+ |
| 506 |
| *size* | Size of the scrap in bytes. | |
| 507 |
+----------+---------------------------------------------+ |
| 508 |
| *handle* | Resource object representing the scrap. | |
| 509 |
+----------+---------------------------------------------+ |
| 510 |
| *count* | Serial number of the scrap contents. | |
| 511 |
+----------+---------------------------------------------+ |
| 512 |
| *state* | Integer; positive if in memory, ``0`` if on | |
| 513 |
| | disk, negative if uninitialized. | |
| 514 |
+----------+---------------------------------------------+ |
| 515 |
| *path* | Filename of the scrap when stored on disk. | |
| 516 |
+----------+---------------------------------------------+ |
| 517 |
|
| 518 |
|
| 519 |
.. seealso:: |
| 520 |
|
| 521 |
`Scrap Manager <http://developer.apple.com/legacy/mac/library/documentation/mac/MoreToolbox/MoreToolbox-109.html>`_ |
| 522 |
Apple's documentation for the Scrap Manager gives a lot of useful information |
| 523 |
about using the Scrap Manager in applications. |
| 524 |
|
| 525 |
|
| 526 |
|
| 527 |
:mod:`Carbon.Snd` --- Sound Manager |
| 528 |
=================================== |
| 529 |
|
| 530 |
.. module:: Carbon.Snd |
| 531 |
:platform: Mac |
| 532 |
:synopsis: Interface to the Sound Manager. |
| 533 |
:deprecated: |
| 534 |
|
| 535 |
:mod:`Carbon.Sound` --- Sound Manager constants |
| 536 |
=============================================== |
| 537 |
|
| 538 |
.. module:: Carbon.Sound |
| 539 |
:platform: Mac |
| 540 |
:synopsis: Constants for the interface to the Sound Manager. |
| 541 |
:deprecated: |
| 542 |
|
| 543 |
|
| 544 |
:mod:`Carbon.TE` --- TextEdit |
| 545 |
============================= |
| 546 |
|
| 547 |
.. module:: Carbon.TE |
| 548 |
:platform: Mac |
| 549 |
:synopsis: Interface to TextEdit. |
| 550 |
:deprecated: |
| 551 |
|
| 552 |
:mod:`Carbon.TextEdit` --- TextEdit constants |
| 553 |
============================================= |
| 554 |
|
| 555 |
.. module:: Carbon.TextEdit |
| 556 |
:platform: Mac |
| 557 |
:synopsis: Constants for the interface to TextEdit. |
| 558 |
:deprecated: |
| 559 |
|
| 560 |
|
| 561 |
|
| 562 |
:mod:`Carbon.Win` --- Window Manager |
| 563 |
==================================== |
| 564 |
|
| 565 |
.. module:: Carbon.Win |
| 566 |
:platform: Mac |
| 567 |
:synopsis: Interface to the Window Manager. |
| 568 |
:deprecated: |
| 569 |
|
| 570 |
:mod:`Carbon.Windows` --- Window Manager constants |
| 571 |
================================================== |
| 572 |
|
| 573 |
.. module:: Carbon.Windows |
| 574 |
:platform: Mac |
| 575 |
:synopsis: Constants for the interface to the Window Manager. |
| 576 |
:deprecated: |