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

多媒体编程

开发平台:

Visual C++

  1. /*
  2.      File:       EPPC.h
  3.  
  4.      Contains:   High Level Event Manager Interfaces.
  5.  
  6.      Version:    Technology: System 7.5
  7.                  Release:    QuickTime 6.0.2
  8.  
  9.      Copyright:  (c) 1988-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 __EPPC__
  18. #define __EPPC__
  19. #ifndef __MACERRORS__
  20. #include "MacErrors.h"
  21. #endif
  22. #ifndef __APPLETALK__
  23. #include "AppleTalk.h"
  24. #endif
  25. #ifndef __FILES__
  26. #include "Files.h"
  27. #endif
  28. #ifndef __PPCTOOLBOX__
  29. #include "PPCToolbox.h"
  30. #endif
  31. #ifndef __PROCESSES__
  32. #include "Processes.h"
  33. #endif
  34. #ifndef __EVENTS__
  35. #include "Events.h"
  36. #endif
  37. #if PRAGMA_ONCE
  38. #pragma once
  39. #endif
  40. #ifdef __cplusplus
  41. extern "C" {
  42. #endif
  43. #if PRAGMA_IMPORT
  44. #pragma import on
  45. #endif
  46. #if PRAGMA_STRUCT_ALIGN
  47.     #pragma options align=mac68k
  48. #elif PRAGMA_STRUCT_PACKPUSH
  49.     #pragma pack(push, 2)
  50. #elif PRAGMA_STRUCT_PACK
  51.     #pragma pack(2)
  52. #endif
  53. enum {
  54.                                                                 /* postOptions currently supported */
  55.     receiverIDMask              = 0x0000F000,
  56.     receiverIDisPSN             = 0x00008000,
  57.     receiverIDisSignature       = 0x00007000,
  58.     receiverIDisSessionID       = 0x00006000,
  59.     receiverIDisTargetID        = 0x00005000,
  60.     systemOptionsMask           = 0x00000F00,
  61.     nReturnReceipt              = 0x00000200,
  62.     priorityMask                = 0x000000FF,
  63.     nAttnMsg                    = 0x00000001
  64. };
  65. enum {
  66.                                                                 /* constant for return receipts */
  67.     HighLevelEventMsgClass      = FOUR_CHAR_CODE('jaym'),
  68.     rtrnReceiptMsgID            = FOUR_CHAR_CODE('rtrn')
  69. };
  70. enum {
  71.     msgWasPartiallyAccepted     = 2,
  72.     msgWasFullyAccepted         = 1,
  73.     msgWasNotAccepted           = 0
  74. };
  75. struct TargetID {
  76.     long                            sessionID;
  77.     PPCPortRec                      name;
  78.     LocationNameRec                 location;
  79.     PPCPortRec                      recvrName;
  80. };
  81. typedef struct TargetID                 TargetID;
  82. typedef TargetID *                      TargetIDPtr;
  83. typedef TargetIDPtr *                   TargetIDHandle;
  84. typedef TargetIDHandle                  TargetIDHdl;
  85. typedef TargetID                        SenderID;
  86. typedef SenderID *                      SenderIDPtr;
  87. struct HighLevelEventMsg {
  88.     unsigned short                  HighLevelEventMsgHeaderLength;
  89.     unsigned short                  version;
  90.     unsigned long                   reserved1;
  91.     EventRecord                     theMsgEvent;
  92.     unsigned long                   userRefcon;
  93.     unsigned long                   postingOptions;
  94.     unsigned long                   msgLength;
  95. };
  96. typedef struct HighLevelEventMsg        HighLevelEventMsg;
  97. typedef HighLevelEventMsg *             HighLevelEventMsgPtr;
  98. typedef HighLevelEventMsgPtr *          HighLevelEventMsgHandle;
  99. typedef HighLevelEventMsgHandle         HighLevelEventMsgHdl;
  100. typedef CALLBACK_API( Boolean , GetSpecificFilterProcPtr )(void *contextPtr, HighLevelEventMsgPtr msgBuff, const TargetID *sender);
  101. typedef STACK_UPP_TYPE(GetSpecificFilterProcPtr)                GetSpecificFilterUPP;
  102. #if OPAQUE_UPP_TYPES
  103. #if CALL_NOT_IN_CARBON
  104.     EXTERN_API(GetSpecificFilterUPP)
  105.     NewGetSpecificFilterUPP        (GetSpecificFilterProcPtr userRoutine);
  106.     EXTERN_API(void)
  107.     DisposeGetSpecificFilterUPP    (GetSpecificFilterUPP    userUPP);
  108.     EXTERN_API(Boolean)
  109.     InvokeGetSpecificFilterUPP     (void *                  contextPtr,
  110.                                     HighLevelEventMsgPtr    msgBuff,
  111.                                     const TargetID *        sender,
  112.                                     GetSpecificFilterUPP    userUPP);
  113. #endif  /* CALL_NOT_IN_CARBON */
  114. #else
  115.     enum { uppGetSpecificFilterProcInfo = 0x00000FD0 };             /* pascal 1_byte Func(4_bytes, 4_bytes, 4_bytes) */
  116.     #define NewGetSpecificFilterUPP(userRoutine)                    (GetSpecificFilterUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppGetSpecificFilterProcInfo, GetCurrentArchitecture())
  117.     #define DisposeGetSpecificFilterUPP(userUPP)                    DisposeRoutineDescriptor(userUPP)
  118.     #define InvokeGetSpecificFilterUPP(contextPtr, msgBuff, sender, userUPP)  (Boolean)CALL_THREE_PARAMETER_UPP((userUPP), uppGetSpecificFilterProcInfo, (contextPtr), (msgBuff), (sender))
  119. #endif
  120. /* support for pre-Carbon UPP routines: NewXXXProc and CallXXXProc */
  121. #define NewGetSpecificFilterProc(userRoutine)                   NewGetSpecificFilterUPP(userRoutine)
  122. #define CallGetSpecificFilterProc(userRoutine, contextPtr, msgBuff, sender) InvokeGetSpecificFilterUPP(contextPtr, msgBuff, sender, userRoutine)
  123. #if CALL_NOT_IN_CARBON
  124. #if CALL_NOT_IN_CARBON
  125. EXTERN_API( OSErr )
  126. PostHighLevelEvent              (const EventRecord *    theEvent,
  127.                                  void *                 receiverID,
  128.                                  unsigned long          msgRefcon,
  129.                                  void *                 msgBuff,
  130.                                  unsigned long          msgLen,
  131.                                  unsigned long          postingOptions)                     THREEWORDINLINE(0x3F3C, 0x0034, 0xA88F);
  132. #endif  /* CALL_NOT_IN_CARBON */
  133. #endif  /* CALL_NOT_IN_CARBON */
  134. #if CALL_NOT_IN_CARBON
  135. #if CALL_NOT_IN_CARBON
  136. EXTERN_API( OSErr )
  137. AcceptHighLevelEvent            (TargetID *             sender,
  138.                                  unsigned long *        msgRefcon,
  139.                                  void *                 msgBuff,
  140.                                  unsigned long *        msgLen)                             THREEWORDINLINE(0x3F3C, 0x0033, 0xA88F);
  141. #endif  /* CALL_NOT_IN_CARBON */
  142. #endif  /* CALL_NOT_IN_CARBON */
  143. #if CALL_NOT_IN_CARBON
  144. #if CALL_NOT_IN_CARBON
  145. EXTERN_API( OSErr )
  146. GetProcessSerialNumberFromPortName (const PPCPortRec *  portName,
  147.                                  ProcessSerialNumber *  pPSN)                               THREEWORDINLINE(0x3F3C, 0x0035, 0xA88F);
  148. #endif  /* CALL_NOT_IN_CARBON */
  149. #endif  /* CALL_NOT_IN_CARBON */
  150. #if CALL_NOT_IN_CARBON
  151. #if CALL_NOT_IN_CARBON
  152. EXTERN_API( OSErr )
  153. GetPortNameFromProcessSerialNumber (PPCPortRec *        portName,
  154.                                  const ProcessSerialNumber * pPSN)                          THREEWORDINLINE(0x3F3C, 0x0046, 0xA88F);
  155. #endif  /* CALL_NOT_IN_CARBON */
  156. #endif  /* CALL_NOT_IN_CARBON */
  157. #if CALL_NOT_IN_CARBON
  158. #if CALL_NOT_IN_CARBON
  159. EXTERN_API( Boolean )
  160. GetSpecificHighLevelEvent       (GetSpecificFilterUPP   aFilter,
  161.                                  void *                 contextPtr,
  162.                                  OSErr *                err)                                THREEWORDINLINE(0x3F3C, 0x0045, 0xA88F);
  163. #endif  /* CALL_NOT_IN_CARBON */
  164. #endif  /* CALL_NOT_IN_CARBON */
  165. #if PRAGMA_STRUCT_ALIGN
  166.     #pragma options align=reset
  167. #elif PRAGMA_STRUCT_PACKPUSH
  168.     #pragma pack(pop)
  169. #elif PRAGMA_STRUCT_PACK
  170.     #pragma pack()
  171. #endif
  172. #ifdef PRAGMA_IMPORT_OFF
  173. #pragma import off
  174. #elif PRAGMA_IMPORT
  175. #pragma import reset
  176. #endif
  177. #ifdef __cplusplus
  178. }
  179. #endif
  180. #endif /* __EPPC__ */