Mac OS 9
Notification.h
Go to the documentation of this file.
1 
19 #ifndef __NOTIFICATION__
20 #define __NOTIFICATION__
21 
22 #ifndef __MACTYPES__
23 #include <MacTypes.h>
24 #endif
25 
26 #ifndef __OSUTILS__
27 #include <OSUtils.h>
28 #endif
29 
30 #if PRAGMA_ONCE
31 #pragma once
32 #endif
33 
34 #ifdef __cplusplus
35 extern "C"
36 {
37 #endif
38 
39 #if PRAGMA_IMPORT
40 #pragma import on
41 #endif
42 
43 #if PRAGMA_STRUCT_ALIGN
44 #pragma options align = mac68k
45 #elif PRAGMA_STRUCT_PACKPUSH
46 #pragma pack(push, 2)
47 #elif PRAGMA_STRUCT_PACK
48 #pragma pack(2)
49 #endif
50 
51  typedef struct NMRec NMRec;
52  typedef NMRec *NMRecPtr;
53  typedef CALLBACK_API(void, NMProcPtr)(NMRecPtr nmReqPtr);
54  typedef STACK_UPP_TYPE(NMProcPtr) NMUPP;
55  struct NMRec
56  {
57  QElemPtr qLink;
58  short qType;
59  short nmFlags;
60  long nmPrivate;
61  short nmReserved;
62  short nmMark;
63  Handle nmIcon;
64  Handle nmSound;
66  NMUPP nmResp;
67  long nmRefCon;
68  };
69 
78  NMUPP
79  NewNMUPP(NMProcPtr userRoutine);
80 #if !OPAQUE_UPP_TYPES
81  enum
82  {
83  uppNMProcInfo = 0x000000C0
84  };
85 #ifdef __cplusplus
86  inline NMUPP NewNMUPP(NMProcPtr userRoutine)
87  {
88  return (NMUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppNMProcInfo,
89  GetCurrentArchitecture());
90  }
91 #else
92 #define NewNMUPP(userRoutine) \
93  (NMUPP) NewRoutineDescriptor((ProcPtr)(userRoutine), uppNMProcInfo, \
94  GetCurrentArchitecture())
95 #endif
96 #endif
97 
106  void
107  DisposeNMUPP(NMUPP userUPP);
108 #if !OPAQUE_UPP_TYPES
109 #ifdef __cplusplus
110  inline void DisposeNMUPP(NMUPP userUPP)
111  {
112  DisposeRoutineDescriptor((UniversalProcPtr)userUPP);
113  }
114 #else
115 #define DisposeNMUPP(userUPP) DisposeRoutineDescriptor(userUPP)
116 #endif
117 #endif
118 
127  void
128  InvokeNMUPP(NMRecPtr nmReqPtr, NMUPP userUPP);
129 #if !OPAQUE_UPP_TYPES
130 #ifdef __cplusplus
131  inline void InvokeNMUPP(NMRecPtr nmReqPtr, NMUPP userUPP)
132  {
133  CALL_ONE_PARAMETER_UPP(userUPP, uppNMProcInfo, nmReqPtr);
134  }
135 #else
136 #define InvokeNMUPP(nmReqPtr, userUPP) \
137  CALL_ONE_PARAMETER_UPP((userUPP), uppNMProcInfo, (nmReqPtr))
138 #endif
139 #endif
140 
141 #if CALL_NOT_IN_CARBON || OLDROUTINENAMES
143 #define NewNMProc(userRoutine) NewNMUPP(userRoutine)
144 #define CallNMProc(userRoutine, nmReqPtr) InvokeNMUPP(nmReqPtr, userRoutine)
145 #endif
188 #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
189 #pragma parameter __D0 NMInstall(__A0)
190 #endif
191  OSErr
192  NMInstall(NMRecPtr nmReqPtr);
193 
224 #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
225 #pragma parameter __D0 NMRemove(__A0)
226 #endif
227  OSErr
228  NMRemove(NMRecPtr nmReqPtr);
229 
230 #if PRAGMA_STRUCT_ALIGN
231 #pragma options align = reset
232 #elif PRAGMA_STRUCT_PACKPUSH
233 #pragma pack(pop)
234 #elif PRAGMA_STRUCT_PACK
235 #pragma pack()
236 #endif
237 
238 #ifdef PRAGMA_IMPORT_OFF
239 #pragma import off
240 #elif PRAGMA_IMPORT
241 #pragma import reset
242 #endif
243 
244 #ifdef __cplusplus
245 }
246 #endif
247 
248 #endif
249 */*/
Basic Macintosh data types.
unsigned char * StringPtr
Definition: MacTypes.h:477
void DisposeRoutineDescriptor(UniversalProcPtr theUPP)
#define STACK_UPP_TYPE(name)
Definition: MixedMode.h:734
UniversalProcPtr NewRoutineDescriptor(ProcPtr theProc, ProcInfoType theProcInfo, ISAType theISA)
#define NewNMUPP(userRoutine)
Definition: Notification.h:92
void DisposeNMUPP(NMUPP userUPP)
void InvokeNMUPP(NMRecPtr nmReqPtr, NMUPP userUPP)
OSErr NMInstall(NMRecPtr nmReqPtr)
Add a notification request to the notification queue.
OSErr NMRemove(NMRecPtr nmReqPtr)
Remove a notification request from the notification queue.
OS Utilities Interfaces.
Definition: Notification.h:56
short nmFlags
Definition: Notification.h:59
short nmReserved
Definition: Notification.h:61
Handle nmIcon
Definition: Notification.h:63
short nmMark
Definition: Notification.h:62
long nmRefCon
Definition: Notification.h:67
short qType
Definition: Notification.h:58
NMUPP nmResp
Definition: Notification.h:66
long nmPrivate
Definition: Notification.h:60
Handle nmSound
Definition: Notification.h:64
StringPtr nmStr
Definition: Notification.h:65
Definition: OSUtils.h:131