/Doc/library/carbon.rst

http://unladen-swallow.googlecode.com/ · ReStructuredText · 573 lines · 400 code · 173 blank · 0 comment · 0 complexity · f4d2618d0714c80eae7d2cd5673eee49 MD5 · raw file

  1. .. _toolbox:
  2. **********************
  3. Mac OS Toolbox Modules
  4. **********************
  5. There are a set of modules that provide interfaces to various Mac OS toolboxes.
  6. If applicable the module will define a number of Python objects for the various
  7. structures declared by the toolbox, and operations will be implemented as
  8. methods of the object. Other operations will be implemented as functions in the
  9. module. Not all operations possible in C will also be possible in Python
  10. (callbacks are often a problem), and parameters will occasionally be different
  11. in Python (input and output buffers, especially). All methods and functions
  12. have a :attr:`__doc__` string describing their arguments and return values, and
  13. for additional description you are referred to `Inside Macintosh
  14. <http://developer.apple.com/documentation/macos8/mac8.html>`_ or similar works.
  15. These modules all live in a package called :mod:`Carbon`. Despite that name they
  16. are not all part of the Carbon framework: CF is really in the CoreFoundation
  17. framework and Qt is in the QuickTime framework. The normal use pattern is ::
  18. from Carbon import AE
  19. .. note::
  20. The Carbon modules have been removed in Python 3.0.
  21. :mod:`Carbon.AE` --- Apple Events
  22. =================================
  23. .. module:: Carbon.AE
  24. :platform: Mac
  25. :synopsis: Interface to the Apple Events toolbox.
  26. :deprecated:
  27. :mod:`Carbon.AH` --- Apple Help
  28. ===============================
  29. .. module:: Carbon.AH
  30. :platform: Mac
  31. :synopsis: Interface to the Apple Help manager.
  32. :deprecated:
  33. :mod:`Carbon.App` --- Appearance Manager
  34. ========================================
  35. .. module:: Carbon.App
  36. :platform: Mac
  37. :synopsis: Interface to the Appearance Manager.
  38. :deprecated:
  39. :mod:`Carbon.Appearance` --- Appearance Manager constants
  40. =========================================================
  41. .. module:: Carbon.Appearance
  42. :platform: Mac
  43. :synopsis: Constant definitions for the interface to the Appearance Manager.
  44. :deprecated:
  45. :mod:`Carbon.CF` --- Core Foundation
  46. ====================================
  47. .. module:: Carbon.CF
  48. :platform: Mac
  49. :synopsis: Interface to the Core Foundation.
  50. :deprecated:
  51. The ``CFBase``, ``CFArray``, ``CFData``, ``CFDictionary``, ``CFString`` and
  52. ``CFURL`` objects are supported, some only partially.
  53. :mod:`Carbon.CG` --- Core Graphics
  54. ==================================
  55. .. module:: Carbon.CG
  56. :platform: Mac
  57. :synopsis: Interface to Core Graphics.
  58. :deprecated:
  59. :mod:`Carbon.CarbonEvt` --- Carbon Event Manager
  60. ================================================
  61. .. module:: Carbon.CarbonEvt
  62. :platform: Mac
  63. :synopsis: Interface to the Carbon Event Manager.
  64. :deprecated:
  65. :mod:`Carbon.CarbonEvents` --- Carbon Event Manager constants
  66. =============================================================
  67. .. module:: Carbon.CarbonEvents
  68. :platform: Mac
  69. :synopsis: Constants for the interface to the Carbon Event Manager.
  70. :deprecated:
  71. :mod:`Carbon.Cm` --- Component Manager
  72. ======================================
  73. .. module:: Carbon.Cm
  74. :platform: Mac
  75. :synopsis: Interface to the Component Manager.
  76. :deprecated:
  77. :mod:`Carbon.Components` --- Component Manager constants
  78. ========================================================
  79. .. module:: Carbon.Components
  80. :platform: Mac
  81. :synopsis: Constants for the interface to the Component Manager.
  82. :deprecated:
  83. :mod:`Carbon.ControlAccessor` --- Control Manager accssors
  84. ===========================================================
  85. .. module:: Carbon.ControlAccessor
  86. :platform: Mac
  87. :synopsis: Accessor functions for the interface to the Control Manager.
  88. :deprecated:
  89. :mod:`Carbon.Controls` --- Control Manager constants
  90. ====================================================
  91. .. module:: Carbon.Controls
  92. :platform: Mac
  93. :synopsis: Constants for the interface to the Control Manager.
  94. :deprecated:
  95. :mod:`Carbon.CoreFounation` --- CoreFounation constants
  96. =======================================================
  97. .. module:: Carbon.CoreFounation
  98. :platform: Mac
  99. :synopsis: Constants for the interface to CoreFoundation.
  100. :deprecated:
  101. :mod:`Carbon.CoreGraphics` --- CoreGraphics constants
  102. =======================================================
  103. .. module:: Carbon.CoreGraphics
  104. :platform: Mac
  105. :synopsis: Constants for the interface to CoreGraphics.
  106. :deprecated:
  107. :mod:`Carbon.Ctl` --- Control Manager
  108. =====================================
  109. .. module:: Carbon.Ctl
  110. :platform: Mac
  111. :synopsis: Interface to the Control Manager.
  112. :deprecated:
  113. :mod:`Carbon.Dialogs` --- Dialog Manager constants
  114. ==================================================
  115. .. module:: Carbon.Dialogs
  116. :platform: Mac
  117. :synopsis: Constants for the interface to the Dialog Manager.
  118. :deprecated:
  119. :mod:`Carbon.Dlg` --- Dialog Manager
  120. ====================================
  121. .. module:: Carbon.Dlg
  122. :platform: Mac
  123. :synopsis: Interface to the Dialog Manager.
  124. :deprecated:
  125. :mod:`Carbon.Drag` --- Drag and Drop Manager
  126. =============================================
  127. .. module:: Carbon.Drag
  128. :platform: Mac
  129. :synopsis: Interface to the Drag and Drop Manager.
  130. :deprecated:
  131. :mod:`Carbon.Dragconst` --- Drag and Drop Manager constants
  132. ===========================================================
  133. .. module:: Carbon.Dragconst
  134. :platform: Mac
  135. :synopsis: Constants for the interface to the Drag and Drop Manager.
  136. :deprecated:
  137. :mod:`Carbon.Events` --- Event Manager constants
  138. ================================================
  139. .. module:: Carbon.Events
  140. :platform: Mac
  141. :synopsis: Constants for the interface to the classic Event Manager.
  142. :deprecated:
  143. :mod:`Carbon.Evt` --- Event Manager
  144. ===================================
  145. .. module:: Carbon.Evt
  146. :platform: Mac
  147. :synopsis: Interface to the classic Event Manager.
  148. :deprecated:
  149. :mod:`Carbon.File` --- File Manager
  150. ===================================
  151. .. module:: Carbon.File
  152. :platform: Mac
  153. :synopsis: Interface to the File Manager.
  154. :deprecated:
  155. :mod:`Carbon.Files` --- File Manager constants
  156. ==============================================
  157. .. module:: Carbon.Files
  158. :platform: Mac
  159. :synopsis: Constants for the interface to the File Manager.
  160. :deprecated:
  161. :mod:`Carbon.Fm` --- Font Manager
  162. =================================
  163. .. module:: Carbon.Fm
  164. :platform: Mac
  165. :synopsis: Interface to the Font Manager.
  166. :deprecated:
  167. :mod:`Carbon.Folder` --- Folder Manager
  168. =======================================
  169. .. module:: Carbon.Folder
  170. :platform: Mac
  171. :synopsis: Interface to the Folder Manager.
  172. :deprecated:
  173. :mod:`Carbon.Folders` --- Folder Manager constants
  174. ==================================================
  175. .. module:: Carbon.Folders
  176. :platform: Mac
  177. :synopsis: Constants for the interface to the Folder Manager.
  178. :deprecated:
  179. :mod:`Carbon.Fonts` --- Font Manager constants
  180. ==================================================
  181. .. module:: Carbon.Fonts
  182. :platform: Mac
  183. :synopsis: Constants for the interface to the Font Manager.
  184. :deprecated:
  185. :mod:`Carbon.Help` --- Help Manager
  186. ===================================
  187. .. module:: Carbon.Help
  188. :platform: Mac
  189. :synopsis: Interface to the Carbon Help Manager.
  190. :deprecated:
  191. :mod:`Carbon.IBCarbon` --- Carbon InterfaceBuilder
  192. ==================================================
  193. .. module:: Carbon.IBCarbon
  194. :platform: Mac
  195. :synopsis: Interface to the Carbon InterfaceBuilder support libraries.
  196. :deprecated:
  197. :mod:`Carbon.IBCarbonRuntime` --- Carbon InterfaceBuilder constants
  198. ===================================================================
  199. .. module:: Carbon.IBCarbonRuntime
  200. :platform: Mac
  201. :synopsis: Constants for the interface to the Carbon InterfaceBuilder support libraries.
  202. :deprecated:
  203. :mod:`Carbon.Icn` --- Carbon Icon Manager
  204. =========================================
  205. .. module:: Carbon.Icns
  206. :platform: Mac
  207. :synopsis: Interface to the Carbon Icon Manager
  208. :deprecated:
  209. :mod:`Carbon.Icons` --- Carbon Icon Manager constants
  210. =====================================================
  211. .. module:: Carbon.Icons
  212. :platform: Mac
  213. :synopsis: Constants for the interface to the Carbon Icon Manager
  214. :deprecated:
  215. :mod:`Carbon.Launch` --- Carbon Launch Services
  216. ===============================================
  217. .. module:: Carbon.Launch
  218. :platform: Mac
  219. :synopsis: Interface to the Carbon Launch Services.
  220. :deprecated:
  221. :mod:`Carbon.LaunchServices` --- Carbon Launch Services constants
  222. =================================================================
  223. .. module:: Carbon.LaunchServices
  224. :platform: Mac
  225. :synopsis: Constants for the interface to the Carbon Launch Services.
  226. :deprecated:
  227. :mod:`Carbon.List` --- List Manager
  228. ===================================
  229. .. module:: Carbon.List
  230. :platform: Mac
  231. :synopsis: Interface to the List Manager.
  232. :deprecated:
  233. :mod:`Carbon.Lists` --- List Manager constants
  234. ==============================================
  235. .. module:: Carbon.Lists
  236. :platform: Mac
  237. :synopsis: Constants for the interface to the List Manager.
  238. :deprecated:
  239. :mod:`Carbon.MacHelp` --- Help Manager constants
  240. ================================================
  241. .. module:: Carbon.MacHelp
  242. :platform: Mac
  243. :synopsis: Constants for the interface to the Carbon Help Manager.
  244. :deprecated:
  245. :mod:`Carbon.MediaDescr` --- Parsers and generators for Quicktime Media descriptors
  246. ===================================================================================
  247. .. module:: Carbon.MediaDescr
  248. :platform: Mac
  249. :synopsis: Parsers and generators for Quicktime Media descriptors
  250. :deprecated:
  251. :mod:`Carbon.Menu` --- Menu Manager
  252. ===================================
  253. .. module:: Carbon.Menu
  254. :platform: Mac
  255. :synopsis: Interface to the Menu Manager.
  256. :deprecated:
  257. :mod:`Carbon.Menus` --- Menu Manager constants
  258. ==============================================
  259. .. module:: Carbon.Menus
  260. :platform: Mac
  261. :synopsis: Constants for the interface to the Menu Manager.
  262. :deprecated:
  263. :mod:`Carbon.Mlte` --- MultiLingual Text Editor
  264. ===============================================
  265. .. module:: Carbon.Mlte
  266. :platform: Mac
  267. :synopsis: Interface to the MultiLingual Text Editor.
  268. :deprecated:
  269. :mod:`Carbon.OSA` --- Carbon OSA Interface
  270. ==========================================
  271. .. module:: Carbon.OSA
  272. :platform: Mac
  273. :synopsis: Interface to the Carbon OSA Library.
  274. :deprecated:
  275. :mod:`Carbon.OSAconst` --- Carbon OSA Interface constants
  276. =========================================================
  277. .. module:: Carbon.OSAconst
  278. :platform: Mac
  279. :synopsis: Constants for the interface to the Carbon OSA Library.
  280. :deprecated:
  281. :mod:`Carbon.QDOffscreen` --- QuickDraw Offscreen constants
  282. ===========================================================
  283. .. module:: Carbon.QDOffscreen
  284. :platform: Mac
  285. :synopsis: Constants for the interface to the QuickDraw Offscreen APIs.
  286. :deprecated:
  287. :mod:`Carbon.Qd` --- QuickDraw
  288. ==============================
  289. .. module:: Carbon.Qd
  290. :platform: Mac
  291. :synopsis: Interface to the QuickDraw toolbox.
  292. :deprecated:
  293. :mod:`Carbon.Qdoffs` --- QuickDraw Offscreen
  294. ============================================
  295. .. module:: Carbon.Qdoffs
  296. :platform: Mac
  297. :synopsis: Interface to the QuickDraw Offscreen APIs.
  298. :deprecated:
  299. :mod:`Carbon.Qt` --- QuickTime
  300. ==============================
  301. .. module:: Carbon.Qt
  302. :platform: Mac
  303. :synopsis: Interface to the QuickTime toolbox.
  304. :deprecated:
  305. :mod:`Carbon.QuickDraw` --- QuickDraw constants
  306. ===============================================
  307. .. module:: Carbon.QuickDraw
  308. :platform: Mac
  309. :synopsis: Constants for the interface to the QuickDraw toolbox.
  310. :deprecated:
  311. :mod:`Carbon.QuickTime` --- QuickTime constants
  312. ===============================================
  313. .. module:: Carbon.QuickTime
  314. :platform: Mac
  315. :synopsis: Constants for the interface to the QuickTime toolbox.
  316. :deprecated:
  317. :mod:`Carbon.Res` --- Resource Manager and Handles
  318. ==================================================
  319. .. module:: Carbon.Res
  320. :platform: Mac
  321. :synopsis: Interface to the Resource Manager and Handles.
  322. :deprecated:
  323. :mod:`Carbon.Resources` --- Resource Manager and Handles constants
  324. ==================================================================
  325. .. module:: Carbon.Resources
  326. :platform: Mac
  327. :synopsis: Constants for the interface to the Resource Manager and Handles.
  328. :deprecated:
  329. :mod:`Carbon.Scrap` --- Scrap Manager
  330. =====================================
  331. .. module:: Carbon.Scrap
  332. :platform: Mac
  333. :synopsis: The Scrap Manager provides basic services for implementing cut & paste and
  334. clipboard operations.
  335. :deprecated:
  336. This module is only fully available on Mac OS 9 and earlier under classic PPC
  337. MacPython. Very limited functionality is available under Carbon MacPython.
  338. .. index:: single: Scrap Manager
  339. The Scrap Manager supports the simplest form of cut & paste operations on the
  340. Macintosh. It can be use for both inter- and intra-application clipboard
  341. operations.
  342. The :mod:`Scrap` module provides low-level access to the functions of the Scrap
  343. Manager. It contains the following functions:
  344. .. function:: InfoScrap()
  345. Return current information about the scrap. The information is encoded as a
  346. tuple containing the fields ``(size, handle, count, state, path)``.
  347. +----------+---------------------------------------------+
  348. | Field | Meaning |
  349. +==========+=============================================+
  350. | *size* | Size of the scrap in bytes. |
  351. +----------+---------------------------------------------+
  352. | *handle* | Resource object representing the scrap. |
  353. +----------+---------------------------------------------+
  354. | *count* | Serial number of the scrap contents. |
  355. +----------+---------------------------------------------+
  356. | *state* | Integer; positive if in memory, ``0`` if on |
  357. | | disk, negative if uninitialized. |
  358. +----------+---------------------------------------------+
  359. | *path* | Filename of the scrap when stored on disk. |
  360. +----------+---------------------------------------------+
  361. .. seealso::
  362. `Scrap Manager <http://developer.apple.com/documentation/mac/MoreToolbox/MoreToolbox-109.html>`_
  363. Apple's documentation for the Scrap Manager gives a lot of useful information
  364. about using the Scrap Manager in applications.
  365. :mod:`Carbon.Snd` --- Sound Manager
  366. ===================================
  367. .. module:: Carbon.Snd
  368. :platform: Mac
  369. :synopsis: Interface to the Sound Manager.
  370. :deprecated:
  371. :mod:`Carbon.Sound` --- Sound Manager constants
  372. ===============================================
  373. .. module:: Carbon.Sound
  374. :platform: Mac
  375. :synopsis: Constants for the interface to the Sound Manager.
  376. :deprecated:
  377. :mod:`Carbon.TE` --- TextEdit
  378. =============================
  379. .. module:: Carbon.TE
  380. :platform: Mac
  381. :synopsis: Interface to TextEdit.
  382. :deprecated:
  383. :mod:`Carbon.TextEdit` --- TextEdit constants
  384. =============================================
  385. .. module:: Carbon.TextEdit
  386. :platform: Mac
  387. :synopsis: Constants for the interface to TextEdit.
  388. :deprecated:
  389. :mod:`Carbon.Win` --- Window Manager
  390. ====================================
  391. .. module:: Carbon.Win
  392. :platform: Mac
  393. :synopsis: Interface to the Window Manager.
  394. :deprecated:
  395. :mod:`Carbon.Windows` --- Window Manager constants
  396. ==================================================
  397. .. module:: Carbon.Windows
  398. :platform: Mac
  399. :synopsis: Constants for the interface to the Window Manager.
  400. :deprecated: