home *** CD-ROM | disk | FTP | other *** search
Text File | 1992-09-09 | 3.6 KB | 109 lines | [TEXT/KAHL] |
- //////////////////////////////////////////////////////////////////////////////
- //
- // SpinCursor - VBLTask Cursor Spinning Library
- // --------------------------------------------
- //
- // Copyright © 1992 Daniel E. Rudman
- //
- // This library is for use by any individual or company free of charge so
- // long as this header file, library, and ResEdit template are unmodified.
- // Sale of this libraryis strictly prohibited. You may also distribute this
- // library, so long as you distribute the header file, library, and ResEdit
- // template untouched and together.
- //
- // Source code available from rudman@engin.umich.edu
- //
- // Some portions are the expressed copyright of Apple Computer, Inc.
- //
- // "Die, AnimCursor, Die"
- //
- /////////////////////////////////////////////////////////////////////////////
-
-
- #ifndef __SPINNER__
- #define __SPINNER__
-
- #include <Retrace.h>
-
- /* ------------------------------------- */
- /* Error codes returned by BeginSpinning */
- /* ------------------------------------- */
-
- #define cursNoErr 0
- #define cursResNotFound -50
- #define cursMemReqFailed -51
- #define cursVBLNotAvail -52
- #define cursVBLReqFailed -53
- #define cursVBLTaskNotFound -54
- #define cursTaskNotInstalled -55
- #define cursFatalErr -56
- #define cursSpinCursResErr -57
- #define cursCouldNotRelease -58
- #define cursAlreadyInstalled -59
-
- /* ---------------------------- */
- /* Cursor Error Type Definition */
- /* ---------------------------- */
-
- typedef short int CursErr;
-
- #endif
-
- /* ------------------- */
- /* Function Prototypes */
- /* ------------------- */
-
- /* BeginSpinning */
- /* ------------- */
- /*
- When you are ready to spin your cursor, call BeginSpinning().
- You should have a 'CURS' resource regardless of whether or not
- you want to use color cursors ('crsr' resources), because if
- the end user does not have Color QuickDraw, this library will
- default to a 'CURS' of the same ID.
-
- Remember, specifying TRUE for the "color" field does not guarantee
- you will get a color cursor, only that you have requested one if
- it is available and can be displayed.
-
- You should check the error code returned by BeginSpinning(), although
- it is not a fatal problem if you do not.
- */
-
- CursErr BeginSpinning ( Boolean color, /* TRUE = 'crsr', FALSE = 'CURS' */
- short int initResID, /* starting resource ID of cursors */
- short int numCursors, /* number of frames past initResID */
- short int initDelay, /* initial delay before showing cursor */
- short int frequency); /* interrupt delay between frames */
-
- /* BeginResSpinning */
- /* ---------------- */
- /*
- Call BeginResSpinning() when you have created a 'SPIN' resource.
- The library will load in the resource and obtain all of the
- necessary information, and then will pass it on to BeginSpinning().
- This is a more Apple-like way of doing things, since it allows
- quick changes to be made in an application without recompiling it.
- */
-
- CursErr BeginResSpinning (short int resID);
-
-
-
- /* StopSpinning */
- /* ------------ */
- /*
- When you are done with the task in question, call StopSpinning(). It is
- okay if your call to BeginSpinning() failed; StopSpinning() will simply
- return an error stating that it failed, but nothing horrible will happen
- otherwise.
-
- StopSpinning() releases all the cursor resources and memory it received
- during the call to BeginSpinning(). You should check the error code
- returned by StopSpinning(). If the error is fatal, you should probably
- halt execution of the program; it is indicative that a cursor resource
- which was LOCKED and UNPURGEABLE somehow was removed from memory -- this
- is QUITE undesirable.
- */
-
- CursErr StopSpinning ( void);