blob: c53c1b65ef7110e4ffa099a02aed529304e1acce [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
Georg Brandl9af94982008-09-13 17:41:16 +00008There are a set of modules that provide interfaces to various 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
17<http://developer.apple.com/documentation/macos8/mac8.html>`_ or similar works.
18
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 Brandl38853142009-04-28 18:23:28 +000025.. note::
Benjamin Peterson23681932008-05-12 21:42:13 +000026
Georg Brandl38853142009-04-28 18:23:28 +000027 The Carbon modules have been removed in Python 3.0.
Georg Brandl8ec7f652007-08-15 14:28:01 +000028
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 Peterson23681932008-05-12 21:42:13 +000036 :deprecated:
Georg Brandl8ec7f652007-08-15 14:28:01 +000037
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 Peterson23681932008-05-12 21:42:13 +000046 :deprecated:
Georg Brandl8ec7f652007-08-15 14:28:01 +000047
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 Peterson23681932008-05-12 21:42:13 +000056 :deprecated:
Georg Brandl8ec7f652007-08-15 14:28:01 +000057
Ronald Oussoren783fa442009-03-30 16:03:41 +000058:mod:`Carbon.Appearance` --- Appearance Manager constants
59=========================================================
60
61.. module:: Carbon.Appearance
62 :platform: Mac
63 :synopsis: Constant definitions for the interface to the Appearance Manager.
64 :deprecated:
65
Georg Brandl8ec7f652007-08-15 14:28:01 +000066
67
68:mod:`Carbon.CF` --- Core Foundation
69====================================
70
71.. module:: Carbon.CF
72 :platform: Mac
73 :synopsis: Interface to the Core Foundation.
Benjamin Peterson23681932008-05-12 21:42:13 +000074 :deprecated:
Georg Brandl8ec7f652007-08-15 14:28:01 +000075
76
77The ``CFBase``, ``CFArray``, ``CFData``, ``CFDictionary``, ``CFString`` and
78``CFURL`` objects are supported, some only partially.
79
80
81:mod:`Carbon.CG` --- Core Graphics
82==================================
83
84.. module:: Carbon.CG
85 :platform: Mac
Georg Brandl0c65fe62008-05-01 18:24:32 +000086 :synopsis: Interface to Core Graphics.
Benjamin Peterson23681932008-05-12 21:42:13 +000087 :deprecated:
Georg Brandl8ec7f652007-08-15 14:28:01 +000088
89
90
91:mod:`Carbon.CarbonEvt` --- Carbon Event Manager
92================================================
93
94.. module:: Carbon.CarbonEvt
95 :platform: Mac
96 :synopsis: Interface to the Carbon Event Manager.
Benjamin Peterson23681932008-05-12 21:42:13 +000097 :deprecated:
Georg Brandl8ec7f652007-08-15 14:28:01 +000098
Ronald Oussoren783fa442009-03-30 16:03:41 +000099:mod:`Carbon.CarbonEvents` --- Carbon Event Manager constants
100=============================================================
101
102.. module:: Carbon.CarbonEvents
103 :platform: Mac
104 :synopsis: Constants for the interface to the Carbon Event Manager.
105 :deprecated:
106
Georg Brandl8ec7f652007-08-15 14:28:01 +0000107
108
109:mod:`Carbon.Cm` --- Component Manager
110======================================
111
112.. module:: Carbon.Cm
113 :platform: Mac
114 :synopsis: Interface to the Component Manager.
Benjamin Peterson23681932008-05-12 21:42:13 +0000115 :deprecated:
Georg Brandl8ec7f652007-08-15 14:28:01 +0000116
Ronald Oussoren783fa442009-03-30 16:03:41 +0000117:mod:`Carbon.Components` --- Component Manager constants
118========================================================
Georg Brandl8ec7f652007-08-15 14:28:01 +0000119
Ronald Oussoren783fa442009-03-30 16:03:41 +0000120.. module:: Carbon.Components
121 :platform: Mac
122 :synopsis: Constants for the interface to the Component Manager.
123 :deprecated:
124
125
126:mod:`Carbon.ControlAccessor` --- Control Manager accssors
127===========================================================
128
129.. module:: Carbon.ControlAccessor
130 :platform: Mac
131 :synopsis: Accessor functions for the interface to the Control Manager.
132 :deprecated:
133
134:mod:`Carbon.Controls` --- Control Manager constants
135====================================================
136
137.. module:: Carbon.Controls
138 :platform: Mac
139 :synopsis: Constants for the interface to the Control Manager.
140 :deprecated:
141
142:mod:`Carbon.CoreFounation` --- CoreFounation constants
143=======================================================
144
145.. module:: Carbon.CoreFounation
146 :platform: Mac
147 :synopsis: Constants for the interface to CoreFoundation.
148 :deprecated:
149
150:mod:`Carbon.CoreGraphics` --- CoreGraphics constants
151=======================================================
152
153.. module:: Carbon.CoreGraphics
154 :platform: Mac
155 :synopsis: Constants for the interface to CoreGraphics.
156 :deprecated:
Georg Brandl8ec7f652007-08-15 14:28:01 +0000157
158:mod:`Carbon.Ctl` --- Control Manager
159=====================================
160
161.. module:: Carbon.Ctl
162 :platform: Mac
163 :synopsis: Interface to the Control Manager.
Benjamin Peterson23681932008-05-12 21:42:13 +0000164 :deprecated:
Georg Brandl8ec7f652007-08-15 14:28:01 +0000165
Ronald Oussoren783fa442009-03-30 16:03:41 +0000166:mod:`Carbon.Dialogs` --- Dialog Manager constants
167==================================================
Georg Brandl8ec7f652007-08-15 14:28:01 +0000168
Ronald Oussoren783fa442009-03-30 16:03:41 +0000169.. module:: Carbon.Dialogs
170 :platform: Mac
171 :synopsis: Constants for the interface to the Dialog Manager.
172 :deprecated:
Georg Brandl8ec7f652007-08-15 14:28:01 +0000173
174:mod:`Carbon.Dlg` --- Dialog Manager
175====================================
176
177.. module:: Carbon.Dlg
178 :platform: Mac
179 :synopsis: Interface to the Dialog Manager.
Benjamin Peterson23681932008-05-12 21:42:13 +0000180 :deprecated:
Georg Brandl8ec7f652007-08-15 14:28:01 +0000181
Ronald Oussoren783fa442009-03-30 16:03:41 +0000182:mod:`Carbon.Drag` --- Drag and Drop Manager
183=============================================
Georg Brandl8ec7f652007-08-15 14:28:01 +0000184
Ronald Oussoren783fa442009-03-30 16:03:41 +0000185.. module:: Carbon.Drag
186 :platform: Mac
187 :synopsis: Interface to the Drag and Drop Manager.
188 :deprecated:
189
190:mod:`Carbon.Dragconst` --- Drag and Drop Manager constants
191===========================================================
192
193.. module:: Carbon.Dragconst
194 :platform: Mac
195 :synopsis: Constants for the interface to the Drag and Drop Manager.
196 :deprecated:
197
198:mod:`Carbon.Events` --- Event Manager constants
199================================================
200
201.. module:: Carbon.Events
202 :platform: Mac
203 :synopsis: Constants for the interface to the classic Event Manager.
204 :deprecated:
Georg Brandl8ec7f652007-08-15 14:28:01 +0000205
206:mod:`Carbon.Evt` --- Event Manager
207===================================
208
209.. module:: Carbon.Evt
210 :platform: Mac
211 :synopsis: Interface to the classic Event Manager.
Benjamin Peterson23681932008-05-12 21:42:13 +0000212 :deprecated:
Georg Brandl8ec7f652007-08-15 14:28:01 +0000213
Ronald Oussoren783fa442009-03-30 16:03:41 +0000214:mod:`Carbon.File` --- File Manager
215===================================
216
217.. module:: Carbon.File
218 :platform: Mac
219 :synopsis: Interface to the File Manager.
220 :deprecated:
221
222:mod:`Carbon.Files` --- File Manager constants
223==============================================
224
225.. module:: Carbon.Files
226 :platform: Mac
227 :synopsis: Constants for the interface to the File Manager.
228 :deprecated:
Georg Brandl8ec7f652007-08-15 14:28:01 +0000229
230
231:mod:`Carbon.Fm` --- Font Manager
232=================================
233
234.. module:: Carbon.Fm
235 :platform: Mac
236 :synopsis: Interface to the Font Manager.
Benjamin Peterson23681932008-05-12 21:42:13 +0000237 :deprecated:
Georg Brandl8ec7f652007-08-15 14:28:01 +0000238
239
240
241:mod:`Carbon.Folder` --- Folder Manager
242=======================================
243
244.. module:: Carbon.Folder
245 :platform: Mac
246 :synopsis: Interface to the Folder Manager.
Benjamin Peterson23681932008-05-12 21:42:13 +0000247 :deprecated:
Georg Brandl8ec7f652007-08-15 14:28:01 +0000248
Ronald Oussoren783fa442009-03-30 16:03:41 +0000249:mod:`Carbon.Folders` --- Folder Manager constants
250==================================================
251
252.. module:: Carbon.Folders
253 :platform: Mac
254 :synopsis: Constants for the interface to the Folder Manager.
255 :deprecated:
256
257
258:mod:`Carbon.Fonts` --- Font Manager constants
259==================================================
260
261.. module:: Carbon.Fonts
262 :platform: Mac
263 :synopsis: Constants for the interface to the Font Manager.
264 :deprecated:
265
Georg Brandl8ec7f652007-08-15 14:28:01 +0000266
267
268:mod:`Carbon.Help` --- Help Manager
269===================================
270
271.. module:: Carbon.Help
272 :platform: Mac
273 :synopsis: Interface to the Carbon Help Manager.
Benjamin Peterson23681932008-05-12 21:42:13 +0000274 :deprecated:
Georg Brandl8ec7f652007-08-15 14:28:01 +0000275
Ronald Oussoren783fa442009-03-30 16:03:41 +0000276:mod:`Carbon.IBCarbon` --- Carbon InterfaceBuilder
277==================================================
278
279.. module:: Carbon.IBCarbon
280 :platform: Mac
281 :synopsis: Interface to the Carbon InterfaceBuilder support libraries.
282 :deprecated:
283
284:mod:`Carbon.IBCarbonRuntime` --- Carbon InterfaceBuilder constants
285===================================================================
286
287.. module:: Carbon.IBCarbonRuntime
288 :platform: Mac
289 :synopsis: Constants for the interface to the Carbon InterfaceBuilder support libraries.
290 :deprecated:
291
292:mod:`Carbon.Icn` --- Carbon Icon Manager
293=========================================
294
295.. module:: Carbon.Icns
296 :platform: Mac
297 :synopsis: Interface to the Carbon Icon Manager
298 :deprecated:
299
300:mod:`Carbon.Icons` --- Carbon Icon Manager constants
301=====================================================
302
303.. module:: Carbon.Icons
304 :platform: Mac
305 :synopsis: Constants for the interface to the Carbon Icon Manager
306 :deprecated:
307
308:mod:`Carbon.Launch` --- Carbon Launch Services
309===============================================
310
311.. module:: Carbon.Launch
312 :platform: Mac
313 :synopsis: Interface to the Carbon Launch Services.
314 :deprecated:
315
316:mod:`Carbon.LaunchServices` --- Carbon Launch Services constants
317=================================================================
318
319.. module:: Carbon.LaunchServices
320 :platform: Mac
321 :synopsis: Constants for the interface to the Carbon Launch Services.
322 :deprecated:
Georg Brandl8ec7f652007-08-15 14:28:01 +0000323
324
325:mod:`Carbon.List` --- List Manager
326===================================
327
328.. module:: Carbon.List
329 :platform: Mac
330 :synopsis: Interface to the List Manager.
Benjamin Peterson23681932008-05-12 21:42:13 +0000331 :deprecated:
Georg Brandl8ec7f652007-08-15 14:28:01 +0000332
333
334
Ronald Oussoren783fa442009-03-30 16:03:41 +0000335:mod:`Carbon.Lists` --- List Manager constants
336==============================================
337
338.. module:: Carbon.Lists
339 :platform: Mac
340 :synopsis: Constants for the interface to the List Manager.
341 :deprecated:
342
343:mod:`Carbon.MacHelp` --- Help Manager constants
344================================================
345
346.. module:: Carbon.MacHelp
347 :platform: Mac
348 :synopsis: Constants for the interface to the Carbon Help Manager.
349 :deprecated:
350
351:mod:`Carbon.MediaDescr` --- Parsers and generators for Quicktime Media descriptors
352===================================================================================
353
354.. module:: Carbon.MediaDescr
355 :platform: Mac
356 :synopsis: Parsers and generators for Quicktime Media descriptors
357 :deprecated:
358
359
Georg Brandl8ec7f652007-08-15 14:28:01 +0000360:mod:`Carbon.Menu` --- Menu Manager
361===================================
362
363.. module:: Carbon.Menu
364 :platform: Mac
365 :synopsis: Interface to the Menu Manager.
Benjamin Peterson23681932008-05-12 21:42:13 +0000366 :deprecated:
Georg Brandl8ec7f652007-08-15 14:28:01 +0000367
Ronald Oussoren783fa442009-03-30 16:03:41 +0000368:mod:`Carbon.Menus` --- Menu Manager constants
369==============================================
370
371.. module:: Carbon.Menus
372 :platform: Mac
373 :synopsis: Constants for the interface to the Menu Manager.
374 :deprecated:
Georg Brandl8ec7f652007-08-15 14:28:01 +0000375
376
377:mod:`Carbon.Mlte` --- MultiLingual Text Editor
378===============================================
379
380.. module:: Carbon.Mlte
381 :platform: Mac
382 :synopsis: Interface to the MultiLingual Text Editor.
Benjamin Peterson23681932008-05-12 21:42:13 +0000383 :deprecated:
Georg Brandl8ec7f652007-08-15 14:28:01 +0000384
Ronald Oussoren783fa442009-03-30 16:03:41 +0000385:mod:`Carbon.OSA` --- Carbon OSA Interface
386==========================================
387
388.. module:: Carbon.OSA
389 :platform: Mac
390 :synopsis: Interface to the Carbon OSA Library.
391 :deprecated:
392
393:mod:`Carbon.OSAconst` --- Carbon OSA Interface constants
394=========================================================
395
396.. module:: Carbon.OSAconst
397 :platform: Mac
398 :synopsis: Constants for the interface to the Carbon OSA Library.
399 :deprecated:
400
401:mod:`Carbon.QDOffscreen` --- QuickDraw Offscreen constants
402===========================================================
403
404.. module:: Carbon.QDOffscreen
405 :platform: Mac
406 :synopsis: Constants for the interface to the QuickDraw Offscreen APIs.
407 :deprecated:
Georg Brandl8ec7f652007-08-15 14:28:01 +0000408
409
410:mod:`Carbon.Qd` --- QuickDraw
411==============================
412
413.. module:: Carbon.Qd
414 :platform: Mac
415 :synopsis: Interface to the QuickDraw toolbox.
Benjamin Peterson23681932008-05-12 21:42:13 +0000416 :deprecated:
Georg Brandl8ec7f652007-08-15 14:28:01 +0000417
418
419
420:mod:`Carbon.Qdoffs` --- QuickDraw Offscreen
421============================================
422
423.. module:: Carbon.Qdoffs
424 :platform: Mac
425 :synopsis: Interface to the QuickDraw Offscreen APIs.
Benjamin Peterson23681932008-05-12 21:42:13 +0000426 :deprecated:
Georg Brandl8ec7f652007-08-15 14:28:01 +0000427
428
429
430:mod:`Carbon.Qt` --- QuickTime
431==============================
432
433.. module:: Carbon.Qt
434 :platform: Mac
435 :synopsis: Interface to the QuickTime toolbox.
Benjamin Peterson23681932008-05-12 21:42:13 +0000436 :deprecated:
Georg Brandl8ec7f652007-08-15 14:28:01 +0000437
Ronald Oussoren783fa442009-03-30 16:03:41 +0000438:mod:`Carbon.QuickDraw` --- QuickDraw constants
439===============================================
440
441.. module:: Carbon.QuickDraw
442 :platform: Mac
443 :synopsis: Constants for the interface to the QuickDraw toolbox.
444 :deprecated:
445
446:mod:`Carbon.QuickTime` --- QuickTime constants
447===============================================
448
449.. module:: Carbon.QuickTime
450 :platform: Mac
451 :synopsis: Constants for the interface to the QuickTime toolbox.
452 :deprecated:
Georg Brandl8ec7f652007-08-15 14:28:01 +0000453
454
455:mod:`Carbon.Res` --- Resource Manager and Handles
456==================================================
457
458.. module:: Carbon.Res
459 :platform: Mac
460 :synopsis: Interface to the Resource Manager and Handles.
Benjamin Peterson23681932008-05-12 21:42:13 +0000461 :deprecated:
Georg Brandl8ec7f652007-08-15 14:28:01 +0000462
Ronald Oussoren783fa442009-03-30 16:03:41 +0000463:mod:`Carbon.Resources` --- Resource Manager and Handles constants
464==================================================================
465
466.. module:: Carbon.Resources
467 :platform: Mac
468 :synopsis: Constants for the interface to the Resource Manager and Handles.
469 :deprecated:
Georg Brandl8ec7f652007-08-15 14:28:01 +0000470
471
472:mod:`Carbon.Scrap` --- Scrap Manager
473=====================================
474
475.. module:: Carbon.Scrap
476 :platform: Mac
477 :synopsis: The Scrap Manager provides basic services for implementing cut & paste and
478 clipboard operations.
Benjamin Peterson23681932008-05-12 21:42:13 +0000479 :deprecated:
Georg Brandl8ec7f652007-08-15 14:28:01 +0000480
481
Georg Brandl9af94982008-09-13 17:41:16 +0000482This module is only fully available on Mac OS 9 and earlier under classic PPC
Georg Brandl8ec7f652007-08-15 14:28:01 +0000483MacPython. Very limited functionality is available under Carbon MacPython.
484
485.. index:: single: Scrap Manager
486
487The Scrap Manager supports the simplest form of cut & paste operations on the
488Macintosh. It can be use for both inter- and intra-application clipboard
489operations.
490
491The :mod:`Scrap` module provides low-level access to the functions of the Scrap
492Manager. It contains the following functions:
493
494
495.. function:: InfoScrap()
496
497 Return current information about the scrap. The information is encoded as a
498 tuple containing the fields ``(size, handle, count, state, path)``.
499
500 +----------+---------------------------------------------+
501 | Field | Meaning |
502 +==========+=============================================+
503 | *size* | Size of the scrap in bytes. |
504 +----------+---------------------------------------------+
505 | *handle* | Resource object representing the scrap. |
506 +----------+---------------------------------------------+
507 | *count* | Serial number of the scrap contents. |
508 +----------+---------------------------------------------+
509 | *state* | Integer; positive if in memory, ``0`` if on |
510 | | disk, negative if uninitialized. |
511 +----------+---------------------------------------------+
512 | *path* | Filename of the scrap when stored on disk. |
513 +----------+---------------------------------------------+
514
515
516.. seealso::
517
518 `Scrap Manager <http://developer.apple.com/documentation/mac/MoreToolbox/MoreToolbox-109.html>`_
519 Apple's documentation for the Scrap Manager gives a lot of useful information
520 about using the Scrap Manager in applications.
521
522
523
524:mod:`Carbon.Snd` --- Sound Manager
525===================================
526
527.. module:: Carbon.Snd
528 :platform: Mac
529 :synopsis: Interface to the Sound Manager.
Benjamin Peterson23681932008-05-12 21:42:13 +0000530 :deprecated:
Georg Brandl8ec7f652007-08-15 14:28:01 +0000531
Ronald Oussoren783fa442009-03-30 16:03:41 +0000532:mod:`Carbon.Sound` --- Sound Manager constants
533===============================================
534
535.. module:: Carbon.Sound
536 :platform: Mac
537 :synopsis: Constants for the interface to the Sound Manager.
538 :deprecated:
Georg Brandl8ec7f652007-08-15 14:28:01 +0000539
540
541:mod:`Carbon.TE` --- TextEdit
542=============================
543
544.. module:: Carbon.TE
545 :platform: Mac
546 :synopsis: Interface to TextEdit.
Benjamin Peterson23681932008-05-12 21:42:13 +0000547 :deprecated:
Georg Brandl8ec7f652007-08-15 14:28:01 +0000548
Ronald Oussoren783fa442009-03-30 16:03:41 +0000549:mod:`Carbon.TextEdit` --- TextEdit constants
550=============================================
551
552.. module:: Carbon.TextEdit
553 :platform: Mac
554 :synopsis: Constants for the interface to TextEdit.
555 :deprecated:
556
Georg Brandl8ec7f652007-08-15 14:28:01 +0000557
558
559:mod:`Carbon.Win` --- Window Manager
560====================================
561
562.. module:: Carbon.Win
563 :platform: Mac
564 :synopsis: Interface to the Window Manager.
Benjamin Peterson23681932008-05-12 21:42:13 +0000565 :deprecated:
Ronald Oussoren783fa442009-03-30 16:03:41 +0000566
567:mod:`Carbon.Windows` --- Window Manager constants
568==================================================
569
570.. module:: Carbon.Windows
571 :platform: Mac
572 :synopsis: Constants for the interface to the Window Manager.
573 :deprecated: