home *** CD-ROM | disk | FTP | other *** search
/ Mac-Source 1994 July / Mac-Source_July_1994.iso / C and C++ / Libraries / Spin Cursor Lib / SpinCursor.h < prev    next >
Encoding:
Text File  |  1992-09-09  |  3.6 KB  |  109 lines  |  [TEXT/KAHL]

  1. //////////////////////////////////////////////////////////////////////////////
  2. //
  3. //    SpinCursor - VBLTask Cursor Spinning Library
  4. //    --------------------------------------------
  5. //
  6. //    Copyright © 1992 Daniel E. Rudman
  7. //
  8. //    This library is for use by any individual or company free of charge so
  9. //    long as this header file, library, and ResEdit template are unmodified.
  10. //    Sale of this libraryis strictly prohibited.  You may also distribute this 
  11. //    library, so long as you distribute the header file, library, and ResEdit
  12. //    template untouched and together.
  13. //
  14. //    Source code available from rudman@engin.umich.edu
  15. //
  16. //    Some portions are the expressed copyright of Apple Computer, Inc.
  17. //
  18. //    "Die, AnimCursor, Die"
  19. //
  20. /////////////////////////////////////////////////////////////////////////////
  21.  
  22.  
  23. #ifndef __SPINNER__
  24. #define __SPINNER__
  25.  
  26. #include <Retrace.h>
  27.  
  28. /* ------------------------------------- */
  29. /* Error codes returned by BeginSpinning */
  30. /* ------------------------------------- */
  31.  
  32. #define    cursNoErr                0
  33. #define    cursResNotFound            -50
  34. #define    cursMemReqFailed        -51
  35. #define    cursVBLNotAvail            -52
  36. #define    cursVBLReqFailed        -53
  37. #define    cursVBLTaskNotFound        -54
  38. #define    cursTaskNotInstalled    -55
  39. #define    cursFatalErr            -56
  40. #define    cursSpinCursResErr        -57
  41. #define    cursCouldNotRelease        -58
  42. #define    cursAlreadyInstalled    -59
  43.  
  44. /* ---------------------------- */
  45. /* Cursor Error Type Definition */
  46. /* ---------------------------- */
  47.  
  48. typedef short int        CursErr;
  49.  
  50. #endif
  51.  
  52. /* ------------------- */
  53. /* Function Prototypes */
  54. /* ------------------- */
  55.  
  56. /* BeginSpinning */
  57. /* ------------- */
  58. /*
  59.     When you are ready to spin your cursor, call BeginSpinning().
  60.     You should have a 'CURS' resource regardless of whether or not
  61.     you want to use color cursors ('crsr' resources), because if
  62.     the end user does not have Color QuickDraw, this library will
  63.     default to a 'CURS' of the same ID.
  64.     
  65.     Remember, specifying TRUE for the "color" field does not guarantee
  66.     you will get a color cursor, only that you have requested one if
  67.     it is available and can be displayed.
  68.     
  69.     You should check the error code returned by BeginSpinning(), although
  70.     it is not a fatal problem if you do not.
  71. */
  72.  
  73. CursErr    BeginSpinning    (    Boolean        color,            /* TRUE = 'crsr', FALSE = 'CURS' */
  74.                             short int    initResID,        /* starting resource ID of cursors */
  75.                             short int    numCursors,        /* number of frames past initResID */
  76.                             short int    initDelay,        /* initial delay before showing cursor */
  77.                             short int    frequency);        /* interrupt delay between frames */
  78.  
  79. /* BeginResSpinning */
  80. /* ---------------- */
  81. /*
  82.     Call BeginResSpinning() when you have created a 'SPIN' resource.
  83.     The library will load in the resource and obtain all of the
  84.     necessary information, and then will pass it on to BeginSpinning().
  85.     This is a more Apple-like way of doing things, since it allows
  86.     quick changes to be made in an application without recompiling it.
  87. */
  88.  
  89. CursErr    BeginResSpinning (short int resID);
  90.  
  91.  
  92.  
  93. /* StopSpinning */
  94. /* ------------ */
  95. /*
  96.     When you are done with the task in question, call StopSpinning(). It is
  97.     okay if your call to BeginSpinning() failed; StopSpinning() will simply
  98.     return an error stating that it failed, but nothing horrible will happen
  99.     otherwise.
  100.     
  101.     StopSpinning() releases all the cursor resources and memory it received
  102.     during the call to BeginSpinning(). You should check the error code
  103.     returned by StopSpinning().  If the error is fatal, you should probably
  104.     halt execution of the program; it is indicative that a cursor resource
  105.     which was LOCKED and UNPURGEABLE somehow was removed from memory -- this
  106.     is QUITE undesirable.
  107. */
  108.  
  109. CursErr    StopSpinning    (    void);