home *** CD-ROM | disk | FTP | other *** search
/ MacFormat 1995 January / macformat-020.iso / Shareware City / Developers / apps.to.go / DTS.Lib / DTS.Lib.headers / AEUtils.h < prev    next >
Encoding:
C/C++ Source or Header  |  1994-06-11  |  3.8 KB  |  113 lines  |  [TEXT/MPS ]

  1. #ifndef __AEUTILS__
  2. #define __AEUTILS__
  3.  
  4. #ifndef __TYPES__
  5. #include <Types.h>
  6. #endif
  7.  
  8. #ifndef __APPLEEVENTS__
  9. #include <AppleEvents.h>
  10. #endif
  11.  
  12. #ifndef __EVENTS__
  13. #include <Events.h>
  14. #endif
  15.  
  16. #ifndef __WINDOWS__
  17. #include <Windows.h>
  18. #endif
  19.  
  20.  
  21.  
  22. void    DoHighLevelEvent(EventRecord *event);
  23.     /*
  24.     **    ¶ Simply calls AEProcessAppleEvent and reports any errors.
  25.     **
  26.     **    INPUT:    event
  27.     **
  28.     **    AEProcessAppleEvent looks in its table of registered events and sees if the current event
  29.     **    is registered.  If so, off we go. */
  30.  
  31.  
  32.  
  33. OSErr    GetTargetInfo(AEAddressDesc targetDesc, StringPtr zone, StringPtr machine,
  34.                               StringPtr application);
  35.     /*
  36.     **    ¶ Return zone, machine, and application name for targetDesc.
  37.     **
  38.     **    INPUT:    targetDesc        A properly constructed target descriptor.
  39.     **    OUTPUT:    zone            The zone name extracted from targetDesc.
  40.     **            machine            The machine name extracted from targetDesc
  41.     **            application        The application name extracted from targetDesc
  42.     **    RESULT:    OSErr
  43.     **
  44.     **    Given a target descriptor, return fascinating information about the target. */
  45.  
  46.  
  47.  
  48. OSErr    MakeTarget(AEAddressDesc *target, Boolean sendDirect, short replyMode, Str255 prompt,
  49.                            Str255 applListLabel, PPCFilterUPP portFilter, char *theLocNBPType);
  50.     /*
  51.     **    ¶ PPCBrowser interface to build a target descriptor.
  52.     **
  53.     **    INPUT:    sendDirect        Pass in true if we are sending the AppleEvent to
  54.     **                            ourselves (this application).  Note that passing in false
  55.     **                            doesn't exclude the possibility of sending to ourself.
  56.     **            replyMode        kAEWaitReply, kAEQueueReply, or kAENoReply
  57.     **            prompt            PPCBrowser dialog box prompt
  58.     **            applListLabel    The PPCBrowser title over the 'programs' list
  59.     **            portFilter        Procedure pointer for PPCBrowser filter (or nil)
  60.     **            theLocNBPType    List ports only of this type
  61.     **    OUTPUT:    target            AEAddressDesc of target returned here
  62.     **    RESULT:    OSErr            If err returned, then target not created.  Note that
  63.     **                            the dataHandle field of target is initialized to nil
  64.     **                            so that you can always call AEDisposeDesc, independent
  65.     **                            of whether or not an error was returned.
  66.     **
  67.     **    Creates a Target descriptor.
  68.     **
  69.     **    If sendDirect is TRUE, the target is specified by setting a ProcessSerialNumber to
  70.     **    kCurrentProcess.  This has the advantage of sending the message directly to ourselves,
  71.     **    bypassing ePPC and gaining about a 10-15x speed improvement.  If sendDirect is FALSE,
  72.     **    we see if we have the PPCToolBox.  If not, then we are forced to do a direct send.
  73.     **    If we do have the PPCToolbox, then we call PPCBrowser.  We then look at the reply, and
  74.     **    factor in the mode we are going to use in AESend.  If that mode is kAEWaitReply and the
  75.     **    user selected us as the target, we have to turn that into a direct send.  This is because
  76.     **    the AppleEvent Manager will otherwise post the event as a high-level event.  However, we
  77.     **    are busy waiting for a reply, not looking for events, so we'll hang.  We avoid this by
  78.     **    forcing a direct send. */
  79.  
  80.  
  81.  
  82. Boolean    MissedAnyParameters(AppleEvent *message);
  83.     /*
  84.     **    ¶ Returns true if not a AE parms were used.
  85.     **
  86.     **    INPUT:    message        AppleEvent to check for unused parameters
  87.     **    OUTPUT:    Boolean        Returns true if at least one paramater missed
  88.     **
  89.     **    You may need to know if all parameters were used.  To determine this, just call this.
  90.     **    If true is returned, then something wasn’t looked at. */
  91.  
  92.  
  93.  
  94. void    NotifyCancel(void);
  95.     /*
  96.     **    ¶ Cancels a notification generated by NotifyUser.
  97.     **
  98.     **    This is a simplistic call for Notification Manager support.  Just call NotifyCancel to
  99.     **    cancel the notification posted by NotifyUser. */
  100.  
  101.  
  102.  
  103. void    NotifyUser(void);
  104.     /*
  105.     **    ¶ Creates a default notification.  Call NotifyCancel to undo.
  106.     **
  107.     **    This a simplistic call for Notification Manager support.  Just call NotifyUser if a
  108.     **    notification is needed.  Just call NotifyCancel to cancel the notification posted
  109.     **    by NotifyUser. */
  110.  
  111.  
  112. #endif
  113.