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.

181 lines
5.0 KiB

  1. /*
  2. File: Notification.h
  3. Contains: Notification Manager interfaces
  4. Version: QuickTime 7.3
  5. Copyright: (c) 2007 (c) 1989-2001 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 __NOTIFICATION__
  11. #define __NOTIFICATION__
  12. #ifndef __MACTYPES__
  13. #include <MacTypes.h>
  14. #endif
  15. #ifndef __OSUTILS__
  16. #include <OSUtils.h>
  17. #endif
  18. #if PRAGMA_ONCE
  19. #pragma once
  20. #endif
  21. #ifdef __cplusplus
  22. extern "C" {
  23. #endif
  24. #if PRAGMA_IMPORT
  25. #pragma import on
  26. #endif
  27. #if PRAGMA_STRUCT_ALIGN
  28. #pragma options align=mac68k
  29. #elif PRAGMA_STRUCT_PACKPUSH
  30. #pragma pack(push, 2)
  31. #elif PRAGMA_STRUCT_PACK
  32. #pragma pack(2)
  33. #endif
  34. typedef struct NMRec NMRec;
  35. typedef NMRec * NMRecPtr;
  36. typedef CALLBACK_API( void , NMProcPtr )(NMRecPtr nmReqPtr);
  37. typedef STACK_UPP_TYPE(NMProcPtr) NMUPP;
  38. struct NMRec {
  39. QElemPtr qLink; /* next queue entry*/
  40. short qType; /* queue type -- ORD(nmType) = 8*/
  41. short nmFlags; /* reserved*/
  42. long nmPrivate; /* reserved*/
  43. short nmReserved; /* reserved*/
  44. short nmMark; /* item to mark in Apple menu*/
  45. Handle nmIcon; /* handle to small icon*/
  46. Handle nmSound; /* handle to sound record*/
  47. StringPtr nmStr; /* string to appear in alert*/
  48. NMUPP nmResp; /* pointer to response routine*/
  49. long nmRefCon; /* for application use*/
  50. };
  51. /*
  52. * NewNMUPP()
  53. *
  54. * Availability:
  55. * Non-Carbon CFM: available as macro/inline
  56. * CarbonLib: in CarbonLib 1.0 and later
  57. * Mac OS X: in version 10.0 and later
  58. */
  59. EXTERN_API_C( NMUPP )
  60. NewNMUPP(NMProcPtr userRoutine);
  61. #if !OPAQUE_UPP_TYPES
  62. enum { uppNMProcInfo = 0x000000C0 }; /* pascal no_return_value Func(4_bytes) */
  63. #ifdef __cplusplus
  64. inline DEFINE_API_C(NMUPP) NewNMUPP(NMProcPtr userRoutine) { return (NMUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppNMProcInfo, GetCurrentArchitecture()); }
  65. #else
  66. #define NewNMUPP(userRoutine) (NMUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppNMProcInfo, GetCurrentArchitecture())
  67. #endif
  68. #endif
  69. /*
  70. * DisposeNMUPP()
  71. *
  72. * Availability:
  73. * Non-Carbon CFM: available as macro/inline
  74. * CarbonLib: in CarbonLib 1.0 and later
  75. * Mac OS X: in version 10.0 and later
  76. */
  77. EXTERN_API_C( void )
  78. DisposeNMUPP(NMUPP userUPP);
  79. #if !OPAQUE_UPP_TYPES
  80. #ifdef __cplusplus
  81. inline DEFINE_API_C(void) DisposeNMUPP(NMUPP userUPP) { DisposeRoutineDescriptor((UniversalProcPtr)userUPP); }
  82. #else
  83. #define DisposeNMUPP(userUPP) DisposeRoutineDescriptor(userUPP)
  84. #endif
  85. #endif
  86. /*
  87. * InvokeNMUPP()
  88. *
  89. * Availability:
  90. * Non-Carbon CFM: available as macro/inline
  91. * CarbonLib: in CarbonLib 1.0 and later
  92. * Mac OS X: in version 10.0 and later
  93. */
  94. EXTERN_API_C( void )
  95. InvokeNMUPP(
  96. NMRecPtr nmReqPtr,
  97. NMUPP userUPP);
  98. #if !OPAQUE_UPP_TYPES
  99. #ifdef __cplusplus
  100. inline DEFINE_API_C(void) InvokeNMUPP(NMRecPtr nmReqPtr, NMUPP userUPP) { CALL_ONE_PARAMETER_UPP(userUPP, uppNMProcInfo, nmReqPtr); }
  101. #else
  102. #define InvokeNMUPP(nmReqPtr, userUPP) CALL_ONE_PARAMETER_UPP((userUPP), uppNMProcInfo, (nmReqPtr))
  103. #endif
  104. #endif
  105. #if CALL_NOT_IN_CARBON || OLDROUTINENAMES
  106. /* support for pre-Carbon UPP routines: New...Proc and Call...Proc */
  107. #define NewNMProc(userRoutine) NewNMUPP(userRoutine)
  108. #define CallNMProc(userRoutine, nmReqPtr) InvokeNMUPP(nmReqPtr, userRoutine)
  109. #endif /* CALL_NOT_IN_CARBON */
  110. /*
  111. * NMInstall()
  112. *
  113. * Availability:
  114. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  115. * CarbonLib: in CarbonLib 1.0 and later
  116. * Mac OS X: in version 10.0 and later
  117. */
  118. #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  119. #pragma parameter __D0 NMInstall(__A0)
  120. #endif
  121. EXTERN_API( OSErr )
  122. NMInstall(NMRecPtr nmReqPtr) ONEWORDINLINE(0xA05E);
  123. /*
  124. * NMRemove()
  125. *
  126. * Availability:
  127. * Non-Carbon CFM: in InterfaceLib 7.1 and later
  128. * CarbonLib: in CarbonLib 1.0 and later
  129. * Mac OS X: in version 10.0 and later
  130. */
  131. #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  132. #pragma parameter __D0 NMRemove(__A0)
  133. #endif
  134. EXTERN_API( OSErr )
  135. NMRemove(NMRecPtr nmReqPtr) ONEWORDINLINE(0xA05F);
  136. #if PRAGMA_STRUCT_ALIGN
  137. #pragma options align=reset
  138. #elif PRAGMA_STRUCT_PACKPUSH
  139. #pragma pack(pop)
  140. #elif PRAGMA_STRUCT_PACK
  141. #pragma pack()
  142. #endif
  143. #ifdef PRAGMA_IMPORT_OFF
  144. #pragma import off
  145. #elif PRAGMA_IMPORT
  146. #pragma import reset
  147. #endif
  148. #ifdef __cplusplus
  149. }
  150. #endif
  151. #endif /* __NOTIFICATION__ */