ControlStrip.h
上传用户:xjjlds
上传日期:2015-12-05
资源大小:22823k
文件大小:10k
源码类别:

多媒体编程

开发平台:

Visual C++

  1. /*
  2.      File:       ControlStrip.h
  3.  
  4.      Contains:   Control Strip (for Powerbooks and Duos) Interfaces.
  5.  
  6.      Version:    Technology: ControlStrip 1.4
  7.                  Release:    QuickTime 6.0.2
  8.  
  9.      Copyright:  (c) 1992-2001 by Apple Computer, Inc. All rights reserved.
  10.  
  11.      Bugs?:      For bug reports, consult the following page on
  12.                  the World Wide Web:
  13.  
  14.                      http://developer.apple.com/bugreporter/
  15.  
  16. */
  17. #ifndef __CONTROLSTRIP__
  18. #define __CONTROLSTRIP__
  19. #ifndef __MACTYPES__
  20. #include "MacTypes.h"
  21. #endif
  22. #ifndef __MENUS__
  23. #include "Menus.h"
  24. #endif
  25. #ifndef __DIALOGS__
  26. #include "Dialogs.h"
  27. #endif
  28. #if PRAGMA_ONCE
  29. #pragma once
  30. #endif
  31. #ifdef __cplusplus
  32. extern "C" {
  33. #endif
  34. #if PRAGMA_IMPORT
  35. #pragma import on
  36. #endif
  37. #if PRAGMA_STRUCT_ALIGN
  38.     #pragma options align=mac68k
  39. #elif PRAGMA_STRUCT_PACKPUSH
  40.     #pragma pack(push, 2)
  41. #elif PRAGMA_STRUCT_PACK
  42.     #pragma pack(2)
  43. #endif
  44. /*********************************************************************************************
  45.     messages passed to the modules
  46. *********************************************************************************************/
  47. enum {
  48.     sdevInitModule              = 0,                            /* initialize the module*/
  49.     sdevCloseModule             = 1,                            /* clean up before being closed*/
  50.     sdevFeatures                = 2,                            /* return feature bits*/
  51.     sdevGetDisplayWidth         = 3,                            /* returns the width of the module's display*/
  52.     sdevPeriodicTickle          = 4,                            /* periodic tickle when nothing else is happening*/
  53.     sdevDrawStatus              = 5,                            /* update the interface in the Control Strip*/
  54.     sdevMouseClick              = 6,                            /* user clicked on the module's display area in the Control Strip*/
  55.     sdevSaveSettings            = 7,                            /* saved any changed settings in module's preferences file*/
  56.     sdevShowBalloonHelp         = 8                             /* puts up a help balloon, if the module has one to display*/
  57. };
  58. /*********************************************************************************************
  59.     Features supported by the module.  If a bit is set, it means that feature is supported.
  60.     All undefined bits are reserved for future use by Apple, and should be set to zero.
  61. *********************************************************************************************/
  62. enum {
  63.     sdevWantMouseClicks         = 0,                            /* notify the module of mouseDown events*/
  64.     sdevDontAutoTrack           = 1,                            /* call the module to do mouse tracking*/
  65.     sdevHasCustomHelp           = 2,                            /* module provides its own help messages*/
  66.     sdevKeepModuleLocked        = 3                             /* module needs to be locked in the heap*/
  67. };
  68. /*********************************************************************************************
  69.     Result values returned by the sdevPeriodicTickle and sdevIconMouseClick selectors.
  70.     If a bit is set, the module can request that a specific function is performed by
  71.     the Control Strip.  A result of zero will do nothing.  All undefined bits are reserved
  72.     for future use by Apple, and should be set to zero.
  73. *********************************************************************************************/
  74. enum {
  75.     sdevResizeDisplay           = 0,                            /* resize the module's display*/
  76.     sdevNeedToSave              = 1,                            /* need to save changed settings, when convenient*/
  77.     sdevHelpStateChange         = 2,                            /* need to update the help message because of a state change*/
  78.     sdevCloseNow                = 3                             /* close a module because it doesn't want to stay around*/
  79. };
  80. /*********************************************************************************************
  81.     miscellaneous
  82. *********************************************************************************************/
  83. enum {
  84.     sdevFileType                = FOUR_CHAR_CODE('sdev')        /* module's file type*/
  85. };
  86. enum {
  87.     sdevMenuItemMark            = 0xA5                          /* 'o': 'checkmark' to use in popup menus*/
  88. };
  89. /*  direction values for SBDrawBarGraph*/
  90. enum {
  91.     BarGraphSlopeLeft           = -1,                           /* max end of sloping bar graph is on the left*/
  92.     BarGraphFlatRight           = 0,                            /* max end of flat bar graph is on the right*/
  93.     BarGraphSlopeRight          = 1                             /* max end of sloping bar graph is on the right*/
  94. };
  95. /*********************************************************************************************
  96.     utility routines to provide standard interface elements and support for common functions
  97. *********************************************************************************************/
  98. #if CALL_NOT_IN_CARBON
  99. EXTERN_API( Boolean )
  100. SBIsControlStripVisible         (void)                                                      TWOWORDINLINE(0x7000, 0xAAF2);
  101. EXTERN_API( void )
  102. SBShowHideControlStrip          (Boolean                showIt)                             THREEWORDINLINE(0x303C, 0x0101, 0xAAF2);
  103. EXTERN_API( Boolean )
  104. SBSafeToAccessStartupDisk       (void)                                                      TWOWORDINLINE(0x7002, 0xAAF2);
  105. EXTERN_API( short )
  106. SBOpenModuleResourceFile        (OSType                 fileCreator)                        THREEWORDINLINE(0x303C, 0x0203, 0xAAF2);
  107. EXTERN_API( OSErr )
  108. SBLoadPreferences               (ConstStr255Param       prefsResourceName,
  109.                                  Handle *               preferences)                        THREEWORDINLINE(0x303C, 0x0404, 0xAAF2);
  110. EXTERN_API( OSErr )
  111. SBSavePreferences               (ConstStr255Param       prefsResourceName,
  112.                                  Handle                 preferences)                        THREEWORDINLINE(0x303C, 0x0405, 0xAAF2);
  113. EXTERN_API( void )
  114. SBGetDetachedIndString          (StringPtr              theString,
  115.                                  Handle                 stringList,
  116.                                  short                  whichString)                        THREEWORDINLINE(0x303C, 0x0506, 0xAAF2);
  117. EXTERN_API( OSErr )
  118. SBGetDetachIconSuite            (Handle *               theIconSuite,
  119.                                  short                  theResID,
  120.                                  unsigned long          selector)                           THREEWORDINLINE(0x303C, 0x0507, 0xAAF2);
  121. EXTERN_API( short )
  122. SBTrackPopupMenu                (const Rect *           moduleRect,
  123.                                  MenuHandle             theMenu)                            THREEWORDINLINE(0x303C, 0x0408, 0xAAF2);
  124. EXTERN_API( short )
  125. SBTrackSlider                   (const Rect *           moduleRect,
  126.                                  short                  ticksOnSlider,
  127.                                  short                  initialValue)                       THREEWORDINLINE(0x303C, 0x0409, 0xAAF2);
  128. EXTERN_API( OSErr )
  129. SBShowHelpString                (const Rect *           moduleRect,
  130.                                  StringPtr              helpString)                         THREEWORDINLINE(0x303C, 0x040A, 0xAAF2);
  131. EXTERN_API( short )
  132. SBGetBarGraphWidth              (short                  barCount)                           THREEWORDINLINE(0x303C, 0x010B, 0xAAF2);
  133. EXTERN_API( void )
  134. SBDrawBarGraph                  (short                  level,
  135.                                  short                  barCount,
  136.                                  short                  direction,
  137.                                  Point                  barGraphTopLeft)                    THREEWORDINLINE(0x303C, 0x050C, 0xAAF2);
  138. EXTERN_API( void )
  139. SBModalDialogInContext          (ModalFilterUPP         filterProc,
  140.                                  short *                itemHit)                            THREEWORDINLINE(0x303C, 0x040D, 0xAAF2);
  141. /* The following routines are available in Control Strip 1.2 and later. */
  142. EXTERN_API( OSErr )
  143. SBGetControlStripFontID         (short *                fontID)                             THREEWORDINLINE(0x303C, 0x020E, 0xAAF2);
  144. EXTERN_API( OSErr )
  145. SBSetControlStripFontID         (short                  fontID)                             THREEWORDINLINE(0x303C, 0x010F, 0xAAF2);
  146. EXTERN_API( OSErr )
  147. SBGetControlStripFontSize       (short *                fontSize)                           THREEWORDINLINE(0x303C, 0x0210, 0xAAF2);
  148. EXTERN_API( OSErr )
  149. SBSetControlStripFontSize       (short                  fontSize)                           THREEWORDINLINE(0x303C, 0x0111, 0xAAF2);
  150. EXTERN_API( OSErr )
  151. SBGetShowHideHotKey             (short *                modifiers,
  152.                                  unsigned char *        keyCode)                            THREEWORDINLINE(0x303C, 0x0412, 0xAAF2);
  153. EXTERN_API( OSErr )
  154. SBSetShowHideHotKey             (short                  modifiers,
  155.                                  unsigned char          keyCode)                            THREEWORDINLINE(0x303C, 0x0213, 0xAAF2);
  156. EXTERN_API( OSErr )
  157. SBIsShowHideHotKeyEnabled       (Boolean *              enabled)                            THREEWORDINLINE(0x303C, 0x0214, 0xAAF2);
  158. EXTERN_API( OSErr )
  159. SBEnableShowHideHotKey          (Boolean                enabled)                            THREEWORDINLINE(0x303C, 0x0115, 0xAAF2);
  160. /* The following routines are available in Control Strip 1.4 and later. */
  161. EXTERN_API( short )
  162. SBHitTrackSlider                (const Rect *           moduleRect,
  163.                                  short                  ticksOnSlider,
  164.                                  short                  initialValue,
  165.                                  Boolean *              hit)                                THREEWORDINLINE(0x303C, 0x0616, 0xAAF2);
  166. #endif  /* CALL_NOT_IN_CARBON */
  167. #if PRAGMA_STRUCT_ALIGN
  168.     #pragma options align=reset
  169. #elif PRAGMA_STRUCT_PACKPUSH
  170.     #pragma pack(pop)
  171. #elif PRAGMA_STRUCT_PACK
  172.     #pragma pack()
  173. #endif
  174. #ifdef PRAGMA_IMPORT_OFF
  175. #pragma import off
  176. #elif PRAGMA_IMPORT
  177. #pragma import reset
  178. #endif
  179. #ifdef __cplusplus
  180. }
  181. #endif
  182. #endif /* __CONTROLSTRIP__ */