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

多媒体编程

开发平台:

Visual C++

  1. /*
  2.      File:       GXMessages.h
  3.  
  4.      Contains:   This file contains all of the public data structures,
  5.  
  6.      Version:    Technology: Quickdraw GX 1.1
  7.                  Release:    QuickTime 6.0.2
  8.  
  9.      Copyright:  (c) 1994-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 __GXMESSAGES__
  18. #define __GXMESSAGES__
  19. #ifndef __CONDITIONALMACROS__
  20. #include "ConditionalMacros.h"
  21. #endif
  22. #ifndef __MACTYPES__
  23. #include "MacTypes.h"
  24. #endif
  25. #ifndef __MIXEDMODE__
  26. #include "MixedMode.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. #if defined(__MWERKS__) && TARGET_CPU_68K
  45.     #pragma push
  46.     #pragma pointers_in_D0
  47. #endif
  48.  
  49. /*
  50.     >>>>>> CONSTANTS <<<<<<
  51. */
  52. /* Message Manager Trap */
  53. enum {
  54.     messageManagerTrap          = 0xABFB
  55. };
  56. /* Message Manager Error Result Codes */
  57. enum {
  58.     messageStopLoopingErr       = -5775,
  59.     cantDeleteRunningHandlerErr = -5776,
  60.     noMessageTableErr           = -5777,
  61.     dupSignatureErr             = -5778,
  62.     messageNotReceivedErr       = -5799
  63. };
  64. /*
  65.     DATA TYPES
  66. */
  67. typedef CALLBACK_API_C( OSErr , MessageHandlerOverrideProcPtr )(long arg1, long arg2, long arg3, long arg4, long arg5, long arg6);
  68. typedef STACK_UPP_TYPE(MessageHandlerOverrideProcPtr)           MessageHandlerOverrideUPP;
  69. #if OPAQUE_UPP_TYPES
  70. #if CALL_NOT_IN_CARBON
  71.     EXTERN_API(MessageHandlerOverrideUPP)
  72.     NewMessageHandlerOverrideUPP    (MessageHandlerOverrideProcPtr userRoutine);
  73.     EXTERN_API(void)
  74.     DisposeMessageHandlerOverrideUPP    (MessageHandlerOverrideUPP userUPP);
  75.     EXTERN_API(OSErr)
  76.     InvokeMessageHandlerOverrideUPP    (long                arg1,
  77.                                     long                    arg2,
  78.                                     long                    arg3,
  79.                                     long                    arg4,
  80.                                     long                    arg5,
  81.                                     long                    arg6,
  82.                                     MessageHandlerOverrideUPP userUPP);
  83. #endif  /* CALL_NOT_IN_CARBON */
  84. #else
  85.     enum { uppMessageHandlerOverrideProcInfo = 0x0003FFE1 };        /* 2_bytes Func(4_bytes, 4_bytes, 4_bytes, 4_bytes, 4_bytes, 4_bytes) */
  86.     #define NewMessageHandlerOverrideUPP(userRoutine)               (MessageHandlerOverrideUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppMessageHandlerOverrideProcInfo, GetCurrentArchitecture())
  87.     #define DisposeMessageHandlerOverrideUPP(userUPP)               DisposeRoutineDescriptor(userUPP)
  88.     #define InvokeMessageHandlerOverrideUPP(arg1, arg2, arg3, arg4, arg5, arg6, userUPP)  (OSErr)CALL_SIX_PARAMETER_UPP((userUPP), uppMessageHandlerOverrideProcInfo, (arg1), (arg2), (arg3), (arg4), (arg5), (arg6))
  89. #endif
  90. /* support for pre-Carbon UPP routines: NewXXXProc and CallXXXProc */
  91. #define NewMessageHandlerOverrideProc(userRoutine)              NewMessageHandlerOverrideUPP(userRoutine)
  92. #define CallMessageHandlerOverrideProc(userRoutine, arg1, arg2, arg3, arg4, arg5, arg6) InvokeMessageHandlerOverrideUPP(arg1, arg2, arg3, arg4, arg5, arg6, userRoutine)
  93. typedef CALLBACK_API_C( void , MessageGlobalsInitProcPtr )(void *messageGlobals);
  94. typedef STACK_UPP_TYPE(MessageGlobalsInitProcPtr)               MessageGlobalsInitUPP;
  95. #if OPAQUE_UPP_TYPES
  96. #if CALL_NOT_IN_CARBON
  97.     EXTERN_API(MessageGlobalsInitUPP)
  98.     NewMessageGlobalsInitUPP       (MessageGlobalsInitProcPtr userRoutine);
  99.     EXTERN_API(void)
  100.     DisposeMessageGlobalsInitUPP    (MessageGlobalsInitUPP  userUPP);
  101.     EXTERN_API(void)
  102.     InvokeMessageGlobalsInitUPP    (void *                  messageGlobals,
  103.                                     MessageGlobalsInitUPP   userUPP);
  104. #endif  /* CALL_NOT_IN_CARBON */
  105. #else
  106.     enum { uppMessageGlobalsInitProcInfo = 0x000000C1 };            /* no_return_value Func(4_bytes) */
  107.     #define NewMessageGlobalsInitUPP(userRoutine)                   (MessageGlobalsInitUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppMessageGlobalsInitProcInfo, GetCurrentArchitecture())
  108.     #define DisposeMessageGlobalsInitUPP(userUPP)                   DisposeRoutineDescriptor(userUPP)
  109.     #define InvokeMessageGlobalsInitUPP(messageGlobals, userUPP)    CALL_ONE_PARAMETER_UPP((userUPP), uppMessageGlobalsInitProcInfo, (messageGlobals))
  110. #endif
  111. /* support for pre-Carbon UPP routines: NewXXXProc and CallXXXProc */
  112. #define NewMessageGlobalsInitProc(userRoutine)                  NewMessageGlobalsInitUPP(userRoutine)
  113. #define CallMessageGlobalsInitProc(userRoutine, messageGlobals) InvokeMessageGlobalsInitUPP(messageGlobals, userRoutine)
  114. #if OLDROUTINENAMES
  115. typedef MessageHandlerOverrideProcPtr   MessageHandlerOverrideProc;
  116. typedef MessageGlobalsInitProcPtr       MessageGlobalsInitProc;
  117. #endif  /* OLDROUTINENAMES */
  118. typedef struct OpaqueMessageHandler*    MessageHandler;
  119. typedef struct OpaqueMessageObject*     MessageObject;
  120. /*
  121.     PUBLIC INTERFACES
  122.     Message Handler API Routines
  123. */
  124. #if CALL_NOT_IN_CARBON
  125. EXTERN_API_C( long )
  126. CountMessageHandlerInstances    (void)                                                      TWOWORDINLINE(0x7028, 0xABFB);
  127. EXTERN_API_C( void *)
  128. GetMessageHandlerClassContext   (void)                                                      TWOWORDINLINE(0x7029, 0xABFB);
  129. EXTERN_API_C( void *)
  130. SetMessageHandlerClassContext   (void *                 anyValue)                           TWOWORDINLINE(0x702A, 0xABFB);
  131. EXTERN_API_C( void *)
  132. GetMessageHandlerInstanceContext (void)                                                     TWOWORDINLINE(0x702B, 0xABFB);
  133. EXTERN_API_C( void *)
  134. SetMessageHandlerInstanceContext (void *                anyValue)                           TWOWORDINLINE(0x702C, 0xABFB);
  135. EXTERN_API_C( OSErr )
  136. NewMessageGlobals               (long                   messageGlobalsSize,
  137.                                  MessageGlobalsInitUPP  initProc)                           TWOWORDINLINE(0x702D, 0xABFB);
  138. EXTERN_API_C( void )
  139. DisposeMessageGlobals           (void)                                                      TWOWORDINLINE(0x702E, 0xABFB);
  140. /*
  141.     Message Sending API Routines
  142. */
  143. #ifndef BUILDING_GXMESSAGES
  144. #endif  /* CALL_NOT_IN_CARBON */
  145. #if CALL_NOT_IN_CARBON
  146. EXTERN_API_C( OSErr )
  147. SendObjectMessage               (MessageObject          msgObject,
  148.                                  long                   messageSelector,
  149.                                  ...)                                                       FIVEWORDINLINE(0x205F, 0x221F, 0x702F, 0xABFB, 0x518F);
  150. EXTERN_API_C( OSErr )
  151. SendObjectMessageTo             (MessageObject          msgObject,
  152.                                  long                   messageSelector,
  153.                                  MessageHandler         msgHandler,
  154.                                  ...)                                                       SEVENWORDINLINE(0x205F, 0x221F, 0x241F, 0x7030, 0xABFB, 0x9EFC, 0x000C);
  155. EXTERN_API_C( OSErr )
  156. SendObjectMessageFor            (MessageObject          msgObject,
  157.                                  long                   messageSelector,
  158.                                  MessageHandler         msgHandler,
  159.                                  ...)                                                       SEVENWORDINLINE(0x205F, 0x221F, 0x241F, 0x7037, 0xABFB, 0x9EFC, 0x000C);
  160. EXTERN_API_C( OSErr )
  161. StartObjectMessageAt            (MessageObject          msgObject,
  162.                                  long                   messageSelector,
  163.                                  MessageHandler         msgHandler,
  164.                                  ...)                                                       SEVENWORDINLINE(0x205F, 0x221F, 0x241F, 0x7031, 0xABFB, 0x9EFC, 0x000C);
  165. #if TARGET_OS_MAC
  166.     #define MacSendMessage SendMessage
  167. #endif
  168. EXTERN_API_C( OSErr )
  169. MacSendMessage                  (long                   messageSelector,
  170.                                  ...)                                                       FOURWORDINLINE(0x221F, 0x7032, 0xABFB, 0x598F);
  171. EXTERN_API_C( OSErr )
  172. SendMessageTo                   (long                   messageSelector,
  173.                                  MessageHandler         msgHandler,
  174.                                  ...)                                                       FIVEWORDINLINE(0x221F, 0x241F, 0x7033, 0xABFB, 0x518F);
  175. EXTERN_API_C( OSErr )
  176. StartMessageAt                  (long                   messageSelector,
  177.                                  MessageHandler         msgHandler,
  178.                                  ...)                                                       FIVEWORDINLINE(0x221F, 0x241F, 0x7034, 0xABFB, 0x518F);
  179. EXTERN_API_C( OSErr )
  180. ForwardMessage                  (long                   messageSelector,
  181.                                  ...)                                                       FOURWORDINLINE(0x221F, 0x7035, 0xABFB, 0x598F);
  182. EXTERN_API_C( OSErr )
  183. ForwardThisMessage              (void *                 parameter1,
  184.                                  ...)                                                       TWOWORDINLINE(0x7036, 0xABFB);
  185. #endif  /* CALL_NOT_IN_CARBON */
  186. #endif  /* BUILDING_GXMESSAGES */
  187.  
  188. #if defined(__MWERKS__) && TARGET_CPU_68K
  189.     #pragma pop
  190. #endif
  191. #if PRAGMA_STRUCT_ALIGN
  192.     #pragma options align=reset
  193. #elif PRAGMA_STRUCT_PACKPUSH
  194.     #pragma pack(pop)
  195. #elif PRAGMA_STRUCT_PACK
  196.     #pragma pack()
  197. #endif
  198. #ifdef PRAGMA_IMPORT_OFF
  199. #pragma import off
  200. #elif PRAGMA_IMPORT
  201. #pragma import reset
  202. #endif
  203. #ifdef __cplusplus
  204. }
  205. #endif
  206. #endif /* __GXMESSAGES__ */