home *** CD-ROM | disk | FTP | other *** search
/ Otherware / Otherware_1_SB_Development.iso / mac / developm / source / drgnsmth.cpt / Dragonsmith 1.1 / Base files / Classes / AppleEventQueue.h < prev    next >
Encoding:
C/C++ Source or Header  |  1992-09-19  |  877 b   |  34 lines

  1. /*
  2.     AppleEventQueue.h
  3. */
  4.  
  5. #pragma once
  6.  
  7. // Format for an Apple event handler function
  8. typedef pascal OSErr (*AEHandlerFunc) (AppleEvent*, AppleEvent*, long);
  9.  
  10. typedef struct PendingAERec {
  11.     AppleEvent            event;
  12.     AppleEvent            reply;
  13.     long                    refcon;
  14.     AEHandlerFunc        handler;
  15.     struct PendingAERec    **next;
  16. };
  17.  
  18. typedef struct PendingAERec PendingAERec;
  19.  
  20. class AppleEventQueue : indirect {
  21.  
  22.     protected:
  23.         PendingAERec    **head;            // Handle to a record for the first pending Apple event
  24.         PendingAERec    **tail;            // Handle to a record for the last pending Apple event
  25.         short            numAEvents;        // Number of pending Apple events
  26.         
  27.     public:
  28.                         AppleEventQueue (void);        // Constructor
  29.         virtual OSErr        Put (AppleEvent *event, AppleEvent *reply, AEHandlerFunc handler, long refcon);
  30.         virtual OSErr        Get (AppleEvent *event, AppleEvent *reply, AEHandlerFunc *handler, long *refcon);
  31.         
  32. };
  33.  
  34.