blob: 40b76eff5154b589df8de447eb231bcd352d3a22 [file] [log] [blame]
Georg Brandl8ec7f652007-08-15 14:28:01 +00001
2.. _toolbox:
3
Georg Brandl9af94982008-09-13 17:41:16 +00004**********************
5Mac OS Toolbox Modules
6**********************
Georg Brandl8ec7f652007-08-15 14:28:01 +00007
Ned Deilyec8f8f72013-01-09 22:04:35 -08008These are a set of modules that provide interfaces to various legacy Mac OS toolboxes.
Georg Brandl8ec7f652007-08-15 14:28:01 +00009If applicable the module will define a number of Python objects for the various
10structures declared by the toolbox, and operations will be implemented as
11methods of the object. Other operations will be implemented as functions in the
12module. Not all operations possible in C will also be possible in Python
13(callbacks are often a problem), and parameters will occasionally be different
14in Python (input and output buffers, especially). All methods and functions
15have a :attr:`__doc__` string describing their arguments and return values, and
16for additional description you are referred to `Inside Macintosh
Sandro Tosi117e1f02011-12-31 18:13:59 +010017<http://developer.apple.com/legacy/mac/library/#documentation/macos8/mac8.html>`_ or similar works.
Georg Brandl8ec7f652007-08-15 14:28:01 +000018
19These modules all live in a package called :mod:`Carbon`. Despite that name they
20are not all part of the Carbon framework: CF is really in the CoreFoundation
21framework and Qt is in the QuickTime framework. The normal use pattern is ::
22
23 from Carbon import AE
24
Georg Brandlb44c9f32009-04-27 15:29:26 +000025.. note::
Benjamin Peterson23681932008-05-12 21:42:13 +000026
Ned Deilyec8f8f72013-01-09 22:04:35 -080027 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.
Georg Brandl8ec7f652007-08-15 14:28:01 +000031
32
33:mod:`Carbon.AE` --- Apple Events
34=================================
35
36.. module:: Carbon.AE
37 :platform: Mac
38 :synopsis: Interface to the Apple Events toolbox.
Benjamin Peterson23681932008-05-12 21:42:13 +000039 :deprecated:
Georg Brandl8ec7f652007-08-15 14:28:01 +000040
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.
Benjamin Peterson23681932008-05-12 21:42:13 +000049 :deprecated:
Georg Brandl8ec7f652007-08-15 14:28:01 +000050
51
52
53:mod:`Carbon.App` --- Appearance Manager
54========================================
55
56.. module:: Carbon.App
57 :platform: Mac
58 :synopsis: Interface to the Appearance Manager.
Benjamin Peterson23681932008-05-12 21:42:13 +000059 :deprecated:
Georg Brandl8ec7f652007-08-15 14:28:01 +000060
Ronald Oussoren8ba6f3b2009-03-30 16:01:51 +000061: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
Georg Brandl8ec7f652007-08-15 14:28:01 +000069
70
71:mod:`Carbon.CF` --- Core Foundation
72====================================
73
74.. module:: Carbon.CF
75 :platform: Mac
76 :synopsis: Interface to the Core Foundation.
Benjamin Peterson23681932008-05-12 21:42:13 +000077 :deprecated:
Georg Brandl8ec7f652007-08-15 14:28:01 +000078
79
80The ``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
Georg Brandl0c65fe62008-05-01 18:24:32 +000089 :synopsis: Interface to Core Graphics.
Benjamin Peterson23681932008-05-12 21:42:13 +000090 :deprecated:
Georg Brandl8ec7f652007-08-15 14:28:01 +000091
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.
Benjamin Peterson23681932008-05-12 21:42:13 +0000100 :deprecated:
Georg Brandl8ec7f652007-08-15 14:28:01 +0000101
Ronald Oussoren8ba6f3b2009-03-30 16:01:51 +0000102: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
Georg Brandl8ec7f652007-08-15 14:28:01 +0000110
111
112:mod:`Carbon.Cm` --- Component Manager
113======================================
114
115.. module:: Carbon.Cm
116 :platform: Mac
117 :synopsis: Interface to the Component Manager.
Benjamin Peterson23681932008-05-12 21:42:13 +0000118 :deprecated:
Georg Brandl8ec7f652007-08-15 14:28:01 +0000119
Ronald Oussoren8ba6f3b2009-03-30 16:01:51 +0000120:mod:`Carbon.Components` --- Component Manager constants
121========================================================
Georg Brandl8ec7f652007-08-15 14:28:01 +0000122
Ronald Oussoren8ba6f3b2009-03-30 16:01:51 +0000123.. 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:
Georg Brandl8ec7f652007-08-15 14:28:01 +0000160
161:mod:`Carbon.Ctl` --- Control Manager
162=====================================
163
164.. module:: Carbon.Ctl
165 :platform: Mac
166 :synopsis: Interface to the Control Manager.
Benjamin Peterson23681932008-05-12 21:42:13 +0000167 :deprecated:
Georg Brandl8ec7f652007-08-15 14:28:01 +0000168
Ronald Oussoren8ba6f3b2009-03-30 16:01:51 +0000169:mod:`Carbon.Dialogs` --- Dialog Manager constants
170==================================================
Georg Brandl8ec7f652007-08-15 14:28:01 +0000171
Ronald Oussoren8ba6f3b2009-03-30 16:01:51 +0000172.. module:: Carbon.Dialogs
173 :platform: Mac
174 :synopsis: Constants for the interface to the Dialog Manager.
175 :deprecated:
Georg Brandl8ec7f652007-08-15 14:28:01 +0000176
177:mod:`Carbon.Dlg` --- Dialog Manager
178====================================
179
180.. module:: Carbon.Dlg
181 :platform: Mac
182 :synopsis: Interface to the Dialog Manager.
Benjamin Peterson23681932008-05-12 21:42:13 +0000183 :deprecated:
Georg Brandl8ec7f652007-08-15 14:28:01 +0000184
Ronald Oussoren8ba6f3b2009-03-30 16:01:51 +0000185:mod:`Carbon.Drag` --- Drag and Drop Manager
186=============================================
Georg Brandl8ec7f652007-08-15 14:28:01 +0000187
Ronald Oussoren8ba6f3b2009-03-30 16:01:51 +0000188.. 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:
Georg Brandl8ec7f652007-08-15 14:28:01 +0000208
209:mod:`Carbon.Evt` --- Event Manager
210===================================
211
212.. module:: Carbon.Evt
213 :platform: Mac
214 :synopsis: Interface to the classic Event Manager.
Benjamin Peterson23681932008-05-12 21:42:13 +0000215 :deprecated:
Georg Brandl8ec7f652007-08-15 14:28:01 +0000216
Ronald Oussoren8ba6f3b2009-03-30 16:01:51 +0000217: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:
Georg Brandl8ec7f652007-08-15 14:28:01 +0000232
233
234:mod:`Carbon.Fm` --- Font Manager
235=================================
236
237.. module:: Carbon.Fm
238 :platform: Mac
239 :synopsis: Interface to the Font Manager.
Benjamin Peterson23681932008-05-12 21:42:13 +0000240 :deprecated:
Georg Brandl8ec7f652007-08-15 14:28:01 +0000241
242
243
244:mod:`Carbon.Folder` --- Folder Manager
245=======================================
246
247.. module:: Carbon.Folder
248 :platform: Mac
249 :synopsis: Interface to the Folder Manager.
Benjamin Peterson23681932008-05-12 21:42:13 +0000250 :deprecated:
Georg Brandl8ec7f652007-08-15 14:28:01 +0000251
Ronald Oussoren8ba6f3b2009-03-30 16:01:51 +0000252: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
Georg Brandl8ec7f652007-08-15 14:28:01 +0000269
270
271:mod:`Carbon.Help` --- Help Manager
272===================================
273
274.. module:: Carbon.Help
275 :platform: Mac
276 :synopsis: Interface to the Carbon Help Manager.
Benjamin Peterson23681932008-05-12 21:42:13 +0000277 :deprecated:
Georg Brandl8ec7f652007-08-15 14:28:01 +0000278
Ronald Oussoren8ba6f3b2009-03-30 16:01:51 +0000279: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:
Georg Brandl8ec7f652007-08-15 14:28:01 +0000326
327
328:mod:`Carbon.List` --- List Manager
329===================================
330
331.. module:: Carbon.List
332 :platform: Mac
333 :synopsis: Interface to the List Manager.
Benjamin Peterson23681932008-05-12 21:42:13 +0000334 :deprecated:
Georg Brandl8ec7f652007-08-15 14:28:01 +0000335
336
337
Ronald Oussoren8ba6f3b2009-03-30 16:01:51 +0000338: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
Georg Brandl8ec7f652007-08-15 14:28:01 +0000363:mod:`Carbon.Menu` --- Menu Manager
364===================================
365
366.. module:: Carbon.Menu
367 :platform: Mac
368 :synopsis: Interface to the Menu Manager.
Benjamin Peterson23681932008-05-12 21:42:13 +0000369 :deprecated:
Georg Brandl8ec7f652007-08-15 14:28:01 +0000370
Ronald Oussoren8ba6f3b2009-03-30 16:01:51 +0000371: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:
Georg Brandl8ec7f652007-08-15 14:28:01 +0000378
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.
Benjamin Peterson23681932008-05-12 21:42:13 +0000386 :deprecated:
Georg Brandl8ec7f652007-08-15 14:28:01 +0000387
Ronald Oussoren8ba6f3b2009-03-30 16:01:51 +0000388: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:
Georg Brandl8ec7f652007-08-15 14:28:01 +0000411
412
413:mod:`Carbon.Qd` --- QuickDraw
414==============================
415
416.. module:: Carbon.Qd
417 :platform: Mac
418 :synopsis: Interface to the QuickDraw toolbox.
Benjamin Peterson23681932008-05-12 21:42:13 +0000419 :deprecated:
Georg Brandl8ec7f652007-08-15 14:28:01 +0000420
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.
Benjamin Peterson23681932008-05-12 21:42:13 +0000429 :deprecated:
Georg Brandl8ec7f652007-08-15 14:28:01 +0000430
431
432
433:mod:`Carbon.Qt` --- QuickTime
434==============================
435
436.. module:: Carbon.Qt
437 :platform: Mac
438 :synopsis: Interface to the QuickTime toolbox.
Benjamin Peterson23681932008-05-12 21:42:13 +0000439 :deprecated:
Georg Brandl8ec7f652007-08-15 14:28:01 +0000440
Ronald Oussoren8ba6f3b2009-03-30 16:01:51 +0000441: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:
Georg Brandl8ec7f652007-08-15 14:28:01 +0000456
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.
Benjamin Peterson23681932008-05-12 21:42:13 +0000464 :deprecated:
Georg Brandl8ec7f652007-08-15 14:28:01 +0000465
Ronald Oussoren8ba6f3b2009-03-30 16:01:51 +0000466: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:
Georg Brandl8ec7f652007-08-15 14:28:01 +0000473
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.
Benjamin Peterson23681932008-05-12 21:42:13 +0000482 :deprecated:
Georg Brandl8ec7f652007-08-15 14:28:01 +0000483
484
Georg Brandl9af94982008-09-13 17:41:16 +0000485This module is only fully available on Mac OS 9 and earlier under classic PPC
Georg Brandl8ec7f652007-08-15 14:28:01 +0000486MacPython. Very limited functionality is available under Carbon MacPython.
487
488.. index:: single: Scrap Manager
489
490The Scrap Manager supports the simplest form of cut & paste operations on the
491Macintosh. It can be use for both inter- and intra-application clipboard
492operations.
493
494The :mod:`Scrap` module provides low-level access to the functions of the Scrap
495Manager. 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
Sandro Tosi117e1f02011-12-31 18:13:59 +0100521 `Scrap Manager <http://developer.apple.com/legacy/mac/library/documentation/mac/MoreToolbox/MoreToolbox-109.html>`_
Georg Brandl8ec7f652007-08-15 14:28:01 +0000522 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.
Benjamin Peterson23681932008-05-12 21:42:13 +0000533 :deprecated:
Georg Brandl8ec7f652007-08-15 14:28:01 +0000534
Ronald Oussoren8ba6f3b2009-03-30 16:01:51 +0000535: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:
Georg Brandl8ec7f652007-08-15 14:28:01 +0000542
543
544:mod:`Carbon.TE` --- TextEdit
545=============================
546
547.. module:: Carbon.TE
548 :platform: Mac
549 :synopsis: Interface to TextEdit.
Benjamin Peterson23681932008-05-12 21:42:13 +0000550 :deprecated:
Georg Brandl8ec7f652007-08-15 14:28:01 +0000551
Ronald Oussoren8ba6f3b2009-03-30 16:01:51 +0000552: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
Georg Brandl8ec7f652007-08-15 14:28:01 +0000560
561
562:mod:`Carbon.Win` --- Window Manager
563====================================
564
565.. module:: Carbon.Win
566 :platform: Mac
567 :synopsis: Interface to the Window Manager.
Benjamin Peterson23681932008-05-12 21:42:13 +0000568 :deprecated:
Ronald Oussoren8ba6f3b2009-03-30 16:01:51 +0000569
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: