home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1994 June: Reference Library / Dev.CD Jun 94.toast / Periodicals / develop / develop Issue 18 / develop 18 code / OSA Sample / Sources / ScriptUtils.h < prev    next >
Encoding:
C/C++ Source or Header  |  1994-01-28  |  2.0 KB  |  82 lines  |  [TEXT/MPS ]

  1. /*
  2.     File:        ScriptUtils.h
  3.  
  4.     Contains:    Script handling & OSA interface
  5.  
  6.     Utilities derived from various DTS example source code.
  7.  
  8. */
  9.  
  10.  
  11. #ifndef __SCRIPTUTILS__
  12. #define __SCRIPTUTILS__
  13.  
  14.  
  15. #ifndef __APPLEEVENTS__
  16. #include "AppleEvents.h"
  17. #endif
  18.  
  19. #ifndef __PASCALSTRING__
  20. #include <PascalString.h>
  21. #endif
  22.  
  23. #ifndef __AERegistry__
  24. #include <AERegistry.h>
  25. #endif
  26.  
  27. #ifndef __OSA__
  28. #include <OSA.h>
  29. #endif
  30.  
  31.  
  32. #define    kEndOfList            NULL        // Nil terminator for variable argument list.
  33.  
  34. /**-----------------------------------------------------------------------
  35.     Utility Routines for getting data from AEDesc's
  36.   -----------------------------------------------------------------------**/
  37.     
  38. pascal void GetRawDataFromDescriptor(const AEDesc *theDesc,
  39.                                      Ptr     destPtr,
  40.                                      Size    destMaxSize,
  41.                                      Size    *actSize);
  42.                                                                          
  43. pascal OSErr GetDescTypeFromDescriptor(const AEDesc *sourceDesc, DescType *result);
  44.                                                                          
  45. pascal OSErr GetPStringFromDescriptor(const AEDesc *sourceDesc, char *resultStr);
  46.  
  47. pascal OSErr GetIntegerFromDescriptor(const AEDesc *sourceDesc, short *result);
  48.     
  49. pascal OSErr GetBooleanFromDescriptor(const AEDesc *sourceDesc, Boolean *result);
  50.                                                                             
  51. pascal OSErr GetLongIntFromDescriptor(const AEDesc *sourceDesc, long *result);
  52.  
  53. pascal OSErr GetRectFromDescriptor(const AEDesc *sourceDesc, Rect *result);
  54.  
  55. pascal OSErr GetPointFromDescriptor(const AEDesc *sourceDesc, Point *result);
  56.  
  57. pascal OSErr GetCStringFromDescriptor(const AEDesc *sourceDesc, CStr255 *resultStr);
  58.  
  59.  
  60. OSErr    MakeNullDesc(AEDesc *dataDesc);
  61.  
  62. OSErr    MakeNameDesc(CStr255& theString, AEDesc *dataDesc);
  63.  
  64. OSErr    MakeLongIntDesc(long theIndex, AEDesc *dataDesc);
  65.  
  66.  
  67.  
  68. pascal WindowPtr WindowNameToWindowPtr(StringPtr nameStr);
  69.  
  70. pascal WindowPtr GetWindowPtrOfNthWindow(short index);
  71.  
  72. pascal short CountWindows(void);
  73.  
  74.  
  75. pascal OSErr FindApplicationOnVolume(OSType whatSig, short theVol, FSSpec *foundSpec);
  76.  
  77. void InitAEDescs(AEDesc*  desc1, ... );            // Null terminated argument list.
  78. void DisposeAEDescs(AEDesc*  desc1, ... );    // Null terminated argument list.
  79.  
  80.  
  81. #endif
  82.