|
Mac OS 9
|
Notification Manager interfaces. More...
Go to the source code of this file.
Data Structures | |
| struct | NMRec |
Macros | |
| #define | NewNMUPP(userRoutine) |
| #define | DisposeNMUPP(userUPP) DisposeRoutineDescriptor(userUPP) |
| #define | InvokeNMUPP(nmReqPtr, userUPP) CALL_ONE_PARAMETER_UPP((userUPP), uppNMProcInfo, (nmReqPtr)) |
| #define | NewNMProc(userRoutine) NewNMUPP(userRoutine) |
| #define | CallNMProc(userRoutine, nmReqPtr) InvokeNMUPP(nmReqPtr, userRoutine) |
Typedefs | |
| typedef struct NMRec | NMRec |
| typedef NMRec * | NMRecPtr |
Enumerations | |
| enum | { uppNMProcInfo = 0x000000C0 } |
Functions | |
| typedef | CALLBACK_API (void, NMProcPtr)(NMRecPtr nmReqPtr) |
| typedef | STACK_UPP_TYPE (NMProcPtr) NMUPP |
| NMUPP | NewNMUPP (NMProcPtr userRoutine) |
| void | DisposeNMUPP (NMUPP userUPP) |
| void | InvokeNMUPP (NMRecPtr nmReqPtr, NMUPP userUPP) |
| OSErr | NMInstall (NMRecPtr nmReqPtr) |
| Add a notification request to the notification queue. More... | |
| OSErr | NMRemove (NMRecPtr nmReqPtr) |
| Remove a notification request from the notification queue. More... | |
Notification Manager interfaces.
For bug reports, consult the following page on the World Wide Web:
http://developer.apple.com/bugreporter/
| #define NewNMProc | ( | userRoutine | ) | NewNMUPP(userRoutine) |
support for pre-Carbon UPP routines: New...Proc and Call...Proc
| #define NewNMUPP | ( | userRoutine | ) |
pascal no_return_value Func(4_bytes)
| void DisposeNMUPP | ( | NMUPP | userUPP | ) |
| void InvokeNMUPP | ( | NMRecPtr | nmReqPtr, |
| NMUPP | userUPP | ||
| ) |
| NMUPP NewNMUPP | ( | NMProcPtr | userRoutine | ) |
| OSErr NMInstall | ( | NMRecPtr | nmReqPtr | ) |
Add a notification request to the notification queue.
CALL_NOT_IN_CARBON
NMInstall adds a notification request to the notification queue. nmReqPtr is a pointer to an NMRec data structure.
an error code. It will be one of: noErr(0) No error nmTypErr (-299)Wrong qType (must be 8)
NMInstall neither moves nor purges memory and you can call it from
completion routines, interrupt handlers, the main body of an application
program and from the response procedure of a notification request
The system automatically initializes the Notification Manager when it
boots. You call NMInstall when you want to add a request to the queue.
However, before calling NMInstall , you need to see if your application is
running in the background. If it is, make this call to install the notification
event.
err = NMInstall (( NMRecPtr ) &myNote);
If your application is in the foreground, Notification Manager generally
isn't needed.
If NMInstall returns an error, you can't install the notification event.
Wait for the user to switch your application to the foreground before
proceeding with anything else. If you installed the notification successfully,
make sure you remove it with code like this when your application is
switched back into the foreground:
err = NMRemove (( QElemPtr ) &myNote);
Glue for the Notification Manager is available in System 6.0 and later.
If you do not yet have glue for NMInstall , you can use the following:
Pascal
FUNCTION NMInstall (nmReqPtr: QElemPtr) : OSErr;
NLINE 0x205F, 0xA05E, 0x3E80;
C
pascal OSErr NMInstall (QElemPtr nmReqPtr) = {0x205F, 0xA05E,
0x3E80};
| OSErr NMRemove | ( | NMRecPtr | nmReqPtr | ) |
Remove a notification request from the notification queue.
NMRemove removes a notification request procedure from the notification queue. nmReqPtr is a pointer to the NMRec that you want to remove.
an error code. It will be one of: noErr(0) No error qErr (-1) Not in queue nmTypErr (-299)Wrong qType (must be ORD(nmType))
NMRemove neither moves nor purges memory and you can call it from
completion routines, interrupt handlers, the main body of an application
program and from the response procedure of a notification request
If you do not yet have glue for NMRemove , you can use the following:
Pascal
FUNCTION NMRemove (nmReqPtr: QElemPtr) : OSErr;
INLINE 0x205F, 0xA05F, 0x3E80;
C
pascal OSErr NMRemove (QElemPtr nmReqPtr)
= {0x205F, 0xA05F, 0x3E80};
Also note that qType must be set to ORD(nmType), which is 8.
See NMInstall for a code example using the Notification Manager .