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

多媒体编程

开发平台:

Visual C++

  1. /*
  2.      File:       Retrace.h
  3.  
  4.      Contains:   Vertical Retrace Interfaces.
  5.  
  6.      Version:    Technology: System 7.5
  7.                  Release:    QuickTime 6.0.2
  8.  
  9.      Copyright:  (c) 1985-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 __RETRACE__
  18. #define __RETRACE__
  19. #ifndef __MACTYPES__
  20. #include "MacTypes.h"
  21. #endif
  22. #ifndef __OSUTILS__
  23. #include "OSUtils.h"
  24. #endif
  25. #if PRAGMA_ONCE
  26. #pragma once
  27. #endif
  28. #ifdef __cplusplus
  29. extern "C" {
  30. #endif
  31. #if PRAGMA_IMPORT
  32. #pragma import on
  33. #endif
  34. #if PRAGMA_STRUCT_ALIGN
  35.     #pragma options align=mac68k
  36. #elif PRAGMA_STRUCT_PACKPUSH
  37.     #pragma pack(push, 2)
  38. #elif PRAGMA_STRUCT_PACK
  39.     #pragma pack(2)
  40. #endif
  41. typedef struct VBLTask                  VBLTask;
  42. typedef VBLTask *                       VBLTaskPtr;
  43. typedef CALLBACK_API( void , VBLProcPtr )(VBLTaskPtr vblTaskPtr);
  44. /*
  45.     WARNING: VBLProcPtr uses register based parameters under classic 68k
  46.              and cannot be written in a high-level language without 
  47.              the help of mixed mode or assembly glue.
  48. */
  49. typedef REGISTER_UPP_TYPE(VBLProcPtr)                           VBLUPP;
  50. struct VBLTask {
  51.     QElemPtr                        qLink;
  52.     short                           qType;
  53.     VBLUPP                          vblAddr;
  54.     short                           vblCount;
  55.     short                           vblPhase;
  56. };
  57. #if OPAQUE_UPP_TYPES
  58. #if CALL_NOT_IN_CARBON
  59.     EXTERN_API(VBLUPP)
  60.     NewVBLUPP                      (VBLProcPtr              userRoutine);
  61.     EXTERN_API(void)
  62.     DisposeVBLUPP                  (VBLUPP                  userUPP);
  63.     EXTERN_API(void)
  64.     InvokeVBLUPP                   (VBLTaskPtr              vblTaskPtr,
  65.                                     VBLUPP                  userUPP);
  66. #endif  /* CALL_NOT_IN_CARBON */
  67. #else
  68.     enum { uppVBLProcInfo = 0x00009802 };                           /* register no_return_value Func(4_bytes:A0) */
  69.     #define NewVBLUPP(userRoutine)                                  (VBLUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppVBLProcInfo, GetCurrentArchitecture())
  70.     #define DisposeVBLUPP(userUPP)                                  DisposeRoutineDescriptor(userUPP)
  71.     #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  72.     #pragma parameter InvokeVBLUPP(__A0, __A1)
  73.     void InvokeVBLUPP(VBLTaskPtr vblTaskPtr, VBLUPP userUPP) = 0x4E91;
  74.     #else
  75.         #define InvokeVBLUPP(vblTaskPtr, userUPP)                       CALL_ONE_PARAMETER_UPP((userUPP), uppVBLProcInfo, (vblTaskPtr))
  76.     #endif
  77. #endif
  78. /* support for pre-Carbon UPP routines: NewXXXProc and CallXXXProc */
  79. #define NewVBLProc(userRoutine)                                 NewVBLUPP(userRoutine)
  80. #define CallVBLProc(userRoutine, vblTaskPtr)                    InvokeVBLUPP(vblTaskPtr, userRoutine)
  81. #if CALL_NOT_IN_CARBON
  82. #if CALL_NOT_IN_CARBON
  83. EXTERN_API( QHdrPtr )
  84. GetVBLQHdr                      (void)                                                      THREEWORDINLINE(0x2EBC, 0x0000, 0x0160);
  85.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  86.                                                                                             #pragma parameter __D0 SlotVInstall(__A0, __D0)
  87.                                                                                             #endif
  88. EXTERN_API( OSErr )
  89. SlotVInstall                    (QElemPtr               vblBlockPtr,
  90.                                  short                  theSlot)                            ONEWORDINLINE(0xA06F);
  91.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  92.                                                                                             #pragma parameter __D0 SlotVRemove(__A0, __D0)
  93.                                                                                             #endif
  94. EXTERN_API( OSErr )
  95. SlotVRemove                     (QElemPtr               vblBlockPtr,
  96.                                  short                  theSlot)                            ONEWORDINLINE(0xA070);
  97.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  98.                                                                                             #pragma parameter __D0 AttachVBL(__D0)
  99.                                                                                             #endif
  100. EXTERN_API( OSErr )
  101. AttachVBL                       (short                  theSlot)                            ONEWORDINLINE(0xA071);
  102.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  103.                                                                                             #pragma parameter __D0 DoVBLTask(__D0)
  104.                                                                                             #endif
  105. EXTERN_API( OSErr )
  106. DoVBLTask                       (short                  theSlot)                            ONEWORDINLINE(0xA072);
  107.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  108.                                                                                             #pragma parameter __D0 VInstall(__A0)
  109.                                                                                             #endif
  110. EXTERN_API( OSErr )
  111. VInstall                        (QElemPtr               vblTaskPtr)                         ONEWORDINLINE(0xA033);
  112.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  113.                                                                                             #pragma parameter __D0 VRemove(__A0)
  114.                                                                                             #endif
  115. EXTERN_API( OSErr )
  116. VRemove                         (QElemPtr               vblTaskPtr)                         ONEWORDINLINE(0xA034);
  117. #endif  /* CALL_NOT_IN_CARBON */
  118. #endif  /* CALL_NOT_IN_CARBON */
  119. #if PRAGMA_STRUCT_ALIGN
  120.     #pragma options align=reset
  121. #elif PRAGMA_STRUCT_PACKPUSH
  122.     #pragma pack(pop)
  123. #elif PRAGMA_STRUCT_PACK
  124.     #pragma pack()
  125. #endif
  126. #ifdef PRAGMA_IMPORT_OFF
  127. #pragma import off
  128. #elif PRAGMA_IMPORT
  129. #pragma import reset
  130. #endif
  131. #ifdef __cplusplus
  132. }
  133. #endif
  134. #endif /* __RETRACE__ */