Team Fortress 2 Source Code as on 22/4/2020
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

7685 lines
242 KiB

  1. /*
  2. File: MacWindows.h
  3. Contains: Window Manager Interfaces
  4. Version: QuickTime 7.3
  5. Copyright: (c) 2007 (c) 1997-2002 by Apple Computer, Inc., all rights reserved
  6. Bugs?: For bug reports, consult the following page on
  7. the World Wide Web:
  8. http://developer.apple.com/bugreporter/
  9. */
  10. #ifndef __MACWINDOWS__
  11. #define __MACWINDOWS__
  12. #ifndef __MACTYPES__
  13. #include <MacTypes.h>
  14. #endif
  15. #ifndef __TEXTCOMMON__
  16. #include <TextCommon.h>
  17. #endif
  18. #ifndef __MACERRORS__
  19. #include <MacErrors.h>
  20. #endif
  21. #ifndef __ALIASES__
  22. #include <Aliases.h>
  23. #endif
  24. #ifndef __APPLEEVENTS__
  25. #include <AppleEvents.h>
  26. #endif
  27. #ifndef __COLLECTIONS__
  28. #include <Collections.h>
  29. #endif
  30. #ifndef __MIXEDMODE__
  31. #include <MixedMode.h>
  32. #endif
  33. #ifndef __QDOFFSCREEN__
  34. #include <QDOffscreen.h>
  35. #endif
  36. #ifndef __QUICKDRAW__
  37. #include <Quickdraw.h>
  38. #endif
  39. #ifndef __CFSTRING__
  40. #include <CFString.h>
  41. #endif
  42. #ifndef __ICONS__
  43. #include <Icons.h>
  44. #endif
  45. #ifndef __DRAG__
  46. #include <Drag.h>
  47. #endif
  48. #ifndef __EVENTS__
  49. #include <Events.h>
  50. #endif
  51. #ifndef __MENUS__
  52. #include <Menus.h>
  53. #endif
  54. #ifndef __HITOOLBAR__
  55. #include <HIToolbar.h>
  56. #endif
  57. #if PRAGMA_ONCE
  58. #pragma once
  59. #endif
  60. #ifdef __cplusplus
  61. extern "C" {
  62. #endif
  63. #if PRAGMA_IMPORT
  64. #pragma import on
  65. #endif
  66. #if PRAGMA_STRUCT_ALIGN
  67. #pragma options align=mac68k
  68. #elif PRAGMA_STRUCT_PACKPUSH
  69. #pragma pack(push, 2)
  70. #elif PRAGMA_STRUCT_PACK
  71. #pragma pack(2)
  72. #endif
  73. /* */
  74. /* Current documentation for the Mac OS Window Manager is available on the web: */
  75. /* <http://developer.apple.com/techpubs/macos8/HumanInterfaceToolbox/WindowManager/windowmanager.html> */
  76. /* */
  77. /*--------------------------------------------------------------------------------------*/
  78. /* o Property Types */
  79. /*--------------------------------------------------------------------------------------*/
  80. typedef OSType PropertyCreator;
  81. typedef OSType PropertyTag;
  82. /*--------------------------------------------------------------------------------------*/
  83. /* o Window Classes */
  84. /*--------------------------------------------------------------------------------------*/
  85. /*
  86. * WindowClass
  87. *
  88. * Summary:
  89. * The types of windows provided by the Window Manager.
  90. *
  91. * Discussion:
  92. * The class of a window determines several aspects of the window:
  93. * its appearance, its initial window attributes, its initial window
  94. * group, and its initial modality. All of these except for the
  95. * window's appearance may be changed later using other Window
  96. * Manager APIs.
  97. */
  98. typedef UInt32 WindowClass;
  99. enum {
  100. /*
  101. * An alert window is used when the application needs the user's
  102. * attention immediately. On Mac OS 9 and earlier, a visible alert
  103. * window will prevent the user from switching to any other
  104. * application. Use kThemeBrushAlertBackgroundActive to draw the
  105. * background of alert windows. Alert windows are initially placed in
  106. * the modal window group, given a modality of
  107. * kWindowModalityAppModal, and given an activation scope of
  108. * kWindowActivationScopeAll. Available in Mac OS 8.5 and later.
  109. */
  110. kAlertWindowClass = 1,
  111. /*
  112. * Similar to kAlertWindowClass, but provides a window that is
  113. * movable and that allows switching to other applications. Generally
  114. * you should use this window class rather than kAlertWindowClass.
  115. * Use kThemeBrushAlertBackgroundActive to draw the background of
  116. * movable alert windows. Movable alert windows are initially placed
  117. * in the modal window group, given a modality of
  118. * kWindowModalityAppModal, and given an activation scope of
  119. * kWindowActivationScopeAll. Available in Mac OS 8.5 and later.
  120. */
  121. kMovableAlertWindowClass = 2,
  122. /*
  123. * A modal window is used to display a dialog (but not an alert; use
  124. * kAlertWindowClass for alerts). On Mac OS 9 and earlier, a visible
  125. * modal window will prevent the user from switching to any other
  126. * application. Use kThemeBrushDialogBackgroundActive to draw the
  127. * background of modal windows. Modal windows are initially placed in
  128. * the modal window group, given a modality of
  129. * kWindowModalityAppModal, and given an activation scope of
  130. * kWindowActivationScopeAll. Available in Mac OS 8.5 and later.
  131. */
  132. kModalWindowClass = 3,
  133. /*
  134. * Similar to kModalWindowClass, but provides a window that is
  135. * movable and that allows switching to other applications. Generally
  136. * you should use this window class rather than kModalWindowClass. If
  137. * you are using CarbonLib 1.3 or later, or Mac OS X, use
  138. * kThemeBrushMovableModalBackground to draw the background of
  139. * movable modal windows; on earlier versions of CarbonLib, or for
  140. * non-Carbon programming, use kThemeBrushDialogBackgroundActive.
  141. * Movable modal windows are initially placed in the modal window
  142. * group, given a modality of kWindowModalityAppModal, and given an
  143. * activation scope of kWindowActivationScopeAll. Available in Mac OS
  144. * 8.5 and later.
  145. */
  146. kMovableModalWindowClass = 4,
  147. /*
  148. * A floating window is layered above all application windows except
  149. * for alert and modal windows. It is commonly used for palette
  150. * windows, inspectors, and other accessory (non-document) windows.
  151. * Use kThemeBrushUtilityWindowBackgroundActive or
  152. * kThemeBrushDocumentWindowBackground to draw the background of
  153. * floating windows. Floating windows are initially placed in the
  154. * floating window group, given a modality of kWindowModalityNone,
  155. * and given an activation scope of
  156. * kWindowActivationScopeIndependent. Available in Mac OS 8.6 and
  157. * later.
  158. */
  159. kFloatingWindowClass = 5,
  160. /*
  161. * A document window is used for normal application document windows.
  162. * Use kThemeBrushDocumentWindowBackground or your own custom drawing
  163. * to draw the background of a document window. Document windows are
  164. * initially placed in the document window group, given a modality of
  165. * kWindowModalityNone, and given an activation scope of
  166. * kWindowActivationScopeAll. Available in Mac OS 8.5 and later.
  167. */
  168. kDocumentWindowClass = 6,
  169. /*
  170. * A utility window is similar to a floating window, but it floats
  171. * above the windows of all applications rather than just above the
  172. * windows of the application that creates it. Use
  173. * kThemeBrushUtilityWindowBackgroundActive or
  174. * kThemeBrushDocumentWindowBackground to draw the background of
  175. * utility windows. Utility windows are initially placed in the
  176. * utility window group, given a modality of kWindowModalityNone, and
  177. * given an activation scope of kWindowActivationScopeIndependent.
  178. * Available in CarbonLib 1.1 and later, and in Mac OS X.
  179. */
  180. kUtilityWindowClass = 8,
  181. /*
  182. * A help window is used to display help tags. It has no window
  183. * frame. Typically you should use the Help Manager to display help
  184. * tags, rather than creating a help tag window yourself. Help
  185. * windows are initially placed in the help window group, given a
  186. * modality of kWindowModalityNone, and given an activation scope of
  187. * kWindowActivationScopeNone. Available in CarbonLib 1.1 and later,
  188. * and in Mac OS X.
  189. */
  190. kHelpWindowClass = 10,
  191. /*
  192. * A sheet window is used to display a dialog that is attached
  193. * directly to its parent window, rather than being a independent
  194. * window. A sheet dialog only prevents interaction with its parent
  195. * window; the user may still interact with other windows in the same
  196. * application. Use kThemeBrushSheetBackgroundOpaque to draw an
  197. * opaque background for sheet windows, or
  198. * kThemeBrushSheetBackgroundTransparent to draw a transparent
  199. * background (the transparent brush is only available in Mac OS X
  200. * 10.1 and later). Sheet windows are initially placed in the
  201. * document window group, given a modality of kWindowModalityNone,
  202. * and given an activation scope of kWindowActivationScopeAll.
  203. * Available in CarbonLib 1.3 and later, and in Mac OS X; in
  204. * CarbonLib, a sheet window is actually a movable-modal window,
  205. * which blocks user interaction with all windows of the application.
  206. */
  207. kSheetWindowClass = 11,
  208. /*
  209. * A toolbar window is used to display a palette of controls. It is
  210. * similar to a floating window, and like a floating window is
  211. * layered above all application windows except for alert and modal
  212. * windows, but is layered beneath floating windows. Use
  213. * kThemeBrushToolbarBackground to draw the background of a toolbar
  214. * window in Mac OS X or later; CarbonLib does not currently support
  215. * kThemeBrushToolbarBackground. Floating windows are initially
  216. * placed in the toolbar window group, given a modality of
  217. * kWindowModalityNone, and given an activation scope of
  218. * kWindowActivationScopeNone. Available in CarbonLib 1.1 and later,
  219. * and Mac OS X.
  220. */
  221. kToolbarWindowClass = 12,
  222. /*
  223. * A plain window has a single-pixel window frame.
  224. * kThemeBrushDocumentWindowBackground,
  225. * kThemeBrushDialogBackgroundActive, and application-specific custom
  226. * drawing are all commonly used to draw the background of a plain
  227. * window. Plain windows are initially placed in the document window
  228. * group, given a modality of kWindowModalityNone, and given an
  229. * activation scope of kWindowActivationScopeAll. Available in
  230. * CarbonLib 1.2.5 and later, and Mac OS X.
  231. */
  232. kPlainWindowClass = 13,
  233. /*
  234. * An overlay window is a completely transparent window positioned
  235. * above all other windows. Overlay windows are intended as a
  236. * replacement for the pre-Carbon practice of drawing directly into
  237. * the window manager port; by creating a full-screen overlay window
  238. * and drawing into it, you can draw over any window in any
  239. * application without disturbing the contents of the windows
  240. * underneath your drawing. After creating an overlay window, you
  241. * should use CGContextClearRect to clear the overlay window's alpha
  242. * channel to zero; this ensures the initial transparancy of the
  243. * window. You must use CoreGraphics to draw into an overlay window
  244. * to preserve the transparency of the window. Overlay windows are
  245. * initially placed in the overlay window group, given a modality of
  246. * kWindowModalityNone, and given an activation scope of
  247. * kWindowActivationScopeNone. Available in Mac OS X.
  248. */
  249. kOverlayWindowClass = 14,
  250. /*
  251. * A sheet alert window is similar to a sheet window, but is intended
  252. * to display an alert rather than a dialog. On Mac OS X, the
  253. * appearance of a sheet window and a sheet alert window is currently
  254. * identical, but in CarbonLib a sheet alert window has a different
  255. * appearance from a sheet window. Use
  256. * kThemeBrushSheetBackgroundOpaque to draw an opaque background for
  257. * sheet alert windows, or kThemeBrushSheetBackgroundTransparent to
  258. * draw a transparent background (the transparent brush is only
  259. * available in Mac OS X 10.1 and later). Sheet alert windows are
  260. * initially placed in the document window group, given a modality of
  261. * kWindowModalityNone, and given an activation scope of
  262. * kWindowActivationScopeAll. Available in CarbonLib 1.3 and later,
  263. * and in Mac OS X 10.1 and later; in CarbonLib, a sheet alert window
  264. * is actually a movable alert window, which blocks user interaction
  265. * with all windows of the application.
  266. */
  267. kSheetAlertWindowClass = 15,
  268. /*
  269. * A alternate plain window is similar to a plain window but has a
  270. * solid black shadow on its right and bottom sides. It is rarely
  271. * used in modern Mac OS applications.
  272. * kThemeBrushDocumentWindowBackground,
  273. * kThemeBrushDialogBackgroundActive, and application-specific custom
  274. * drawing are all commonly used to draw the background of an
  275. * alternate plain window. Alternate plain windows are initially
  276. * placed in the document window group, given a modality of
  277. * kWindowModalityNone, and given an activation scope of
  278. * kWindowActivationScopeAll. Available in CarbonLib 1.3 and later,
  279. * and Mac OS X 10.1 and later.
  280. */
  281. kAltPlainWindowClass = 16,
  282. /*
  283. * A drawer window is used when implementing a drawer user interface,
  284. * in which the drawer windo slides out from underneath a document
  285. * window. Use kThemeBrushDrawerBackground or
  286. * kThemeBrushDocumentWindowBackground to draw the background of
  287. * drawer windows. Drawer windows are initially placed in the
  288. * document window group, given a modality of kWindowModalityNone,
  289. * and given an activation scope of kWindowActivationScopeAll.
  290. * Available in Mac OS X 10.2 or later.
  291. */
  292. kDrawerWindowClass = 20,
  293. /*
  294. * Not an actual window class, but a meta-constant that is used with
  295. * GetFrontWindowOfClass, FindWindowOfClass, and GetNextWindowOfClass
  296. * to indicate that there should be no restriction on the class of
  297. * the returned window. Also used with GetWindowGroupOfClass to get
  298. * the root window group.
  299. */
  300. kAllWindowClasses = (unsigned long)0xFFFFFFFF
  301. };
  302. /*--------------------------------------------------------------------------------------*/
  303. /* o Window Attributes */
  304. /*--------------------------------------------------------------------------------------*/
  305. typedef UInt32 WindowAttributes;
  306. /*
  307. * Summary:
  308. * Window attributes
  309. */
  310. enum {
  311. /*
  312. * A constant with value zero; the lack of any attributes.
  313. */
  314. kWindowNoAttributes = 0L,
  315. /*
  316. * This window has a close box. Available for windows of
  317. * kDocumentWindowClass, kFloatingWindowClass, and
  318. * kUtilityWindowClass.
  319. */
  320. kWindowCloseBoxAttribute = (1L << 0),
  321. /*
  322. * This window changes width when zooming. Available for windows of
  323. * kDocumentWindowClass, kFloatingWindowClass, and
  324. * kUtilityWindowClass.
  325. */
  326. kWindowHorizontalZoomAttribute = (1L << 1),
  327. /*
  328. * This window changes height when zooming. Available for windows of
  329. * kDocumentWindowClass, kFloatingWindowClass, and
  330. * kUtilityWindowClass.
  331. */
  332. kWindowVerticalZoomAttribute = (1L << 2),
  333. /*
  334. * This window changes both width and height when zooming. Available
  335. * for windows of kDocumentWindowClass, kFloatingWindowClass, and
  336. * kUtilityWindowClass.
  337. */
  338. kWindowFullZoomAttribute = (kWindowVerticalZoomAttribute | kWindowHorizontalZoomAttribute),
  339. /*
  340. * This window has a collapse box. Available for windows of
  341. * kDocumentWindowClass and, on Mac OS 9, kFloatingWindowClass and
  342. * kUtilityWindowClass; not available for windows of
  343. * kFloatingWindowClass or kUtilityWindowClass on Mac OS X.
  344. */
  345. kWindowCollapseBoxAttribute = (1L << 3),
  346. /*
  347. * This window can be resized. Available for windows of
  348. * kDocumentWindowClass, kMovableModalWindowClass,
  349. * kFloatingWindowClass, kUtilityWindowClass, and kSheetWindowClass.
  350. */
  351. kWindowResizableAttribute = (1L << 4),
  352. /*
  353. * This window has a vertical titlebar on the side of the window.
  354. * Available for windows of kFloatingWindowClass and
  355. * kUtilityWindowClass.
  356. */
  357. kWindowSideTitlebarAttribute = (1L << 5),
  358. /*
  359. * This window has a toolbar button. Available for windows of
  360. * kDocumentWindowClass on Mac OS X.
  361. */
  362. kWindowToolbarButtonAttribute = (1L << 6),
  363. /*
  364. * This window uses the Metal appearance. Available for document and
  365. * floating window classes on Mac OS X 10.2 and later. Drawers can
  366. * also be metal, but dynamically adjust their appearance based on
  367. * their parent window's appearance; it is not necessary to specify
  368. * this attribute for a metal drawer.
  369. */
  370. kWindowMetalAttribute = (1L << 8),
  371. /*
  372. * This window receives no update events. Available for all windows.
  373. */
  374. kWindowNoUpdatesAttribute = (1L << 16),
  375. /*
  376. * This window receives no activate events. Available for all windows.
  377. */
  378. kWindowNoActivatesAttribute = (1L << 17),
  379. /*
  380. * This window receives mouse events even for areas of the window
  381. * that are transparent (have an alpha channel component of zero).
  382. * Available for windows of kOverlayWindowClass on Mac OS X 10.0 and
  383. * 10.1, and available for all windows on Mac OS X 10.2 and later.
  384. */
  385. kWindowOpaqueForEventsAttribute = (1L << 18),
  386. /*
  387. * This window uses composited drawing. This means that the entire
  388. * window is comprised of HIViews, and can be treated thusly. This
  389. * attribute must be specified at window creation, and cannot be
  390. * changed later with ChangeWindowAttributes. Available on Mac OS X
  391. * 10.2 and later.
  392. */
  393. kWindowCompositingAttribute = (1L << 19),
  394. /*
  395. * This window has no shadow. Available for all windows on Mac OS X.
  396. * This attribute is automatically given to windows of
  397. * kOverlayWindowClass.
  398. */
  399. kWindowNoShadowAttribute = (1L << 21),
  400. /*
  401. * This window is automatically hidden on suspend and shown on
  402. * resume. Available for all windows. This attribute is automatically
  403. * given to windows of kFloatingWindowClass, kHelpWindowClass, and
  404. * kToolbarWindowClass.
  405. */
  406. kWindowHideOnSuspendAttribute = (1L << 24),
  407. /*
  408. * This window has the standard Carbon window event handler
  409. * installed. Available for all windows.
  410. */
  411. kWindowStandardHandlerAttribute = (1L << 25),
  412. /*
  413. * This window is automatically hidden during fullscreen mode (when
  414. * the menubar is invisible) and shown afterwards. Available for all
  415. * windows. This attribute is automatically given to windows of
  416. * kUtilityWindowClass.
  417. */
  418. kWindowHideOnFullScreenAttribute = (1L << 26),
  419. /*
  420. * This window is added to the standard Window menu. Available for
  421. * windows of kDocumentWindowClass. This attribute is automatically
  422. * given to windows of kDocumentWindowClass.
  423. */
  424. kWindowInWindowMenuAttribute = (1L << 27),
  425. /*
  426. * This window supports live resizing. Available for all windows on
  427. * Mac OS X.
  428. */
  429. kWindowLiveResizeAttribute = (1L << 28),
  430. /*
  431. * This window never receives mouse events, even in areas that are
  432. * opaque. Instead, clicks on the window will be passed through to
  433. * windows beneath it. Available for all windows on Mac OS X 10.2 and
  434. * later.
  435. */
  436. kWindowIgnoreClicksAttribute = (1L << 29),
  437. /*
  438. * This window will not be repositioned by the default
  439. * kEventWindowConstrain handler in response to changes in monitor
  440. * size, Dock position, and so on. Available for all windows on Mac
  441. * OS X 10.1 and later, and CarbonLib 1.6 and later.
  442. */
  443. kWindowNoConstrainAttribute = (unsigned long)((1L << 31)),
  444. /*
  445. * The minimum set of window attributes commonly used by document
  446. * windows.
  447. */
  448. kWindowStandardDocumentAttributes = (kWindowCloseBoxAttribute | kWindowFullZoomAttribute | kWindowCollapseBoxAttribute | kWindowResizableAttribute),
  449. /*
  450. * The minimum set of window attributes commonly used by floating
  451. * windows.
  452. */
  453. kWindowStandardFloatingAttributes = (kWindowCloseBoxAttribute | kWindowCollapseBoxAttribute)
  454. };
  455. /*--------------------------------------------------------------------------------------*/
  456. /* o Window Definition Type */
  457. /*--------------------------------------------------------------------------------------*/
  458. enum {
  459. kWindowDefProcType = FOUR_CHAR_CODE('WDEF')
  460. };
  461. /*--------------------------------------------------------------------------------------*/
  462. /* o Mac OS 7.5 Window Definition Resource IDs */
  463. /*--------------------------------------------------------------------------------------*/
  464. enum {
  465. kStandardWindowDefinition = 0, /* for document windows and dialogs*/
  466. kRoundWindowDefinition = 1, /* old da-style window*/
  467. kFloatingWindowDefinition = 124 /* for floating windows*/
  468. };
  469. /*--------------------------------------------------------------------------------------*/
  470. /* o Variant Codes */
  471. /*--------------------------------------------------------------------------------------*/
  472. enum {
  473. /* for use with kStandardWindowDefinition */
  474. kDocumentWindowVariantCode = 0,
  475. kModalDialogVariantCode = 1,
  476. kPlainDialogVariantCode = 2,
  477. kShadowDialogVariantCode = 3,
  478. kMovableModalDialogVariantCode = 5,
  479. kAlertVariantCode = 7,
  480. kMovableAlertVariantCode = 9, /* for use with kFloatingWindowDefinition */
  481. kSideFloaterVariantCode = 8
  482. };
  483. /*--------------------------------------------------------------------------------------*/
  484. /* o DefProc IDs */
  485. /*--------------------------------------------------------------------------------------*/
  486. enum {
  487. /* classic ids */
  488. documentProc = 0,
  489. dBoxProc = 1,
  490. plainDBox = 2,
  491. altDBoxProc = 3,
  492. noGrowDocProc = 4,
  493. movableDBoxProc = 5,
  494. zoomDocProc = 8,
  495. zoomNoGrow = 12, /* floating window defproc ids */
  496. floatProc = 1985,
  497. floatGrowProc = 1987,
  498. floatZoomProc = 1989,
  499. floatZoomGrowProc = 1991,
  500. floatSideProc = 1993,
  501. floatSideGrowProc = 1995,
  502. floatSideZoomProc = 1997,
  503. floatSideZoomGrowProc = 1999
  504. };
  505. #if CALL_NOT_IN_CARBON
  506. /* The rDocProc (rounded WDEF, ala calculator) is not supported in Carbon.*/
  507. enum {
  508. rDocProc = 16
  509. };
  510. #endif /* CALL_NOT_IN_CARBON */
  511. enum {
  512. /* Resource IDs for theme-savvy window defprocs */
  513. kWindowDocumentDefProcResID = 64,
  514. kWindowDialogDefProcResID = 65,
  515. kWindowUtilityDefProcResID = 66,
  516. kWindowUtilitySideTitleDefProcResID = 67,
  517. kWindowSheetDefProcResID = 68,
  518. kWindowSimpleDefProcResID = 69,
  519. kWindowSheetAlertDefProcResID = 70
  520. };
  521. enum {
  522. /* Proc IDs for theme-savvy windows */
  523. kWindowDocumentProc = 1024,
  524. kWindowGrowDocumentProc = 1025,
  525. kWindowVertZoomDocumentProc = 1026,
  526. kWindowVertZoomGrowDocumentProc = 1027,
  527. kWindowHorizZoomDocumentProc = 1028,
  528. kWindowHorizZoomGrowDocumentProc = 1029,
  529. kWindowFullZoomDocumentProc = 1030,
  530. kWindowFullZoomGrowDocumentProc = 1031
  531. };
  532. enum {
  533. /* Proc IDs for theme-savvy dialogs */
  534. kWindowPlainDialogProc = 1040,
  535. kWindowShadowDialogProc = 1041,
  536. kWindowModalDialogProc = 1042,
  537. kWindowMovableModalDialogProc = 1043,
  538. kWindowAlertProc = 1044,
  539. kWindowMovableAlertProc = 1045
  540. };
  541. enum {
  542. /* procIDs available from Mac OS 8.1 (Appearance 1.0.1) forward */
  543. kWindowMovableModalGrowProc = 1046
  544. };
  545. enum {
  546. /* Proc IDs for top title bar theme-savvy floating windows */
  547. kWindowFloatProc = 1057,
  548. kWindowFloatGrowProc = 1059,
  549. kWindowFloatVertZoomProc = 1061,
  550. kWindowFloatVertZoomGrowProc = 1063,
  551. kWindowFloatHorizZoomProc = 1065,
  552. kWindowFloatHorizZoomGrowProc = 1067,
  553. kWindowFloatFullZoomProc = 1069,
  554. kWindowFloatFullZoomGrowProc = 1071
  555. };
  556. enum {
  557. /* Proc IDs for side title bar theme-savvy floating windows */
  558. kWindowFloatSideProc = 1073,
  559. kWindowFloatSideGrowProc = 1075,
  560. kWindowFloatSideVertZoomProc = 1077,
  561. kWindowFloatSideVertZoomGrowProc = 1079,
  562. kWindowFloatSideHorizZoomProc = 1081,
  563. kWindowFloatSideHorizZoomGrowProc = 1083,
  564. kWindowFloatSideFullZoomProc = 1085,
  565. kWindowFloatSideFullZoomGrowProc = 1087
  566. };
  567. enum {
  568. /* Proc IDs for sheet windows */
  569. kWindowSheetProc = 1088, /* available in Mac OS X and CarbonLib 1.3 */
  570. kWindowSheetAlertProc = 1120 /* available in Mac OS X after 1.0, and CarbonLib 1.3 */
  571. };
  572. /*
  573. * Discussion:
  574. * Window defproc IDs for simple windows
  575. */
  576. enum {
  577. /* Proc IDs for simple windows */
  578. /*
  579. * A window that has no structure region; the content covers the
  580. * entire window.
  581. */
  582. kWindowSimpleProc = 1104,
  583. /*
  584. * A window that has a 1-pixel black frame as its structure.
  585. */
  586. kWindowSimpleFrameProc = 1105
  587. };
  588. /*--------------------------------------------------------------------------------------*/
  589. /* o System 7 Window Positioning Constants */
  590. /* */
  591. /* Passed into StandardAlert and used in 'WIND', 'DLOG', and 'ALRT' templates */
  592. /* StandardAlert uses zero to specify the default position. Other calls use zero to */
  593. /* specify "no position". Do not pass these constants to RepositionWindow. Do not */
  594. /* store these constants in the BasicWindowDescription of a 'wind' resource. */
  595. /*--------------------------------------------------------------------------------------*/
  596. enum {
  597. kWindowNoPosition = 0x0000,
  598. kWindowDefaultPosition = 0x0000, /* used by StandardAlert*/
  599. kWindowCenterMainScreen = 0x280A,
  600. kWindowAlertPositionMainScreen = 0x300A,
  601. kWindowStaggerMainScreen = 0x380A,
  602. kWindowCenterParentWindow = 0xA80A,
  603. kWindowAlertPositionParentWindow = 0xB00A,
  604. kWindowStaggerParentWindow = 0xB80A,
  605. kWindowCenterParentWindowScreen = 0x680A,
  606. kWindowAlertPositionParentWindowScreen = 0x700A,
  607. kWindowStaggerParentWindowScreen = 0x780A
  608. };
  609. /*--------------------------------------------------------------------------------------*/
  610. /* o Window Positioning Methods */
  611. /* */
  612. /* Positioning methods passed to RepositionWindow. */
  613. /* Do not use them in WIND, ALRT, DLOG templates. */
  614. /* Do not confuse these constants with the constants above */
  615. /*--------------------------------------------------------------------------------------*/
  616. /*
  617. * WindowPositionMethod
  618. *
  619. * Summary:
  620. * Positioning methods usable with RepositionWindow.
  621. *
  622. * Discussion:
  623. * These constants are for use solely with the RepositionWindow API.
  624. * They should not be used in 'WIND', 'ALRT', or 'DLOG' resources.
  625. */
  626. typedef UInt32 WindowPositionMethod;
  627. enum {
  628. /*
  629. * Centers the window on the main screen.
  630. */
  631. kWindowCenterOnMainScreen = 1,
  632. /*
  633. * Centers the window on its parent window.
  634. */
  635. kWindowCenterOnParentWindow = 2,
  636. /*
  637. * Centers the window on the screen containing the largest portion of
  638. * its parent window.
  639. */
  640. kWindowCenterOnParentWindowScreen = 3,
  641. /*
  642. * Cascades the window on the main screen.
  643. */
  644. kWindowCascadeOnMainScreen = 4,
  645. /*
  646. * Cascades the window on its parent window.
  647. */
  648. kWindowCascadeOnParentWindow = 5,
  649. /*
  650. * Cascades the window on the screen containing the largest portion
  651. * of its parent window.
  652. */
  653. kWindowCascadeOnParentWindowScreen = 6,
  654. /*
  655. * Cascades the window on the screen containing the largest portion
  656. * of its parent window, starting below and to the right of its
  657. * parent window. Available in Mac OS X after version 10.1.x and
  658. * CarbonLib after 1.5.
  659. */
  660. kWindowCascadeStartAtParentWindowScreen = 10,
  661. /*
  662. * Puts the window into the alert position on the main screen.
  663. */
  664. kWindowAlertPositionOnMainScreen = 7,
  665. /*
  666. * Puts the window into the alert position on its parent window.
  667. */
  668. kWindowAlertPositionOnParentWindow = 8,
  669. /*
  670. * Puts the window into the alert position on the screen containing
  671. * the largest portion of its parent window.
  672. */
  673. kWindowAlertPositionOnParentWindowScreen = 9
  674. };
  675. /*--------------------------------------------------------------------------------------*/
  676. /* o GetWindowRegion Types */
  677. /*--------------------------------------------------------------------------------------*/
  678. typedef UInt16 WindowRegionCode;
  679. enum {
  680. /* Region values to pass into GetWindowRegion & GetWindowBounds. All regions are reported in global coordinates. */
  681. kWindowTitleBarRgn = 0,
  682. kWindowTitleTextRgn = 1,
  683. kWindowCloseBoxRgn = 2,
  684. kWindowZoomBoxRgn = 3,
  685. kWindowDragRgn = 5,
  686. kWindowGrowRgn = 6,
  687. kWindowCollapseBoxRgn = 7,
  688. kWindowTitleProxyIconRgn = 8, /* Mac OS 8.5 forward*/
  689. kWindowStructureRgn = 32,
  690. kWindowContentRgn = 33, /* Content area of the window; empty when the window is collapsed*/
  691. kWindowUpdateRgn = 34, /* Carbon forward*/
  692. kWindowOpaqueRgn = 35, /* Mac OS X: Area of window considered to be opaque. Only valid for windows with alpha channels.*/
  693. kWindowGlobalPortRgn = 40 /* Carbon forward - bounds of the window's port in global coordinates; not affected by CollapseWindow*/
  694. };
  695. /* GetWindowRegionRec - a pointer to this is passed in WDEF param for kWindowMsgGetRegion*/
  696. struct GetWindowRegionRec {
  697. RgnHandle winRgn;
  698. WindowRegionCode regionCode;
  699. };
  700. typedef struct GetWindowRegionRec GetWindowRegionRec;
  701. typedef GetWindowRegionRec * GetWindowRegionPtr;
  702. typedef GetWindowRegionRec * GetWindowRegionRecPtr;
  703. /*--------------------------------------------------------------------------------------*/
  704. /* o WDEF Message Types */
  705. /*--------------------------------------------------------------------------------------*/
  706. /*
  707. SetupWindowProxyDragImageRec - setup the proxy icon drag image
  708. Both regions are allocated and disposed by the Window Manager.
  709. The GWorld is disposed of by the Window Manager, but the WDEF must allocate
  710. it. See Technote on Drag Manager 1.1 additions for more information and sample code for
  711. setting up drag images.
  712. */
  713. struct SetupWindowProxyDragImageRec {
  714. GWorldPtr imageGWorld; /* locked GWorld containing the drag image - output - can be NULL*/
  715. RgnHandle imageRgn; /* image clip region, contains the portion of the image which gets blitted to screen - preallocated output - if imageGWorld is NULL, this is ignored*/
  716. RgnHandle outlineRgn; /* the outline region used on shallow monitors - preallocated output - must always be non-empty*/
  717. };
  718. typedef struct SetupWindowProxyDragImageRec SetupWindowProxyDragImageRec;
  719. /* MeasureWindowTitleRec - a pointer to this is passed in WDEF param for kWindowMsgMeasureTitle*/
  720. struct MeasureWindowTitleRec {
  721. /* output parameters (filled in by the WDEF)*/
  722. SInt16 fullTitleWidth; /* text + proxy icon width*/
  723. SInt16 titleTextWidth; /* text width*/
  724. };
  725. typedef struct MeasureWindowTitleRec MeasureWindowTitleRec;
  726. typedef MeasureWindowTitleRec * MeasureWindowTitleRecPtr;
  727. /*
  728. GetGrowImageRegionRec - generate a region to be xored during GrowWindow and ResizeWindow.
  729. This is passed along with a kWindowMsgGetGrowImageRegion message. On input, the growRect
  730. parameter is the window's new bounds in global coordinates. The growImageRegion parameter
  731. will be allocated and disposed automatically; the window definition should alter the
  732. region appropriately.
  733. */
  734. struct GetGrowImageRegionRec {
  735. Rect growRect;
  736. RgnHandle growImageRegion;
  737. };
  738. typedef struct GetGrowImageRegionRec GetGrowImageRegionRec;
  739. /*--------------------------------------------------------------------------------------*/
  740. /* o Standard Window Kinds */
  741. /*--------------------------------------------------------------------------------------*/
  742. enum {
  743. dialogKind = 2,
  744. userKind = 8,
  745. kDialogWindowKind = 2,
  746. kApplicationWindowKind = 8
  747. };
  748. /*--------------------------------------------------------------------------------------*/
  749. /* o FindWindow Result Codes */
  750. /*--------------------------------------------------------------------------------------*/
  751. typedef SInt16 WindowPartCode;
  752. enum {
  753. inDesk = 0,
  754. inNoWindow = 0,
  755. inMenuBar = 1,
  756. inSysWindow = 2,
  757. inContent = 3,
  758. inDrag = 4,
  759. inGrow = 5,
  760. inGoAway = 6,
  761. inZoomIn = 7,
  762. inZoomOut = 8,
  763. inCollapseBox = 11, /* Mac OS 8.0 forward*/
  764. inProxyIcon = 12, /* Mac OS 8.5 forward*/
  765. inToolbarButton = 13, /* Mac OS X forward*/
  766. inStructure = 15 /* Mac OS X 10.1 forward*/
  767. };
  768. /*--------------------------------------------------------------------------------------*/
  769. /* o Window Definition Hit Test Result Codes */
  770. /*--------------------------------------------------------------------------------------*/
  771. typedef SInt16 WindowDefPartCode;
  772. enum {
  773. wNoHit = 0,
  774. wInContent = 1,
  775. wInDrag = 2,
  776. wInGrow = 3,
  777. wInGoAway = 4,
  778. wInZoomIn = 5,
  779. wInZoomOut = 6,
  780. wInCollapseBox = 9, /* Mac OS 8.0 forward*/
  781. wInProxyIcon = 10, /* Mac OS 8.5 forward*/
  782. wInToolbarButton = 11, /* Mac OS X forward*/
  783. wInStructure = 13 /* Mac OS X 10.1 forward*/
  784. };
  785. /*--------------------------------------------------------------------------------------*/
  786. /* o Window Definition Messages */
  787. /*--------------------------------------------------------------------------------------*/
  788. enum {
  789. kWindowMsgDraw = 0,
  790. kWindowMsgHitTest = 1,
  791. kWindowMsgCalculateShape = 2,
  792. kWindowMsgInitialize = 3,
  793. kWindowMsgCleanUp = 4,
  794. kWindowMsgDrawGrowOutline = 5,
  795. kWindowMsgDrawGrowBox = 6
  796. };
  797. /* Messages available from Mac OS 8.0 forward*/
  798. enum {
  799. kWindowMsgGetFeatures = 7,
  800. kWindowMsgGetRegion = 8
  801. };
  802. /* Messages available from Mac OS 8.5 forward*/
  803. enum {
  804. kWindowMsgDragHilite = 9, /* parameter boolean indicating on or off*/
  805. kWindowMsgModified = 10, /* parameter boolean indicating saved (false) or modified (true)*/
  806. kWindowMsgDrawInCurrentPort = 11, /* same as kWindowMsgDraw, but must draw in current port*/
  807. kWindowMsgSetupProxyDragImage = 12, /* parameter pointer to SetupWindowProxyDragImageRec*/
  808. kWindowMsgStateChanged = 13, /* something about the window's state has changed*/
  809. kWindowMsgMeasureTitle = 14 /* measure and return the ideal title width*/
  810. };
  811. /* Messages only available in Carbon*/
  812. enum {
  813. kWindowMsgGetGrowImageRegion = 19 /* get region to xor during grow/resize. parameter pointer to GetGrowImageRegionRec.*/
  814. };
  815. /* old names*/
  816. enum {
  817. wDraw = 0,
  818. wHit = 1,
  819. wCalcRgns = 2,
  820. wNew = 3,
  821. wDispose = 4,
  822. wGrow = 5,
  823. wDrawGIcon = 6
  824. };
  825. /*--------------------------------------------------------------------------------------*/
  826. /* o State-changed Flags for kWindowMsgStateChanged */
  827. /*--------------------------------------------------------------------------------------*/
  828. enum {
  829. kWindowStateTitleChanged = (1 << 0)
  830. };
  831. /*--------------------------------------------------------------------------------------*/
  832. /* o Window Feature Bits */
  833. /*--------------------------------------------------------------------------------------*/
  834. enum {
  835. kWindowCanGrow = (1 << 0),
  836. kWindowCanZoom = (1 << 1),
  837. kWindowCanCollapse = (1 << 2),
  838. kWindowIsModal = (1 << 3),
  839. kWindowCanGetWindowRegion = (1 << 4),
  840. kWindowIsAlert = (1 << 5),
  841. kWindowHasTitleBar = (1 << 6)
  842. };
  843. /* Feature bits available from Mac OS 8.5 forward*/
  844. enum {
  845. kWindowSupportsDragHilite = (1 << 7), /* window definition supports kWindowMsgDragHilite*/
  846. kWindowSupportsModifiedBit = (1 << 8), /* window definition supports kWindowMsgModified*/
  847. kWindowCanDrawInCurrentPort = (1 << 9), /* window definition supports kWindowMsgDrawInCurrentPort*/
  848. kWindowCanSetupProxyDragImage = (1 << 10), /* window definition supports kWindowMsgSetupProxyDragImage*/
  849. kWindowCanMeasureTitle = (1 << 11), /* window definition supports kWindowMsgMeasureTitle*/
  850. kWindowWantsDisposeAtProcessDeath = (1 << 12), /* window definition wants a Dispose message for windows still extant during ExitToShell*/
  851. kWindowSupportsGetGrowImageRegion = (1 << 13), /* window definition will calculate the grow image region manually.*/
  852. kWindowDefSupportsColorGrafPort = 0x40000002
  853. };
  854. /* Feature bits for post MacOS 10.0*/
  855. enum {
  856. kWindowIsOpaque = (1 << 14) /* Window doesn't need an alpha channel. Saves memory.*/
  857. };
  858. /*
  859. THIS CONSTANT IS GOING AWAY. IT IS NAMED INCORRECTLY. USE THE GETGROWIMAGE CONSTANT ABOVE INSTEAD.
  860. DO YOU HEAR ME! AM I YELLING LOUD ENOUGH?!
  861. */
  862. enum {
  863. kWindowSupportsSetGrowImageRegion = (1 << 13)
  864. };
  865. /*--------------------------------------------------------------------------------------*/
  866. /* o Desktop Pattern Resource ID */
  867. /*--------------------------------------------------------------------------------------*/
  868. enum {
  869. deskPatID = 16
  870. };
  871. /*--------------------------------------------------------------------------------------*/
  872. /* o Window Color Part Codes */
  873. /*--------------------------------------------------------------------------------------*/
  874. enum {
  875. wContentColor = 0,
  876. wFrameColor = 1,
  877. wTextColor = 2,
  878. wHiliteColor = 3,
  879. wTitleBarColor = 4
  880. };
  881. /*--------------------------------------------------------------------------------------*/
  882. /* o Region Dragging Constants */
  883. /*--------------------------------------------------------------------------------------*/
  884. enum {
  885. kMouseUpOutOfSlop = (long)0x80008000
  886. };
  887. /*--------------------------------------------------------------------------------------*/
  888. /* o Window Color Table */
  889. /*--------------------------------------------------------------------------------------*/
  890. struct WinCTab {
  891. long wCSeed; /* reserved */
  892. short wCReserved; /* reserved */
  893. short ctSize; /* usually 4 for windows */
  894. ColorSpec ctTable[5];
  895. };
  896. typedef struct WinCTab WinCTab;
  897. typedef WinCTab * WCTabPtr;
  898. typedef WCTabPtr * WCTabHandle;
  899. /*--------------------------------------------------------------------------------------*/
  900. /* o WindowRecord */
  901. /*--------------------------------------------------------------------------------------*/
  902. #if !OPAQUE_TOOLBOX_STRUCTS
  903. typedef struct WindowRecord WindowRecord;
  904. typedef WindowRecord * WindowPeek;
  905. struct WindowRecord {
  906. GrafPort port; /* in Carbon use GetWindowPort*/
  907. short windowKind; /* in Carbon use Get/SetWindowKind*/
  908. Boolean visible; /* in Carbon use Hide/ShowWindow, ShowHide, IsWindowVisible*/
  909. Boolean hilited; /* in Carbon use HiliteWindow, IsWindowHilited*/
  910. Boolean goAwayFlag; /* in Carbon use ChangeWindowAttributes*/
  911. Boolean spareFlag; /* in Carbon use ChangeWindowAttributes*/
  912. RgnHandle strucRgn; /* in Carbon use GetWindowRegion*/
  913. RgnHandle contRgn; /* in Carbon use GetWindowRegion*/
  914. RgnHandle updateRgn; /* in Carbon use GetWindowRegion*/
  915. Handle windowDefProc; /* not supported in Carbon */
  916. Handle dataHandle; /* not supported in Carbon */
  917. StringHandle titleHandle; /* in Carbon use Get/SetWTitle */
  918. short titleWidth; /* in Carbon use GetWindowRegion */
  919. Handle controlList; /* in Carbon use GetRootControl */
  920. WindowPeek nextWindow; /* in Carbon use GetNextWindow */
  921. PicHandle windowPic; /* in Carbon use Get/SetWindowPic */
  922. long refCon; /* in Carbon use Get/SetWRefCon*/
  923. };
  924. #endif /* !OPAQUE_TOOLBOX_STRUCTS */
  925. /*--------------------------------------------------------------------------------------*/
  926. /* o Color WindowRecord */
  927. /*--------------------------------------------------------------------------------------*/
  928. #if !OPAQUE_TOOLBOX_STRUCTS
  929. typedef struct CWindowRecord CWindowRecord;
  930. typedef CWindowRecord * CWindowPeek;
  931. struct CWindowRecord {
  932. CGrafPort port; /* in Carbon use GetWindowPort*/
  933. short windowKind; /* in Carbon use Get/SetWindowKind */
  934. Boolean visible; /* in Carbon use Hide/ShowWindow, ShowHide, IsWindowVisible */
  935. Boolean hilited; /* in Carbon use HiliteWindow, IsWindowHilited*/
  936. Boolean goAwayFlag; /* in Carbon use ChangeWindowAttributes */
  937. Boolean spareFlag; /* in Carbon use ChangeWindowAttributes */
  938. RgnHandle strucRgn; /* in Carbon use GetWindowRegion */
  939. RgnHandle contRgn; /* in Carbon use GetWindowRegion */
  940. RgnHandle updateRgn; /* in Carbon use GetWindowRegion */
  941. Handle windowDefProc; /* not supported in Carbon */
  942. Handle dataHandle; /* not supported in Carbon */
  943. StringHandle titleHandle; /* in Carbon use Get/SetWTitle */
  944. short titleWidth; /* in Carbon use GetWindowRegion */
  945. Handle controlList; /* in Carbon use GetRootControl */
  946. CWindowPeek nextWindow; /* in Carbon use GetNextWindow */
  947. PicHandle windowPic; /* in Carbon use Get/SetWindowPic */
  948. long refCon; /* in Carbon use Get/SetWRefCon */
  949. };
  950. #endif /* !OPAQUE_TOOLBOX_STRUCTS */
  951. /*--------------------------------------------------------------------------------------*/
  952. /* o AuxWinHandle */
  953. /*--------------------------------------------------------------------------------------*/
  954. #if !OPAQUE_TOOLBOX_STRUCTS
  955. typedef struct AuxWinRec AuxWinRec;
  956. typedef AuxWinRec * AuxWinPtr;
  957. typedef AuxWinPtr * AuxWinHandle;
  958. struct AuxWinRec {
  959. AuxWinHandle awNext; /* handle to next AuxWinRec, not supported in Carbon*/
  960. WindowRef awOwner; /* not supported in Carbon*/
  961. CTabHandle awCTable; /* color table for this window, use Get/SetWindowContentColor in Carbon*/
  962. Handle reserved; /* not supported in Carbon*/
  963. long awFlags; /* reserved for expansion, not supported in Carbon*/
  964. CTabHandle awReserved; /* reserved for expansion, not supported in Carbon*/
  965. long awRefCon; /* user constant, in Carbon use Get/SetWindowProperty if you need more refCons*/
  966. };
  967. #endif /* !OPAQUE_TOOLBOX_STRUCTS */
  968. /*--------------------------------------------------------------------------------------*/
  969. /* o BasicWindowDescription */
  970. /* */
  971. /* Contains statically-sized basic attributes of the window, for storage in a */
  972. /* collection item. */
  973. /*--------------------------------------------------------------------------------------*/
  974. /* constants for the version field*/
  975. enum {
  976. kWindowDefinitionVersionOne = 1,
  977. kWindowDefinitionVersionTwo = 2
  978. };
  979. /* constants for the stateflags bit field */
  980. enum {
  981. kWindowIsCollapsedState = (1 << 0L)
  982. };
  983. struct BasicWindowDescription {
  984. UInt32 descriptionSize; /* sizeof(BasicWindowDescription)*/
  985. Rect windowContentRect; /* location on screen*/
  986. Rect windowZoomRect; /* location on screen when zoomed out*/
  987. UInt32 windowRefCon; /* the refcon - __avoid saving stale pointers here__ */
  988. UInt32 windowStateFlags; /* window state bit flags*/
  989. WindowPositionMethod windowPositionMethod; /* method last used by RepositionWindow to position the window (if any)*/
  990. UInt32 windowDefinitionVersion;
  991. union {
  992. struct {
  993. SInt16 windowDefProc; /* defProc and variant*/
  994. Boolean windowHasCloseBox;
  995. } versionOne;
  996. struct {
  997. WindowClass windowClass; /* the class*/
  998. WindowAttributes windowAttributes; /* the attributes*/
  999. } versionTwo;
  1000. } windowDefinition;
  1001. };
  1002. typedef struct BasicWindowDescription BasicWindowDescription;
  1003. /* the window manager stores the default collection items using these IDs*/
  1004. enum {
  1005. kStoredWindowSystemTag = FOUR_CHAR_CODE('appl'), /* Only Apple collection items will be of this tag*/
  1006. kStoredBasicWindowDescriptionID = FOUR_CHAR_CODE('sbas'), /* BasicWindowDescription*/
  1007. kStoredWindowPascalTitleID = FOUR_CHAR_CODE('s255') /* pascal title string*/
  1008. };
  1009. /*--------------------------------------------------------------------------------------*/
  1010. /* o Window Class Ordering */
  1011. /* */
  1012. /* Special cases for the "behind" parameter in window creation calls. */
  1013. /*--------------------------------------------------------------------------------------*/
  1014. #define kFirstWindowOfClass ((WindowRef)(-1))
  1015. #define kLastWindowOfClass ((WindowRef)0)
  1016. /*--------------------------------------------------------------------------------------*/
  1017. /* o Zoom Information Handle */
  1018. /*--------------------------------------------------------------------------------------*/
  1019. struct WStateData {
  1020. Rect userState; /*user zoom state*/
  1021. Rect stdState; /*standard zoom state*/
  1022. };
  1023. typedef struct WStateData WStateData;
  1024. typedef WStateData * WStateDataPtr;
  1025. typedef WStateDataPtr * WStateDataHandle;
  1026. /*--------------------------------------------------------------------------------------*/
  1027. /* o MixedMode & ProcPtrs */
  1028. /*--------------------------------------------------------------------------------------*/
  1029. typedef CALLBACK_API( long , WindowDefProcPtr )(short varCode, WindowRef window, short message, long param);
  1030. typedef CALLBACK_API_REGISTER68K( void , DeskHookProcPtr, (Boolean mouseClick, EventRecord *theEvent) );
  1031. typedef CALLBACK_API( OSStatus , WindowPaintProcPtr )(GDHandle device, GrafPtr qdContext, WindowRef window, RgnHandle inClientPaintRgn, RgnHandle outSystemPaintRgn, void *refCon);
  1032. typedef STACK_UPP_TYPE(WindowDefProcPtr) WindowDefUPP;
  1033. typedef REGISTER_UPP_TYPE(DeskHookProcPtr) DeskHookUPP;
  1034. typedef STACK_UPP_TYPE(WindowPaintProcPtr) WindowPaintUPP;
  1035. /*
  1036. * NewWindowDefUPP()
  1037. *
  1038. * Availability:
  1039. * Non-Carbon CFM: available as macro/inline
  1040. * CarbonLib: in CarbonLib 1.0 and later
  1041. * Mac OS X: in version 10.0 and later
  1042. */
  1043. EXTERN_API_C( WindowDefUPP )
  1044. NewWindowDefUPP(WindowDefProcPtr userRoutine);
  1045. #if !OPAQUE_UPP_TYPES
  1046. enum { uppWindowDefProcInfo = 0x00003BB0 }; /* pascal 4_bytes Func(2_bytes, 4_bytes, 2_bytes, 4_bytes) */
  1047. #ifdef __cplusplus
  1048. inline DEFINE_API_C(WindowDefUPP) NewWindowDefUPP(WindowDefProcPtr userRoutine) { return (WindowDefUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppWindowDefProcInfo, GetCurrentArchitecture()); }
  1049. #else
  1050. #define NewWindowDefUPP(userRoutine) (WindowDefUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppWindowDefProcInfo, GetCurrentArchitecture())
  1051. #endif
  1052. #endif
  1053. #if CALL_NOT_IN_CARBON
  1054. /*
  1055. * NewDeskHookUPP()
  1056. *
  1057. * Availability:
  1058. * Non-Carbon CFM: available as macro/inline
  1059. * CarbonLib: not available
  1060. * Mac OS X: not available
  1061. */
  1062. EXTERN_API_C( DeskHookUPP )
  1063. NewDeskHookUPP(DeskHookProcPtr userRoutine);
  1064. #if !OPAQUE_UPP_TYPES
  1065. enum { uppDeskHookProcInfo = 0x00130802 }; /* register no_return_value Func(1_byte:D0, 4_bytes:A0) */
  1066. #ifdef __cplusplus
  1067. inline DEFINE_API_C(DeskHookUPP) NewDeskHookUPP(DeskHookProcPtr userRoutine) { return (DeskHookUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppDeskHookProcInfo, GetCurrentArchitecture()); }
  1068. #else
  1069. #define NewDeskHookUPP(userRoutine) (DeskHookUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppDeskHookProcInfo, GetCurrentArchitecture())
  1070. #endif
  1071. #endif
  1072. #endif /* CALL_NOT_IN_CARBON */
  1073. /*
  1074. * NewWindowPaintUPP()
  1075. *
  1076. * Availability:
  1077. * Non-Carbon CFM: available as macro/inline
  1078. * CarbonLib: in CarbonLib 1.0 and later
  1079. * Mac OS X: in version 10.0 and later
  1080. */
  1081. EXTERN_API_C( WindowPaintUPP )
  1082. NewWindowPaintUPP(WindowPaintProcPtr userRoutine);
  1083. #if !OPAQUE_UPP_TYPES
  1084. enum { uppWindowPaintProcInfo = 0x0003FFF0 }; /* pascal 4_bytes Func(4_bytes, 4_bytes, 4_bytes, 4_bytes, 4_bytes, 4_bytes) */
  1085. #ifdef __cplusplus
  1086. inline DEFINE_API_C(WindowPaintUPP) NewWindowPaintUPP(WindowPaintProcPtr userRoutine) { return (WindowPaintUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppWindowPaintProcInfo, GetCurrentArchitecture()); }
  1087. #else
  1088. #define NewWindowPaintUPP(userRoutine) (WindowPaintUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppWindowPaintProcInfo, GetCurrentArchitecture())
  1089. #endif
  1090. #endif
  1091. /*
  1092. * DisposeWindowDefUPP()
  1093. *
  1094. * Availability:
  1095. * Non-Carbon CFM: available as macro/inline
  1096. * CarbonLib: in CarbonLib 1.0 and later
  1097. * Mac OS X: in version 10.0 and later
  1098. */
  1099. EXTERN_API_C( void )
  1100. DisposeWindowDefUPP(WindowDefUPP userUPP);
  1101. #if !OPAQUE_UPP_TYPES
  1102. #ifdef __cplusplus
  1103. inline DEFINE_API_C(void) DisposeWindowDefUPP(WindowDefUPP userUPP) { DisposeRoutineDescriptor((UniversalProcPtr)userUPP); }
  1104. #else
  1105. #define DisposeWindowDefUPP(userUPP) DisposeRoutineDescriptor(userUPP)
  1106. #endif
  1107. #endif
  1108. #if CALL_NOT_IN_CARBON
  1109. /*
  1110. * DisposeDeskHookUPP()
  1111. *
  1112. * Availability:
  1113. * Non-Carbon CFM: available as macro/inline
  1114. * CarbonLib: not available
  1115. * Mac OS X: not available
  1116. */
  1117. EXTERN_API_C( void )
  1118. DisposeDeskHookUPP(DeskHookUPP userUPP);
  1119. #if !OPAQUE_UPP_TYPES
  1120. #ifdef __cplusplus
  1121. inline DEFINE_API_C(void) DisposeDeskHookUPP(DeskHookUPP userUPP) { DisposeRoutineDescriptor((UniversalProcPtr)userUPP); }
  1122. #else
  1123. #define DisposeDeskHookUPP(userUPP) DisposeRoutineDescriptor(userUPP)
  1124. #endif
  1125. #endif
  1126. #endif /* CALL_NOT_IN_CARBON */
  1127. /*
  1128. * DisposeWindowPaintUPP()
  1129. *
  1130. * Availability:
  1131. * Non-Carbon CFM: available as macro/inline
  1132. * CarbonLib: in CarbonLib 1.0 and later
  1133. * Mac OS X: in version 10.0 and later
  1134. */
  1135. EXTERN_API_C( void )
  1136. DisposeWindowPaintUPP(WindowPaintUPP userUPP);
  1137. #if !OPAQUE_UPP_TYPES
  1138. #ifdef __cplusplus
  1139. inline DEFINE_API_C(void) DisposeWindowPaintUPP(WindowPaintUPP userUPP) { DisposeRoutineDescriptor((UniversalProcPtr)userUPP); }
  1140. #else
  1141. #define DisposeWindowPaintUPP(userUPP) DisposeRoutineDescriptor(userUPP)
  1142. #endif
  1143. #endif
  1144. /*
  1145. * InvokeWindowDefUPP()
  1146. *
  1147. * Availability:
  1148. * Non-Carbon CFM: available as macro/inline
  1149. * CarbonLib: in CarbonLib 1.0 and later
  1150. * Mac OS X: in version 10.0 and later
  1151. */
  1152. EXTERN_API_C( long )
  1153. InvokeWindowDefUPP(
  1154. short varCode,
  1155. WindowRef window,
  1156. short message,
  1157. long param,
  1158. WindowDefUPP userUPP);
  1159. #if !OPAQUE_UPP_TYPES
  1160. #ifdef __cplusplus
  1161. inline DEFINE_API_C(long) InvokeWindowDefUPP(short varCode, WindowRef window, short message, long param, WindowDefUPP userUPP) { return (long)CALL_FOUR_PARAMETER_UPP(userUPP, uppWindowDefProcInfo, varCode, window, message, param); }
  1162. #else
  1163. #define InvokeWindowDefUPP(varCode, window, message, param, userUPP) (long)CALL_FOUR_PARAMETER_UPP((userUPP), uppWindowDefProcInfo, (varCode), (window), (message), (param))
  1164. #endif
  1165. #endif
  1166. #if CALL_NOT_IN_CARBON
  1167. /*
  1168. * InvokeDeskHookUPP()
  1169. *
  1170. * Availability:
  1171. * Non-Carbon CFM: available as macro/inline
  1172. * CarbonLib: not available
  1173. * Mac OS X: not available
  1174. */
  1175. #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  1176. #pragma parameter InvokeDeskHookUPP(__D0, __A0, __A1)
  1177. #endif
  1178. EXTERN_API_C( void )
  1179. InvokeDeskHookUPP(
  1180. Boolean mouseClick,
  1181. EventRecord * theEvent,
  1182. DeskHookUPP userUPP) ONEWORDINLINE(0x4E91);
  1183. #if !OPAQUE_UPP_TYPES && (!TARGET_OS_MAC || !TARGET_CPU_68K || TARGET_RT_MAC_CFM)
  1184. #ifdef __cplusplus
  1185. inline DEFINE_API_C(void) InvokeDeskHookUPP(Boolean mouseClick, EventRecord * theEvent, DeskHookUPP userUPP) { CALL_TWO_PARAMETER_UPP(userUPP, uppDeskHookProcInfo, mouseClick, theEvent); }
  1186. #else
  1187. #define InvokeDeskHookUPP(mouseClick, theEvent, userUPP) CALL_TWO_PARAMETER_UPP((userUPP), uppDeskHookProcInfo, (mouseClick), (theEvent))
  1188. #endif
  1189. #endif
  1190. #endif /* CALL_NOT_IN_CARBON */
  1191. /*
  1192. * InvokeWindowPaintUPP()
  1193. *
  1194. * Availability:
  1195. * Non-Carbon CFM: available as macro/inline
  1196. * CarbonLib: in CarbonLib 1.0 and later
  1197. * Mac OS X: in version 10.0 and later
  1198. */
  1199. EXTERN_API_C( OSStatus )
  1200. InvokeWindowPaintUPP(
  1201. GDHandle device,
  1202. GrafPtr qdContext,
  1203. WindowRef window,
  1204. RgnHandle inClientPaintRgn,
  1205. RgnHandle outSystemPaintRgn,
  1206. void * refCon,
  1207. WindowPaintUPP userUPP);
  1208. #if !OPAQUE_UPP_TYPES
  1209. #ifdef __cplusplus
  1210. inline DEFINE_API_C(OSStatus) InvokeWindowPaintUPP(GDHandle device, GrafPtr qdContext, WindowRef window, RgnHandle inClientPaintRgn, RgnHandle outSystemPaintRgn, void * refCon, WindowPaintUPP userUPP) { return (OSStatus)CALL_SIX_PARAMETER_UPP(userUPP, uppWindowPaintProcInfo, device, qdContext, window, inClientPaintRgn, outSystemPaintRgn, refCon); }
  1211. #else
  1212. #define InvokeWindowPaintUPP(device, qdContext, window, inClientPaintRgn, outSystemPaintRgn, refCon, userUPP) (OSStatus)CALL_SIX_PARAMETER_UPP((userUPP), uppWindowPaintProcInfo, (device), (qdContext), (window), (inClientPaintRgn), (outSystemPaintRgn), (refCon))
  1213. #endif
  1214. #endif
  1215. #if CALL_NOT_IN_CARBON || OLDROUTINENAMES
  1216. /* support for pre-Carbon UPP routines: New...Proc and Call...Proc */
  1217. #define NewWindowDefProc(userRoutine) NewWindowDefUPP(userRoutine)
  1218. #define NewDeskHookProc(userRoutine) NewDeskHookUPP(userRoutine)
  1219. #define NewWindowPaintProc(userRoutine) NewWindowPaintUPP(userRoutine)
  1220. #define CallWindowDefProc(userRoutine, varCode, window, message, param) InvokeWindowDefUPP(varCode, window, message, param, userRoutine)
  1221. #define CallDeskHookProc(userRoutine, mouseClick, theEvent) InvokeDeskHookUPP(mouseClick, theEvent, userRoutine)
  1222. #define CallWindowPaintProc(userRoutine, device, qdContext, window, inClientPaintRgn, outSystemPaintRgn, refCon) InvokeWindowPaintUPP(device, qdContext, window, inClientPaintRgn, outSystemPaintRgn, refCon, userRoutine)
  1223. #endif /* CALL_NOT_IN_CARBON */
  1224. /*--------------------------------------------------------------------------------------*/
  1225. /* o Window Definition Spec. Used in Carbon to specify the code that defines a window. */
  1226. /*--------------------------------------------------------------------------------------*/
  1227. enum {
  1228. kWindowDefProcPtr = 0, /* raw proc-ptr based access*/
  1229. kWindowDefObjectClass = 1, /* event-based definition (Carbon 1.1 or later)*/
  1230. kWindowDefProcID = 2, /* explicit proc ID; overrides the window class default proc ID*/
  1231. kWindowDefHIView = 3 /* this window uses a view as its frame, not a WDEF*/
  1232. };
  1233. typedef UInt32 WindowDefType;
  1234. struct WindowDefSpec {
  1235. WindowDefType defType;
  1236. union {
  1237. WindowDefUPP defProc;
  1238. void * classRef;
  1239. short procID;
  1240. void * rootView; /* ControlRef*/
  1241. } u;
  1242. };
  1243. typedef struct WindowDefSpec WindowDefSpec;
  1244. typedef WindowDefSpec * WindowDefSpecPtr;
  1245. /*--------------------------------------------------------------------------------------*/
  1246. /* o Window Creation & Persistence */
  1247. /*--------------------------------------------------------------------------------------*/
  1248. /*
  1249. * GetNewCWindow()
  1250. *
  1251. * Availability:
  1252. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  1253. * CarbonLib: in CarbonLib 1.0 and later
  1254. * Mac OS X: in version 10.0 and later
  1255. */
  1256. EXTERN_API( WindowRef )
  1257. GetNewCWindow(
  1258. short windowID,
  1259. void * wStorage,
  1260. WindowRef behind) ONEWORDINLINE(0xAA46);
  1261. /*
  1262. * NewWindow()
  1263. *
  1264. * Availability:
  1265. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  1266. * CarbonLib: in CarbonLib 1.0 and later
  1267. * Mac OS X: in version 10.0 and later
  1268. */
  1269. EXTERN_API( WindowRef )
  1270. NewWindow(
  1271. void * wStorage,
  1272. const Rect * boundsRect,
  1273. ConstStr255Param title,
  1274. Boolean visible,
  1275. short theProc,
  1276. WindowRef behind,
  1277. Boolean goAwayFlag,
  1278. long refCon) ONEWORDINLINE(0xA913);
  1279. /*
  1280. * GetNewWindow()
  1281. *
  1282. * Availability:
  1283. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  1284. * CarbonLib: in CarbonLib 1.0 and later
  1285. * Mac OS X: in version 10.0 and later
  1286. */
  1287. EXTERN_API( WindowRef )
  1288. GetNewWindow(
  1289. short windowID,
  1290. void * wStorage,
  1291. WindowRef behind) ONEWORDINLINE(0xA9BD);
  1292. /*
  1293. * NewCWindow()
  1294. *
  1295. * Availability:
  1296. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  1297. * CarbonLib: in CarbonLib 1.0 and later
  1298. * Mac OS X: in version 10.0 and later
  1299. */
  1300. EXTERN_API( WindowRef )
  1301. NewCWindow(
  1302. void * wStorage,
  1303. const Rect * boundsRect,
  1304. ConstStr255Param title,
  1305. Boolean visible,
  1306. short procID,
  1307. WindowRef behind,
  1308. Boolean goAwayFlag,
  1309. long refCon) ONEWORDINLINE(0xAA45);
  1310. /*
  1311. * DisposeWindow()
  1312. *
  1313. * Availability:
  1314. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  1315. * CarbonLib: in CarbonLib 1.0 and later
  1316. * Mac OS X: in version 10.0 and later
  1317. */
  1318. EXTERN_API( void )
  1319. DisposeWindow(WindowRef window) ONEWORDINLINE(0xA914);
  1320. #if CALL_NOT_IN_CARBON
  1321. /*
  1322. * [Mac]CloseWindow()
  1323. *
  1324. * Availability:
  1325. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  1326. * CarbonLib: not available
  1327. * Mac OS X: not available
  1328. */
  1329. #if TARGET_OS_MAC
  1330. #define MacCloseWindow CloseWindow
  1331. #endif
  1332. EXTERN_API( void )
  1333. MacCloseWindow(WindowRef window) ONEWORDINLINE(0xA92D);
  1334. /*
  1335. Routines available from Mac OS 8.5 forward
  1336. or from Mac OS 8.1 forward when linking to CarbonLib 1.0 forward
  1337. */
  1338. #endif /* CALL_NOT_IN_CARBON */
  1339. /*
  1340. * CreateNewWindow()
  1341. *
  1342. * Availability:
  1343. * Non-Carbon CFM: in WindowsLib 8.5 and later
  1344. * CarbonLib: in CarbonLib 1.0 and later
  1345. * Mac OS X: in version 10.0 and later
  1346. */
  1347. EXTERN_API( OSStatus )
  1348. CreateNewWindow(
  1349. WindowClass windowClass,
  1350. WindowAttributes attributes,
  1351. const Rect * contentBounds,
  1352. WindowRef * outWindow);
  1353. /* Routines available from Mac OS 8.5 forward*/
  1354. /* Create a window from a 'wind' resource*/
  1355. /*
  1356. * CreateWindowFromResource()
  1357. *
  1358. * Availability:
  1359. * Non-Carbon CFM: in WindowsLib 8.5 and later
  1360. * CarbonLib: in CarbonLib 1.0 and later
  1361. * Mac OS X: in version 10.0 and later
  1362. */
  1363. EXTERN_API( OSStatus )
  1364. CreateWindowFromResource(
  1365. SInt16 resID,
  1366. WindowRef * outWindow);
  1367. /* window persistence*/
  1368. /*
  1369. * StoreWindowIntoCollection()
  1370. *
  1371. * Availability:
  1372. * Non-Carbon CFM: in WindowsLib 8.5 and later
  1373. * CarbonLib: in CarbonLib 1.0 and later
  1374. * Mac OS X: in version 10.0 and later
  1375. */
  1376. EXTERN_API( OSStatus )
  1377. StoreWindowIntoCollection(
  1378. WindowRef window,
  1379. Collection collection);
  1380. /*
  1381. * CreateWindowFromCollection()
  1382. *
  1383. * Availability:
  1384. * Non-Carbon CFM: in WindowsLib 8.5 and later
  1385. * CarbonLib: in CarbonLib 1.0 and later
  1386. * Mac OS X: in version 10.0 and later
  1387. */
  1388. EXTERN_API( OSStatus )
  1389. CreateWindowFromCollection(
  1390. Collection collection,
  1391. WindowRef * outWindow);
  1392. /* window refcounting*/
  1393. /*
  1394. * GetWindowOwnerCount()
  1395. *
  1396. * Availability:
  1397. * Non-Carbon CFM: in WindowsLib 8.5 and later
  1398. * CarbonLib: in CarbonLib 1.0 and later
  1399. * Mac OS X: in version 10.0 and later
  1400. */
  1401. EXTERN_API( OSStatus )
  1402. GetWindowOwnerCount(
  1403. WindowRef window,
  1404. UInt32 * outCount);
  1405. /*
  1406. * CloneWindow()
  1407. *
  1408. * Availability:
  1409. * Non-Carbon CFM: in WindowsLib 8.5 and later
  1410. * CarbonLib: in CarbonLib 1.0 and later
  1411. * Mac OS X: in version 10.0 and later
  1412. */
  1413. EXTERN_API( OSStatus )
  1414. CloneWindow(WindowRef window);
  1415. /*
  1416. * GetWindowRetainCount()
  1417. *
  1418. * Summary:
  1419. * Returns the retain count of a window.
  1420. *
  1421. * Discussion:
  1422. * This API is equivalent to GetWindowOwnerCount. For consistency
  1423. * with CoreFoundation and Carbon Events, it is preferred over
  1424. * GetWindowOwnerCount. Both APIs will continue to be supported.
  1425. *
  1426. * Parameters:
  1427. *
  1428. * inWindow:
  1429. * The window whose retain count to retrieve.
  1430. *
  1431. * Availability:
  1432. * Non-Carbon CFM: not available
  1433. * CarbonLib: in CarbonLib 1.1 and later
  1434. * Mac OS X: in version 10.0 and later
  1435. */
  1436. EXTERN_API( ItemCount )
  1437. GetWindowRetainCount(WindowRef inWindow);
  1438. /*
  1439. * RetainWindow()
  1440. *
  1441. * Summary:
  1442. * Increments the retain count of a window.
  1443. *
  1444. * Discussion:
  1445. * This API is equivalent to CloneWindow. For consistency with
  1446. * CoreFoundation and Carbon Events, it is preferred over
  1447. * CloneWindow. Both APIs will continue to be supported.
  1448. *
  1449. * Parameters:
  1450. *
  1451. * inWindow:
  1452. * The window whose retain count to increment.
  1453. *
  1454. * Availability:
  1455. * Non-Carbon CFM: not available
  1456. * CarbonLib: in CarbonLib 1.1 and later
  1457. * Mac OS X: in version 10.0 and later
  1458. */
  1459. EXTERN_API( OSStatus )
  1460. RetainWindow(WindowRef inWindow);
  1461. /*
  1462. * ReleaseWindow()
  1463. *
  1464. * Summary:
  1465. * Decrements the retain count of a window, and destroys the window
  1466. * if the retain count falls to zero.
  1467. *
  1468. * Discussion:
  1469. * This API is equivalent to DisposeWindow. For consistency with
  1470. * CoreFoundation and Carbon Events, it is preferred over
  1471. * DisposeWindow. Both APIs will continue to be supported.
  1472. *
  1473. * Parameters:
  1474. *
  1475. * inWindow:
  1476. * The window whose retain count to decrement.
  1477. *
  1478. * Availability:
  1479. * Non-Carbon CFM: not available
  1480. * CarbonLib: in CarbonLib 1.1 and later
  1481. * Mac OS X: in version 10.0 and later
  1482. */
  1483. EXTERN_API( OSStatus )
  1484. ReleaseWindow(WindowRef inWindow);
  1485. /*--------------------------------------------------------------------------------------*/
  1486. /* o Custom Windows */
  1487. /*--------------------------------------------------------------------------------------*/
  1488. /* Routines available from Mac OS 8.1 forward when linking to CarbonLib 1.0 forward*/
  1489. /*
  1490. * CreateCustomWindow()
  1491. *
  1492. * Availability:
  1493. * Non-Carbon CFM: not available
  1494. * CarbonLib: in CarbonLib 1.0 and later
  1495. * Mac OS X: in version 10.0 and later
  1496. */
  1497. EXTERN_API( OSStatus )
  1498. CreateCustomWindow(
  1499. const WindowDefSpec * def,
  1500. WindowClass windowClass,
  1501. WindowAttributes attributes,
  1502. const Rect * contentBounds,
  1503. WindowRef * outWindow);
  1504. /*
  1505. * ReshapeCustomWindow()
  1506. *
  1507. * Availability:
  1508. * Non-Carbon CFM: not available
  1509. * CarbonLib: in CarbonLib 1.0 and later
  1510. * Mac OS X: in version 10.0 and later
  1511. */
  1512. EXTERN_API( OSStatus )
  1513. ReshapeCustomWindow(WindowRef window);
  1514. /*
  1515. * RegisterWindowDefinition()
  1516. *
  1517. * Summary:
  1518. * Registers or unregisters a binding between a resource ID and a
  1519. * window definition function.
  1520. *
  1521. * Discussion:
  1522. * In the Mac OS 8.x Window Manager, a 'WIND' resource can contain
  1523. * an embedded WDEF procID that is used by the Window Manager as the
  1524. * resource ID of an 'WDEF' resource to lay out and draw the window.
  1525. * The 'WDEF' resource is loaded by the Window Manager when you load
  1526. * the menu with GetNewWindow. Since WDEFs can no longer be packaged
  1527. * as code resources on Carbon, the procID can no longer refer
  1528. * directly to a WDEF resource. However, using
  1529. * RegisterWindowDefinition you can instead specify a
  1530. * UniversalProcPtr pointing to code in your application code
  1531. * fragment. RegisterWindowDefinition is available when linking to
  1532. * CarbonLib 1.1 forward.
  1533. *
  1534. * Parameters:
  1535. *
  1536. * inResID:
  1537. * A WDEF proc ID, as used in a 'WIND' resource.
  1538. *
  1539. * inDefSpec:
  1540. * Specifies the WindowDefUPP that should be used for windows with
  1541. * the given WDEF proc ID. Passing NULL allows you to unregister
  1542. * the window definition that had been associated with the given
  1543. * WDEF proc ID.
  1544. *
  1545. * Availability:
  1546. * Non-Carbon CFM: not available
  1547. * CarbonLib: in CarbonLib 1.1 and later
  1548. * Mac OS X: in version 10.0 and later
  1549. */
  1550. EXTERN_API( OSStatus )
  1551. RegisterWindowDefinition(
  1552. SInt16 inResID,
  1553. const WindowDefSpec * inDefSpec);
  1554. /*--------------------------------------------------------------------------------------*/
  1555. /* o Window part tracking */
  1556. /*--------------------------------------------------------------------------------------*/
  1557. /*
  1558. Routines available from Mac OS 8.5 forward
  1559. (or from Mac OS 8.6 forward when linking to CarbonLib 1.1 forward)
  1560. */
  1561. /*
  1562. * GetWindowWidgetHilite()
  1563. *
  1564. * Availability:
  1565. * Non-Carbon CFM: in WindowsLib 8.5 and later
  1566. * CarbonLib: in CarbonLib 1.0 and later
  1567. * Mac OS X: in version 10.0 and later
  1568. */
  1569. EXTERN_API( OSStatus )
  1570. GetWindowWidgetHilite(
  1571. WindowRef inWindow,
  1572. WindowDefPartCode * outHilite);
  1573. /*--------------------------------------------------------------------------------------*/
  1574. /* o Window Metainformation Accessors */
  1575. /*--------------------------------------------------------------------------------------*/
  1576. /*
  1577. * IsValidWindowClass()
  1578. *
  1579. * Summary:
  1580. * Indicates whether a window class is supported by the Window
  1581. * Manager.
  1582. *
  1583. * Parameters:
  1584. *
  1585. * inClass:
  1586. * The window class.
  1587. *
  1588. * Availability:
  1589. * Non-Carbon CFM: not available
  1590. * CarbonLib: in CarbonLib 1.5 and later
  1591. * Mac OS X: in version 10.1 and later
  1592. */
  1593. EXTERN_API_C( Boolean )
  1594. IsValidWindowClass(WindowClass inClass);
  1595. /*
  1596. * GetAvailableWindowAttributes()
  1597. *
  1598. * Summary:
  1599. * Returns the window attributes that are valid for a window class.
  1600. *
  1601. * Discussion:
  1602. * This API is useful because some window classes support different
  1603. * attributes on different platforms (for example, floating windows
  1604. * can have collapse boxes on 9, but not on X), and the Window
  1605. * Manager will return an error if you attempt to create a window
  1606. * with attributes that aren't supported for the requested window
  1607. * class. You can use this API to remove attributes that are not
  1608. * supported by the current platform before calling CreateNewWindow.
  1609. *
  1610. * Parameters:
  1611. *
  1612. * inClass:
  1613. * The window class.
  1614. *
  1615. * Result:
  1616. * The window attributes that are supported for the specified window
  1617. * class.
  1618. *
  1619. * Availability:
  1620. * Non-Carbon CFM: not available
  1621. * CarbonLib: in CarbonLib 1.5 and later
  1622. * Mac OS X: in version 10.1 and later
  1623. */
  1624. EXTERN_API_C( WindowAttributes )
  1625. GetAvailableWindowAttributes(WindowClass inClass);
  1626. /*
  1627. Routines available from Mac OS 8.5 forward
  1628. or from Mac OS 8.1 forward when linking to CarbonLib 1.0 forward
  1629. */
  1630. /*
  1631. * GetWindowClass()
  1632. *
  1633. * Availability:
  1634. * Non-Carbon CFM: in WindowsLib 8.5 and later
  1635. * CarbonLib: in CarbonLib 1.0 and later
  1636. * Mac OS X: in version 10.0 and later
  1637. */
  1638. EXTERN_API( OSStatus )
  1639. GetWindowClass(
  1640. WindowRef window,
  1641. WindowClass * outClass);
  1642. /*
  1643. * GetWindowAttributes()
  1644. *
  1645. * Availability:
  1646. * Non-Carbon CFM: in WindowsLib 8.5 and later
  1647. * CarbonLib: in CarbonLib 1.0 and later
  1648. * Mac OS X: in version 10.0 and later
  1649. */
  1650. EXTERN_API( OSStatus )
  1651. GetWindowAttributes(
  1652. WindowRef window,
  1653. WindowAttributes * outAttributes);
  1654. /*
  1655. Routines available from Mac OS 9.0 forward
  1656. or from Mac OS 8.1 forward when linking to CarbonLib 1.0 forward
  1657. */
  1658. /*
  1659. * ChangeWindowAttributes()
  1660. *
  1661. * Availability:
  1662. * Non-Carbon CFM: not available
  1663. * CarbonLib: in CarbonLib 1.0 and later
  1664. * Mac OS X: in version 10.0 and later
  1665. */
  1666. EXTERN_API( OSStatus )
  1667. ChangeWindowAttributes(
  1668. WindowRef window,
  1669. WindowAttributes setTheseAttributes,
  1670. WindowAttributes clearTheseAttributes);
  1671. /*
  1672. WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING
  1673. WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING
  1674. SetWindowClass will disappear in the near future. Instead of SetWindowClass,
  1675. you should use SetWindowGroup to move a window into the group of the desired
  1676. class. This API is very dangerous in that is actually does change the class
  1677. of the window, but class was meant to be an immutable property of the window.
  1678. At the very least, this API will be modified to only change the layer of the
  1679. window to match the layer that the specified class normally lives in. Consider
  1680. yourself warned!
  1681. WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING
  1682. WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING
  1683. */
  1684. /*
  1685. * SetWindowClass()
  1686. *
  1687. * Summary:
  1688. * Changes the window class of a window.
  1689. *
  1690. * Discussion:
  1691. * SetWindowClass changes the class of a window. It also changes the
  1692. * window's z-order so that it is grouped with other windows of the
  1693. * same class. It does not change the visual appearance of the
  1694. * window. In CarbonLib, SetWindowClass may not be used to change a
  1695. * non-utility window to have utility window class, or to make a
  1696. * utility window have non-utility class. SetWindowClass is
  1697. * available from CarbonLib 1.1 forward.
  1698. *
  1699. * Parameters:
  1700. *
  1701. * inWindow:
  1702. * The window whose class to change.
  1703. *
  1704. * inWindowClass:
  1705. * The new window class.
  1706. *
  1707. * Availability:
  1708. * Non-Carbon CFM: not available
  1709. * CarbonLib: in CarbonLib 1.1 and later
  1710. * Mac OS X: in version 10.0 and later
  1711. */
  1712. EXTERN_API( OSStatus )
  1713. SetWindowClass(
  1714. WindowRef inWindow,
  1715. WindowClass inWindowClass);
  1716. /*--------------------------------------------------------------------------------------*/
  1717. /* o Window Modality */
  1718. /*--------------------------------------------------------------------------------------*/
  1719. /*
  1720. * WindowModality
  1721. *
  1722. */
  1723. typedef UInt32 WindowModality;
  1724. enum {
  1725. /*
  1726. * A window does not prevent interaction with any other window in the
  1727. * system.
  1728. */
  1729. kWindowModalityNone = 0,
  1730. /*
  1731. * A window prevents interaction with all other windows in the
  1732. * system. Only available in CarbonLib. Mapped to
  1733. * kWindowModalityAppModal in Mac OS X.
  1734. */
  1735. kWindowModalitySystemModal = 1,
  1736. /*
  1737. * A window prevents interaction with other windows in the same
  1738. * process.
  1739. */
  1740. kWindowModalityAppModal = 2,
  1741. /*
  1742. * A window prevents interaction with a single other window.
  1743. */
  1744. kWindowModalityWindowModal = 3
  1745. };
  1746. /*
  1747. * SetWindowModality()
  1748. *
  1749. * Summary:
  1750. * Sets the modality of a window.
  1751. *
  1752. * Discussion:
  1753. * The modality of a window is used by the Carbon event manager to
  1754. * automatically determine appropriate event handling.
  1755. *
  1756. * Parameters:
  1757. *
  1758. * inWindow:
  1759. * The window whose modality to set.
  1760. *
  1761. * inModalKind:
  1762. * The new modality for the window.
  1763. *
  1764. * inUnavailableWindow:
  1765. * If the window is becoming window-modal, this parameter
  1766. * specifies the window to which the inWindow parameter is modal.
  1767. * The unavailableWindow will not be available while inWindow is
  1768. * in window-modal state.
  1769. *
  1770. * Availability:
  1771. * Non-Carbon CFM: not available
  1772. * CarbonLib: in CarbonLib 1.1 and later
  1773. * Mac OS X: in version 10.0 and later
  1774. */
  1775. EXTERN_API( OSStatus )
  1776. SetWindowModality(
  1777. WindowRef inWindow,
  1778. WindowModality inModalKind,
  1779. WindowRef inUnavailableWindow);
  1780. /*
  1781. * GetWindowModality()
  1782. *
  1783. * Summary:
  1784. * Retrieves the modality of a window.
  1785. *
  1786. * Parameters:
  1787. *
  1788. * inWindow:
  1789. * The window whose modality to retrieve.
  1790. *
  1791. * outModalKind:
  1792. * On exit, contains the modality of the window.
  1793. *
  1794. * outUnavailableWindow:
  1795. * On exit, if.the window is window-modal, contains the target
  1796. * window of the specified window's modality.
  1797. *
  1798. * Availability:
  1799. * Non-Carbon CFM: not available
  1800. * CarbonLib: in CarbonLib 1.1 and later
  1801. * Mac OS X: in version 10.0 and later
  1802. */
  1803. EXTERN_API( OSStatus )
  1804. GetWindowModality(
  1805. WindowRef inWindow,
  1806. WindowModality * outModalKind,
  1807. WindowRef * outUnavailableWindow); /* can be NULL */
  1808. /*--------------------------------------------------------------------------------------*/
  1809. /* o Floating Windows */
  1810. /*--------------------------------------------------------------------------------------*/
  1811. /*
  1812. Routines available from Mac OS 8.6 forward
  1813. or from Mac OS 8.1 forward when linking to CarbonLib 1.0 forward
  1814. */
  1815. /*
  1816. * ShowFloatingWindows()
  1817. *
  1818. * Availability:
  1819. * Non-Carbon CFM: in WindowsLib 8.5 and later
  1820. * CarbonLib: in CarbonLib 1.0 and later
  1821. * Mac OS X: in version 10.0 and later
  1822. */
  1823. EXTERN_API( OSStatus )
  1824. ShowFloatingWindows(void);
  1825. /*
  1826. * HideFloatingWindows()
  1827. *
  1828. * Availability:
  1829. * Non-Carbon CFM: in WindowsLib 8.5 and later
  1830. * CarbonLib: in CarbonLib 1.0 and later
  1831. * Mac OS X: in version 10.0 and later
  1832. */
  1833. EXTERN_API( OSStatus )
  1834. HideFloatingWindows(void);
  1835. /*
  1836. * AreFloatingWindowsVisible()
  1837. *
  1838. * Availability:
  1839. * Non-Carbon CFM: in WindowsLib 8.5 and later
  1840. * CarbonLib: in CarbonLib 1.0 and later
  1841. * Mac OS X: in version 10.0 and later
  1842. */
  1843. EXTERN_API( Boolean )
  1844. AreFloatingWindowsVisible(void);
  1845. /*--------------------------------------------------------------------------------------*/
  1846. /* o Window Groups */
  1847. /* */
  1848. /* The Window Group API allows the creation and management of groups of windows, */
  1849. /* allowing control of the z-order, activation, and positioning of the windows. */
  1850. /* Internally to the Window Manager, each of the standard window tiers (document, */
  1851. /* toolbar, floating, modal, utility, help, and overlay) is implemented as a window */
  1852. /* group; you can access the window group for a class with GetWindowGroupOfClass. */
  1853. /* You can create your own window groups, if you would like your windows to float, */
  1854. /* for example, above the floating window layer but below the modal layer. It is */
  1855. /* also possible to create more complex hierarchical arrangements of window groups. */
  1856. /*--------------------------------------------------------------------------------------*/
  1857. typedef struct OpaqueWindowGroupRef* WindowGroupRef;
  1858. /* may be passed as the "behindWindow" parameter to NewCWindow and SendBehind*/
  1859. #define kFirstWindowOfGroup ((WindowRef)(-1))
  1860. #define kLastWindowOfGroup ((WindowRef)NULL)
  1861. /* may be passed as the "behindGroup" parameter to SendWindowGroupBehind*/
  1862. #define kFirstWindowGroup ((WindowGroupRef)(-1))
  1863. #define kLastWindowGroup ((WindowGroupRef)NULL)
  1864. /*
  1865. * WindowGroupAttributes
  1866. *
  1867. * Summary:
  1868. * These are attributes that may be applied to a window group.
  1869. */
  1870. typedef UInt32 WindowGroupAttributes;
  1871. enum {
  1872. /*
  1873. * Makes the group behave somewhat as a layer of windows that move
  1874. * together. When any window in the group is brought to the front of
  1875. * the group, the entire group will also be brought to the front of
  1876. * the containing group's child hierarchy.
  1877. */
  1878. kWindowGroupAttrSelectAsLayer = 1 << 0,
  1879. /*
  1880. * The positions of the contents of this group with respect to each
  1881. * other cannot be changed. When one item moves, all other items are
  1882. * moved simultaneously.
  1883. */
  1884. kWindowGroupAttrMoveTogether = 1 << 1,
  1885. /*
  1886. * The z-order of the contents of this group with respect to each
  1887. * other cannot be changed. When one item changes z-order, all other
  1888. * items are moved simulataneously. For purposes of z-ordering, the
  1889. * group and all its subgroups are effectively treated as if they
  1890. * were a single window in the parent group of this group.
  1891. */
  1892. kWindowGroupAttrLayerTogether = 1 << 2,
  1893. /*
  1894. * The active state of the windows in this group is shared. The
  1895. * windows in the group are activated or deactivated according to the
  1896. * activation scope of the group, but when any window in the group
  1897. * changes activation, all other windows change to match.
  1898. */
  1899. kWindowGroupAttrSharedActivation = 1 << 3,
  1900. /*
  1901. * When any window in this group is collapsed, all other windows in
  1902. * this group are hidden. All subgroups of this group are also
  1903. * examined for the HideOnCollapse attribute, and any the windows of
  1904. * any subgroup with this attribute are also hidden. All windows will
  1905. * be shown again when the collapsed window is expanded.
  1906. */
  1907. kWindowGroupAttrHideOnCollapse = 1 << 4
  1908. };
  1909. /*
  1910. * WindowActivationScope
  1911. *
  1912. * Discussion:
  1913. * Every window has a WindowActivationScope. It defines how windows
  1914. * are activated by the Window Manager with respect to other windows
  1915. * in the window's group and in the current process.
  1916. */
  1917. typedef UInt32 WindowActivationScope;
  1918. enum {
  1919. /*
  1920. * Windows with this scope are never activated by the Window Manager.
  1921. * This should be used when the window's visual state does not change
  1922. * based on activation (for example, tooltip windows), or when the
  1923. * client wishes to manually control all activation. The window owner
  1924. * is free to explicitly activate windows using the ActivateWindow
  1925. * and DeactivateWindow APIs.
  1926. */
  1927. kWindowActivationScopeNone = 0,
  1928. /*
  1929. * Windows with this scope are always active if visible. Windows with
  1930. * this scope are unaffected by the activation state of other
  1931. * windows. This activation scope is automatically used by floating
  1932. * windows.
  1933. */
  1934. kWindowActivationScopeIndependent = 1,
  1935. /*
  1936. * Windows with this scope are activated relative to other windows
  1937. * with the same scope in the current process. Only one window with
  1938. * this scope can be active in the entire process. This activation
  1939. * scope is automatically used by document and dialog windows.
  1940. */
  1941. kWindowActivationScopeAll = 2
  1942. };
  1943. /*
  1944. * Summary:
  1945. * These are constants that can be used for the inNextGroup
  1946. * parameter to GetSiblingWindowGroup.
  1947. */
  1948. enum {
  1949. /*
  1950. * Indicates that GetSiblingWindowGroup should return the next deeper
  1951. * sibling group in the z-order.
  1952. */
  1953. kNextWindowGroup = true,
  1954. /*
  1955. * Indicates that GetSiblingWindowGroup should return the next higher
  1956. * sibling group in the z-order.
  1957. */
  1958. kPreviousWindowGroup = false
  1959. };
  1960. /*
  1961. * WindowGroupContentOptions
  1962. *
  1963. * Discussion:
  1964. * Window group contents options are used to control what group
  1965. * content is counted or returned by the CountWindowGroupContents
  1966. * and GetWindowGroupContents APIs.
  1967. */
  1968. typedef UInt32 WindowGroupContentOptions;
  1969. enum {
  1970. /*
  1971. * Indicates that Count/GetWindowGroupContents should return the
  1972. * windows in a group. If this option is not set, these APIs return
  1973. * the groups in a group.
  1974. */
  1975. kWindowGroupContentsReturnWindows = 1 << 0,
  1976. /*
  1977. * Indicates that Count/GetWindowGroupContents should include the
  1978. * contents of groups contained by the specified group. If this
  1979. * option is not set, these APIs only return information about the
  1980. * specified group's contents.
  1981. */
  1982. kWindowGroupContentsRecurse = 1 << 1,
  1983. /*
  1984. * Indicates that Count/GetWindowGroupContents should only include
  1985. * visible windows. Only valid when kWindowGroupContentsReturnWindows
  1986. * is specified.
  1987. */
  1988. kWindowGroupContentsVisible = 1 << 2
  1989. };
  1990. /*----------------------------------------------------------------------------------*/
  1991. /* o Group creation, destruction, and refcounting */
  1992. /*----------------------------------------------------------------------------------*/
  1993. /*
  1994. * CreateWindowGroup()
  1995. *
  1996. * Summary:
  1997. * Creates a new window group.
  1998. *
  1999. * Parameters:
  2000. *
  2001. * inAttributes:
  2002. * Attributes for the new window group.
  2003. *
  2004. * outGroup:
  2005. * On exit, contains the new window group.
  2006. *
  2007. * Availability:
  2008. * Non-Carbon CFM: not available
  2009. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.0 and later
  2010. * Mac OS X: in version 10.0 and later
  2011. */
  2012. EXTERN_API_C( OSStatus )
  2013. CreateWindowGroup(
  2014. WindowGroupAttributes inAttributes,
  2015. WindowGroupRef * outGroup);
  2016. /*
  2017. * RetainWindowGroup()
  2018. *
  2019. * Summary:
  2020. * Increments the refcount of a window group.
  2021. *
  2022. * Parameters:
  2023. *
  2024. * inGroup:
  2025. * The group whose refcount to increment.
  2026. *
  2027. * Availability:
  2028. * Non-Carbon CFM: not available
  2029. * CarbonLib: in CarbonLib 1.4 and later
  2030. * Mac OS X: in version 10.0 and later
  2031. */
  2032. EXTERN_API_C( OSStatus )
  2033. RetainWindowGroup(WindowGroupRef inGroup);
  2034. /*
  2035. * ReleaseWindowGroup()
  2036. *
  2037. * Summary:
  2038. * Releases a refcount on a window group. If the refcount goes to
  2039. * zero, the group is destroyed, and a refcount is released from all
  2040. * contained objects.
  2041. *
  2042. * Parameters:
  2043. *
  2044. * inGroup:
  2045. * The group whose refcount to decrement.
  2046. *
  2047. * Availability:
  2048. * Non-Carbon CFM: not available
  2049. * CarbonLib: in CarbonLib 1.4 and later
  2050. * Mac OS X: in version 10.0 and later
  2051. */
  2052. EXTERN_API_C( OSStatus )
  2053. ReleaseWindowGroup(WindowGroupRef inGroup);
  2054. /*
  2055. * GetWindowGroupRetainCount()
  2056. *
  2057. * Summary:
  2058. * Returns the refcount of a window group.
  2059. *
  2060. * Parameters:
  2061. *
  2062. * inGroup:
  2063. * The group whose refcount to return.
  2064. *
  2065. * Availability:
  2066. * Non-Carbon CFM: not available
  2067. * CarbonLib: in CarbonLib 1.4 and later
  2068. * Mac OS X: in version 10.1 and later
  2069. */
  2070. EXTERN_API_C( ItemCount )
  2071. GetWindowGroupRetainCount(WindowGroupRef inGroup);
  2072. /*
  2073. * GetWindowGroupOfClass()
  2074. *
  2075. * Summary:
  2076. * Gets the window group in which windows of a given class are
  2077. * placed.
  2078. *
  2079. * Discussion:
  2080. * The Window Manager uses window groups internally to manage the
  2081. * ordering of windows of different classes. In some cases, multiple
  2082. * classes are placed within the same group; for example, windows
  2083. * from all of the modal and alert window classes are placed into
  2084. * the same modal window group. The refcount of the group returned
  2085. * by this API is not incremented, and the caller does not need to
  2086. * release the reference.
  2087. *
  2088. * Parameters:
  2089. *
  2090. * windowClass:
  2091. * The class whose window group to retrieve. You may pass
  2092. * kAllWindowClasses to retrieve the root window group.
  2093. *
  2094. * Availability:
  2095. * Non-Carbon CFM: not available
  2096. * CarbonLib: in CarbonLib 1.4 and later
  2097. * Mac OS X: in version 10.0 and later
  2098. */
  2099. EXTERN_API_C( WindowGroupRef )
  2100. GetWindowGroupOfClass(WindowClass windowClass);
  2101. /*----------------------------------------------------------------------------------*/
  2102. /* o.Group name, attributes, and level */
  2103. /*----------------------------------------------------------------------------------*/
  2104. /*
  2105. * SetWindowGroupName()
  2106. *
  2107. * Summary:
  2108. * Sets the name of a window group.
  2109. *
  2110. * Discussion:
  2111. * The name of a window group is never displayed to the user.
  2112. * However, it is displayed by debugging functions such as
  2113. * DebugPrintWindowGroup. This can be very useful when debugging the
  2114. * structure of your window groups.
  2115. *
  2116. * Parameters:
  2117. *
  2118. * inGroup:
  2119. * The group whose name to set.
  2120. *
  2121. * inName:
  2122. * The name of the group.
  2123. *
  2124. * Availability:
  2125. * Non-Carbon CFM: not available
  2126. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.0 and later
  2127. * Mac OS X: in version 10.0 and later
  2128. */
  2129. EXTERN_API_C( OSStatus )
  2130. SetWindowGroupName(
  2131. WindowGroupRef inGroup,
  2132. CFStringRef inName);
  2133. /*
  2134. * CopyWindowGroupName()
  2135. *
  2136. * Summary:
  2137. * Returns a copy of the name of a window group.
  2138. *
  2139. * Parameters:
  2140. *
  2141. * inGroup:
  2142. * The group whose name to retrieve.
  2143. *
  2144. * outName:
  2145. * On exit, contains the name of the group. It is the caller's
  2146. * responsibility to release the name.
  2147. *
  2148. * Availability:
  2149. * Non-Carbon CFM: not available
  2150. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.0 and later
  2151. * Mac OS X: in version 10.0 and later
  2152. */
  2153. EXTERN_API_C( OSStatus )
  2154. CopyWindowGroupName(
  2155. WindowGroupRef inGroup,
  2156. CFStringRef * outName);
  2157. /*
  2158. * GetWindowGroupAttributes()
  2159. *
  2160. * Summary:
  2161. * Retrieves the attributes of a window group.
  2162. *
  2163. * Parameters:
  2164. *
  2165. * inGroup:
  2166. * The group whose attributes to retrieve.
  2167. *
  2168. * outAttributes:
  2169. * On exit, the group's attributes.
  2170. *
  2171. * Availability:
  2172. * Non-Carbon CFM: not available
  2173. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.0 and later
  2174. * Mac OS X: in version 10.0 and later
  2175. */
  2176. EXTERN_API_C( OSStatus )
  2177. GetWindowGroupAttributes(
  2178. WindowGroupRef inGroup,
  2179. WindowGroupAttributes * outAttributes);
  2180. /*
  2181. * ChangeWindowGroupAttributes()
  2182. *
  2183. * Summary:
  2184. * Changes the attributes of a window group.
  2185. *
  2186. * Parameters:
  2187. *
  2188. * inGroup:
  2189. * The group whose attributes to change.
  2190. *
  2191. * setTheseAttributes:
  2192. * The attributes to set.
  2193. *
  2194. * clearTheseAttributes:
  2195. * The attributes to clear.
  2196. *
  2197. * Availability:
  2198. * Non-Carbon CFM: not available
  2199. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.0 and later
  2200. * Mac OS X: in version 10.0 and later
  2201. */
  2202. EXTERN_API_C( OSStatus )
  2203. ChangeWindowGroupAttributes(
  2204. WindowGroupRef inGroup,
  2205. WindowGroupAttributes setTheseAttributes,
  2206. WindowGroupAttributes clearTheseAttributes);
  2207. /*
  2208. * SetWindowGroupLevel()
  2209. *
  2210. * Summary:
  2211. * Sets the CoreGraphics window group level of windows in a group.
  2212. *
  2213. * Discussion:
  2214. * CoreGraphics windows (used to implement all windows in Carbon and
  2215. * Cocoa applications on Mac OS X) are divided into layers specified
  2216. * by a window level. Standard window levels are listed in
  2217. * <CoreGraphics/CGWindowLevel.h>. By default, a new window group
  2218. * has a window level of kCGNormalWindowLevel. When a window is
  2219. * placed into a window group, its window level is determined by the
  2220. * window level of its "base group". This is the containing group
  2221. * that is a child of the root group. For example, if group A is a
  2222. * child of the root group, and group B is a child of group A, and
  2223. * window C is in group B, then window C's base group is group A,
  2224. * and group A's window level determines the level of window C.
  2225. * SetWindowGroupLevel only allows changing the window level of
  2226. * groups that are children of the root group. It returns paramErr
  2227. * for other groups, since a group that is not a child of the root
  2228. * group is not a base group and changing its level has no effect.
  2229. * Changing the level of a group also changes the level of all
  2230. * windows currently contained by the group.
  2231. *
  2232. * Parameters:
  2233. *
  2234. * inGroup:
  2235. * The window group whose level to change.
  2236. *
  2237. * inLevel:
  2238. * The new level for the windows in this group.
  2239. *
  2240. * Availability:
  2241. * Non-Carbon CFM: not available
  2242. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.0 and later
  2243. * Mac OS X: in version 10.0 and later
  2244. */
  2245. EXTERN_API_C( OSStatus )
  2246. SetWindowGroupLevel(
  2247. WindowGroupRef inGroup,
  2248. SInt32 inLevel);
  2249. /*
  2250. * GetWindowGroupLevel()
  2251. *
  2252. * Summary:
  2253. * Gets the CoreGraphics window group level of windows in a group.
  2254. *
  2255. * Parameters:
  2256. *
  2257. * inGroup:
  2258. * The window group whose level to return.
  2259. *
  2260. * outLevel:
  2261. * On exit, contains the window level of the windows in this group.
  2262. *
  2263. * Availability:
  2264. * Non-Carbon CFM: not available
  2265. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.0 and later
  2266. * Mac OS X: in version 10.0 and later
  2267. */
  2268. EXTERN_API_C( OSStatus )
  2269. GetWindowGroupLevel(
  2270. WindowGroupRef inGroup,
  2271. SInt32 * outLevel);
  2272. /*----------------------------------------------------------------------------------*/
  2273. /* o.Group z-ordering */
  2274. /*----------------------------------------------------------------------------------*/
  2275. /*
  2276. * SendWindowGroupBehind()
  2277. *
  2278. * Summary:
  2279. * Changes the z-order of a group, if the group does not have the
  2280. * kWindowGroupAttributeLayerTogether attribute set.
  2281. *
  2282. * Discussion:
  2283. * SendWindowGroupBehind currently requires that the group being
  2284. * moved and the behindGroup have the same parent group.
  2285. *
  2286. * Parameters:
  2287. *
  2288. * inGroup:
  2289. * The group whose z-order to change.
  2290. *
  2291. * behindGroup:
  2292. * The group behind which to position the specified group.
  2293. *
  2294. * Availability:
  2295. * Non-Carbon CFM: not available
  2296. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.0 and later
  2297. * Mac OS X: in version 10.0 and later
  2298. */
  2299. EXTERN_API_C( OSStatus )
  2300. SendWindowGroupBehind(
  2301. WindowGroupRef inGroup,
  2302. WindowGroupRef behindGroup);
  2303. /*----------------------------------------------------------------------------------*/
  2304. /* o.Group containment hierarchy manipulation */
  2305. /*----------------------------------------------------------------------------------*/
  2306. /*
  2307. * GetWindowGroup()
  2308. *
  2309. * Summary:
  2310. * Gets the window group that contains a window.
  2311. *
  2312. * Discussion:
  2313. * The refcount of the group returned by this API is not
  2314. * incremented, and the caller does not need to release the
  2315. * reference.
  2316. *
  2317. * Parameters:
  2318. *
  2319. * inWindow:
  2320. * The window whose containing group to retrieve.
  2321. *
  2322. * Availability:
  2323. * Non-Carbon CFM: not available
  2324. * CarbonLib: in CarbonLib 1.4 and later
  2325. * Mac OS X: in version 10.0 and later
  2326. */
  2327. EXTERN_API_C( WindowGroupRef )
  2328. GetWindowGroup(WindowRef inWindow);
  2329. /*
  2330. * SetWindowGroup()
  2331. *
  2332. * Summary:
  2333. * Sets the window group that contains a window.
  2334. *
  2335. * Discussion:
  2336. * The window's z-order relative to windows in the current process
  2337. * may also be changed by this API. If the new window group is
  2338. * z-ordered above the window's current group, the window will be
  2339. * placed at the end of the new group. If the new window group is
  2340. * z-ordered below the window's current group, the window will be
  2341. * placed at the top of the new group. You may not place a window
  2342. * directly into the root group.
  2343. *
  2344. * Parameters:
  2345. *
  2346. * inWindow:
  2347. * The window whose group to change.
  2348. *
  2349. * inNewGroup:
  2350. * The new containing group.
  2351. *
  2352. * Availability:
  2353. * Non-Carbon CFM: not available
  2354. * CarbonLib: in CarbonLib 1.4 and later
  2355. * Mac OS X: in version 10.0 and later
  2356. */
  2357. EXTERN_API_C( OSStatus )
  2358. SetWindowGroup(
  2359. WindowRef inWindow,
  2360. WindowGroupRef inNewGroup);
  2361. /*
  2362. * IsWindowContainedInGroup()
  2363. *
  2364. * Summary:
  2365. * Indicates whether a window is contained within a group or any of
  2366. * its subgroups.
  2367. *
  2368. * Parameters:
  2369. *
  2370. * inWindow:
  2371. * The window whose containment to examine.
  2372. *
  2373. * inGroup:
  2374. * The group that might contain the window.
  2375. *
  2376. * Availability:
  2377. * Non-Carbon CFM: not available
  2378. * CarbonLib: in CarbonLib 1.4 and later
  2379. * Mac OS X: in version 10.0 and later
  2380. */
  2381. EXTERN_API_C( Boolean )
  2382. IsWindowContainedInGroup(
  2383. WindowRef inWindow,
  2384. WindowGroupRef inGroup);
  2385. /*
  2386. * GetWindowGroupParent()
  2387. *
  2388. * Summary:
  2389. * Gets the window group that contains a group.
  2390. *
  2391. * Parameters:
  2392. *
  2393. * inGroup:
  2394. * The group whose containing group to retrieve.
  2395. *
  2396. * outGroup:
  2397. * On exit, the containing window group of the group. The group's
  2398. * refcount is not incremented by this API, and the caller does
  2399. * not need to release the reference.
  2400. *
  2401. * Availability:
  2402. * Non-Carbon CFM: not available
  2403. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.0 and later
  2404. * Mac OS X: in version 10.0 and later
  2405. */
  2406. EXTERN_API_C( WindowGroupRef )
  2407. GetWindowGroupParent(WindowGroupRef inGroup);
  2408. /*
  2409. * SetWindowGroupParent()
  2410. *
  2411. * Summary:
  2412. * Sets the window group that contains a group.
  2413. *
  2414. * Discussion:
  2415. * SetWindowGroupParent currently requires that the group have no
  2416. * windows in it.
  2417. *
  2418. * Parameters:
  2419. *
  2420. * inGroup:
  2421. * The group whose containing group to change.
  2422. *
  2423. * inNewGroup:
  2424. * The new containing group.
  2425. *
  2426. * Availability:
  2427. * Non-Carbon CFM: not available
  2428. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.0 and later
  2429. * Mac OS X: in version 10.0 and later
  2430. */
  2431. EXTERN_API_C( OSStatus )
  2432. SetWindowGroupParent(
  2433. WindowGroupRef inGroup,
  2434. WindowGroupRef inNewGroup);
  2435. /*
  2436. * GetWindowGroupSibling()
  2437. *
  2438. * Summary:
  2439. * Returns the next or previous group of a window group.
  2440. *
  2441. * Parameters:
  2442. *
  2443. * inGroup:
  2444. * The group whose sibling to return.
  2445. *
  2446. * inNextGroup:
  2447. * True to return the next sibling, false to return the previous
  2448. * sibling.
  2449. *
  2450. * Availability:
  2451. * Non-Carbon CFM: not available
  2452. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.0 and later
  2453. * Mac OS X: in version 10.0 and later
  2454. */
  2455. EXTERN_API_C( WindowGroupRef )
  2456. GetWindowGroupSibling(
  2457. WindowGroupRef inGroup,
  2458. Boolean inNextGroup);
  2459. /*
  2460. * GetWindowGroupOwner()
  2461. *
  2462. * Summary:
  2463. * Returns the window that owns a window group, or NULL if none.
  2464. *
  2465. * Discussion:
  2466. * A window may own one or more window groups. The windows in an
  2467. * owned window group will always be z-ordered above the owner
  2468. * window. Whenever the owner window changes z-order, the windows in
  2469. * the groups owned by the window will be moved also.
  2470. *
  2471. * Parameters:
  2472. *
  2473. * inGroup:
  2474. * The group whose owner to retrieve.
  2475. *
  2476. * Availability:
  2477. * Non-Carbon CFM: not available
  2478. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.0 and later
  2479. * Mac OS X: in version 10.0 and later
  2480. */
  2481. EXTERN_API_C( WindowRef )
  2482. GetWindowGroupOwner(WindowGroupRef inGroup);
  2483. /*
  2484. * SetWindowGroupOwner()
  2485. *
  2486. * Summary:
  2487. * Sets the window that owns a window group.
  2488. *
  2489. * Discussion:
  2490. * The group and the window must have the same parent group.
  2491. * SetWindowGroupOwner currently requires that the group have no
  2492. * windows in it.
  2493. *
  2494. * Parameters:
  2495. *
  2496. * inGroup:
  2497. * The group whose owner to set.
  2498. *
  2499. * inWindow:
  2500. * The group's new owner.
  2501. *
  2502. * Availability:
  2503. * Non-Carbon CFM: not available
  2504. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.0 and later
  2505. * Mac OS X: in version 10.0 and later
  2506. */
  2507. EXTERN_API_C( OSStatus )
  2508. SetWindowGroupOwner(
  2509. WindowGroupRef inGroup,
  2510. WindowRef inWindow);
  2511. /*----------------------------------------------------------------------------------*/
  2512. /* o Inspection of group contents */
  2513. /*----------------------------------------------------------------------------------*/
  2514. /*
  2515. * CountWindowGroupContents()
  2516. *
  2517. * Summary:
  2518. * Counts the windows or groups contained in a group.
  2519. *
  2520. * Parameters:
  2521. *
  2522. * inGroup:
  2523. * The group whose contents to count.
  2524. *
  2525. * inOptions:
  2526. * Specifies how to count the group's contents.
  2527. *
  2528. * Availability:
  2529. * Non-Carbon CFM: not available
  2530. * CarbonLib: in CarbonLib 1.4 and later
  2531. * Mac OS X: in version 10.0 and later
  2532. */
  2533. EXTERN_API_C( ItemCount )
  2534. CountWindowGroupContents(
  2535. WindowGroupRef inGroup,
  2536. WindowGroupContentOptions inOptions);
  2537. /*
  2538. * GetWindowGroupContents()
  2539. *
  2540. * Summary:
  2541. * Retrieves the windows or groups contained in a group.
  2542. *
  2543. * Discussion:
  2544. * The windows or groups returned by this API will be placed into
  2545. * the output buffer in z-order, from highest to lowest.
  2546. *
  2547. * Parameters:
  2548. *
  2549. * inGroup:
  2550. * The group whose contents to retrieve.
  2551. *
  2552. * inOptions:
  2553. * Specifies which content to retrieve.
  2554. *
  2555. * inAllowedItems:
  2556. * The number of items that will fit in the output buffer.
  2557. *
  2558. * outNumItems:
  2559. * On exit, the number of items that were returned. May be NULL.
  2560. *
  2561. * outItems:
  2562. * On entry, points to enough memory to hold inAllowedSize
  2563. * WindowRefs or WindowGroupRefs. On exit, contains *outNumItems
  2564. * WindowRefs or WindowGroupRefs.
  2565. *
  2566. * Availability:
  2567. * Non-Carbon CFM: not available
  2568. * CarbonLib: in CarbonLib 1.4 and later
  2569. * Mac OS X: in version 10.0 and later
  2570. */
  2571. EXTERN_API_C( OSStatus )
  2572. GetWindowGroupContents(
  2573. WindowGroupRef inGroup,
  2574. WindowGroupContentOptions inOptions,
  2575. ItemCount inAllowedItems,
  2576. ItemCount * outNumItems, /* can be NULL */
  2577. void ** outItems);
  2578. /*
  2579. * GetIndexedWindow()
  2580. *
  2581. * Summary:
  2582. * Retrieves a specified window from a group.
  2583. *
  2584. * Discussion:
  2585. * GetIndexedWindow is provided as an easier way to get a particular
  2586. * window from a group than using GetWindowGroupContents. If you
  2587. * only need to retrieve, say, the last window in a group, it is
  2588. * easier and more efficient to use GetIndexedWindow. If you need to
  2589. * retrieve all the windows in a group, it is more efficient to use
  2590. * GetWindowGroupContents.
  2591. *
  2592. * Parameters:
  2593. *
  2594. * inGroup:
  2595. * The group containing the window to retrieve.
  2596. *
  2597. * inIndex:
  2598. * The index of the window. This parameter may range from 1 to
  2599. * CountWindowGroupContents( inGroup,
  2600. * kWindowGroupContentsReturnWindows | inOptions );
  2601. *
  2602. * inOptions:
  2603. * Indicates how to locate the specified window.
  2604. * kWindowGroupContentsReturnWindows is implied by this API and
  2605. * does not need to be explicitly specified.
  2606. *
  2607. * outWindow:
  2608. * On exit, the window at the specified index.
  2609. *
  2610. * Availability:
  2611. * Non-Carbon CFM: not available
  2612. * CarbonLib: in CarbonLib 1.4 and later
  2613. * Mac OS X: in version 10.0 and later
  2614. */
  2615. EXTERN_API_C( OSStatus )
  2616. GetIndexedWindow(
  2617. WindowGroupRef inGroup,
  2618. UInt32 inIndex,
  2619. WindowGroupContentOptions inOptions,
  2620. WindowRef * outWindow);
  2621. /*
  2622. * GetWindowIndex()
  2623. *
  2624. * Summary:
  2625. * Retrieves the z-order index of a window inside a group.
  2626. *
  2627. * Discussion:
  2628. * The z-order index of a window is its relative position in z-order
  2629. * inside a group. The index ranges from 1 to the number of windows
  2630. * in the group.
  2631. *
  2632. * Parameters:
  2633. *
  2634. * inWindow:
  2635. * The window whose z-order index to retrieve.
  2636. *
  2637. * inStartGroup:
  2638. * The group on which to base the z-order index. This should be
  2639. * either the containing group of the window, or NULL. If NULL,
  2640. * this API returns the z-order index of the window across the
  2641. * entire process.
  2642. *
  2643. * inOptions:
  2644. * Indicates how to enumerate the specified window.
  2645. * kWindowGroupContentsReturnWindows is implied by this API and
  2646. * does not need to be explicitly specified.
  2647. *
  2648. * outIndex:
  2649. * On exit, contains the window's z-order index.
  2650. *
  2651. * Availability:
  2652. * Non-Carbon CFM: not available
  2653. * CarbonLib: in CarbonLib 1.4 and later
  2654. * Mac OS X: in version 10.0 and later
  2655. */
  2656. EXTERN_API_C( OSStatus )
  2657. GetWindowIndex(
  2658. WindowRef inWindow,
  2659. WindowGroupRef inStartGroup,
  2660. WindowGroupContentOptions inOptions,
  2661. UInt32 * outIndex);
  2662. /*----------------------------------------------------------------------------------*/
  2663. /* o.Window activation */
  2664. /*----------------------------------------------------------------------------------*/
  2665. /*
  2666. * ActiveNonFloatingWindow()
  2667. *
  2668. * Summary:
  2669. * Returns the window, among all windows with activation scope of
  2670. * kWindowActivationScopeAll, that is considered active.
  2671. *
  2672. * Discussion:
  2673. * The Mac OS 8.5 Window Manager introduced the
  2674. * FrontNonFloatingWindow API, which was designed to return the
  2675. * window that should be considered active by the application. With
  2676. * the advent of window groups, it is now possible to have a window
  2677. * that looks active (is highlighted, and accepts keyboard input)
  2678. * but to have other non-floating windows grouped above the active
  2679. * window. The ActiveNonFloatingWindow API returns the active window
  2680. * regardless of where it is positioned in the z-order. Most code
  2681. * that currently uses FrontNonFloatingWindow or
  2682. * GetFrontWindowOfClass(kDocumentClass) to get the active window
  2683. * should use ActiveNonFloatingWindow instead.
  2684. *
  2685. * Availability:
  2686. * Non-Carbon CFM: not available
  2687. * CarbonLib: in CarbonLib 1.4 and later
  2688. * Mac OS X: in version 10.0 and later
  2689. */
  2690. EXTERN_API_C( WindowRef )
  2691. ActiveNonFloatingWindow(void);
  2692. /*
  2693. * IsWindowActive()
  2694. *
  2695. * Summary:
  2696. * Indicates whether a window is active.
  2697. *
  2698. * Discussion:
  2699. * The active state of a window is simply determined by whether its
  2700. * window frame is drawn using an active appearance. This does not
  2701. * indicate whether the window has keyboard focus. To get the window
  2702. * with keyboard focus, use GetUserFocusWindow().
  2703. *
  2704. * Parameters:
  2705. *
  2706. * inWindow:
  2707. * The window whose active state to retrieve.
  2708. *
  2709. * Availability:
  2710. * Non-Carbon CFM: not available
  2711. * CarbonLib: in CarbonLib 1.4 and later
  2712. * Mac OS X: in version 10.0 and later
  2713. */
  2714. EXTERN_API_C( Boolean )
  2715. IsWindowActive(WindowRef inWindow);
  2716. /*
  2717. * ActivateWindow()
  2718. *
  2719. * Summary:
  2720. * Activates or deactivates a window.
  2721. *
  2722. * Discussion:
  2723. * Window activation consists of two steps: hiliting the window
  2724. * frame and sending an activate event to the window. ActivateWindow
  2725. * handles both of these steps and also updates internal Window
  2726. * Manager state. If you just need to hilite the window frame, you
  2727. * may use HiliteWindow. If you need to send an activate event, you
  2728. * should always use ActivateWindow rather than creating and sending
  2729. * the event yourself.
  2730. *
  2731. * Parameters:
  2732. *
  2733. * inWindow:
  2734. * The window to activate or deactivate.
  2735. *
  2736. * inActivate:
  2737. * Whether to activate or deactivate the window.
  2738. *
  2739. * Availability:
  2740. * Non-Carbon CFM: not available
  2741. * CarbonLib: in CarbonLib 1.4 and later
  2742. * Mac OS X: in version 10.0 and later
  2743. */
  2744. EXTERN_API_C( OSStatus )
  2745. ActivateWindow(
  2746. WindowRef inWindow,
  2747. Boolean inActivate);
  2748. /*
  2749. * GetWindowActivationScope()
  2750. *
  2751. * Summary:
  2752. * Retrieves a window's activation scope.
  2753. *
  2754. * Parameters:
  2755. *
  2756. * inWindow:
  2757. * The window whose activation scope to retrieve.
  2758. *
  2759. * outScope:
  2760. * On exit, the window's activation scope.
  2761. *
  2762. * Availability:
  2763. * Non-Carbon CFM: not available
  2764. * CarbonLib: in CarbonLib 1.4 and later
  2765. * Mac OS X: in version 10.0 and later
  2766. */
  2767. EXTERN_API_C( OSStatus )
  2768. GetWindowActivationScope(
  2769. WindowRef inWindow,
  2770. WindowActivationScope * outScope);
  2771. /*
  2772. * SetWindowActivationScope()
  2773. *
  2774. * Summary:
  2775. * Sets a window's activation scope.
  2776. *
  2777. * Parameters:
  2778. *
  2779. * inWindow:
  2780. * The window whose activation scope to set.
  2781. *
  2782. * inScope:
  2783. * The new activation scope.
  2784. *
  2785. * Availability:
  2786. * Non-Carbon CFM: not available
  2787. * CarbonLib: in CarbonLib 1.4 and later
  2788. * Mac OS X: in version 10.0 and later
  2789. */
  2790. EXTERN_API_C( OSStatus )
  2791. SetWindowActivationScope(
  2792. WindowRef inWindow,
  2793. WindowActivationScope inScope);
  2794. /*----------------------------------------------------------------------------------*/
  2795. /* o.Debugging Utilities */
  2796. /*----------------------------------------------------------------------------------*/
  2797. /*
  2798. * DebugPrintWindowGroup()
  2799. *
  2800. * Summary:
  2801. * Prints the contents of a window group to stdout.
  2802. *
  2803. * Parameters:
  2804. *
  2805. * inGroup:
  2806. * The group whose contents to print.
  2807. *
  2808. * Availability:
  2809. * Non-Carbon CFM: not available
  2810. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.0 and later
  2811. * Mac OS X: in version 10.0 and later
  2812. */
  2813. EXTERN_API_C( void )
  2814. DebugPrintWindowGroup(WindowGroupRef inGroup);
  2815. /*
  2816. * DebugPrintAllWindowGroups()
  2817. *
  2818. * Summary:
  2819. * Prints the full window group hierarchy, starting at the root
  2820. * group.
  2821. *
  2822. * Availability:
  2823. * Non-Carbon CFM: not available
  2824. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.0 and later
  2825. * Mac OS X: in version 10.0 and later
  2826. */
  2827. EXTERN_API_C( void )
  2828. DebugPrintAllWindowGroups(void);
  2829. /*--------------------------------------------------------------------------------------*/
  2830. /* o Background Image */
  2831. /*--------------------------------------------------------------------------------------*/
  2832. /* SetWinColor is not available in Carbon.*/
  2833. #if CALL_NOT_IN_CARBON
  2834. /*
  2835. * SetWinColor()
  2836. *
  2837. * Availability:
  2838. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  2839. * CarbonLib: not available
  2840. * Mac OS X: not available
  2841. */
  2842. EXTERN_API( void )
  2843. SetWinColor(
  2844. WindowRef window,
  2845. WCTabHandle newColorTable) ONEWORDINLINE(0xAA41);
  2846. /* SetDeskCPat is not available in Carbon.*/
  2847. /*
  2848. * SetDeskCPat()
  2849. *
  2850. * Availability:
  2851. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  2852. * CarbonLib: not available
  2853. * Mac OS X: not available
  2854. */
  2855. EXTERN_API( void )
  2856. SetDeskCPat(PixPatHandle deskPixPat) ONEWORDINLINE(0xAA47);
  2857. /*
  2858. Routines available from Mac OS 8.5 forward
  2859. or from Mac OS 8.1 forward when linking to CarbonLib 1.0 forward
  2860. */
  2861. #endif /* CALL_NOT_IN_CARBON */
  2862. /*
  2863. * SetWindowContentColor()
  2864. *
  2865. * Availability:
  2866. * Non-Carbon CFM: in WindowsLib 8.5 and later
  2867. * CarbonLib: in CarbonLib 1.0 and later
  2868. * Mac OS X: in version 10.0 and later
  2869. */
  2870. EXTERN_API( OSStatus )
  2871. SetWindowContentColor(
  2872. WindowRef window,
  2873. const RGBColor * color);
  2874. /*
  2875. * GetWindowContentColor()
  2876. *
  2877. * Availability:
  2878. * Non-Carbon CFM: in WindowsLib 8.5 and later
  2879. * CarbonLib: in CarbonLib 1.0 and later
  2880. * Mac OS X: in version 10.0 and later
  2881. */
  2882. EXTERN_API( OSStatus )
  2883. GetWindowContentColor(
  2884. WindowRef window,
  2885. RGBColor * color);
  2886. /* Routines available from Mac OS 8.5 forward*/
  2887. /*
  2888. * GetWindowContentPattern()
  2889. *
  2890. * Availability:
  2891. * Non-Carbon CFM: in WindowsLib 8.5 and later
  2892. * CarbonLib: in CarbonLib 1.0 and later
  2893. * Mac OS X: in version 10.0 and later
  2894. */
  2895. EXTERN_API( OSStatus )
  2896. GetWindowContentPattern(
  2897. WindowRef window,
  2898. PixPatHandle outPixPat);
  2899. /*
  2900. * SetWindowContentPattern()
  2901. *
  2902. * Availability:
  2903. * Non-Carbon CFM: in WindowsLib 8.5 and later
  2904. * CarbonLib: in CarbonLib 1.0 and later
  2905. * Mac OS X: in version 10.0 and later
  2906. */
  2907. EXTERN_API( OSStatus )
  2908. SetWindowContentPattern(
  2909. WindowRef window,
  2910. PixPatHandle pixPat);
  2911. /* Routines available from Mac OS 9.0 forward*/
  2912. typedef OptionBits WindowPaintProcOptions;
  2913. enum {
  2914. kWindowPaintProcOptionsNone = 0
  2915. };
  2916. /*
  2917. * InstallWindowContentPaintProc()
  2918. *
  2919. * Availability:
  2920. * Non-Carbon CFM: in WindowsLib 9.0 and later
  2921. * CarbonLib: in CarbonLib 1.0 and later
  2922. * Mac OS X: in version 10.0 and later
  2923. */
  2924. EXTERN_API( OSStatus )
  2925. InstallWindowContentPaintProc(
  2926. WindowRef window,
  2927. WindowPaintUPP paintProc,
  2928. WindowPaintProcOptions options,
  2929. void * refCon); /* can be NULL */
  2930. /*--------------------------------------------------------------------------------------*/
  2931. /* o Scrolling Routines */
  2932. /*--------------------------------------------------------------------------------------*/
  2933. typedef UInt32 ScrollWindowOptions;
  2934. enum {
  2935. kScrollWindowNoOptions = 0,
  2936. kScrollWindowInvalidate = (1L << 0), /* add the exposed area to the window's update region*/
  2937. kScrollWindowEraseToPortBackground = (1L << 1) /* erase the exposed area using the background color/pattern of the window's grafport*/
  2938. };
  2939. /* Routines available from Mac OS 8.1 forward when linking to CarbonLib 1.0 forward*/
  2940. /*
  2941. * ScrollWindowRect()
  2942. *
  2943. * Availability:
  2944. * Non-Carbon CFM: not available
  2945. * CarbonLib: in CarbonLib 1.0 and later
  2946. * Mac OS X: in version 10.0 and later
  2947. */
  2948. EXTERN_API( OSStatus )
  2949. ScrollWindowRect(
  2950. WindowRef inWindow,
  2951. const Rect * inScrollRect,
  2952. SInt16 inHPixels,
  2953. SInt16 inVPixels,
  2954. ScrollWindowOptions inOptions,
  2955. RgnHandle outExposedRgn); /* can be NULL */
  2956. /*
  2957. * ScrollWindowRegion()
  2958. *
  2959. * Availability:
  2960. * Non-Carbon CFM: not available
  2961. * CarbonLib: in CarbonLib 1.0 and later
  2962. * Mac OS X: in version 10.0 and later
  2963. */
  2964. EXTERN_API( OSStatus )
  2965. ScrollWindowRegion(
  2966. WindowRef inWindow,
  2967. RgnHandle inScrollRgn,
  2968. SInt16 inHPixels,
  2969. SInt16 inVPixels,
  2970. ScrollWindowOptions inOptions,
  2971. RgnHandle outExposedRgn); /* can be NULL */
  2972. /*--------------------------------------------------------------------------------------*/
  2973. /* o Low-Level Region & Painting Routines */
  2974. /*--------------------------------------------------------------------------------------*/
  2975. /*
  2976. * ClipAbove()
  2977. *
  2978. * Availability:
  2979. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  2980. * CarbonLib: in CarbonLib 1.0 and later
  2981. * Mac OS X: in version 10.0 and later
  2982. */
  2983. EXTERN_API( void )
  2984. ClipAbove(WindowRef window) ONEWORDINLINE(0xA90B);
  2985. /* SaveOld/DrawNew are not available in Carbon. Use ReshapeCustomWindow instead.*/
  2986. #if CALL_NOT_IN_CARBON
  2987. /*
  2988. * SaveOld()
  2989. *
  2990. * Availability:
  2991. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  2992. * CarbonLib: not available
  2993. * Mac OS X: not available
  2994. */
  2995. EXTERN_API( void )
  2996. SaveOld(WindowRef window) ONEWORDINLINE(0xA90E);
  2997. /*
  2998. * DrawNew()
  2999. *
  3000. * Availability:
  3001. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  3002. * CarbonLib: not available
  3003. * Mac OS X: not available
  3004. */
  3005. EXTERN_API( void )
  3006. DrawNew(
  3007. WindowRef window,
  3008. Boolean update) ONEWORDINLINE(0xA90F);
  3009. #endif /* CALL_NOT_IN_CARBON */
  3010. /*
  3011. * PaintOne()
  3012. *
  3013. * Availability:
  3014. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  3015. * CarbonLib: in CarbonLib 1.0 and later
  3016. * Mac OS X: in version 10.0 and later
  3017. */
  3018. EXTERN_API( void )
  3019. PaintOne(
  3020. WindowRef window, /* can be NULL */
  3021. RgnHandle clobberedRgn) ONEWORDINLINE(0xA90C);
  3022. /*
  3023. * PaintBehind()
  3024. *
  3025. * Availability:
  3026. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  3027. * CarbonLib: in CarbonLib 1.0 and later
  3028. * Mac OS X: in version 10.0 and later
  3029. */
  3030. EXTERN_API( void )
  3031. PaintBehind(
  3032. WindowRef startWindow, /* can be NULL */
  3033. RgnHandle clobberedRgn) ONEWORDINLINE(0xA90D);
  3034. /*
  3035. * CalcVis()
  3036. *
  3037. * Availability:
  3038. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  3039. * CarbonLib: in CarbonLib 1.0 and later
  3040. * Mac OS X: in version 10.0 and later
  3041. */
  3042. EXTERN_API( void )
  3043. CalcVis(WindowRef window) ONEWORDINLINE(0xA909);
  3044. /*
  3045. * CalcVisBehind()
  3046. *
  3047. * Availability:
  3048. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  3049. * CarbonLib: in CarbonLib 1.0 and later
  3050. * Mac OS X: in version 10.0 and later
  3051. */
  3052. EXTERN_API( void )
  3053. CalcVisBehind(
  3054. WindowRef startWindow, /* can be NULL */
  3055. RgnHandle clobberedRgn) ONEWORDINLINE(0xA90A);
  3056. /*
  3057. * CheckUpdate()
  3058. *
  3059. * Availability:
  3060. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  3061. * CarbonLib: in CarbonLib 1.0 and later
  3062. * Mac OS X: in version 10.0 and later
  3063. */
  3064. EXTERN_API( Boolean )
  3065. CheckUpdate(EventRecord * theEvent) ONEWORDINLINE(0xA911);
  3066. /*--------------------------------------------------------------------------------------*/
  3067. /* o Window List */
  3068. /*--------------------------------------------------------------------------------------*/
  3069. /*
  3070. * [Mac]FindWindow()
  3071. *
  3072. * Availability:
  3073. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  3074. * CarbonLib: in CarbonLib 1.0 and later
  3075. * Mac OS X: in version 10.0 and later
  3076. */
  3077. #if TARGET_OS_MAC
  3078. #define MacFindWindow FindWindow
  3079. #endif
  3080. EXTERN_API( WindowPartCode )
  3081. MacFindWindow(
  3082. Point thePoint,
  3083. WindowRef * window) ONEWORDINLINE(0xA92C);
  3084. /*
  3085. * FrontWindow()
  3086. *
  3087. * Availability:
  3088. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  3089. * CarbonLib: in CarbonLib 1.0 and later
  3090. * Mac OS X: in version 10.0 and later
  3091. */
  3092. EXTERN_API( WindowRef )
  3093. FrontWindow(void) ONEWORDINLINE(0xA924);
  3094. /*
  3095. * BringToFront()
  3096. *
  3097. * Availability:
  3098. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  3099. * CarbonLib: in CarbonLib 1.0 and later
  3100. * Mac OS X: in version 10.0 and later
  3101. */
  3102. EXTERN_API( void )
  3103. BringToFront(WindowRef window) ONEWORDINLINE(0xA920);
  3104. /*
  3105. * SendBehind()
  3106. *
  3107. * Availability:
  3108. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  3109. * CarbonLib: in CarbonLib 1.0 and later
  3110. * Mac OS X: in version 10.0 and later
  3111. */
  3112. EXTERN_API( void )
  3113. SendBehind(
  3114. WindowRef window,
  3115. WindowRef behindWindow) ONEWORDINLINE(0xA921);
  3116. /*
  3117. * SelectWindow()
  3118. *
  3119. * Availability:
  3120. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  3121. * CarbonLib: in CarbonLib 1.0 and later
  3122. * Mac OS X: in version 10.0 and later
  3123. */
  3124. EXTERN_API( void )
  3125. SelectWindow(WindowRef window) ONEWORDINLINE(0xA91F);
  3126. /*
  3127. Routines available from Mac OS 8.6 forward
  3128. or from Mac OS 8.1 forward when linking to CarbonLib 1.0 forward
  3129. */
  3130. /*
  3131. * FrontNonFloatingWindow()
  3132. *
  3133. * Availability:
  3134. * Non-Carbon CFM: in WindowsLib 8.5 and later
  3135. * CarbonLib: in CarbonLib 1.0 and later
  3136. * Mac OS X: in version 10.0 and later
  3137. */
  3138. EXTERN_API( WindowRef )
  3139. FrontNonFloatingWindow(void);
  3140. /* Routines available from Mac OS 8.1 forward when linking to CarbonLib 1.0 forward*/
  3141. /*
  3142. * GetNextWindowOfClass()
  3143. *
  3144. * Availability:
  3145. * Non-Carbon CFM: not available
  3146. * CarbonLib: in CarbonLib 1.0 and later
  3147. * Mac OS X: in version 10.0 and later
  3148. */
  3149. EXTERN_API( WindowRef )
  3150. GetNextWindowOfClass(
  3151. WindowRef inWindow,
  3152. WindowClass inWindowClass,
  3153. Boolean mustBeVisible);
  3154. /*
  3155. * GetFrontWindowOfClass()
  3156. *
  3157. * Availability:
  3158. * Non-Carbon CFM: not available
  3159. * CarbonLib: in CarbonLib 1.0 and later
  3160. * Mac OS X: in version 10.0 and later
  3161. */
  3162. EXTERN_API( WindowRef )
  3163. GetFrontWindowOfClass(
  3164. WindowClass inWindowClass,
  3165. Boolean mustBeVisible);
  3166. /*
  3167. * FindWindowOfClass()
  3168. *
  3169. * Availability:
  3170. * Non-Carbon CFM: not available
  3171. * CarbonLib: in CarbonLib 1.0 and later
  3172. * Mac OS X: in version 10.0 and later
  3173. */
  3174. EXTERN_API( OSStatus )
  3175. FindWindowOfClass(
  3176. const Point * where,
  3177. WindowClass inWindowClass,
  3178. WindowRef * outWindow,
  3179. WindowPartCode * outWindowPart); /* can be NULL */
  3180. /*
  3181. * Summary:
  3182. * Options for the CreateStandardWindowMenu API.
  3183. */
  3184. enum {
  3185. /*
  3186. * Requests the standard window menu include a Rotate Windows menu
  3187. * item. Available in Mac OS X after version 10.1.
  3188. */
  3189. kWindowMenuIncludeRotate = 1 << 0
  3190. };
  3191. /*
  3192. * CreateStandardWindowMenu()
  3193. *
  3194. * Discussion:
  3195. * Creates a standard Window menu for your application. You can call
  3196. * this to create a window menu for your application. Once you have
  3197. * the menu, you need to insert it in your menu bar (typically at
  3198. * the end of your menu list) with a call to InsertMenu. To register
  3199. * a window to be tracked by this menu, you either create your
  3200. * window with CreateNewWindow, passing the
  3201. * kWindowInWindowMenuAttribute, or you can use
  3202. * ChangeWindowAttributes after the window is created. The Toolbox
  3203. * takes care of acting on the standard items such as zoom and
  3204. * minimize, as well as bringing selected windows to the front. All
  3205. * you need to do is install it and register your windows and the
  3206. * Toolbox does the rest.
  3207. *
  3208. * You may also add your own menu items to the standard window menu.
  3209. * To do this, we recommend that you use the
  3210. * GetIndMenuItemWithCommandID API to locate one of the standard
  3211. * menu items in the menu which is immediately above or below the
  3212. * location where you wish to insert your items. Then insert your
  3213. * items relative to the position of the standard menu item. Do not
  3214. * attempt to search the menu items yourself without calling
  3215. * GetIndMenuItemWithCommandID; in Mac OS X 10.2,
  3216. * CreateStandardWindowMenu returns an initially empty menu which is
  3217. * populated later when the menu is displayed or when
  3218. * GetIndMenuItemWithCommandID is called, so you will find no items
  3219. * in the menu unless you first call GetIndMenuItemWithCommandID.
  3220. *
  3221. * Parameters:
  3222. *
  3223. * inOptions:
  3224. * Requests optional behavior of the standard window menu. Mac OS
  3225. * X 10.2 supports the kWindowMenuIncludeRotate option; in earlier
  3226. * versions of Mac OS X, and in CarbonLib, you must pass zero for
  3227. * this parameter.
  3228. *
  3229. * outMenu:
  3230. * Receives a new menu reference which contains the standard
  3231. * window menu items and commands.
  3232. *
  3233. * Result:
  3234. * An operating system status code.
  3235. *
  3236. * Availability:
  3237. * Non-Carbon CFM: not available
  3238. * CarbonLib: in CarbonLib 1.1 and later
  3239. * Mac OS X: in version 10.0 and later
  3240. */
  3241. EXTERN_API( OSStatus )
  3242. CreateStandardWindowMenu(
  3243. OptionBits inOptions,
  3244. MenuRef * outMenu);
  3245. /*
  3246. * SetWindowAlternateTitle()
  3247. *
  3248. * Discussion:
  3249. * This API sets an alternate title for a window. The alternate
  3250. * title overrides what is displayed in the Window menu. If you do
  3251. * not set an alternate title, the normal window title is used. You
  3252. * would normally use this if the window title was not expressive
  3253. * enough to be used in the Window menu (or similar text-only
  3254. * situation).
  3255. *
  3256. * Parameters:
  3257. *
  3258. * inWindow:
  3259. * The window to set the alternate title.
  3260. *
  3261. * inTitle:
  3262. * The alternate title for the window. Passing NULL for this
  3263. * parameter will remove any alternate title that might be present.
  3264. *
  3265. * Result:
  3266. * An operating system status code.
  3267. *
  3268. * Availability:
  3269. * Non-Carbon CFM: not available
  3270. * CarbonLib: in CarbonLib 1.1 and later
  3271. * Mac OS X: in version 10.0 and later
  3272. */
  3273. EXTERN_API( OSStatus )
  3274. SetWindowAlternateTitle(
  3275. WindowRef inWindow,
  3276. CFStringRef inTitle);
  3277. /*
  3278. * CopyWindowAlternateTitle()
  3279. *
  3280. * Discussion:
  3281. * This API gets the alternate title for a window. See the
  3282. * discussion of SetWindowAlternateTitle for more info.
  3283. *
  3284. * Parameters:
  3285. *
  3286. * inWindow:
  3287. * The window to get the alternate title from.
  3288. *
  3289. * outTitle:
  3290. * Receives the alternate title for the window. If the window does
  3291. * not have an alternate title, NULL will be returned in outTitle.
  3292. *
  3293. * Result:
  3294. * An operating system status code.
  3295. *
  3296. * Availability:
  3297. * Non-Carbon CFM: not available
  3298. * CarbonLib: in CarbonLib 1.1 and later
  3299. * Mac OS X: in version 10.0 and later
  3300. */
  3301. EXTERN_API( OSStatus )
  3302. CopyWindowAlternateTitle(
  3303. WindowRef inWindow,
  3304. CFStringRef * outTitle);
  3305. /*--------------------------------------------------------------------------------------*/
  3306. /* o Misc Low-Level stuff */
  3307. /*--------------------------------------------------------------------------------------*/
  3308. #if CALL_NOT_IN_CARBON
  3309. /*
  3310. * InitWindows()
  3311. *
  3312. * Availability:
  3313. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  3314. * CarbonLib: not available
  3315. * Mac OS X: not available
  3316. */
  3317. EXTERN_API( void )
  3318. InitWindows(void) ONEWORDINLINE(0xA912);
  3319. /* The window manager port does not exist in Carbon. */
  3320. /* We are investigating replacement technologies. */
  3321. /*
  3322. * GetWMgrPort()
  3323. *
  3324. * Availability:
  3325. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  3326. * CarbonLib: not available
  3327. * Mac OS X: not available
  3328. */
  3329. EXTERN_API( void )
  3330. GetWMgrPort(GrafPtr * wPort) ONEWORDINLINE(0xA910);
  3331. /*
  3332. * GetCWMgrPort()
  3333. *
  3334. * Availability:
  3335. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  3336. * CarbonLib: not available
  3337. * Mac OS X: not available
  3338. */
  3339. EXTERN_API( void )
  3340. GetCWMgrPort(CGrafPtr * wMgrCPort) ONEWORDINLINE(0xAA48);
  3341. /*
  3342. Routines available from Mac OS 8.5 forward
  3343. or from Mac OS 8.1 forward when linking to CarbonLib 1.0 forward
  3344. */
  3345. #endif /* CALL_NOT_IN_CARBON */
  3346. /*
  3347. * IsValidWindowPtr()
  3348. *
  3349. * Availability:
  3350. * Non-Carbon CFM: in WindowsLib 8.5 and later
  3351. * CarbonLib: in CarbonLib 1.0 and later
  3352. * Mac OS X: in version 10.0 and later
  3353. */
  3354. EXTERN_API( Boolean )
  3355. IsValidWindowPtr(WindowRef possibleWindow);
  3356. #define IsValidWindowRef IsValidWindowPtr
  3357. /*
  3358. Routines available from Mac OS 8.6 forward
  3359. InitFloatingWindows is not available in Carbon;
  3360. window ordering is always active for Carbon clients
  3361. */
  3362. #if CALL_NOT_IN_CARBON
  3363. /*
  3364. * InitFloatingWindows()
  3365. *
  3366. * Availability:
  3367. * Non-Carbon CFM: in WindowsLib 8.5 and later
  3368. * CarbonLib: not available
  3369. * Mac OS X: not available
  3370. */
  3371. EXTERN_API( OSStatus )
  3372. InitFloatingWindows(void);
  3373. /*--------------------------------------------------------------------------------------*/
  3374. /* o Various & Sundry Window Accessors */
  3375. /*--------------------------------------------------------------------------------------*/
  3376. #endif /* CALL_NOT_IN_CARBON */
  3377. /*
  3378. * HiliteWindow()
  3379. *
  3380. * Availability:
  3381. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  3382. * CarbonLib: in CarbonLib 1.0 and later
  3383. * Mac OS X: in version 10.0 and later
  3384. */
  3385. EXTERN_API( void )
  3386. HiliteWindow(
  3387. WindowRef window,
  3388. Boolean fHilite) ONEWORDINLINE(0xA91C);
  3389. /*
  3390. * SetWRefCon()
  3391. *
  3392. * Availability:
  3393. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  3394. * CarbonLib: in CarbonLib 1.0 and later
  3395. * Mac OS X: in version 10.0 and later
  3396. */
  3397. EXTERN_API( void )
  3398. SetWRefCon(
  3399. WindowRef window,
  3400. long data) ONEWORDINLINE(0xA918);
  3401. /*
  3402. * GetWRefCon()
  3403. *
  3404. * Availability:
  3405. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  3406. * CarbonLib: in CarbonLib 1.0 and later
  3407. * Mac OS X: in version 10.0 and later
  3408. */
  3409. EXTERN_API( long )
  3410. GetWRefCon(WindowRef window) ONEWORDINLINE(0xA917);
  3411. /*
  3412. * SetWindowPic()
  3413. *
  3414. * Availability:
  3415. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  3416. * CarbonLib: in CarbonLib 1.0 and later
  3417. * Mac OS X: in version 10.0 and later
  3418. */
  3419. EXTERN_API( void )
  3420. SetWindowPic(
  3421. WindowRef window,
  3422. PicHandle pic) ONEWORDINLINE(0xA92E);
  3423. /*
  3424. * GetWindowPic()
  3425. *
  3426. * Availability:
  3427. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  3428. * CarbonLib: in CarbonLib 1.0 and later
  3429. * Mac OS X: in version 10.0 and later
  3430. */
  3431. EXTERN_API( PicHandle )
  3432. GetWindowPic(WindowRef window) ONEWORDINLINE(0xA92F);
  3433. /*
  3434. * GetWVariant()
  3435. *
  3436. * Availability:
  3437. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  3438. * CarbonLib: in CarbonLib 1.0 and later
  3439. * Mac OS X: in version 10.0 and later
  3440. */
  3441. EXTERN_API( short )
  3442. GetWVariant(WindowRef window) ONEWORDINLINE(0xA80A);
  3443. /* Routines available from Mac OS 8.0 (Appearance 1.0) forward*/
  3444. /*
  3445. * GetWindowFeatures()
  3446. *
  3447. * Availability:
  3448. * Non-Carbon CFM: in AppearanceLib 1.0 and later
  3449. * CarbonLib: in CarbonLib 1.0 and later
  3450. * Mac OS X: in version 10.0 and later
  3451. */
  3452. EXTERN_API( OSStatus )
  3453. GetWindowFeatures(
  3454. WindowRef window,
  3455. UInt32 * outFeatures) THREEWORDINLINE(0x303C, 0x0013, 0xAA74);
  3456. /*
  3457. * GetWindowRegion()
  3458. *
  3459. * Availability:
  3460. * Non-Carbon CFM: in AppearanceLib 1.0 and later
  3461. * CarbonLib: in CarbonLib 1.0 and later
  3462. * Mac OS X: in version 10.0 and later
  3463. */
  3464. EXTERN_API( OSStatus )
  3465. GetWindowRegion(
  3466. WindowRef window,
  3467. WindowRegionCode inRegionCode,
  3468. RgnHandle ioWinRgn) THREEWORDINLINE(0x303C, 0x0014, 0xAA74);
  3469. /*
  3470. * GetWindowStructureWidths()
  3471. *
  3472. * Availability:
  3473. * Non-Carbon CFM: in WindowsLib 8.5 and later
  3474. * CarbonLib: in CarbonLib 1.0 and later
  3475. * Mac OS X: in version 10.0 and later
  3476. */
  3477. EXTERN_API( OSStatus )
  3478. GetWindowStructureWidths(
  3479. WindowRef inWindow,
  3480. Rect * outRect);
  3481. /*--------------------------------------------------------------------------------------*/
  3482. /* o Update Events */
  3483. /*--------------------------------------------------------------------------------------*/
  3484. /*
  3485. These aren't present in Carbon. Please use the InvalWindowRect, etc. routines
  3486. below instead.
  3487. */
  3488. #if CALL_NOT_IN_CARBON
  3489. /*
  3490. * InvalRect()
  3491. *
  3492. * Availability:
  3493. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  3494. * CarbonLib: not available
  3495. * Mac OS X: not available
  3496. */
  3497. EXTERN_API( void )
  3498. InvalRect(const Rect * badRect) ONEWORDINLINE(0xA928);
  3499. /*
  3500. * InvalRgn()
  3501. *
  3502. * Availability:
  3503. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  3504. * CarbonLib: not available
  3505. * Mac OS X: not available
  3506. */
  3507. EXTERN_API( void )
  3508. InvalRgn(RgnHandle badRgn) ONEWORDINLINE(0xA927);
  3509. /*
  3510. * ValidRect()
  3511. *
  3512. * Availability:
  3513. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  3514. * CarbonLib: not available
  3515. * Mac OS X: not available
  3516. */
  3517. EXTERN_API( void )
  3518. ValidRect(const Rect * goodRect) ONEWORDINLINE(0xA92A);
  3519. /*
  3520. * ValidRgn()
  3521. *
  3522. * Availability:
  3523. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  3524. * CarbonLib: not available
  3525. * Mac OS X: not available
  3526. */
  3527. EXTERN_API( void )
  3528. ValidRgn(RgnHandle goodRgn) ONEWORDINLINE(0xA929);
  3529. #endif /* CALL_NOT_IN_CARBON */
  3530. /*
  3531. * BeginUpdate()
  3532. *
  3533. * Availability:
  3534. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  3535. * CarbonLib: in CarbonLib 1.0 and later
  3536. * Mac OS X: in version 10.0 and later
  3537. */
  3538. EXTERN_API( void )
  3539. BeginUpdate(WindowRef window) ONEWORDINLINE(0xA922);
  3540. /*
  3541. * EndUpdate()
  3542. *
  3543. * Availability:
  3544. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  3545. * CarbonLib: in CarbonLib 1.0 and later
  3546. * Mac OS X: in version 10.0 and later
  3547. */
  3548. EXTERN_API( void )
  3549. EndUpdate(WindowRef window) ONEWORDINLINE(0xA923);
  3550. /*
  3551. Routines available from Mac OS 8.5 forward
  3552. or from Mac OS 8.1 forward when linking to CarbonLib 1.0 forward
  3553. */
  3554. /*
  3555. * InvalWindowRgn()
  3556. *
  3557. * Availability:
  3558. * Non-Carbon CFM: in WindowsLib 8.5 and later
  3559. * CarbonLib: in CarbonLib 1.0 and later
  3560. * Mac OS X: in version 10.0 and later
  3561. */
  3562. EXTERN_API( OSStatus )
  3563. InvalWindowRgn(
  3564. WindowRef window,
  3565. RgnHandle region);
  3566. /*
  3567. * InvalWindowRect()
  3568. *
  3569. * Availability:
  3570. * Non-Carbon CFM: in WindowsLib 8.5 and later
  3571. * CarbonLib: in CarbonLib 1.0 and later
  3572. * Mac OS X: in version 10.0 and later
  3573. */
  3574. EXTERN_API( OSStatus )
  3575. InvalWindowRect(
  3576. WindowRef window,
  3577. const Rect * bounds);
  3578. /*
  3579. * ValidWindowRgn()
  3580. *
  3581. * Availability:
  3582. * Non-Carbon CFM: in WindowsLib 8.5 and later
  3583. * CarbonLib: in CarbonLib 1.0 and later
  3584. * Mac OS X: in version 10.0 and later
  3585. */
  3586. EXTERN_API( OSStatus )
  3587. ValidWindowRgn(
  3588. WindowRef window,
  3589. RgnHandle region);
  3590. /*
  3591. * ValidWindowRect()
  3592. *
  3593. * Availability:
  3594. * Non-Carbon CFM: in WindowsLib 8.5 and later
  3595. * CarbonLib: in CarbonLib 1.0 and later
  3596. * Mac OS X: in version 10.0 and later
  3597. */
  3598. EXTERN_API( OSStatus )
  3599. ValidWindowRect(
  3600. WindowRef window,
  3601. const Rect * bounds);
  3602. /*--------------------------------------------------------------------------------------*/
  3603. /* o DrawGrowIcon */
  3604. /* */
  3605. /* DrawGrowIcon is deprecated from Mac OS 8.0 forward. Theme-savvy window defprocs */
  3606. /* include the grow box in the window frame. */
  3607. /*--------------------------------------------------------------------------------------*/
  3608. /*
  3609. * DrawGrowIcon()
  3610. *
  3611. * Availability:
  3612. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  3613. * CarbonLib: in CarbonLib 1.0 and later
  3614. * Mac OS X: in version 10.0 and later
  3615. */
  3616. EXTERN_API( void )
  3617. DrawGrowIcon(WindowRef window) ONEWORDINLINE(0xA904);
  3618. /*--------------------------------------------------------------------------------------*/
  3619. /* o Window Titles */
  3620. /*--------------------------------------------------------------------------------------*/
  3621. /*
  3622. * SetWTitle()
  3623. *
  3624. * Availability:
  3625. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  3626. * CarbonLib: in CarbonLib 1.0 and later
  3627. * Mac OS X: in version 10.0 and later
  3628. */
  3629. EXTERN_API( void )
  3630. SetWTitle(
  3631. WindowRef window,
  3632. ConstStr255Param title) ONEWORDINLINE(0xA91A);
  3633. /*
  3634. * GetWTitle()
  3635. *
  3636. * Availability:
  3637. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  3638. * CarbonLib: in CarbonLib 1.0 and later
  3639. * Mac OS X: in version 10.0 and later
  3640. */
  3641. EXTERN_API( void )
  3642. GetWTitle(
  3643. WindowRef window,
  3644. Str255 title) ONEWORDINLINE(0xA919);
  3645. /*
  3646. * SetWindowTitleWithCFString()
  3647. *
  3648. * Availability:
  3649. * Non-Carbon CFM: not available
  3650. * CarbonLib: in CarbonLib 1.1 and later
  3651. * Mac OS X: in version 10.0 and later
  3652. */
  3653. EXTERN_API( OSStatus )
  3654. SetWindowTitleWithCFString(
  3655. WindowRef inWindow,
  3656. CFStringRef inString);
  3657. /*
  3658. * CopyWindowTitleAsCFString()
  3659. *
  3660. * Availability:
  3661. * Non-Carbon CFM: not available
  3662. * CarbonLib: in CarbonLib 1.1 and later
  3663. * Mac OS X: in version 10.0 and later
  3664. */
  3665. EXTERN_API( OSStatus )
  3666. CopyWindowTitleAsCFString(
  3667. WindowRef inWindow,
  3668. CFStringRef * outString);
  3669. /*--------------------------------------------------------------------------------------*/
  3670. /* o Window Proxies */
  3671. /*--------------------------------------------------------------------------------------*/
  3672. /* Routines available from Mac OS 8.5 forward*/
  3673. /*
  3674. * SetWindowProxyFSSpec()
  3675. *
  3676. * Availability:
  3677. * Non-Carbon CFM: in WindowsLib 8.5 and later
  3678. * CarbonLib: in CarbonLib 1.0 and later
  3679. * Mac OS X: in version 10.0 and later
  3680. */
  3681. EXTERN_API( OSStatus )
  3682. SetWindowProxyFSSpec(
  3683. WindowRef window,
  3684. const FSSpec * inFile);
  3685. /*
  3686. * GetWindowProxyFSSpec()
  3687. *
  3688. * Availability:
  3689. * Non-Carbon CFM: in WindowsLib 8.5 and later
  3690. * CarbonLib: in CarbonLib 1.0 and later
  3691. * Mac OS X: in version 10.0 and later
  3692. */
  3693. EXTERN_API( OSStatus )
  3694. GetWindowProxyFSSpec(
  3695. WindowRef window,
  3696. FSSpec * outFile);
  3697. /*
  3698. * SetWindowProxyAlias()
  3699. *
  3700. * Summary:
  3701. * Sets the proxy icon for a window based on an AliasHandle.
  3702. *
  3703. * Parameters:
  3704. *
  3705. * inWindow:
  3706. * The window whose proxy icon to set.
  3707. *
  3708. * inAlias:
  3709. * The alias that specifies the proxy icon. The Window Manager
  3710. * copies the alias data; the caller may dispose of the alias
  3711. * after SetWindowProxyAlias returns.
  3712. *
  3713. * Availability:
  3714. * Non-Carbon CFM: in WindowsLib 8.5 and later
  3715. * CarbonLib: in CarbonLib 1.0 and later
  3716. * Mac OS X: in version 10.0 and later
  3717. */
  3718. EXTERN_API( OSStatus )
  3719. SetWindowProxyAlias(
  3720. WindowRef inWindow,
  3721. AliasHandle inAlias);
  3722. /*
  3723. * GetWindowProxyAlias()
  3724. *
  3725. * Availability:
  3726. * Non-Carbon CFM: in WindowsLib 8.5 and later
  3727. * CarbonLib: in CarbonLib 1.0 and later
  3728. * Mac OS X: in version 10.0 and later
  3729. */
  3730. EXTERN_API( OSStatus )
  3731. GetWindowProxyAlias(
  3732. WindowRef window,
  3733. AliasHandle * alias);
  3734. /*
  3735. * SetWindowProxyCreatorAndType()
  3736. *
  3737. * Availability:
  3738. * Non-Carbon CFM: in WindowsLib 8.5 and later
  3739. * CarbonLib: in CarbonLib 1.0 and later
  3740. * Mac OS X: in version 10.0 and later
  3741. */
  3742. EXTERN_API( OSStatus )
  3743. SetWindowProxyCreatorAndType(
  3744. WindowRef window,
  3745. OSType fileCreator,
  3746. OSType fileType,
  3747. SInt16 vRefNum);
  3748. /*
  3749. * GetWindowProxyIcon()
  3750. *
  3751. * Availability:
  3752. * Non-Carbon CFM: in WindowsLib 8.5 and later
  3753. * CarbonLib: in CarbonLib 1.0 and later
  3754. * Mac OS X: in version 10.0 and later
  3755. */
  3756. EXTERN_API( OSStatus )
  3757. GetWindowProxyIcon(
  3758. WindowRef window,
  3759. IconRef * outIcon);
  3760. /*
  3761. * SetWindowProxyIcon()
  3762. *
  3763. * Availability:
  3764. * Non-Carbon CFM: in WindowsLib 8.5 and later
  3765. * CarbonLib: in CarbonLib 1.0 and later
  3766. * Mac OS X: in version 10.0 and later
  3767. */
  3768. EXTERN_API( OSStatus )
  3769. SetWindowProxyIcon(
  3770. WindowRef window,
  3771. IconRef icon);
  3772. /*
  3773. * RemoveWindowProxy()
  3774. *
  3775. * Availability:
  3776. * Non-Carbon CFM: in WindowsLib 8.5 and later
  3777. * CarbonLib: in CarbonLib 1.0 and later
  3778. * Mac OS X: in version 10.0 and later
  3779. */
  3780. EXTERN_API( OSStatus )
  3781. RemoveWindowProxy(WindowRef window);
  3782. /*
  3783. * BeginWindowProxyDrag()
  3784. *
  3785. * Availability:
  3786. * Non-Carbon CFM: in WindowsLib 8.5 and later
  3787. * CarbonLib: in CarbonLib 1.0 and later
  3788. * Mac OS X: in version 10.0 and later
  3789. */
  3790. EXTERN_API( OSStatus )
  3791. BeginWindowProxyDrag(
  3792. WindowRef window,
  3793. DragReference * outNewDrag,
  3794. RgnHandle outDragOutlineRgn);
  3795. /*
  3796. * EndWindowProxyDrag()
  3797. *
  3798. * Availability:
  3799. * Non-Carbon CFM: in WindowsLib 8.5 and later
  3800. * CarbonLib: in CarbonLib 1.0 and later
  3801. * Mac OS X: in version 10.0 and later
  3802. */
  3803. EXTERN_API( OSStatus )
  3804. EndWindowProxyDrag(
  3805. WindowRef window,
  3806. DragReference theDrag);
  3807. /*
  3808. * TrackWindowProxyFromExistingDrag()
  3809. *
  3810. * Availability:
  3811. * Non-Carbon CFM: in WindowsLib 8.5 and later
  3812. * CarbonLib: in CarbonLib 1.0 and later
  3813. * Mac OS X: in version 10.0 and later
  3814. */
  3815. EXTERN_API( OSStatus )
  3816. TrackWindowProxyFromExistingDrag(
  3817. WindowRef window,
  3818. Point startPt,
  3819. DragReference drag,
  3820. RgnHandle inDragOutlineRgn);
  3821. /*
  3822. * TrackWindowProxyDrag()
  3823. *
  3824. * Availability:
  3825. * Non-Carbon CFM: in WindowsLib 8.5 and later
  3826. * CarbonLib: in CarbonLib 1.0 and later
  3827. * Mac OS X: in version 10.0 and later
  3828. */
  3829. EXTERN_API( OSStatus )
  3830. TrackWindowProxyDrag(
  3831. WindowRef window,
  3832. Point startPt);
  3833. /*
  3834. * IsWindowModified()
  3835. *
  3836. * Availability:
  3837. * Non-Carbon CFM: in WindowsLib 8.5 and later
  3838. * CarbonLib: in CarbonLib 1.0 and later
  3839. * Mac OS X: in version 10.0 and later
  3840. */
  3841. EXTERN_API( Boolean )
  3842. IsWindowModified(WindowRef window);
  3843. /*
  3844. * SetWindowModified()
  3845. *
  3846. * Availability:
  3847. * Non-Carbon CFM: in WindowsLib 8.5 and later
  3848. * CarbonLib: in CarbonLib 1.0 and later
  3849. * Mac OS X: in version 10.0 and later
  3850. */
  3851. EXTERN_API( OSStatus )
  3852. SetWindowModified(
  3853. WindowRef window,
  3854. Boolean modified);
  3855. /*
  3856. * IsWindowPathSelectClick()
  3857. *
  3858. * Availability:
  3859. * Non-Carbon CFM: in WindowsLib 8.5 and later
  3860. * CarbonLib: in CarbonLib 1.0 and later
  3861. * Mac OS X: in version 10.0 and later
  3862. */
  3863. EXTERN_API( Boolean )
  3864. IsWindowPathSelectClick(
  3865. WindowRef window,
  3866. const EventRecord * event);
  3867. /*
  3868. * WindowPathSelect()
  3869. *
  3870. * Availability:
  3871. * Non-Carbon CFM: in WindowsLib 8.5 and later
  3872. * CarbonLib: in CarbonLib 1.0 and later
  3873. * Mac OS X: in version 10.0 and later
  3874. */
  3875. EXTERN_API( OSStatus )
  3876. WindowPathSelect(
  3877. WindowRef window,
  3878. MenuRef menu, /* can be NULL */
  3879. SInt32 * outMenuResult);
  3880. /*
  3881. * IsWindowPathSelectEvent()
  3882. *
  3883. * Availability:
  3884. * Non-Carbon CFM: not available
  3885. * CarbonLib: in CarbonLib 1.1 and later
  3886. * Mac OS X: in version 10.0 and later
  3887. */
  3888. EXTERN_API( Boolean )
  3889. IsWindowPathSelectEvent(
  3890. WindowRef window,
  3891. EventRef inEvent);
  3892. /*--------------------------------------------------------------------------------------*/
  3893. /* o HiliteWindowFrameForDrag */
  3894. /* */
  3895. /* If you call ShowDragHilite and HideDragHilite, you don't need to use this routine. */
  3896. /* If you implement custom drag hiliting, you should call HiliteWindowFrameForDrag */
  3897. /* when the drag is tracking inside a window with drag-hilited content. */
  3898. /*--------------------------------------------------------------------------------------*/
  3899. /* Routines available from Mac OS 8.5 forward*/
  3900. /*
  3901. * HiliteWindowFrameForDrag()
  3902. *
  3903. * Availability:
  3904. * Non-Carbon CFM: in WindowsLib 8.5 and later
  3905. * CarbonLib: in CarbonLib 1.0 and later
  3906. * Mac OS X: in version 10.0 and later
  3907. */
  3908. EXTERN_API( OSStatus )
  3909. HiliteWindowFrameForDrag(
  3910. WindowRef window,
  3911. Boolean hilited) TWOWORDINLINE(0x7019, 0xA829);
  3912. /*--------------------------------------------------------------------------------------*/
  3913. /* o Window Transitions */
  3914. /* */
  3915. /* TransitionWindow displays a window with accompanying animation and sound. */
  3916. /*--------------------------------------------------------------------------------------*/
  3917. /*
  3918. * WindowTransitionEffect
  3919. *
  3920. * Summary:
  3921. * Visual effects that are provided by TransitionWindow
  3922. */
  3923. typedef UInt32 WindowTransitionEffect;
  3924. enum {
  3925. /*
  3926. * Finder-like zoom rectangles. Use with TransitionWindow and Show or
  3927. * Hide transition actions
  3928. */
  3929. kWindowZoomTransitionEffect = 1,
  3930. /*
  3931. * Zoom in/out from parent. Use with TransitionWindowAndParent and
  3932. * Show or Hide transition actions. Available in Mac OS X, and in
  3933. * CarbonLib 1.5 and later.
  3934. */
  3935. kWindowSheetTransitionEffect = 2,
  3936. /*
  3937. * Slide the window into its new position. Use with TransitionWindow
  3938. * and Move or Resize transition actions. Available in Mac OS X, and
  3939. * in CarbonLib 1.5 and later.
  3940. */
  3941. kWindowSlideTransitionEffect = 3
  3942. };
  3943. /*
  3944. * WindowTransitionAction
  3945. *
  3946. * Summary:
  3947. * Modifications to window state that are provided by
  3948. * TransitionWindow
  3949. */
  3950. typedef UInt32 WindowTransitionAction;
  3951. enum {
  3952. /*
  3953. * Shows the window. Use with the Zoom or Sheet transition effects.
  3954. * The inRect parameter is the global coordinates from which to start
  3955. * the animation; if inRect is NULL, the animation begins at the
  3956. * center of the window.
  3957. */
  3958. kWindowShowTransitionAction = 1,
  3959. /*
  3960. * Hides the window. Use with the Zoom or Sheet transition effects.
  3961. * The inRect parameter is the global coordinates at which to end the
  3962. * animation; if inRect is NULL, the animation ends at the center of
  3963. * the window.
  3964. */
  3965. kWindowHideTransitionAction = 2,
  3966. /*
  3967. * Moves the window. Use with the Slide transition effect. The inRect
  3968. * parameter is the global coordinates of the window's new structure
  3969. * bounds; inRect must be non-NULL. Available in Mac OS X, and in
  3970. * CarbonLib 1.5 and later.
  3971. */
  3972. kWindowMoveTransitionAction = 3,
  3973. /*
  3974. * Resizes the window. Use with the Slide transition effect. The
  3975. * inRect parameter is the global coordinates of the window's new
  3976. * structure bounds; inRect must be non-NULL. Available in Mac OS X,
  3977. * and in CarbonLib 1.5 and later.
  3978. */
  3979. kWindowResizeTransitionAction = 4
  3980. };
  3981. /*
  3982. * TransitionWindow()
  3983. *
  3984. * Summary:
  3985. * Shows, hides, moves, or resizes a window with appropriate
  3986. * animation and sound.
  3987. *
  3988. * Parameters:
  3989. *
  3990. * inWindow:
  3991. * The window on which to act.
  3992. *
  3993. * inEffect:
  3994. * The type of visual effect to use. TransitionWindow supports the
  3995. * Zoom and Slide transition effects. The Slide effect is
  3996. * supported on Mac OS X and in CarbonLib 1.5 and later.
  3997. *
  3998. * inAction:
  3999. * The action to take on the window. TransitionWindow supports the
  4000. * Show, Hide, Move, and Resize actions. The Move and Resize
  4001. * actions are supported on Mac OS X and in CarbonLib 1.5 and
  4002. * later.
  4003. *
  4004. * inRect:
  4005. * A screen rect in global coordinates. The interpretation of the
  4006. * rect is dependent on the transition action; see the
  4007. * documentation for each action for details. May be NULL for some
  4008. * transition actions.
  4009. *
  4010. * Availability:
  4011. * Non-Carbon CFM: in WindowsLib 8.5 and later
  4012. * CarbonLib: in CarbonLib 1.0 and later
  4013. * Mac OS X: in version 10.0 and later
  4014. */
  4015. EXTERN_API( OSStatus )
  4016. TransitionWindow(
  4017. WindowRef inWindow,
  4018. WindowTransitionEffect inEffect,
  4019. WindowTransitionAction inAction,
  4020. const Rect * inRect); /* can be NULL */
  4021. /*
  4022. * TransitionWindowAndParent()
  4023. *
  4024. * Summary:
  4025. * Shows or hides a window, potentially also moving a second window,
  4026. * with appropriate animation and sound.
  4027. *
  4028. * Parameters:
  4029. *
  4030. * inWindow:
  4031. * The window on which to act.
  4032. *
  4033. * inParentWindow:
  4034. * The window to which the primary window is related.
  4035. *
  4036. * inEffect:
  4037. * The type of visual effect to use. TransitionWindowAndParent
  4038. * supports the Sheet transition effect.
  4039. *
  4040. * inAction:
  4041. * The action to take on the window. TransitionWindowAndParent
  4042. * supports the Show and Hide actions.
  4043. *
  4044. * inRect:
  4045. * A screen rect in global coordinates. The interpretation of the
  4046. * rect is dependent on the transition action; see the
  4047. * documentation for each action for details. May be NULL for some
  4048. * transition actions.
  4049. *
  4050. * Availability:
  4051. * Non-Carbon CFM: not available
  4052. * CarbonLib: in CarbonLib 1.5 and later
  4053. * Mac OS X: in version 10.0 and later
  4054. */
  4055. EXTERN_API( OSStatus )
  4056. TransitionWindowAndParent(
  4057. WindowRef inWindow,
  4058. WindowRef inParentWindow,
  4059. WindowTransitionEffect inEffect,
  4060. WindowTransitionAction inAction,
  4061. const Rect * inRect); /* can be NULL */
  4062. /*--------------------------------------------------------------------------------------*/
  4063. /* o Window Positioning */
  4064. /*--------------------------------------------------------------------------------------*/
  4065. /*
  4066. * [Mac]MoveWindow()
  4067. *
  4068. * Availability:
  4069. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  4070. * CarbonLib: in CarbonLib 1.0 and later
  4071. * Mac OS X: in version 10.0 and later
  4072. */
  4073. #if TARGET_OS_MAC
  4074. #define MacMoveWindow MoveWindow
  4075. #endif
  4076. EXTERN_API( void )
  4077. MacMoveWindow(
  4078. WindowRef window,
  4079. short hGlobal,
  4080. short vGlobal,
  4081. Boolean front) ONEWORDINLINE(0xA91B);
  4082. /*
  4083. * SizeWindow()
  4084. *
  4085. * Availability:
  4086. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  4087. * CarbonLib: in CarbonLib 1.0 and later
  4088. * Mac OS X: in version 10.0 and later
  4089. */
  4090. EXTERN_API( void )
  4091. SizeWindow(
  4092. WindowRef window,
  4093. short w,
  4094. short h,
  4095. Boolean fUpdate) ONEWORDINLINE(0xA91D);
  4096. /* Note: bBox can only be NULL when linking to CarbonLib 1.0 forward */
  4097. /*
  4098. * GrowWindow()
  4099. *
  4100. * Availability:
  4101. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  4102. * CarbonLib: in CarbonLib 1.0 and later
  4103. * Mac OS X: in version 10.0 and later
  4104. */
  4105. EXTERN_API( long )
  4106. GrowWindow(
  4107. WindowRef window,
  4108. Point startPt,
  4109. const Rect * bBox) /* can be NULL */ ONEWORDINLINE(0xA92B);
  4110. /* Note: boundsRect can only be NULL when linking to CarbonLib 1.0 forward */
  4111. /*
  4112. * DragWindow()
  4113. *
  4114. * Availability:
  4115. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  4116. * CarbonLib: in CarbonLib 1.0 and later
  4117. * Mac OS X: in version 10.0 and later
  4118. */
  4119. EXTERN_API( void )
  4120. DragWindow(
  4121. WindowRef window,
  4122. Point startPt,
  4123. const Rect * boundsRect) /* can be NULL */ ONEWORDINLINE(0xA925);
  4124. /*
  4125. * ZoomWindow()
  4126. *
  4127. * Availability:
  4128. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  4129. * CarbonLib: in CarbonLib 1.0 and later
  4130. * Mac OS X: in version 10.0 and later
  4131. */
  4132. EXTERN_API( void )
  4133. ZoomWindow(
  4134. WindowRef window,
  4135. WindowPartCode partCode,
  4136. Boolean front) ONEWORDINLINE(0xA83A);
  4137. /*--------------------------------------------------------------------------------------*/
  4138. /* o Window Collapsing/Expanding */
  4139. /*--------------------------------------------------------------------------------------*/
  4140. /* Routines available from Mac OS 8.0 (Appearance 1.0) forward*/
  4141. /*
  4142. * IsWindowCollapsable()
  4143. *
  4144. * Availability:
  4145. * Non-Carbon CFM: in AppearanceLib 1.0 and later
  4146. * CarbonLib: in CarbonLib 1.0 and later
  4147. * Mac OS X: in version 10.0 and later
  4148. */
  4149. EXTERN_API( Boolean )
  4150. IsWindowCollapsable(WindowRef window) THREEWORDINLINE(0x303C, 0x000F, 0xAA74);
  4151. /*
  4152. * IsWindowCollapsed()
  4153. *
  4154. * Availability:
  4155. * Non-Carbon CFM: in AppearanceLib 1.0 and later
  4156. * CarbonLib: in CarbonLib 1.0 and later
  4157. * Mac OS X: in version 10.0 and later
  4158. */
  4159. EXTERN_API( Boolean )
  4160. IsWindowCollapsed(WindowRef window) THREEWORDINLINE(0x303C, 0x0010, 0xAA74);
  4161. /*
  4162. * CollapseWindow()
  4163. *
  4164. * Availability:
  4165. * Non-Carbon CFM: in AppearanceLib 1.0 and later
  4166. * CarbonLib: in CarbonLib 1.0 and later
  4167. * Mac OS X: in version 10.0 and later
  4168. */
  4169. EXTERN_API( OSStatus )
  4170. CollapseWindow(
  4171. WindowRef window,
  4172. Boolean collapse) THREEWORDINLINE(0x303C, 0x0011, 0xAA74);
  4173. /*
  4174. * CollapseAllWindows()
  4175. *
  4176. * Availability:
  4177. * Non-Carbon CFM: in AppearanceLib 1.0 and later
  4178. * CarbonLib: in CarbonLib 1.0 and later
  4179. * Mac OS X: in version 10.0 and later
  4180. */
  4181. EXTERN_API( OSStatus )
  4182. CollapseAllWindows(Boolean collapse) THREEWORDINLINE(0x303C, 0x0012, 0xAA74);
  4183. /* Routines available on Mac OS X*/
  4184. /*
  4185. * CreateQDContextForCollapsedWindowDockTile()
  4186. *
  4187. * Discussion:
  4188. * Creates and returns a CGrafPtr for a collapsed window's tile in
  4189. * the dock. You can use this port to draw into your window's dock
  4190. * tile with Quickdraw. You **MUST** call
  4191. * ReleaseQDContextForCollapsedWindowDockTile and NOT DisposePort
  4192. * when using this API, as it maintains more state than just the
  4193. * port. If you call DisposePort, you may leak system resources.
  4194. *
  4195. * Parameters:
  4196. *
  4197. * inWindow:
  4198. * The window to create the dock tile port for. If this window is
  4199. * not collapsed, an error is returned.
  4200. *
  4201. * outContext:
  4202. * The Quickdraw port for you to use to draw into. If you wish to
  4203. * use CoreGraphics (Quartz) drawing, call CreateCGContextForPort
  4204. * with this port to obtain a CGContext.
  4205. *
  4206. * Result:
  4207. * An operating system result code.
  4208. *
  4209. * Availability:
  4210. * Non-Carbon CFM: not available
  4211. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.0 and later
  4212. * Mac OS X: in version 10.0 and later
  4213. */
  4214. EXTERN_API_C( OSStatus )
  4215. CreateQDContextForCollapsedWindowDockTile(
  4216. WindowRef inWindow,
  4217. CGrafPtr * outContext);
  4218. /*
  4219. * ReleaseQDContextForCollapsedWindowDockTile()
  4220. *
  4221. * Discussion:
  4222. * Releases a port and other state created by the
  4223. * CreateQDContextForCollapsedWindowDockTile API. You MUST call this
  4224. * instead of DisposePort directly, or you may leak system resources.
  4225. *
  4226. * Parameters:
  4227. *
  4228. * inWindow:
  4229. * The window you created the port for. If this window is not
  4230. * collapsed, an error is returned.
  4231. *
  4232. * inContext:
  4233. * The Quickdraw context to dispose.
  4234. *
  4235. * Result:
  4236. * An operating system result code.
  4237. *
  4238. * Availability:
  4239. * Non-Carbon CFM: not available
  4240. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.0 and later
  4241. * Mac OS X: in version 10.0 and later
  4242. */
  4243. EXTERN_API_C( OSStatus )
  4244. ReleaseQDContextForCollapsedWindowDockTile(
  4245. WindowRef inWindow,
  4246. CGrafPtr inContext);
  4247. /*
  4248. * UpdateCollapsedWindowDockTile()
  4249. *
  4250. * Discussion:
  4251. * Automatically updates the image of a particular window in the
  4252. * dock to the current contents of the window. Use this for periodic
  4253. * updates, etc. Do not use this for animation purposes, if you want
  4254. * animation, use the above create/release drawing context APIs.
  4255. *
  4256. * Parameters:
  4257. *
  4258. * inWindow:
  4259. * The window to update the dock tile for. If this window is not
  4260. * collapsed, an error is returned.
  4261. *
  4262. * Result:
  4263. * An operating system result code.
  4264. *
  4265. * Availability:
  4266. * Non-Carbon CFM: not available
  4267. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.0 and later
  4268. * Mac OS X: in version 10.0 and later
  4269. */
  4270. EXTERN_API_C( OSStatus )
  4271. UpdateCollapsedWindowDockTile(WindowRef inWindow);
  4272. /*
  4273. * SetWindowDockTileMenu()
  4274. *
  4275. * Summary:
  4276. * Sets the menu that is displayed by a window's dock tile.
  4277. *
  4278. * Discussion:
  4279. * When a window's dock tile menu is right-clicked or
  4280. * control-clicked, the Dock will always automatically display a
  4281. * menu containing a Close menu item that closes the window. If the
  4282. * application wants to add other additional menu items, it can use
  4283. * the SetWindowDockTileMenu API to provide those items. The items
  4284. * in the specified menu will be combined with the standard items
  4285. * provided by the Dock.
  4286. *
  4287. * Before the menu is actually displayed, it will receive
  4288. * kEventMenuPopulate, kEventMenuOpening, and kEventMenuEnableItems
  4289. * Carbon events, so any event handlers for these events may update
  4290. * the menu appropriately for the current state of the
  4291. * application.
  4292. *
  4293. * The application should set a command ID for each menu item in the
  4294. * dock tile menu, and when that item is chosen, a
  4295. * kEventCommandProcess Carbon event containing the item's command
  4296. * ID will be sent to the window's event target (and from there to
  4297. * the application, if the window does not handle the
  4298. * event).
  4299. *
  4300. * This API increments the refcount of the specified menu.
  4301. *
  4302. * The toolbox provides a default handler for the
  4303. * kEventWindowGetDockTileMenu event that returns the menu specified
  4304. * by the SetWindowDockTileMenu API.
  4305. *
  4306. * Parameters:
  4307. *
  4308. * inWindow:
  4309. * The window for which to set the dock tile menu.
  4310. *
  4311. * inMenu:
  4312. * The menu to display, or NULL to remove the current dock tile
  4313. * menu.
  4314. *
  4315. * Availability:
  4316. * Non-Carbon CFM: not available
  4317. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.2 and later
  4318. * Mac OS X: in version 10.2 and later
  4319. */
  4320. EXTERN_API_C( OSStatus )
  4321. SetWindowDockTileMenu(
  4322. WindowRef inWindow,
  4323. MenuRef inMenu); /* can be NULL */
  4324. /*
  4325. * GetWindowDockTileMenu()
  4326. *
  4327. * Summary:
  4328. * Returns the menu that is displayed by a window's dock tile.
  4329. *
  4330. * Result:
  4331. * The application's dock tile menu, or NULL if none.
  4332. *
  4333. * Availability:
  4334. * Non-Carbon CFM: not available
  4335. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.2 and later
  4336. * Mac OS X: in version 10.2 and later
  4337. */
  4338. EXTERN_API_C( MenuRef )
  4339. GetWindowDockTileMenu(WindowRef inWindow);
  4340. /*
  4341. Routines available from Mac OS 8.5 forward
  4342. or from Mac OS 8.1 forward when linking to CarbonLib 1.0 forward
  4343. */
  4344. /*
  4345. * GetWindowBounds()
  4346. *
  4347. * Availability:
  4348. * Non-Carbon CFM: in WindowsLib 8.5 and later
  4349. * CarbonLib: in CarbonLib 1.0 and later
  4350. * Mac OS X: in version 10.0 and later
  4351. */
  4352. EXTERN_API( OSStatus )
  4353. GetWindowBounds(
  4354. WindowRef window,
  4355. WindowRegionCode regionCode,
  4356. Rect * globalBounds);
  4357. /*
  4358. * SetWindowResizeLimits()
  4359. *
  4360. * Summary:
  4361. * Sets the minimum and maximum content sizes for a window.
  4362. *
  4363. * Discussion:
  4364. * The minimum and maximum sizes are obeyed by ResizeWindow and
  4365. * GrowWindow. The default Carbon event handler installed for all
  4366. * windows will return these sizes in response to
  4367. * kEventWindowGetMinimumSize and kEventWindowGetMaximumSize events.
  4368. * When a window is first created, its minimum and maximum sizes are
  4369. * set to reasonable values (which may change from one system
  4370. * release to the next).
  4371. *
  4372. * Parameters:
  4373. *
  4374. * inWindow:
  4375. * The window whose minimum and maximum sizes to set.
  4376. *
  4377. * inMinLimits:
  4378. * The new minimum size for the content region of the window. Pass
  4379. * NULL if you don't want to set a minimum size.
  4380. *
  4381. * inMaxLimits:
  4382. * The new maximum size for the content region of the window. Pass
  4383. * NULL if you don't want to set a maximum size.
  4384. *
  4385. * Result:
  4386. * An operating system result code.
  4387. *
  4388. * Availability:
  4389. * Non-Carbon CFM: not available
  4390. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.2 and later
  4391. * Mac OS X: in version 10.2 and later
  4392. */
  4393. EXTERN_API_C( OSStatus )
  4394. SetWindowResizeLimits(
  4395. WindowRef inWindow,
  4396. const HISize * inMinLimits, /* can be NULL */
  4397. const HISize * inMaxLimits); /* can be NULL */
  4398. /*
  4399. * GetWindowResizeLimits()
  4400. *
  4401. * Summary:
  4402. * Returns the minimum and maximum content sizes for a window.
  4403. *
  4404. * Discussion:
  4405. * GetWindowResizeLimits returns the minimum and maximum sizes that
  4406. * were set by SetWindowResizeLimits. Note that it does not send
  4407. * kEventWindowGetMinimumSize or kEventWindowGetMaximumSize Carbon
  4408. * events to get these sizes; it simply retrieves the sizes from the
  4409. * WindowRef. It is entirely possible (and quite likely) that a
  4410. * given window will have event handlers for the
  4411. * kEventWindowGetMinimum/MaximumSize events that will modify or
  4412. * override the sizes in the WindowRef; therefore, to accurately
  4413. * determine the desired minimum and maximum sizes, you should send
  4414. * kEventWindowGetMinimum/MaximumSize Carbon events rather than
  4415. * using this API.
  4416. *
  4417. * Parameters:
  4418. *
  4419. * inWindow:
  4420. * The window whose minimum and maximum sizes to retrieve.
  4421. *
  4422. * outMinLimits:
  4423. * On exit, contains the minimum size of the window's content
  4424. * region. Pass NULL if you don't want this information.
  4425. *
  4426. * outMaxLimits:
  4427. * On exit, contains the maximum size of the window's content
  4428. * region. Pass NULL if you don't want this information.
  4429. *
  4430. * Result:
  4431. * An operating system result code.
  4432. *
  4433. * Availability:
  4434. * Non-Carbon CFM: not available
  4435. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.2 and later
  4436. * Mac OS X: in version 10.2 and later
  4437. */
  4438. EXTERN_API_C( OSStatus )
  4439. GetWindowResizeLimits(
  4440. WindowRef inWindow,
  4441. HISize * outMinLimits, /* can be NULL */
  4442. HISize * outMaxLimits); /* can be NULL */
  4443. /*
  4444. * ResizeWindow()
  4445. *
  4446. * Summary:
  4447. * Handles all user interaction while a window is being resized.
  4448. *
  4449. * Discussion:
  4450. * The ResizeWindow function moves either an outline of the window's
  4451. * edges (on Mac OS 9.x and earlier) or the actual window (on Mac OS
  4452. * X) around the screen, following the user's cursor movements, and
  4453. * handles all user interaction until the mouse button is released.
  4454. * Unlike the GrowWindow API, there is no need to follow this call
  4455. * with a call to the function SizeWindow, because once the mouse
  4456. * button is released, ResizeWindow resizes the window if the user
  4457. * has changed the window size. Once the resizing is complete,
  4458. * ResizeWindow draws the window in the new size. Your application
  4459. * should call the ResizeWindow function instead of the earlier
  4460. * Window Manager APIs SizeWindow and GrowWindow. Some windows may
  4461. * allow themselves to be resized from any corner or edge, not just
  4462. * the bottom right, and as a result, when the user resizes the
  4463. * window, the window may move on the screen and not merely change
  4464. * size. ResizeWindow informs your application of the new window
  4465. * bounds, so that your application can respond to any changes in
  4466. * the window's position.
  4467. *
  4468. * Parameters:
  4469. *
  4470. * inWindow:
  4471. * The window to be resized.
  4472. *
  4473. * inStartPoint:
  4474. * The point, in global coordinates, at which the original
  4475. * mouse-down occurred.
  4476. *
  4477. * inSizeConstraints:
  4478. * The limits on the vertical and horizontal measurements of the
  4479. * content rectangle, in pixels. Although this parameter is typed
  4480. * as a Rect, the four numbers in the structure represent limits,
  4481. * not screen coordinates. The top, left, bottom, and right fields
  4482. * of the structure specify the minimum vertical measurement
  4483. * (top), the minimum horizontal measurement (left), the maximum
  4484. * vertical measurement (bottom), and the maximum horizontal
  4485. * measurement (right). The minimum dimensions should be large
  4486. * enough to allow a manageable rectangle; 64 pixels on a side is
  4487. * typical. The maximum dimensions can be no greater than 32,767.
  4488. * You can pass NULL to allow the user to resize the window to any
  4489. * size that is contained onscreen.
  4490. *
  4491. * outNewContentRect:
  4492. * On exit, the structure contains the new dimensions of the
  4493. * window's content region, in global coordinates. On Mac OS 9.x
  4494. * and earlier, you must pass a non-NULL value in this parameter;
  4495. * in Carbon, you may pass NULL if you do not need the window's
  4496. * new dimensions.
  4497. *
  4498. * Result:
  4499. * Returns true if the window changed size, or false if not.
  4500. *
  4501. * Availability:
  4502. * Non-Carbon CFM: in WindowsLib 8.5 and later
  4503. * CarbonLib: in CarbonLib 1.0 and later
  4504. * Mac OS X: in version 10.0 and later
  4505. */
  4506. EXTERN_API( Boolean )
  4507. ResizeWindow(
  4508. WindowRef inWindow,
  4509. Point inStartPoint,
  4510. const Rect * inSizeConstraints, /* can be NULL */
  4511. Rect * outNewContentRect); /* can be NULL */
  4512. /*
  4513. Routines available from Mac OS 8.5 forward,
  4514. or from Mac OS 8.1 forward when linking to CarbonLib 1.0.2 forward
  4515. */
  4516. /*
  4517. * SetWindowBounds()
  4518. *
  4519. * Availability:
  4520. * Non-Carbon CFM: in WindowsLib 8.5 and later
  4521. * CarbonLib: in CarbonLib 1.0 and later
  4522. * Mac OS X: in version 10.0 and later
  4523. */
  4524. EXTERN_API( OSStatus )
  4525. SetWindowBounds(
  4526. WindowRef window,
  4527. WindowRegionCode regionCode,
  4528. const Rect * globalBounds);
  4529. /* Routines available from Mac OS 8.5 forward*/
  4530. /*
  4531. * RepositionWindow()
  4532. *
  4533. * Availability:
  4534. * Non-Carbon CFM: in WindowsLib 8.5 and later
  4535. * CarbonLib: in CarbonLib 1.0 and later
  4536. * Mac OS X: in version 10.0 and later
  4537. */
  4538. EXTERN_API( OSStatus )
  4539. RepositionWindow(
  4540. WindowRef window,
  4541. WindowRef parentWindow,
  4542. WindowPositionMethod method);
  4543. /*
  4544. * MoveWindowStructure()
  4545. *
  4546. * Availability:
  4547. * Non-Carbon CFM: in WindowsLib 8.5 and later
  4548. * CarbonLib: in CarbonLib 1.0 and later
  4549. * Mac OS X: in version 10.0 and later
  4550. */
  4551. EXTERN_API( OSStatus )
  4552. MoveWindowStructure(
  4553. WindowRef window,
  4554. short hGlobal,
  4555. short vGlobal);
  4556. /*
  4557. Routines available from Mac OS 8.5 forward,
  4558. or from Mac OS 8.6 forward when linking to CarbonLib 1.1 forward
  4559. */
  4560. /* Routines available from Mac OS 8.5 forward*/
  4561. /*
  4562. * IsWindowInStandardState()
  4563. *
  4564. * Summary:
  4565. * Determines whether a window is currently zoomed in to the user
  4566. * state or zoomed out to the standard state.
  4567. *
  4568. * Discussion:
  4569. * IsWindowInStandardState compares the window's current dimensions
  4570. * to those given by the inIdealSize parameter to determine if the
  4571. * window is currently in its standard (zoomed-out) state. Your
  4572. * application may use IsWindowInStandardState to decide whether a
  4573. * user's click of the zoom box is a request to zoom in to the user
  4574. * state or out to the standard state. Your application may also use
  4575. * IsWindowInStandardState to determine the size and position of the
  4576. * standard state that the Window Manager would calculate for a
  4577. * window, given a specified ideal size; this value is returned in
  4578. * the outIdealStandardState parameter.
  4579. *
  4580. * Parameters:
  4581. *
  4582. * inWindow:
  4583. * The window for which to determine the zoom state.
  4584. *
  4585. * inIdealSize:
  4586. * The ideal width and height of the window's content region,
  4587. * regardless of the actual screen device dimensions. If you set
  4588. * idealSize to NULL, IsWindowInStandardState examines the
  4589. * dimensions stored in the stdState field of the WStateData
  4590. * structure attached to the window.
  4591. *
  4592. * outIdealStandardState:
  4593. * On exit, contains the global coordinates for the content region
  4594. * of the window in its standard state, based on the data supplied
  4595. * in the inIdealSize parameter. You may pass NULL if you do not
  4596. * need this information.
  4597. *
  4598. * Result:
  4599. * Returns true if the window is currently in its standard
  4600. * (zoomed-out) state, or false if the window is a non-zoomed-out
  4601. * state.
  4602. *
  4603. * Availability:
  4604. * Non-Carbon CFM: in WindowsLib 8.5 and later
  4605. * CarbonLib: in CarbonLib 1.0 and later
  4606. * Mac OS X: in version 10.0 and later
  4607. */
  4608. EXTERN_API( Boolean )
  4609. IsWindowInStandardState(
  4610. WindowRef inWindow,
  4611. const Point * inIdealSize, /* can be NULL */
  4612. Rect * outIdealStandardState); /* can be NULL */
  4613. /*
  4614. * ZoomWindowIdeal()
  4615. *
  4616. * Summary:
  4617. * Zooms a window in accordance with human interface guidelines.
  4618. *
  4619. * Discussion:
  4620. * Applications should use the ZoomWindowIdeal API instead of the
  4621. * older ZoomWindow API. When your application calls
  4622. * ZoomWindowIdeal, it automatically conforms to the human interface
  4623. * guidelines for determining a window's standard state: the window
  4624. * is moved as little as possible when switching between user and
  4625. * standard states, the window is zoomed to the screen that contains
  4626. * the largest portion of the window, and the window is positioned
  4627. * in its zoomed-out size to avoid the Dock on Mac OS X. The
  4628. * ZoomWindowIdeal API calculates a window's ideal standard state
  4629. * and updates a window's ideal user state independently of the
  4630. * WStateData structure. Previously, the window definition function
  4631. * was responsible for updating the user state, but because it
  4632. * relies upon the WStateData structure, the window definition
  4633. * function is unaware of the ideal standard state and can no longer
  4634. * track the window's zoom state reliably. The Window Manager
  4635. * provides the GetWindowIdealUserState and SetWindowIdealUserState
  4636. * APIs to access a window's current ideal user state, previously
  4637. * recorded by ZoomWindowIdeal.
  4638. *
  4639. * Parameters:
  4640. *
  4641. * inWindow:
  4642. * The window to be zoomed.
  4643. *
  4644. * inPartCode:
  4645. * The direction of the zoom, either inZoomIn or inZoomOut. The
  4646. * value passed in this parameter should generally be determined
  4647. * by calling IsWindowInStandardState; if IsWindowInStandardState
  4648. * returns true, pass inZoomIn, otherwise pass inZoomOut.
  4649. *
  4650. * ioIdealSize:
  4651. * When you specify inZoomIn in the inPartCode parameter, this
  4652. * parameter is unused on entry; you pass a pointer to a Point
  4653. * structure, but do not fill the structure with data. On exit,
  4654. * the Point contains the new height and width of the window's
  4655. * content region, and ZoomWindowIdeal restores the previous ideal
  4656. * user state. When you specify inZoomOut in the inPartCode
  4657. * parameter, you pass the ideal height and width of the window's
  4658. * content region in the Point structure. On return, the Point
  4659. * contains the new height and width of the window's content
  4660. * region; ZoomWindowIdeal saves the current user state of the
  4661. * window and zooms the window to its ideal size for the standard
  4662. * state.
  4663. *
  4664. * Result:
  4665. * An operating system result code.
  4666. *
  4667. * Availability:
  4668. * Non-Carbon CFM: in WindowsLib 8.5 and later
  4669. * CarbonLib: in CarbonLib 1.0 and later
  4670. * Mac OS X: in version 10.0 and later
  4671. */
  4672. EXTERN_API( OSStatus )
  4673. ZoomWindowIdeal(
  4674. WindowRef inWindow,
  4675. WindowPartCode inPartCode,
  4676. Point * ioIdealSize);
  4677. /*
  4678. * GetWindowIdealUserState()
  4679. *
  4680. * Summary:
  4681. * Returns the bounds of a window's content region in its user
  4682. * (zoomed-in) state.
  4683. *
  4684. * Discussion:
  4685. * Traditionally, the user (zoomed-in) state of a window has been
  4686. * stored in the WStateData structure attached to a window. This
  4687. * field is updated by the window definition when the user clicks on
  4688. * the zoom box and the window definition determines that the window
  4689. * is currently not zoomed out. When determining whether the window
  4690. * is zoomed out, however, the window definition can only look at
  4691. * the standard state stored in the WStateData field. With the
  4692. * introduction of the ZoomWindowIdeal API, there is a new basis for
  4693. * determining whether a window is zoomed out: the window's ideal
  4694. * size. The window definition does not have access to the window's
  4695. * ideal size, and therefore cannot accurately determine whether a
  4696. * window that is zoomed with ZoomWindowIdeal is in its user state
  4697. * or standard state; therefore, the user state that the window
  4698. * definition stores in the WStateData is also unreliable. The
  4699. * ZoomWindowIdeal API therefore stores the window's user state
  4700. * before zooming out in a new location, which is accessed using the
  4701. * GetWindowIdealUserState API. The GetWindowIdealUserState API
  4702. * returns the window's user state most recently recorded by
  4703. * ZoomWindowIdeal.
  4704. *
  4705. * Parameters:
  4706. *
  4707. * inWindow:
  4708. * The window whose ideal user state you wish to retrieve.
  4709. *
  4710. * outUserState:
  4711. * On exit, contains the global coordinates of the window's
  4712. * content region when zoomed in. On Mac OS X 10.1 and earlier,
  4713. * and CarbonLib 1.5 and earlier, the window's ideal user state is
  4714. * an empty rect with coordinates (0,0,0,0) if the window has
  4715. * never been zoomed out; you should check for an empty rect and
  4716. * use GetWindowBounds with the kWindowContentRgn selector to
  4717. * determine the window's current content region. On later
  4718. * versions of Mac OS X and CarbonLib, GetWindowIdealUserState
  4719. * automatically returns the window's current content bounds if
  4720. * the window has not yet been zoomed.
  4721. *
  4722. * Result:
  4723. * An operating system result code.
  4724. *
  4725. * Availability:
  4726. * Non-Carbon CFM: in WindowsLib 8.5 and later
  4727. * CarbonLib: in CarbonLib 1.0 and later
  4728. * Mac OS X: in version 10.0 and later
  4729. */
  4730. EXTERN_API( OSStatus )
  4731. GetWindowIdealUserState(
  4732. WindowRef inWindow,
  4733. Rect * outUserState);
  4734. /*
  4735. * SetWindowIdealUserState()
  4736. *
  4737. * Summary:
  4738. * Sets the bounds of a window's content region in its user
  4739. * (zoomed-in) state.
  4740. *
  4741. * Discussion:
  4742. * The window's ideal user state is used by the ZoomWindowIdeal API
  4743. * when zooming in. The ideal user state is ignored by the
  4744. * ZoomWindow API.
  4745. *
  4746. * Parameters:
  4747. *
  4748. * inWindow:
  4749. * The window whose ideal user state to set.
  4750. *
  4751. * inUserState:
  4752. * The global coordinates of the window's content region in its
  4753. * ideal user state.
  4754. *
  4755. * Result:
  4756. * An operating system result code.
  4757. *
  4758. * Availability:
  4759. * Non-Carbon CFM: in WindowsLib 8.5 and later
  4760. * CarbonLib: in CarbonLib 1.0 and later
  4761. * Mac OS X: in version 10.0 and later
  4762. */
  4763. EXTERN_API( OSStatus )
  4764. SetWindowIdealUserState(
  4765. WindowRef inWindow,
  4766. const Rect * inUserState);
  4767. /* Routines available in CarbonLib 1.1 and later*/
  4768. /*
  4769. * GetWindowGreatestAreaDevice()
  4770. *
  4771. * Summary:
  4772. * Returns the graphics device with the greatest area of
  4773. * intersection with a specified window region.
  4774. *
  4775. * Parameters:
  4776. *
  4777. * inWindow:
  4778. * The window to compare against.
  4779. *
  4780. * inRegion:
  4781. * The window region to compare against.
  4782. *
  4783. * outGreatestDevice:
  4784. * On exit, the graphics device with the greatest intersection.
  4785. * May be NULL.
  4786. *
  4787. * outGreatestDeviceRect:
  4788. * On exit, the bounds of the graphics device with the greatest
  4789. * intersection. May be NULL. If the device with the greatest
  4790. * intersection also contains the menu bar, the device rect will
  4791. * exclude the menu bar area.
  4792. *
  4793. * Availability:
  4794. * Non-Carbon CFM: not available
  4795. * CarbonLib: in CarbonLib 1.1 and later
  4796. * Mac OS X: in version 10.0 and later
  4797. */
  4798. EXTERN_API( OSStatus )
  4799. GetWindowGreatestAreaDevice(
  4800. WindowRef inWindow,
  4801. WindowRegionCode inRegion,
  4802. GDHandle * outGreatestDevice, /* can be NULL */
  4803. Rect * outGreatestDeviceRect); /* can be NULL */
  4804. /*
  4805. * WindowConstrainOptions
  4806. *
  4807. */
  4808. typedef UInt32 WindowConstrainOptions;
  4809. enum {
  4810. /*
  4811. * The window may be resized if necessary to make it fit onscreen.
  4812. */
  4813. kWindowConstrainMayResize = (1L << 0),
  4814. /*
  4815. * The window will be moved even if it doesn't fit entirely onscreen.
  4816. */
  4817. kWindowConstrainMoveRegardlessOfFit = (1L << 1),
  4818. /*
  4819. * Allow partial intersection of the specified window region with the
  4820. * screen, instead of requiring total intersection.
  4821. */
  4822. kWindowConstrainAllowPartial = (1L << 2),
  4823. /*
  4824. * Only calculate the new window bounds; don't actually move the
  4825. * window.
  4826. */
  4827. kWindowConstrainCalcOnly = (1L << 3),
  4828. /*
  4829. * Use TransitionWindow with kWindowSlideTransitionEffect to move
  4830. * windows onscreen. Available in Mac OS X 10.2.
  4831. */
  4832. kWindowConstrainUseTransitionWindow = (1L << 4),
  4833. /*
  4834. * The most common options: don't resize the window, move the window
  4835. * regardless of fit to the screen, require total intersection of the
  4836. * specified window region with the screen, and do actually move the
  4837. * window.
  4838. */
  4839. kWindowConstrainStandardOptions = kWindowConstrainMoveRegardlessOfFit
  4840. };
  4841. /*
  4842. * ConstrainWindowToScreen()
  4843. *
  4844. * Summary:
  4845. * Moves and resizes a window so that it's contained entirely on a
  4846. * single screen.
  4847. *
  4848. * Parameters:
  4849. *
  4850. * inWindowRef:
  4851. * The window to constrain.
  4852. *
  4853. * inRegionCode:
  4854. * The window region to constrain.
  4855. *
  4856. * inOptions:
  4857. * Flags controlling how the window is constrained.
  4858. *
  4859. * inScreenRect:
  4860. * A rectangle, in global coordinates, in which to constrain the
  4861. * window. May be NULL. If NULL, the window is constrained to the
  4862. * screen with the greatest intersection with the specified window
  4863. * region.
  4864. *
  4865. * outStructure:
  4866. * On exit, contains the new structure bounds of the window, in
  4867. * global coordinates. May be NULL.
  4868. *
  4869. * Availability:
  4870. * Non-Carbon CFM: not available
  4871. * CarbonLib: in CarbonLib 1.1 and later
  4872. * Mac OS X: in version 10.0 and later
  4873. */
  4874. EXTERN_API( OSStatus )
  4875. ConstrainWindowToScreen(
  4876. WindowRef inWindowRef,
  4877. WindowRegionCode inRegionCode,
  4878. WindowConstrainOptions inOptions,
  4879. const Rect * inScreenRect, /* can be NULL */
  4880. Rect * outStructure); /* can be NULL */
  4881. /*
  4882. * GetAvailableWindowPositioningBounds()
  4883. *
  4884. * Summary:
  4885. * Returns the available window positioning bounds on the given
  4886. * screen (i.e., the screen rect minus the MenuBar and Dock if
  4887. * located on that screen).
  4888. *
  4889. * Parameters:
  4890. *
  4891. * inDevice:
  4892. * The device for which to find the available bounds.
  4893. *
  4894. * outAvailableRect:
  4895. * On exit, contains the available bounds for the given device.
  4896. *
  4897. * Availability:
  4898. * Non-Carbon CFM: not available
  4899. * CarbonLib: in CarbonLib 1.3 and later
  4900. * Mac OS X: in version 10.0 and later
  4901. */
  4902. EXTERN_API( OSStatus )
  4903. GetAvailableWindowPositioningBounds(
  4904. GDHandle inDevice,
  4905. Rect * outAvailableRect);
  4906. /*
  4907. * GetAvailableWindowPositioningRegion()
  4908. *
  4909. * Summary:
  4910. * Returns the available window positioning region on the given
  4911. * screen (i.e., the screen rect minus the MenuBar and Dock if
  4912. * located on that screen).
  4913. *
  4914. * Discussion:
  4915. * GetAvailableWindowPositionRegion differs from
  4916. * GetAvailableWindowPositioningBounds in that the Bounds API
  4917. * removes the entire area that may theoretically be covered by the
  4918. * Dock, even if the the Dock does not currently reach from edge to
  4919. * edge of the device on which it is positioned. The Region API
  4920. * includes the area at the sides of the Dock that is not covered by
  4921. * the Dock in the available region.
  4922. *
  4923. * Parameters:
  4924. *
  4925. * inDevice:
  4926. * The device for which to find the available bounds.
  4927. *
  4928. * ioRgn:
  4929. * On entry, contains a preallocated RgnHandle. On exit, the
  4930. * RgnHandle has been modified to contain the available region for
  4931. * the given device.
  4932. *
  4933. * Availability:
  4934. * Non-Carbon CFM: not available
  4935. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.2 and later
  4936. * Mac OS X: in version 10.2 and later
  4937. */
  4938. EXTERN_API_C( OSStatus )
  4939. GetAvailableWindowPositioningRegion(
  4940. GDHandle inDevice,
  4941. RgnHandle ioRgn);
  4942. /*--------------------------------------------------------------------------------------*/
  4943. /* o Window Visibility */
  4944. /*--------------------------------------------------------------------------------------*/
  4945. /*
  4946. * HideWindow()
  4947. *
  4948. * Availability:
  4949. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  4950. * CarbonLib: in CarbonLib 1.0 and later
  4951. * Mac OS X: in version 10.0 and later
  4952. */
  4953. EXTERN_API( void )
  4954. HideWindow(WindowRef window) ONEWORDINLINE(0xA916);
  4955. /*
  4956. * [Mac]ShowWindow()
  4957. *
  4958. * Availability:
  4959. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  4960. * CarbonLib: in CarbonLib 1.0 and later
  4961. * Mac OS X: in version 10.0 and later
  4962. */
  4963. #if TARGET_OS_MAC
  4964. #define MacShowWindow ShowWindow
  4965. #endif
  4966. EXTERN_API( void )
  4967. MacShowWindow(WindowRef window) ONEWORDINLINE(0xA915);
  4968. /*
  4969. * ShowHide()
  4970. *
  4971. * Availability:
  4972. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  4973. * CarbonLib: in CarbonLib 1.0 and later
  4974. * Mac OS X: in version 10.0 and later
  4975. */
  4976. EXTERN_API( void )
  4977. ShowHide(
  4978. WindowRef window,
  4979. Boolean showFlag) ONEWORDINLINE(0xA908);
  4980. /*
  4981. * [Mac]IsWindowVisible()
  4982. *
  4983. * Availability:
  4984. * Non-Carbon CFM: in CarbonAccessors.o 1.0 and later or as macro/inline
  4985. * CarbonLib: in CarbonLib 1.0 and later
  4986. * Mac OS X: in version 10.0 and later
  4987. */
  4988. #if TARGET_OS_MAC
  4989. #define MacIsWindowVisible IsWindowVisible
  4990. #endif
  4991. EXTERN_API( Boolean )
  4992. MacIsWindowVisible(WindowRef window);
  4993. #if !OPAQUE_TOOLBOX_STRUCTS && !ACCESSOR_CALLS_ARE_FUNCTIONS
  4994. #ifdef __cplusplus
  4995. inline DEFINE_API(Boolean ) MacIsWindowVisible(WindowRef window) { return ((WindowPeek)window)->visible != 0; }
  4996. #else
  4997. #if TARGET_OS_MAC
  4998. #define IsWindowVisible(window) (((WindowPeek)window)->visible != 0)
  4999. #else
  5000. #define MacIsWindowVisible(window) (((WindowPeek)window)->visible != 0)
  5001. #endif
  5002. #endif
  5003. #endif
  5004. /*
  5005. --------------------------------------------------------------------------------------
  5006. o.Latent window visibility
  5007. --------------------------------------------------------------------------------------
  5008. */
  5009. /*
  5010. * WindowLatentVisibility
  5011. *
  5012. * Summary:
  5013. * Reasons why a window is currently invisible when ordinarily it
  5014. * would be visible.
  5015. */
  5016. typedef UInt32 WindowLatentVisibility;
  5017. enum {
  5018. /*
  5019. * Window is a floater and floating windows are hidden
  5020. */
  5021. kWindowLatentVisibleFloater = 1 << 0,
  5022. /*
  5023. * Window has HideOnSuspend and we are suspended
  5024. */
  5025. kWindowLatentVisibleSuspend = 1 << 1,
  5026. /*
  5027. * Window has HideOnFullScreen and we are full-screen
  5028. */
  5029. kWindowLatentVisibleFullScreen = 1 << 2,
  5030. /*
  5031. * Window's process is hidden
  5032. */
  5033. kWindowLatentVisibleAppHidden = 1 << 3,
  5034. /*
  5035. * Window is in an owned group and the owner was collapsed
  5036. */
  5037. kWindowLatentVisibleCollapsedOwner = 1 << 4,
  5038. /*
  5039. * Window is in a HideOnCollapse group and another window in the
  5040. * group was collapsed
  5041. */
  5042. kWindowLatentVisibleCollapsedGroup = 1 << 5
  5043. };
  5044. /*
  5045. * IsWindowLatentVisible()
  5046. *
  5047. * Summary:
  5048. * Indicates whether a window is visible onscreen and also whether
  5049. * it is latently visible but not currently onscreen.
  5050. *
  5051. * Discussion:
  5052. * All windows are either onscreen or offscreen. A window that is
  5053. * offscreen may still be latently visible; this occurs, for
  5054. * example, when a floating window is hidden as an application is
  5055. * suspended. The floating window is not visible onscreen, but it is
  5056. * latently visible and is only hidden due to the suspended state of
  5057. * the application; when the application becomes active again, the
  5058. * floating window will be placed back onscreen.
  5059. * IsWindowLatentVisible may be used to determine both the window's
  5060. * onscreen/offscreen status and its latent visibility (if the
  5061. * window is offscreen).
  5062. *
  5063. * Parameters:
  5064. *
  5065. * inWindow:
  5066. * The window whose visibility to return.
  5067. *
  5068. * outLatentVisible:
  5069. * If the window is onscreen, the latent visibility is zero. If
  5070. * the window is offscreen, this parameter is used to return the
  5071. * latent visibility flags of the window. If any of the flags are
  5072. * set, then the window is latently visible.
  5073. *
  5074. * Result:
  5075. * Indicates whether the window is currently onscreen.
  5076. *
  5077. * Availability:
  5078. * Non-Carbon CFM: not available
  5079. * CarbonLib: in CarbonLib 1.5 and later
  5080. * Mac OS X: in version 10.1 and later
  5081. */
  5082. EXTERN_API_C( Boolean )
  5083. IsWindowLatentVisible(
  5084. WindowRef inWindow,
  5085. WindowLatentVisibility * outLatentVisible); /* can be NULL */
  5086. /*--------------------------------------------------------------------------------------*/
  5087. /*
  5088. o Sheets
  5089. Sheets are a new user interface object in Mac OS X. A sheet is a modal alert or dialog,
  5090. but unlike a traditional alert or dialog window (which is visually separate from the
  5091. frontmost document window), a sheet appears to be attached to its parent window; it
  5092. moves and z-orders simultaneously with its parent. Furthermore, sheets on Mac OS X
  5093. use a new type of modality called window modality. A traditional alert or dialog is
  5094. app-modal; it prevents user interaction with all other windows in the current application.
  5095. A sheet is window-modal; it only prevents user interaction with its parent window, and
  5096. events continue to flow to other windows in the application.
  5097. o Sheet Event Handling
  5098. Implementing a sheet window in your application generally requires some modifications
  5099. to your event-handling code. A traditional app-modal window is implemented using a modal
  5100. event loop; your application starts a new event loop (either by processing events itself,
  5101. or by calling ModalDialog), which does not return back to your application's main event
  5102. loop until the app-modal window has closed.
  5103. Starting a new event loop doesn't work with sheets, because typically the modal event loop
  5104. will only handle events destined for the sheet, and not events for other windows, but
  5105. a sheet only blocks events for its parent window, and your application must still handle
  5106. events for the rest of its windows as normal. Therefore, you will usually not use a modal
  5107. event loop to handle events in a sheet. Rather, you will show the sheet window, and then
  5108. return directly back to your main event loop. The Carbon Event Manager automatically
  5109. prevents events in the sheet's parent window from reaching it; events in your application's
  5110. other windows are still returned to you via WaitNextEvent or your application's Carbon
  5111. event handlers, where you can process them as normal.
  5112. You have several choices for handling events in the sheet itself. A sheet is, at the most
  5113. basic level, simply another window in your application, and you can use any of the standard
  5114. event-handling APIs to receive events in the sheet. For example, you can:
  5115. - receive events in the sheet via WaitNextEvent, and handle them directly in your
  5116. main event loop
  5117. - create the sheet using Dialog Manager APIs, and use IsDialogEvent and DialogSelect
  5118. to handle events in the sheet
  5119. - install Carbon event handlers on the sheet, and respond to events in your handlers
  5120. Which approach you choose is up to you.
  5121. o Sheets in CarbonLib
  5122. The sheet window class, sheet WDEF procIDs, and ShowSheetWindow, HideSheetWindow, and
  5123. GetSheetWindowParent APIs are implemented in CarbonLib starting with version 1.3. However,
  5124. since Mac OS 8 and 9 do not traditionally support a window-modal user interface, sheet
  5125. windows are displayed as app-modal windows by CarbonLib. From your application's perspective,
  5126. event handling for a sheet in CarbonLib is the same as event handling for a sheet on X;
  5127. ShowSheetWindow still returns immediately, and your application should still return back
  5128. to its main event loop and be prepared to handle events in other windows. On CarbonLib,
  5129. your application will simply never receive an user input in any of your other windows;
  5130. since the sheet has application modality, the Carbon Event Manager will discard events
  5131. in any windows other than the sheet.
  5132. o.Creating a Sheet
  5133. A sheet is just a normal window with a special window class: kSheetWindowClass or
  5134. kSheetAlertWindowClass. As such, it can be created in any of the ways you might create
  5135. a window: NewWindow, NewCWindow, CreateNewWindow, GetNewWindow, GetNewCWindow,
  5136. CreateWindowFromCollection, CreateWindowFromResource, CreateWindowFromNib, NewDialog,
  5137. NewColorDialog, NewFeaturesDialog, or GetNewDialog.
  5138. The Window Manager defines two window classes and two WDEF procIDs for sheets:
  5139. - kSheetWindowClass and kSheetAlertWindowClass
  5140. - kWindowSheetProc and kWindowSheetAlertProc
  5141. The window classes may be used with CreateNewWindow, CreateWindowFromCollection, and
  5142. CreateWindowFromResource; the WDEF procIDs may be used with NewWindow, NewCWindow, NewDialog,
  5143. NewColorDialog, NewFeaturesDialog, and in 'WDEF' and 'DLOG' resources.
  5144. The first release of Mac OS X only supports kSheetWindowClass and kWindowSheetProc;
  5145. it does not support kSheetAlertWindowClass or kWindowSheetAlertProc. The latter window
  5146. class and procID were added in CarbonLib 1.3 and will be added to a future version of
  5147. Mac OS X. A new window class and procID were necessary for CarbonLib support because
  5148. sheets can be used for both alerts ("Do you want to save changes before closing this
  5149. window?") and dialogs (a Navigation Services PutFile dialog). On Mac OS X, sheet windows
  5150. have the same appearance when used for either an alert or a dialog, but on Mac OS 8 and 9,
  5151. alert windows have a different appearance from dialog windows. Two separate window classes
  5152. are necessary for CarbonLib to know whether to display a sheet using a movable alert or a
  5153. movable dialog window. Therefore, it is recommended that you use kSheetAlertWindowClass when
  5154. creating a sheet window that will be used to display an alert, although this is not required.
  5155. o Displaying a Sheet
  5156. A sheet is made visible by calling the ShowSheetWindow API. This API shows the sheet,
  5157. using whatever visual effects are appropriate for the platform, and then returns immediately.
  5158. On Mac OS X, it creates a window group and places the sheet and its parent window into the
  5159. group; it also marks the sheet as window-modal. On CarbonLib, it marks the sheet as app-modal
  5160. but does not create a window group.
  5161. On Mac OS X, before the sheet window is actually made visible, ShowSheetWindow sends a
  5162. kEventWindowDrawContent event to the sheet window, asking it to draw its content into the
  5163. window's offscreen buffer. The sheet must handle this event, or its content area will be
  5164. blank after the sheet becomes visible.
  5165. In some cases, this handler is automatically provided for you:
  5166. - If you create your sheet window using the Dialog Manager, the Dialog Manager
  5167. automatically installs a handler for this event that calls DrawDialog, so you
  5168. don't need to install the handler yourself.
  5169. - If you install the standard Carbon window event handler on your sheet window
  5170. (using kWindowStandardHandlerAttribute or InstallStandardEventHandler), the
  5171. standard handler automatically handles this event and calls DrawControls.
  5172. Typically, your event handling code (whether it uses WaitNextEvent, the Dialog Manager,
  5173. or Carbon event handlers) will receive and respond to events in the sheet until the
  5174. user does something that should cause the sheet to close. This might be clicking in an
  5175. OK or Cancel button, for example. At that time, your event handling code should call
  5176. HideSheetWindow. The sheet window will hide, but will not be destroyed, so you can use
  5177. it again later if you want.
  5178. */
  5179. /*
  5180. * ShowSheetWindow()
  5181. *
  5182. * Summary:
  5183. * Shows a sheet window using appropriate visual effects.
  5184. *
  5185. * Discussion:
  5186. * ShowSheetWindow is implemented in both CarbonLib 1.3 and Mac OS
  5187. * X. Since Mac OS 9 does not use a window-modal user interface for
  5188. * alerts and dialogs, ShowSheetWindow in CarbonLib does not bind
  5189. * the sheet to the parent window in the same way that it does on
  5190. * Mac OS X; instead, it shows the sheet like a standard
  5191. * movable-modal dialog window. Sheet windows must use the window
  5192. * classes kSheetWindowClass or kSheetAlertWindowClass to get the
  5193. * right appearance on both platforms.
  5194. *
  5195. * Parameters:
  5196. *
  5197. * inSheet:
  5198. * The sheet window to show.
  5199. *
  5200. * inParentWindow:
  5201. * The sheet's parent window.
  5202. *
  5203. * Availability:
  5204. * Non-Carbon CFM: not available
  5205. * CarbonLib: in CarbonLib 1.3 and later
  5206. * Mac OS X: in version 10.0 and later
  5207. */
  5208. EXTERN_API( OSStatus )
  5209. ShowSheetWindow(
  5210. WindowRef inSheet,
  5211. WindowRef inParentWindow);
  5212. /*
  5213. * HideSheetWindow()
  5214. *
  5215. * Summary:
  5216. * Hides a sheet window using appropriate visual effects.
  5217. *
  5218. * Parameters:
  5219. *
  5220. * inSheet:
  5221. * The sheet window to hide.
  5222. *
  5223. * Availability:
  5224. * Non-Carbon CFM: not available
  5225. * CarbonLib: in CarbonLib 1.3 and later
  5226. * Mac OS X: in version 10.0 and later
  5227. */
  5228. EXTERN_API( OSStatus )
  5229. HideSheetWindow(WindowRef inSheet);
  5230. /*
  5231. * GetSheetWindowParent()
  5232. *
  5233. * Summary:
  5234. * Returns the parent window of a sheet.
  5235. *
  5236. * Parameters:
  5237. *
  5238. * inSheet:
  5239. * The sheet window whose parent to retrieve.
  5240. *
  5241. * outParentWindow:
  5242. * On exit, contains the parent window of the sheet.
  5243. *
  5244. * Availability:
  5245. * Non-Carbon CFM: not available
  5246. * CarbonLib: in CarbonLib 1.3 and later
  5247. * Mac OS X: in version 10.0 and later
  5248. */
  5249. EXTERN_API( OSStatus )
  5250. GetSheetWindowParent(
  5251. WindowRef inSheet,
  5252. WindowRef * outParentWindow);
  5253. /*--------------------------------------------------------------------------------------*/
  5254. /*
  5255. o Drawers
  5256. Drawers are supported in Carbon by Jaguar and later. To create and use a drawer:
  5257. - Create a window using kDrawerWindowClass. You may optionally set the background
  5258. brush of the window to kThemeBrushDrawerBackground using the SetThemeWindowBackground
  5259. function.
  5260. - Either install the standard window event handler on the drawer window, or use
  5261. your own Carbon event or WaitNextEvent code to handle user interaction with the
  5262. drawer. If you do not use the standard window event handler, you should call
  5263. ResizeWindow in response to clicks on the grow region of the drawer if you want
  5264. the drawer to be resizable.
  5265. - Install a handler on the drawer window for the kEventWindowDrawContent event.
  5266. You must handle this event and draw your drawer's content so that the content
  5267. will be visible when the drawer is slid out from underneath the parent window.
  5268. - Set the drawer's parent window with the SetDrawerParent function. The parent is
  5269. the window on which the drawer will open.
  5270. - Optionally, install a Carbon event handler on the drawer or the drawer's parent
  5271. window for the kEventWindowDrawerOpening/Opened/Closing/Closed events, to be notified
  5272. when the drawer has started or finished opening or closing.
  5273. - Optionally, set the drawer's preferred edge on the parent window with the
  5274. SetDrawerPreferredEdge function. If you do not set a preferred edge, the drawer
  5275. opens on the parent's left side on a left-to-right system, or on the parent's right
  5276. side on a right-to-left system.
  5277. - Optionally, Set the drawer's offsets with the SetDrawerOffsets function. The offsets
  5278. control the amount of inset between the edge of the parent's content area and the edge
  5279. of the drawer's structure. If you do not set any offsets, the drawer's edges are flush
  5280. with the edges of the parent's content.
  5281. - Optionally, set the drawer's minimum and maximum sizes with the SetWindowResizeLimits
  5282. function. Or, install a Carbon event handler on the drawer to handle the kEventWindow-
  5283. GetMinimumSize and kEventWindowGetMaximumSize events. The drawer's minimum and maximum
  5284. sizes control how small or large it will resize together with the parent. If you do not
  5285. set resize limits, the drawer will be capable of resizing to default small and large
  5286. limits.
  5287. - Call ToggleDrawer to open or close the drawer, or use OpenDrawer or CloseDrawer if
  5288. you require more control over how the drawer opens or closes.
  5289. */
  5290. /*
  5291. * Summary:
  5292. * Indicates the parent window edge on which a drawer will be shown.
  5293. */
  5294. enum {
  5295. /*
  5296. * This constant is typically used with the OpenDrawer API; it
  5297. * indicates that the drawer should be opened on whatever edge of the
  5298. * parent window has previously been set as the drawer's preferred
  5299. * edge.
  5300. */
  5301. kWindowEdgeDefault = 0,
  5302. /*
  5303. * The drawer should open on the top edge of the parent window.
  5304. */
  5305. kWindowEdgeTop = 1 << 0,
  5306. /*
  5307. * The drawer should open on the left edge of the parent window.
  5308. */
  5309. kWindowEdgeLeft = 1 << 1,
  5310. /*
  5311. * The drawer should open on the bottom edge of the parent window.
  5312. */
  5313. kWindowEdgeBottom = 1 << 2,
  5314. /*
  5315. * The drawer should open on the right edge of the parent window.
  5316. */
  5317. kWindowEdgeRight = 1 << 3
  5318. };
  5319. /*
  5320. * Summary:
  5321. * Indicates the current state of a drawer window.
  5322. */
  5323. enum {
  5324. /*
  5325. * The drawer is opening, but is not yet fully open.
  5326. */
  5327. kWindowDrawerOpening = 1,
  5328. /*
  5329. * The drawer is fully open.
  5330. */
  5331. kWindowDrawerOpen = 2,
  5332. /*
  5333. * The drawer is closing, but is not yet fully closed.
  5334. */
  5335. kWindowDrawerClosing = 3,
  5336. /*
  5337. * The drawer is fully closed.
  5338. */
  5339. kWindowDrawerClosed = 4
  5340. };
  5341. typedef UInt32 WindowDrawerState;
  5342. /*
  5343. * GetDrawerPreferredEdge()
  5344. *
  5345. * Summary:
  5346. * Returns the preferred parent window edge of a drawer.
  5347. *
  5348. * Discussion:
  5349. * Drawers start out with a preferred parent window edge of
  5350. * kWindowEdgeDefault. On left-to-right systems, the default edge is
  5351. * the left edge of the parent window; on right-to-left systems, the
  5352. * default edge is the right edge. You can set the preferred edge
  5353. * with SetDrawerPreferredEdge. If there's not enough room on the
  5354. * preferred edge, the drawer will automatically switch to the
  5355. * opposite edge.
  5356. *
  5357. * Parameters:
  5358. *
  5359. * inDrawerWindow:
  5360. * The drawer window whose preferred edge to retrieve.
  5361. *
  5362. * Result:
  5363. * The preferred edge of the drawer window.
  5364. *
  5365. * Availability:
  5366. * Non-Carbon CFM: not available
  5367. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.2 and later
  5368. * Mac OS X: in version 10.2 and later
  5369. */
  5370. EXTERN_API_C( OptionBits )
  5371. GetDrawerPreferredEdge(WindowRef inDrawerWindow);
  5372. /*
  5373. * SetDrawerPreferredEdge()
  5374. *
  5375. * Summary:
  5376. * Sets the preferred parent window edge of a drawer.
  5377. *
  5378. * Parameters:
  5379. *
  5380. * inDrawerWindow:
  5381. * The drawer window whose preferred edge to set.
  5382. *
  5383. * inEdge:
  5384. * The preferred edge of the drawer window. Note that although the
  5385. * WindowEdge enumeration has values appropriate for a bitfield,
  5386. * the current implementation does not support receiving more than
  5387. * one edge bit in this parameter. You can also pass
  5388. * kWindowEdgeDefault to allow the Window Manager to pick an edge.
  5389. *
  5390. * Availability:
  5391. * Non-Carbon CFM: not available
  5392. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.2 and later
  5393. * Mac OS X: in version 10.2 and later
  5394. */
  5395. EXTERN_API_C( OSStatus )
  5396. SetDrawerPreferredEdge(
  5397. WindowRef inDrawerWindow,
  5398. OptionBits inEdge);
  5399. /*
  5400. * GetDrawerCurrentEdge()
  5401. *
  5402. * Summary:
  5403. * Returns the current parent window edge on which a drawer is
  5404. * displayed.
  5405. *
  5406. * Discussion:
  5407. * If the drawer window is currently visible, this API returns the
  5408. * parent window edge on which the drawer is displayed. If the
  5409. * drawer is not visible, this API determines on which edge of the
  5410. * parent window the drawer should be displayed, given the current
  5411. * size of the drawer, position of the parent, and preferred edge
  5412. * for the drawer.
  5413. *
  5414. * Parameters:
  5415. *
  5416. * inDrawerWindow:
  5417. * The drawer window whose current edge to retrieve.
  5418. *
  5419. * Result:
  5420. * The current edge of the drawer window.
  5421. *
  5422. * Availability:
  5423. * Non-Carbon CFM: not available
  5424. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.2 and later
  5425. * Mac OS X: in version 10.2 and later
  5426. */
  5427. EXTERN_API_C( OptionBits )
  5428. GetDrawerCurrentEdge(WindowRef inDrawerWindow);
  5429. /*
  5430. * GetDrawerState()
  5431. *
  5432. * Summary:
  5433. * Returns the current state of a drawer: opening, open, closing, or
  5434. * closed.
  5435. *
  5436. * Parameters:
  5437. *
  5438. * inDrawerWindow:
  5439. * The drawer window whose state to retrieve.
  5440. *
  5441. * Result:
  5442. * The current state of the drawer window.
  5443. *
  5444. * Availability:
  5445. * Non-Carbon CFM: not available
  5446. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.2 and later
  5447. * Mac OS X: in version 10.2 and later
  5448. */
  5449. EXTERN_API_C( WindowDrawerState )
  5450. GetDrawerState(WindowRef inDrawerWindow);
  5451. /*
  5452. * GetDrawerParent()
  5453. *
  5454. * Summary:
  5455. * Returns the parent window of a drawer.
  5456. *
  5457. * Parameters:
  5458. *
  5459. * inDrawerWindow:
  5460. * The drawer window whose parent window to retrieve.
  5461. *
  5462. * Result:
  5463. * The drawer's parent window, or NULL if the drawer has no assigned
  5464. * parent.
  5465. *
  5466. * Availability:
  5467. * Non-Carbon CFM: not available
  5468. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.2 and later
  5469. * Mac OS X: in version 10.2 and later
  5470. */
  5471. EXTERN_API_C( WindowRef )
  5472. GetDrawerParent(WindowRef inDrawerWindow);
  5473. /*
  5474. * SetDrawerParent()
  5475. *
  5476. * Summary:
  5477. * Sets the parent window of a drawer.
  5478. *
  5479. * Parameters:
  5480. *
  5481. * inDrawerWindow:
  5482. * The drawer window whose parent window to set.
  5483. *
  5484. * inParent:
  5485. * The drawer's new parent window, or NULL if the drawer should
  5486. * have no parent.
  5487. *
  5488. * Result:
  5489. * An operating system result code.
  5490. *
  5491. * Availability:
  5492. * Non-Carbon CFM: not available
  5493. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.2 and later
  5494. * Mac OS X: in version 10.2 and later
  5495. */
  5496. EXTERN_API_C( OSStatus )
  5497. SetDrawerParent(
  5498. WindowRef inDrawerWindow,
  5499. WindowRef inParent);
  5500. /*
  5501. * kWindowOffsetUnchanged
  5502. *
  5503. * Discussion:
  5504. * Pass this value to SetDrawerOffsets to indicate that an existing
  5505. * offset should not be changed.
  5506. */
  5507. #define kWindowOffsetUnchanged ((float)(-1.0))
  5508. /*
  5509. * SetDrawerOffsets()
  5510. *
  5511. * Summary:
  5512. * Sets the offsets from the beginning and end of the parent window
  5513. * to the beginning and end of the drawer window.
  5514. *
  5515. * Discussion:
  5516. * The drawer offsets control the positioning of the drawer relative
  5517. * to its parent window. When a drawer is first created, its offsets
  5518. * are zero. When a drawer is positioned, it is initially given a
  5519. * height or width equal to the height or width of the content area
  5520. * of the parent to which it is attached. If a drawer is opening on
  5521. * the left side of its parent, for example, the drawer's height
  5522. * will be the height of the parent's content area. In this case,
  5523. * the top side of the drawer window is called the leading edge of
  5524. * the drawer, and the bottom side of the drawer window is called
  5525. * the trailing edge of the drawer. The drawer's size is then
  5526. * adjusted by the leading and trailing offsets. The leading edge of
  5527. * the drawer is moved inward by an amount equal to the leading
  5528. * offset, and the trailing edge is moved inward by an amount equal
  5529. * to the trailing offset. For example, if the leading and trailing
  5530. * offsets are five and fifteen, then the top edge of a left-opening
  5531. * drawer will be five pixels inside the top edge of the parent
  5532. * window's content area, and the bottom edge of the drawer will be
  5533. * fifteen pixels inside the bottom edge of the parent's content
  5534. * area.
  5535. *
  5536. * Parameters:
  5537. *
  5538. * inDrawerWindow:
  5539. * The drawer window whose offsets to change.
  5540. *
  5541. * inLeadingOffset:
  5542. * The new leading offset, in pixels. Pass kWindowOffsetUnchanged
  5543. * if you don't want to change the leading offset.
  5544. *
  5545. * inTrailingOffset:
  5546. * The new trailing offset, in pixels. Pass kWindowOffsetUnchanged
  5547. * if you don't want to change the trailing offset.
  5548. *
  5549. * Result:
  5550. * An operating system result code.
  5551. *
  5552. * Availability:
  5553. * Non-Carbon CFM: not available
  5554. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.2 and later
  5555. * Mac OS X: in version 10.2 and later
  5556. */
  5557. EXTERN_API_C( OSStatus )
  5558. SetDrawerOffsets(
  5559. WindowRef inDrawerWindow,
  5560. float inLeadingOffset,
  5561. float inTrailingOffset);
  5562. /*
  5563. * GetDrawerOffsets()
  5564. *
  5565. * Summary:
  5566. * Returns the offsets from the beginning and end of the parent
  5567. * window to the beginning and end of the drawer window.
  5568. *
  5569. * Parameters:
  5570. *
  5571. * inDrawerWindow:
  5572. * The drawer window whose offsets to retrieve.
  5573. *
  5574. * outLeadingOffset:
  5575. * On exit, contains the drawer's leading offset. Pass NULL if you
  5576. * don't need this information returned.
  5577. *
  5578. * outTrailingOffset:
  5579. * On exit, contains the drawer's trailing offset. Pass NULL if
  5580. * you don't need this information returned.
  5581. *
  5582. * Result:
  5583. * An operating system result code.
  5584. *
  5585. * Availability:
  5586. * Non-Carbon CFM: not available
  5587. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.2 and later
  5588. * Mac OS X: in version 10.2 and later
  5589. */
  5590. EXTERN_API_C( OSStatus )
  5591. GetDrawerOffsets(
  5592. WindowRef inDrawerWindow,
  5593. float * outLeadingOffset, /* can be NULL */
  5594. float * outTrailingOffset); /* can be NULL */
  5595. /*
  5596. * ToggleDrawer()
  5597. *
  5598. * Summary:
  5599. * Toggles a drawer from open to closed, or vice versa.
  5600. *
  5601. * Discussion:
  5602. * ToggleDrawer opens the drawer if it is closed, opening, or
  5603. * closing. If the drawer is open, it closes the drawer.
  5604. * ToggleDrawer attemps to open the drawer on its preferred edge,
  5605. * but if there is not enough room on that edge, it will try the
  5606. * opposite edge instead. If there is insufficient room on either
  5607. * edge, the drawer will open on the preferred edge but may extend
  5608. * offscreen, under the Dock, or under the menubar.
  5609. * The opening or closing of the drawer is performed asynchronously;
  5610. * ToggleDrawer installs an event loop timer that opens or closes
  5611. * the drawer after ToggleDrawer returns to the caller. Therefore,
  5612. * the caller must be running its event loop for the drawer to open
  5613. * or close. To open or close the drawer synchronously, use the
  5614. * OpenDrawer or CloseDrawer APIs.
  5615. * ToggleDrawer retains the drawer window while the drawer is
  5616. * opening or closing, and releases it when the drawer is fully
  5617. * opened or closed.
  5618. * ToggleDrawer sends the kEventWindowDrawerOpening,
  5619. * kEventWindowDrawerOpened, kEventWindowDrawerClosing, and
  5620. * kEventWindowDrawerClosed events as the drawer opens or closes.
  5621. *
  5622. * Parameters:
  5623. *
  5624. * inDrawerWindow:
  5625. * The drawer window to open or close.
  5626. *
  5627. * Result:
  5628. * An operating system result code.
  5629. *
  5630. * Availability:
  5631. * Non-Carbon CFM: not available
  5632. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.2 and later
  5633. * Mac OS X: in version 10.2 and later
  5634. */
  5635. EXTERN_API_C( OSStatus )
  5636. ToggleDrawer(WindowRef inDrawerWindow);
  5637. /*
  5638. * OpenDrawer()
  5639. *
  5640. * Summary:
  5641. * Opens a drawer on a specified parent window edge.
  5642. *
  5643. * Discussion:
  5644. * OpenDrawer may open the drawer either synchronously or
  5645. * asynchronously, depending on the value of the inAsync parameter.
  5646. * If inAsync is true, OpenDrawer installs an event loop timer that
  5647. * opens the drawer after OpenDrawer returns to the caller;
  5648. * therefore, the caller must be running its event loop for the
  5649. * drawer to open. If inAsync is false, OpenDrawer opens the drawer
  5650. * completely before returning to the caller.
  5651. * OpenDrawer retains the drawer window while the drawer is opening,
  5652. * and releases it when the drawer is fully open.
  5653. * OpenDrawer sends the kEventWindowDrawerOpening event to the
  5654. * drawer, the drawer's parent, and the application before opening
  5655. * the drawer. If an event handler for this event returns
  5656. * userCanceledErr, OpenDrawer will return immediately without
  5657. * opening the drawer. OpenDrawer sends the kEventWindowDrawerOpened
  5658. * event to the drawer, the drawer's parent, and the application
  5659. * after the drawer has finished opening.
  5660. *
  5661. * Parameters:
  5662. *
  5663. * inDrawerWindow:
  5664. * The drawer window to open.
  5665. *
  5666. * inEdge:
  5667. * The parent window edge on which to open the drawer. Pass
  5668. * kWindowEdgeDefault to use the drawer's preferred edge. If there
  5669. * is not enough room on the preferred edge, OpenDrawer will try
  5670. * the opposite edge instead. If there is insufficient room on
  5671. * either edge, the drawer will open on the preferred edge but may
  5672. * extend offscreen, under the Dock, or under the menubar.
  5673. *
  5674. * inAsync:
  5675. * Whether to open the drawer synchronously (the drawer is
  5676. * entirely opened before the function call returns) or
  5677. * asynchronously (the drawer opens using an event loop timer
  5678. * after the function call returns).
  5679. *
  5680. * Result:
  5681. * An operating system result code.
  5682. *
  5683. * Availability:
  5684. * Non-Carbon CFM: not available
  5685. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.2 and later
  5686. * Mac OS X: in version 10.2 and later
  5687. */
  5688. EXTERN_API_C( OSStatus )
  5689. OpenDrawer(
  5690. WindowRef inDrawerWindow,
  5691. OptionBits inEdge,
  5692. Boolean inAsync);
  5693. /*
  5694. * CloseDrawer()
  5695. *
  5696. * Summary:
  5697. * Closes a drawer.
  5698. *
  5699. * Discussion:
  5700. * CloseDrawer may close the drawer either synchronously or
  5701. * asynchronously, depending on the value of the inAsync parameter.
  5702. * If inAsync is true, CloseDrawer installs an event loop timer that
  5703. * closes the drawer after CloseDrawer returns to the caller;
  5704. * therefore, the caller must be running its event loop for the
  5705. * drawer to close. If inAsync is false, CloseDrawer closes the
  5706. * drawer completely before returning to the caller.
  5707. * CloseDrawer retains the drawer window while the drawer is
  5708. * closing, and releases it when the drawer is fully closed.
  5709. * CloseDrawer sends the kEventWindowDrawerClosing event to the
  5710. * drawer, the drawer's parent, and the application before closing
  5711. * the drawer. If an event handler for this event returns
  5712. * userCanceledErr, CloseDrawer will return immediately without
  5713. * closing the drawer. CloseDrawer sends the
  5714. * kEventWindowDrawerClosed event to the drawer, the drawer's
  5715. * parent, and the application after the drawer has finished closing.
  5716. *
  5717. * Parameters:
  5718. *
  5719. * inDrawerWindow:
  5720. * The drawer window to close.
  5721. *
  5722. * inAsync:
  5723. * Whether to close the drawer synchronously (the drawer is
  5724. * entirely closed before the function call returns) or
  5725. * asynchronously (the drawer closes using an event loop timer
  5726. * after the function call returns).
  5727. *
  5728. * Result:
  5729. * An operating system result code.
  5730. *
  5731. * Availability:
  5732. * Non-Carbon CFM: not available
  5733. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.2 and later
  5734. * Mac OS X: in version 10.2 and later
  5735. */
  5736. EXTERN_API_C( OSStatus )
  5737. CloseDrawer(
  5738. WindowRef inDrawerWindow,
  5739. Boolean inAsync);
  5740. /*--------------------------------------------------------------------------------------*/
  5741. /* o Disabling Screen Redraw */
  5742. /*--------------------------------------------------------------------------------------*/
  5743. /*
  5744. disable and enable screen updates for changes to the current application's windows
  5745. (OS X only for now)
  5746. */
  5747. /*
  5748. * DisableScreenUpdates()
  5749. *
  5750. * Availability:
  5751. * Non-Carbon CFM: not available
  5752. * CarbonLib: in CarbonLib 1.1 and later
  5753. * Mac OS X: in version 10.0 and later
  5754. */
  5755. EXTERN_API( OSStatus )
  5756. DisableScreenUpdates(void);
  5757. /*
  5758. * EnableScreenUpdates()
  5759. *
  5760. * Availability:
  5761. * Non-Carbon CFM: not available
  5762. * CarbonLib: in CarbonLib 1.1 and later
  5763. * Mac OS X: in version 10.0 and later
  5764. */
  5765. EXTERN_API( OSStatus )
  5766. EnableScreenUpdates(void);
  5767. /*--------------------------------------------------------------------------------------*/
  5768. /* o Window Toolbars */
  5769. /*--------------------------------------------------------------------------------------*/
  5770. #define _SetWindowToolbar SetWindowToolbar
  5771. /*
  5772. * SetWindowToolbar()
  5773. *
  5774. * Discussion:
  5775. * Sets the toolbar for a window. If any other toolbar is currently
  5776. * bound to the window, it is released. This API does NOT add the
  5777. * toolbar button to the window, your application must set the
  5778. * attribute itself.
  5779. *
  5780. * Parameters:
  5781. *
  5782. * inWindow:
  5783. * The window to add the toolbar to.
  5784. *
  5785. * inToolbar:
  5786. * The toolbar to add.
  5787. *
  5788. * Result:
  5789. * An operating system result code.
  5790. *
  5791. * Availability:
  5792. * Non-Carbon CFM: not available
  5793. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.2 and later
  5794. * Mac OS X: in version 10.2 and later
  5795. */
  5796. EXTERN_API_C( OSStatus )
  5797. SetWindowToolbar(
  5798. WindowRef inWindow,
  5799. HIToolbarRef inToolbar);
  5800. #define _GetWindowToolbar GetWindowToolbar
  5801. /*
  5802. * GetWindowToolbar()
  5803. *
  5804. * Discussion:
  5805. * Gets the toolbar of a window, if any.
  5806. *
  5807. * Parameters:
  5808. *
  5809. * inWindow:
  5810. * The window to add the toolbar to.
  5811. *
  5812. * outToolbar:
  5813. * The toolbar. You do not own the toolbar reference returned by
  5814. * this function. Do not release it! It is possibly for the
  5815. * toolbar returned to be NULL, indicating there is no toolbar
  5816. * associated with this window. ooo NOTE: May need to change the
  5817. * release strategy here.
  5818. *
  5819. * Result:
  5820. * An operating system result code.
  5821. *
  5822. * Availability:
  5823. * Non-Carbon CFM: not available
  5824. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.2 and later
  5825. * Mac OS X: in version 10.2 and later
  5826. */
  5827. EXTERN_API_C( OSStatus )
  5828. GetWindowToolbar(
  5829. WindowRef inWindow,
  5830. HIToolbarRef * outToolbar);
  5831. #define _ShowHideWindowToolbar ShowHideWindowToolbar
  5832. /*
  5833. * ShowHideWindowToolbar()
  5834. *
  5835. * Discussion:
  5836. * Shows or hides a window's toolbar. Optionally, you can ask for
  5837. * the transition to be animated or not. Typically, you would not
  5838. * need to call this other than to set up your window accordingly.
  5839. *
  5840. * Parameters:
  5841. *
  5842. * inWindow:
  5843. * The window to show or hide the toolbar for.
  5844. *
  5845. * inShow:
  5846. * Pass true to show the toolbar, false to hide it.
  5847. *
  5848. * inAnimate:
  5849. * Pass true to animate the transition, false to do it quickly and
  5850. * without fanfare.
  5851. *
  5852. * Result:
  5853. * An operating system result code.
  5854. *
  5855. * Availability:
  5856. * Non-Carbon CFM: not available
  5857. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.2 and later
  5858. * Mac OS X: in version 10.2 and later
  5859. */
  5860. EXTERN_API_C( OSStatus )
  5861. ShowHideWindowToolbar(
  5862. WindowRef inWindow,
  5863. Boolean inShow,
  5864. Boolean inAnimate);
  5865. #define _IsWindowToolbarVisible IsWindowToolbarVisible
  5866. /*
  5867. * IsWindowToolbarVisible()
  5868. *
  5869. * Discussion:
  5870. * Returns whether the toolbar (if any) attached to a window is
  5871. * visible. If the window has no toolbar, false is returned.
  5872. *
  5873. * Parameters:
  5874. *
  5875. * inWindow:
  5876. * The window test the toolbar visiblity for.
  5877. *
  5878. * Result:
  5879. * A boolean result indicating whether the toolbar is visible (true)
  5880. * or not (false).
  5881. *
  5882. * Availability:
  5883. * Non-Carbon CFM: not available
  5884. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.2 and later
  5885. * Mac OS X: in version 10.2 and later
  5886. */
  5887. EXTERN_API_C( Boolean )
  5888. IsWindowToolbarVisible(WindowRef inWindow);
  5889. /*--------------------------------------------------------------------------------------*/
  5890. /* o Window Transparency */
  5891. /*--------------------------------------------------------------------------------------*/
  5892. /*
  5893. * SetWindowAlpha()
  5894. *
  5895. * Discussion:
  5896. * Alters the overall alpha of a window, making the entire window
  5897. * (including window frame) either more or less transparent. The
  5898. * alpha is expressed as a floating point value from 0.0 (completely
  5899. * transparent) to 1.0 (completely opaque).
  5900. *
  5901. * Parameters:
  5902. *
  5903. * inWindow:
  5904. * The window whose alpha to modify.
  5905. *
  5906. * inAlpha:
  5907. * The new alpha value.
  5908. *
  5909. * Result:
  5910. * An operating system result code.
  5911. *
  5912. * Availability:
  5913. * Non-Carbon CFM: not available
  5914. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.0 and later
  5915. * Mac OS X: in version 10.0 and later
  5916. */
  5917. EXTERN_API_C( OSStatus )
  5918. SetWindowAlpha(
  5919. WindowRef inWindow,
  5920. float inAlpha);
  5921. /*
  5922. * GetWindowAlpha()
  5923. *
  5924. * Discussion:
  5925. * Returns the current overall alpha value for a window. The alpha
  5926. * is expressed as a floating point value from 0.0 (completely
  5927. * transparent) to 1.0 (completely opaque).
  5928. *
  5929. * Parameters:
  5930. *
  5931. * inWindow:
  5932. * The window whose alpha to return.
  5933. *
  5934. * outAlpha:
  5935. * On exit, contains the window's current alpha value.
  5936. *
  5937. * Result:
  5938. * An operating system result code.
  5939. *
  5940. * Availability:
  5941. * Non-Carbon CFM: not available
  5942. * CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.0 and later
  5943. * Mac OS X: in version 10.0 and later
  5944. */
  5945. EXTERN_API_C( OSStatus )
  5946. GetWindowAlpha(
  5947. WindowRef inWindow,
  5948. float * outAlpha);
  5949. /*--------------------------------------------------------------------------------------*/
  5950. /* o Window Properties */
  5951. /*--------------------------------------------------------------------------------------*/
  5952. /*
  5953. Routines available from Mac OS 8.5 forward
  5954. or from Mac OS 8.1 forward when linking to CarbonLib 1.0 forward
  5955. */
  5956. /*
  5957. * GetWindowProperty()
  5958. *
  5959. * Availability:
  5960. * Non-Carbon CFM: in WindowsLib 8.5 and later
  5961. * CarbonLib: in CarbonLib 1.0 and later
  5962. * Mac OS X: in version 10.0 and later
  5963. */
  5964. EXTERN_API( OSStatus )
  5965. GetWindowProperty(
  5966. WindowRef window,
  5967. PropertyCreator propertyCreator,
  5968. PropertyTag propertyTag,
  5969. UInt32 bufferSize,
  5970. UInt32 * actualSize, /* can be NULL */
  5971. void * propertyBuffer);
  5972. /*
  5973. * GetWindowPropertySize()
  5974. *
  5975. * Availability:
  5976. * Non-Carbon CFM: in WindowsLib 8.5 and later
  5977. * CarbonLib: in CarbonLib 1.0 and later
  5978. * Mac OS X: in version 10.0 and later
  5979. */
  5980. EXTERN_API( OSStatus )
  5981. GetWindowPropertySize(
  5982. WindowRef window,
  5983. PropertyCreator creator,
  5984. PropertyTag tag,
  5985. UInt32 * size);
  5986. /*
  5987. * SetWindowProperty()
  5988. *
  5989. * Availability:
  5990. * Non-Carbon CFM: in WindowsLib 8.5 and later
  5991. * CarbonLib: in CarbonLib 1.0 and later
  5992. * Mac OS X: in version 10.0 and later
  5993. */
  5994. EXTERN_API( OSStatus )
  5995. SetWindowProperty(
  5996. WindowRef window,
  5997. PropertyCreator propertyCreator,
  5998. PropertyTag propertyTag,
  5999. UInt32 propertySize,
  6000. const void * propertyBuffer);
  6001. /*
  6002. * RemoveWindowProperty()
  6003. *
  6004. * Availability:
  6005. * Non-Carbon CFM: in WindowsLib 8.5 and later
  6006. * CarbonLib: in CarbonLib 1.0 and later
  6007. * Mac OS X: in version 10.0 and later
  6008. */
  6009. EXTERN_API( OSStatus )
  6010. RemoveWindowProperty(
  6011. WindowRef window,
  6012. PropertyCreator propertyCreator,
  6013. PropertyTag propertyTag);
  6014. /* Routines available from Mac OS 8.1 forward when linking to CarbonLib 1.0 forward*/
  6015. enum {
  6016. kWindowPropertyPersistent = 0x00000001 /* whether this property gets saved when flattening the window */
  6017. };
  6018. /*
  6019. * GetWindowPropertyAttributes()
  6020. *
  6021. * Availability:
  6022. * Non-Carbon CFM: not available
  6023. * CarbonLib: in CarbonLib 1.0 and later
  6024. * Mac OS X: in version 10.0 and later
  6025. */
  6026. EXTERN_API( OSStatus )
  6027. GetWindowPropertyAttributes(
  6028. WindowRef window,
  6029. OSType propertyCreator,
  6030. OSType propertyTag,
  6031. UInt32 * attributes);
  6032. /*
  6033. * ChangeWindowPropertyAttributes()
  6034. *
  6035. * Availability:
  6036. * Non-Carbon CFM: not available
  6037. * CarbonLib: in CarbonLib 1.0 and later
  6038. * Mac OS X: in version 10.0 and later
  6039. */
  6040. EXTERN_API( OSStatus )
  6041. ChangeWindowPropertyAttributes(
  6042. WindowRef window,
  6043. OSType propertyCreator,
  6044. OSType propertyTag,
  6045. UInt32 attributesToSet,
  6046. UInt32 attributesToClear);
  6047. /*--------------------------------------------------------------------------------------*/
  6048. /* o Utilities */
  6049. /*--------------------------------------------------------------------------------------*/
  6050. /*
  6051. * PinRect()
  6052. *
  6053. * Availability:
  6054. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  6055. * CarbonLib: in CarbonLib 1.0 and later
  6056. * Mac OS X: in version 10.0 and later
  6057. */
  6058. EXTERN_API( long )
  6059. PinRect(
  6060. const Rect * theRect,
  6061. Point thePt) ONEWORDINLINE(0xA94E);
  6062. /*
  6063. * GetGrayRgn()
  6064. *
  6065. * Availability:
  6066. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  6067. * CarbonLib: in CarbonLib 1.0 and later
  6068. * Mac OS X: in version 10.0 and later
  6069. */
  6070. EXTERN_API( RgnHandle )
  6071. GetGrayRgn(void) TWOWORDINLINE(0x2EB8, 0x09EE);
  6072. /*--------------------------------------------------------------------------------------*/
  6073. /* o Window Part Tracking */
  6074. /*--------------------------------------------------------------------------------------*/
  6075. /*
  6076. * TrackBox()
  6077. *
  6078. * Availability:
  6079. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  6080. * CarbonLib: in CarbonLib 1.0 and later
  6081. * Mac OS X: in version 10.0 and later
  6082. */
  6083. EXTERN_API( Boolean )
  6084. TrackBox(
  6085. WindowRef window,
  6086. Point thePt,
  6087. WindowPartCode partCode) ONEWORDINLINE(0xA83B);
  6088. /*
  6089. * TrackGoAway()
  6090. *
  6091. * Availability:
  6092. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  6093. * CarbonLib: in CarbonLib 1.0 and later
  6094. * Mac OS X: in version 10.0 and later
  6095. */
  6096. EXTERN_API( Boolean )
  6097. TrackGoAway(
  6098. WindowRef window,
  6099. Point thePt) ONEWORDINLINE(0xA91E);
  6100. /*--------------------------------------------------------------------------------------*/
  6101. /* o Region Dragging */
  6102. /*--------------------------------------------------------------------------------------*/
  6103. /*
  6104. * DragGrayRgn()
  6105. *
  6106. * Availability:
  6107. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  6108. * CarbonLib: in CarbonLib 1.0 and later
  6109. * Mac OS X: in version 10.0 and later
  6110. */
  6111. EXTERN_API( long )
  6112. DragGrayRgn(
  6113. RgnHandle theRgn,
  6114. Point startPt,
  6115. const Rect * limitRect,
  6116. const Rect * slopRect,
  6117. short axis,
  6118. DragGrayRgnUPP actionProc) ONEWORDINLINE(0xA905);
  6119. /*
  6120. * DragTheRgn()
  6121. *
  6122. * Availability:
  6123. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  6124. * CarbonLib: in CarbonLib 1.0 and later
  6125. * Mac OS X: in version 10.0 and later
  6126. */
  6127. EXTERN_API( long )
  6128. DragTheRgn(
  6129. RgnHandle theRgn,
  6130. Point startPt,
  6131. const Rect * limitRect,
  6132. const Rect * slopRect,
  6133. short axis,
  6134. DragGrayRgnUPP actionProc) ONEWORDINLINE(0xA926);
  6135. /*--------------------------------------------------------------------------------------*/
  6136. /* o GetAuxWin */
  6137. /* */
  6138. /* GetAuxWin is not available in Carbon */
  6139. /*--------------------------------------------------------------------------------------*/
  6140. #if !OPAQUE_TOOLBOX_STRUCTS
  6141. #if CALL_NOT_IN_CARBON
  6142. /*
  6143. * GetAuxWin()
  6144. *
  6145. * Availability:
  6146. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  6147. * CarbonLib: not available
  6148. * Mac OS X: not available
  6149. */
  6150. EXTERN_API( Boolean )
  6151. GetAuxWin(
  6152. WindowRef window,
  6153. AuxWinHandle * awHndl) ONEWORDINLINE(0xAA42);
  6154. #endif /* CALL_NOT_IN_CARBON */
  6155. #endif /* !OPAQUE_TOOLBOX_STRUCTS */
  6156. /*--------------------------------------------------------------------------------------*/
  6157. /* o C Glue */
  6158. /*--------------------------------------------------------------------------------------*/
  6159. #if CALL_NOT_IN_CARBON
  6160. /*
  6161. * setwtitle()
  6162. *
  6163. * Availability:
  6164. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  6165. * CarbonLib: not available
  6166. * Mac OS X: not available
  6167. */
  6168. EXTERN_API_C( void )
  6169. setwtitle(
  6170. WindowRef window,
  6171. const char * title);
  6172. /*
  6173. * trackgoaway()
  6174. *
  6175. * Availability:
  6176. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  6177. * CarbonLib: not available
  6178. * Mac OS X: not available
  6179. */
  6180. EXTERN_API_C( Boolean )
  6181. trackgoaway(
  6182. WindowRef window,
  6183. Point * thePt);
  6184. /*
  6185. * findwindow()
  6186. *
  6187. * Availability:
  6188. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  6189. * CarbonLib: not available
  6190. * Mac OS X: not available
  6191. */
  6192. EXTERN_API_C( short )
  6193. findwindow(
  6194. Point * thePoint,
  6195. WindowRef * window);
  6196. /*
  6197. * getwtitle()
  6198. *
  6199. * Availability:
  6200. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  6201. * CarbonLib: not available
  6202. * Mac OS X: not available
  6203. */
  6204. EXTERN_API_C( void )
  6205. getwtitle(
  6206. WindowRef window,
  6207. char * title);
  6208. /*
  6209. * growwindow()
  6210. *
  6211. * Availability:
  6212. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  6213. * CarbonLib: not available
  6214. * Mac OS X: not available
  6215. */
  6216. EXTERN_API_C( long )
  6217. growwindow(
  6218. WindowRef window,
  6219. Point * startPt,
  6220. const Rect * bBox);
  6221. /*
  6222. * newwindow()
  6223. *
  6224. * Availability:
  6225. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  6226. * CarbonLib: not available
  6227. * Mac OS X: not available
  6228. */
  6229. EXTERN_API_C( WindowRef )
  6230. newwindow(
  6231. void * wStorage,
  6232. const Rect * boundsRect,
  6233. const char * title,
  6234. Boolean visible,
  6235. short theProc,
  6236. WindowRef behind,
  6237. Boolean goAwayFlag,
  6238. long refCon);
  6239. /*
  6240. * newcwindow()
  6241. *
  6242. * Availability:
  6243. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  6244. * CarbonLib: not available
  6245. * Mac OS X: not available
  6246. */
  6247. EXTERN_API_C( WindowRef )
  6248. newcwindow(
  6249. void * wStorage,
  6250. const Rect * boundsRect,
  6251. const char * title,
  6252. Boolean visible,
  6253. short procID,
  6254. WindowRef behind,
  6255. Boolean goAwayFlag,
  6256. long refCon);
  6257. /*
  6258. * pinrect()
  6259. *
  6260. * Availability:
  6261. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  6262. * CarbonLib: not available
  6263. * Mac OS X: not available
  6264. */
  6265. EXTERN_API_C( long )
  6266. pinrect(
  6267. const Rect * theRect,
  6268. Point * thePt);
  6269. /*
  6270. * trackbox()
  6271. *
  6272. * Availability:
  6273. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  6274. * CarbonLib: not available
  6275. * Mac OS X: not available
  6276. */
  6277. EXTERN_API_C( Boolean )
  6278. trackbox(
  6279. WindowRef window,
  6280. Point * thePt,
  6281. short partCode);
  6282. /*
  6283. * draggrayrgn()
  6284. *
  6285. * Availability:
  6286. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  6287. * CarbonLib: not available
  6288. * Mac OS X: not available
  6289. */
  6290. EXTERN_API_C( long )
  6291. draggrayrgn(
  6292. RgnHandle theRgn,
  6293. Point * startPt,
  6294. const Rect * boundsRect,
  6295. const Rect * slopRect,
  6296. short axis,
  6297. DragGrayRgnUPP actionProc);
  6298. /*
  6299. * dragwindow()
  6300. *
  6301. * Availability:
  6302. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  6303. * CarbonLib: not available
  6304. * Mac OS X: not available
  6305. */
  6306. EXTERN_API_C( void )
  6307. dragwindow(
  6308. WindowRef window,
  6309. Point * startPt,
  6310. const Rect * boundsRect);
  6311. #endif /* CALL_NOT_IN_CARBON */
  6312. /*--------------------------------------------------------------------------------------*/
  6313. /* o Window Accessors */
  6314. /*--------------------------------------------------------------------------------------*/
  6315. #if CALL_NOT_IN_CARBON
  6316. /*
  6317. * GetWindowGoAwayFlag()
  6318. *
  6319. * Discussion:
  6320. * use GetWindowAttributes in Carbon
  6321. *
  6322. * Availability:
  6323. * Non-Carbon CFM: in CarbonAccessors.o 1.0 and later or as macro/inline
  6324. * CarbonLib: not available
  6325. * Mac OS X: not available
  6326. */
  6327. EXTERN_API( Boolean )
  6328. GetWindowGoAwayFlag(WindowRef window);
  6329. #if !OPAQUE_TOOLBOX_STRUCTS && !ACCESSOR_CALLS_ARE_FUNCTIONS
  6330. #ifdef __cplusplus
  6331. inline DEFINE_API(Boolean ) GetWindowGoAwayFlag(WindowRef window) { return ((WindowPeek)window)->goAwayFlag; }
  6332. #else
  6333. #define GetWindowGoAwayFlag(window) (((WindowPeek)window)->goAwayFlag)
  6334. #endif
  6335. #endif
  6336. /*
  6337. * GetWindowSpareFlag()
  6338. *
  6339. * Discussion:
  6340. * use GetWindowAttributes in Carbon
  6341. *
  6342. * Availability:
  6343. * Non-Carbon CFM: in CarbonAccessors.o 1.0 and later or as macro/inline
  6344. * CarbonLib: not available
  6345. * Mac OS X: not available
  6346. */
  6347. EXTERN_API( Boolean )
  6348. GetWindowSpareFlag(WindowRef window);
  6349. #if !OPAQUE_TOOLBOX_STRUCTS && !ACCESSOR_CALLS_ARE_FUNCTIONS
  6350. #ifdef __cplusplus
  6351. inline DEFINE_API(Boolean ) GetWindowSpareFlag(WindowRef window) { return ((WindowPeek)window)->spareFlag; }
  6352. #else
  6353. #define GetWindowSpareFlag(window) (((WindowPeek)window)->spareFlag)
  6354. #endif
  6355. #endif
  6356. #endif /* CALL_NOT_IN_CARBON */
  6357. /*
  6358. * GetWindowList()
  6359. *
  6360. * Availability:
  6361. * Non-Carbon CFM: in CarbonAccessors.o 1.0.2 and later
  6362. * CarbonLib: in CarbonLib 1.0 and later
  6363. * Mac OS X: in version 10.0 and later
  6364. */
  6365. EXTERN_API( WindowRef )
  6366. GetWindowList(void);
  6367. /*
  6368. * GetWindowPort()
  6369. *
  6370. * Availability:
  6371. * Non-Carbon CFM: in CarbonAccessors.o 1.0 and later or as macro/inline
  6372. * CarbonLib: in CarbonLib 1.0 and later
  6373. * Mac OS X: in version 10.0 and later
  6374. */
  6375. EXTERN_API( CGrafPtr )
  6376. GetWindowPort(WindowRef window);
  6377. #if !OPAQUE_TOOLBOX_STRUCTS && !ACCESSOR_CALLS_ARE_FUNCTIONS
  6378. #ifdef __cplusplus
  6379. inline DEFINE_API(CGrafPtr ) GetWindowPort(WindowRef window) { return (CGrafPtr)window; }
  6380. #else
  6381. #define GetWindowPort(window) ((CGrafPtr)window)
  6382. #endif
  6383. #endif
  6384. /*
  6385. * GetWindowStructurePort()
  6386. *
  6387. * Availability:
  6388. * Non-Carbon CFM: not available
  6389. * CarbonLib: in CarbonLib 1.5 and later
  6390. * Mac OS X: in version 10.1 and later
  6391. */
  6392. EXTERN_API( CGrafPtr )
  6393. GetWindowStructurePort(WindowRef inWindow);
  6394. /*
  6395. * GetWindowKind()
  6396. *
  6397. * Availability:
  6398. * Non-Carbon CFM: in CarbonAccessors.o 1.0 and later or as macro/inline
  6399. * CarbonLib: in CarbonLib 1.0 and later
  6400. * Mac OS X: in version 10.0 and later
  6401. */
  6402. EXTERN_API( short )
  6403. GetWindowKind(WindowRef window);
  6404. #if !OPAQUE_TOOLBOX_STRUCTS && !ACCESSOR_CALLS_ARE_FUNCTIONS
  6405. #ifdef __cplusplus
  6406. inline DEFINE_API(short ) GetWindowKind(WindowRef window) { return ((WindowPeek)window)->windowKind; }
  6407. #else
  6408. #define GetWindowKind(window) (((WindowPeek)window)->windowKind)
  6409. #endif
  6410. #endif
  6411. /*
  6412. * IsWindowHilited()
  6413. *
  6414. * Availability:
  6415. * Non-Carbon CFM: in CarbonAccessors.o 1.0 and later or as macro/inline
  6416. * CarbonLib: in CarbonLib 1.0 and later
  6417. * Mac OS X: in version 10.0 and later
  6418. */
  6419. EXTERN_API( Boolean )
  6420. IsWindowHilited(WindowRef window);
  6421. #if !OPAQUE_TOOLBOX_STRUCTS && !ACCESSOR_CALLS_ARE_FUNCTIONS
  6422. #ifdef __cplusplus
  6423. inline DEFINE_API(Boolean ) IsWindowHilited(WindowRef window) { return ((WindowPeek)window)->hilited != 0; }
  6424. #else
  6425. #define IsWindowHilited(window) (((WindowPeek)window)->hilited != 0)
  6426. #endif
  6427. #endif
  6428. /*
  6429. * IsWindowUpdatePending()
  6430. *
  6431. * Availability:
  6432. * Non-Carbon CFM: in CarbonAccessors.o 1.0 and later or as macro/inline
  6433. * CarbonLib: in CarbonLib 1.0 and later
  6434. * Mac OS X: in version 10.0 and later
  6435. */
  6436. EXTERN_API( Boolean )
  6437. IsWindowUpdatePending(WindowRef window);
  6438. #if !OPAQUE_TOOLBOX_STRUCTS && !ACCESSOR_CALLS_ARE_FUNCTIONS
  6439. #ifdef __cplusplus
  6440. inline DEFINE_API(Boolean ) IsWindowUpdatePending(WindowRef window) { return (((WindowPeek) window)->updateRgn != NULL) && !EmptyRgn(((WindowPeek) window)->updateRgn); }
  6441. #else
  6442. #define IsWindowUpdatePending(window) ((((WindowPeek) window)->updateRgn != NULL) && !EmptyRgn(((WindowPeek) window)->updateRgn))
  6443. #endif
  6444. #endif
  6445. /*
  6446. * [Mac]GetNextWindow()
  6447. *
  6448. * Availability:
  6449. * Non-Carbon CFM: in CarbonAccessors.o 1.0.2 and later or as macro/inline
  6450. * CarbonLib: in CarbonLib 1.0 and later
  6451. * Mac OS X: in version 10.0 and later
  6452. */
  6453. #if TARGET_OS_MAC
  6454. #define MacGetNextWindow GetNextWindow
  6455. #endif
  6456. EXTERN_API( WindowRef )
  6457. MacGetNextWindow(WindowRef window);
  6458. #if !OPAQUE_TOOLBOX_STRUCTS && !ACCESSOR_CALLS_ARE_FUNCTIONS
  6459. #ifdef __cplusplus
  6460. inline DEFINE_API(WindowRef ) MacGetNextWindow(WindowRef window) { return (WindowRef)(((WindowPeek)window)->nextWindow); }
  6461. #else
  6462. #if TARGET_OS_MAC
  6463. #define GetNextWindow(window) ((WindowRef)(((WindowPeek)window)->nextWindow))
  6464. #else
  6465. #define MacGetNextWindow(window) ((WindowRef)(((WindowPeek)window)->nextWindow))
  6466. #endif
  6467. #endif
  6468. #endif
  6469. /*
  6470. * GetPreviousWindow()
  6471. *
  6472. * Summary:
  6473. * Returns the window above a given window in the window list.
  6474. *
  6475. * Parameters:
  6476. *
  6477. * inWindow:
  6478. * The window above this window is returned.
  6479. *
  6480. * Availability:
  6481. * Non-Carbon CFM: not available
  6482. * CarbonLib: in CarbonLib 1.6 and later
  6483. * Mac OS X: in version 10.2 and later
  6484. */
  6485. EXTERN_API_C( WindowRef )
  6486. GetPreviousWindow(WindowRef inWindow);
  6487. /*
  6488. * GetWindowStandardState()
  6489. *
  6490. * Availability:
  6491. * Non-Carbon CFM: in CarbonAccessors.o 1.0 and later or as macro/inline
  6492. * CarbonLib: in CarbonLib 1.0 and later
  6493. * Mac OS X: in version 10.0 and later
  6494. */
  6495. EXTERN_API( Rect * )
  6496. GetWindowStandardState(
  6497. WindowRef window,
  6498. Rect * rect);
  6499. #if !OPAQUE_TOOLBOX_STRUCTS && !ACCESSOR_CALLS_ARE_FUNCTIONS
  6500. #ifdef __cplusplus
  6501. inline DEFINE_API(Rect *) GetWindowStandardState(WindowRef window, Rect *rect) { return (*(rect) = ((*(((WindowPeek)window)->dataHandle) == NULL) ? *(rect) : ((Rect*)(*(((WindowPeek)window)->dataHandle)))[1])), (rect); }
  6502. #else
  6503. #define GetWindowStandardState(window, rect) ((*(rect) = ((*(((WindowPeek)window)->dataHandle) == NULL) ? *(rect) : ((Rect*)(*(((WindowPeek)window)->dataHandle)))[1])), (rect))
  6504. #endif
  6505. #endif
  6506. /*
  6507. * GetWindowUserState()
  6508. *
  6509. * Availability:
  6510. * Non-Carbon CFM: in CarbonAccessors.o 1.0 and later or as macro/inline
  6511. * CarbonLib: in CarbonLib 1.0 and later
  6512. * Mac OS X: in version 10.0 and later
  6513. */
  6514. EXTERN_API( Rect * )
  6515. GetWindowUserState(
  6516. WindowRef window,
  6517. Rect * rect);
  6518. #if !OPAQUE_TOOLBOX_STRUCTS && !ACCESSOR_CALLS_ARE_FUNCTIONS
  6519. #ifdef __cplusplus
  6520. inline DEFINE_API(Rect *) GetWindowUserState(WindowRef window, Rect *rect) { return (*(rect) = ((*(((WindowPeek)window)->dataHandle) == NULL) ? *(rect) : ((Rect*)(*(((WindowPeek)window)->dataHandle)))[0])), (rect); }
  6521. #else
  6522. #define GetWindowUserState(window, rect) ((*(rect) = ((*(((WindowPeek)window)->dataHandle) == NULL) ? *(rect) : ((Rect*)(*(((WindowPeek)window)->dataHandle)))[0])), (rect))
  6523. #endif
  6524. #endif
  6525. /*
  6526. * SetWindowKind()
  6527. *
  6528. * Availability:
  6529. * Non-Carbon CFM: in CarbonAccessors.o 1.0 and later or as macro/inline
  6530. * CarbonLib: in CarbonLib 1.0 and later
  6531. * Mac OS X: in version 10.0 and later
  6532. */
  6533. EXTERN_API( void )
  6534. SetWindowKind(
  6535. WindowRef window,
  6536. short kind);
  6537. #if !OPAQUE_TOOLBOX_STRUCTS && !ACCESSOR_CALLS_ARE_FUNCTIONS
  6538. #ifdef __cplusplus
  6539. inline DEFINE_API(void) SetWindowKind(WindowRef window, short kind) { ((WindowPeek)window)->windowKind = kind; }
  6540. #else
  6541. #define SetWindowKind(window, kind) (((WindowPeek)window)->windowKind = kind)
  6542. #endif
  6543. #endif
  6544. /*
  6545. * SetWindowStandardState()
  6546. *
  6547. * Availability:
  6548. * Non-Carbon CFM: in CarbonAccessors.o 1.0 and later or as macro/inline
  6549. * CarbonLib: in CarbonLib 1.0 and later
  6550. * Mac OS X: in version 10.0 and later
  6551. */
  6552. EXTERN_API( void )
  6553. SetWindowStandardState(
  6554. WindowRef window,
  6555. const Rect * rect);
  6556. #if !OPAQUE_TOOLBOX_STRUCTS && !ACCESSOR_CALLS_ARE_FUNCTIONS
  6557. #ifdef __cplusplus
  6558. inline DEFINE_API(void) SetWindowStandardState(WindowRef window, const Rect *rect) { Rect* stateRects = (Rect*)(*(((WindowPeek)window)->dataHandle)); if (stateRects != NULL) stateRects[1] = *rect; }
  6559. #else
  6560. #define SetWindowStandardState(window, rect) do { Rect* stateRects = (Rect*)(*(((WindowPeek)window)->dataHandle)); if (stateRects != NULL) stateRects[1] = *rect; } while (false)
  6561. #endif
  6562. #endif
  6563. /*
  6564. * SetWindowUserState()
  6565. *
  6566. * Availability:
  6567. * Non-Carbon CFM: in CarbonAccessors.o 1.0 and later or as macro/inline
  6568. * CarbonLib: in CarbonLib 1.0 and later
  6569. * Mac OS X: in version 10.0 and later
  6570. */
  6571. EXTERN_API( void )
  6572. SetWindowUserState(
  6573. WindowRef window,
  6574. const Rect * rect);
  6575. #if !OPAQUE_TOOLBOX_STRUCTS && !ACCESSOR_CALLS_ARE_FUNCTIONS
  6576. #ifdef __cplusplus
  6577. inline DEFINE_API(void) SetWindowUserState(WindowRef window, const Rect *rect) { Rect* stateRects = (Rect*)(*(((WindowPeek)window)->dataHandle)); if (stateRects != NULL) stateRects[0] = *rect; }
  6578. #else
  6579. #define SetWindowUserState(window, rect) do { Rect* stateRects = (Rect*)(*(((WindowPeek)window)->dataHandle)); if (stateRects != NULL) stateRects[0] = *rect; } while (false)
  6580. #endif
  6581. #endif
  6582. /*
  6583. * SetPortWindowPort()
  6584. *
  6585. * Discussion:
  6586. * set the current QuickDraw port to the port associated with the
  6587. * window
  6588. *
  6589. * Availability:
  6590. * Non-Carbon CFM: in CarbonAccessors.o 1.0 and later or as macro/inline
  6591. * CarbonLib: in CarbonLib 1.0 and later
  6592. * Mac OS X: in version 10.0 and later
  6593. */
  6594. EXTERN_API( void )
  6595. SetPortWindowPort(WindowRef window);
  6596. #if !OPAQUE_TOOLBOX_STRUCTS && !ACCESSOR_CALLS_ARE_FUNCTIONS
  6597. #ifdef __cplusplus
  6598. inline DEFINE_API(void) SetPortWindowPort(WindowRef window) { MacSetPort((GrafPtr)window); }
  6599. #else
  6600. #define SetPortWindowPort(window) (MacSetPort((GrafPtr)window))
  6601. #endif
  6602. #endif
  6603. /*
  6604. * GetWindowPortBounds()
  6605. *
  6606. * Availability:
  6607. * Non-Carbon CFM: in CarbonAccessors.o 1.0 and later or as macro/inline
  6608. * CarbonLib: in CarbonLib 1.0 and later
  6609. * Mac OS X: in version 10.0 and later
  6610. */
  6611. EXTERN_API( Rect * )
  6612. GetWindowPortBounds(
  6613. WindowRef window,
  6614. Rect * bounds);
  6615. #if !OPAQUE_TOOLBOX_STRUCTS && !ACCESSOR_CALLS_ARE_FUNCTIONS
  6616. #ifdef __cplusplus
  6617. inline DEFINE_API(Rect *) GetWindowPortBounds(WindowRef window, Rect *bounds) { return ((*(bounds) = (window)->portRect)), (bounds); }
  6618. #else
  6619. #define GetWindowPortBounds(window, bounds) (((*(bounds) = (window)->portRect)), (bounds))
  6620. #endif
  6621. #endif
  6622. /*
  6623. * GetWindowFromPort()
  6624. *
  6625. * Discussion:
  6626. * Needed to 'cast up' to a WindowRef from a GrafPtr
  6627. *
  6628. * Availability:
  6629. * Non-Carbon CFM: in CarbonAccessors.o 1.0 and later or as macro/inline
  6630. * CarbonLib: in CarbonLib 1.0 and later
  6631. * Mac OS X: in version 10.0 and later
  6632. */
  6633. EXTERN_API( WindowRef )
  6634. GetWindowFromPort(CGrafPtr port);
  6635. #if !OPAQUE_TOOLBOX_STRUCTS && !ACCESSOR_CALLS_ARE_FUNCTIONS
  6636. #ifdef __cplusplus
  6637. inline DEFINE_API(WindowRef ) GetWindowFromPort(CGrafPtr port) { return (WindowRef)port; }
  6638. #else
  6639. #define GetWindowFromPort(port) ((WindowRef)port)
  6640. #endif
  6641. #endif
  6642. /* old accessors*/
  6643. #if CALL_NOT_IN_CARBON
  6644. /*
  6645. * GetWindowDataHandle()
  6646. *
  6647. * Availability:
  6648. * Non-Carbon CFM: available as macro/inline
  6649. * CarbonLib: not available
  6650. * Mac OS X: not available
  6651. */
  6652. EXTERN_API_C( Handle )
  6653. GetWindowDataHandle(WindowRef window);
  6654. #if !OPAQUE_TOOLBOX_STRUCTS && !ACCESSOR_CALLS_ARE_FUNCTIONS
  6655. #ifdef __cplusplus
  6656. inline DEFINE_API_C(Handle ) GetWindowDataHandle(WindowRef window) { return ((WindowPeek)window)->dataHandle; }
  6657. #else
  6658. #define GetWindowDataHandle(window) (((WindowPeek)window)->dataHandle)
  6659. #endif
  6660. #endif
  6661. /*
  6662. * SetWindowDataHandle()
  6663. *
  6664. * Availability:
  6665. * Non-Carbon CFM: available as macro/inline
  6666. * CarbonLib: not available
  6667. * Mac OS X: not available
  6668. */
  6669. EXTERN_API_C( void )
  6670. SetWindowDataHandle(
  6671. WindowRef window,
  6672. Handle data);
  6673. #if !OPAQUE_TOOLBOX_STRUCTS && !ACCESSOR_CALLS_ARE_FUNCTIONS
  6674. #ifdef __cplusplus
  6675. inline DEFINE_API_C(void) SetWindowDataHandle(WindowRef window, Handle data) { ((WindowPeek)window)->dataHandle = data; }
  6676. #else
  6677. #define SetWindowDataHandle(window, data) (((WindowPeek)window)->dataHandle = data)
  6678. #endif
  6679. #endif
  6680. /*
  6681. * GetWindowZoomFlag()
  6682. *
  6683. * Availability:
  6684. * Non-Carbon CFM: available as macro/inline
  6685. * CarbonLib: not available
  6686. * Mac OS X: not available
  6687. */
  6688. EXTERN_API_C( Boolean )
  6689. GetWindowZoomFlag(WindowRef window);
  6690. #if !OPAQUE_TOOLBOX_STRUCTS && !ACCESSOR_CALLS_ARE_FUNCTIONS
  6691. #ifdef __cplusplus
  6692. inline DEFINE_API_C(Boolean ) GetWindowZoomFlag(WindowRef window) { return ((WindowPeek)window)->spareFlag; }
  6693. #else
  6694. #define GetWindowZoomFlag(window) (((WindowPeek)window)->spareFlag)
  6695. #endif
  6696. #endif
  6697. /*
  6698. * GetWindowStructureRgn()
  6699. *
  6700. * Availability:
  6701. * Non-Carbon CFM: available as macro/inline
  6702. * CarbonLib: not available
  6703. * Mac OS X: not available
  6704. */
  6705. EXTERN_API_C( void )
  6706. GetWindowStructureRgn(
  6707. WindowRef window,
  6708. RgnHandle r);
  6709. #if !OPAQUE_TOOLBOX_STRUCTS && !ACCESSOR_CALLS_ARE_FUNCTIONS
  6710. #ifdef __cplusplus
  6711. inline DEFINE_API_C(void) GetWindowStructureRgn(WindowRef window, RgnHandle r) { MacCopyRgn(((WindowPeek)window)->strucRgn, r); }
  6712. #else
  6713. #define GetWindowStructureRgn(window, r) (MacCopyRgn(((WindowPeek)window)->strucRgn, r))
  6714. #endif
  6715. #endif
  6716. /*
  6717. * GetWindowContentRgn()
  6718. *
  6719. * Availability:
  6720. * Non-Carbon CFM: available as macro/inline
  6721. * CarbonLib: not available
  6722. * Mac OS X: not available
  6723. */
  6724. EXTERN_API_C( void )
  6725. GetWindowContentRgn(
  6726. WindowRef window,
  6727. RgnHandle r);
  6728. #if !OPAQUE_TOOLBOX_STRUCTS && !ACCESSOR_CALLS_ARE_FUNCTIONS
  6729. #ifdef __cplusplus
  6730. inline DEFINE_API_C(void) GetWindowContentRgn(WindowRef window, RgnHandle r) { MacCopyRgn(((WindowPeek)window)->contRgn, r); }
  6731. #else
  6732. #define GetWindowContentRgn(window, r) (MacCopyRgn(((WindowPeek)window)->contRgn, r))
  6733. #endif
  6734. #endif
  6735. /*
  6736. * GetWindowUpdateRgn()
  6737. *
  6738. * Availability:
  6739. * Non-Carbon CFM: available as macro/inline
  6740. * CarbonLib: not available
  6741. * Mac OS X: not available
  6742. */
  6743. EXTERN_API_C( void )
  6744. GetWindowUpdateRgn(
  6745. WindowRef window,
  6746. RgnHandle r);
  6747. #if !OPAQUE_TOOLBOX_STRUCTS && !ACCESSOR_CALLS_ARE_FUNCTIONS
  6748. #ifdef __cplusplus
  6749. inline DEFINE_API_C(void) GetWindowUpdateRgn(WindowRef window, RgnHandle r) { MacCopyRgn(((WindowPeek)window)->updateRgn, r); }
  6750. #else
  6751. #define GetWindowUpdateRgn(window, r) (MacCopyRgn(((WindowPeek)window)->updateRgn, r))
  6752. #endif
  6753. #endif
  6754. /*
  6755. * GetWindowTitleWidth()
  6756. *
  6757. * Availability:
  6758. * Non-Carbon CFM: available as macro/inline
  6759. * CarbonLib: not available
  6760. * Mac OS X: not available
  6761. */
  6762. EXTERN_API_C( SInt16 )
  6763. GetWindowTitleWidth(WindowRef window);
  6764. #if !OPAQUE_TOOLBOX_STRUCTS && !ACCESSOR_CALLS_ARE_FUNCTIONS
  6765. #ifdef __cplusplus
  6766. inline DEFINE_API_C(SInt16 ) GetWindowTitleWidth(WindowRef window) { return ((WindowPeek)window)->titleWidth; }
  6767. #else
  6768. #define GetWindowTitleWidth(window) (((WindowPeek)window)->titleWidth)
  6769. #endif
  6770. #endif
  6771. /*--------------------------------------------------------------------------------------------------*/
  6772. /* Obsolete symbolic names */
  6773. /*--------------------------------------------------------------------------------------------------*/
  6774. #endif /* CALL_NOT_IN_CARBON */
  6775. enum {
  6776. kWindowGroupAttrSelectable = kWindowGroupAttrSelectAsLayer,
  6777. kWindowGroupAttrPositionFixed = kWindowGroupAttrMoveTogether,
  6778. kWindowGroupAttrZOrderFixed = kWindowGroupAttrLayerTogether
  6779. };
  6780. #if PRAGMA_STRUCT_ALIGN
  6781. #pragma options align=reset
  6782. #elif PRAGMA_STRUCT_PACKPUSH
  6783. #pragma pack(pop)
  6784. #elif PRAGMA_STRUCT_PACK
  6785. #pragma pack()
  6786. #endif
  6787. #ifdef PRAGMA_IMPORT_OFF
  6788. #pragma import off
  6789. #elif PRAGMA_IMPORT
  6790. #pragma import reset
  6791. #endif
  6792. #ifdef __cplusplus
  6793. }
  6794. #endif
  6795. #endif /* __MACWINDOWS__ */