home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 2 / Apprentice-Release2.iso / Source Code / C / System / Control Panel Project 0.9.5 / SharedData.h < prev    next >
Encoding:
C/C++ Source or Header  |  1994-10-06  |  1.9 KB  |  58 lines  |  [TEXT/KAHL]

  1. /*
  2.     SharedData.h
  3.     
  4.     Data structure shared by the extension and the patch code.
  5. */
  6.  
  7. /* This is a struct that the shared data holds a handle to */
  8.  
  9. typedef struct {
  10.     Boolean        On;            /* Is the extension "on" or "off"? */
  11.     Boolean        ShowIcon;    /* Show icon at startup? */
  12. } CPprefsStruct, *CPprefsPtr, **CPprefsHandle;
  13.  
  14. /* This is the actual shared data structure */
  15.  
  16. typedef struct {
  17.  
  18.     Boolean        inUse;            /* This should be set to true when a piece of code */
  19.                                 /* is using the data structure, then back to false */
  20.                                 /* when it's through.  Each piece of code that     */
  21.                                 /* accesses the structure should wait until the    */
  22.                                 /* flag is false before using the data structure.  */
  23.  
  24.     /* Variables used by the Trap Patch */
  25.     
  26.     UniversalProcPtr    oldTrap;/* addr of old trap routine (before our patch) */
  27.     long        paramBytes;        /* how many bytes taken up by parameters */
  28.     long        returnBytes;    /* how many bytes taken by return value (can be 0) */
  29.     
  30.     /* Variables used by the Extension and Control Panel */
  31.     
  32.     long        checkValue;        /* set by extension, then checked by cdev to make */
  33.                                 /* sure extension loaded at startup time. */
  34.     Boolean        patched;        /* was the patch installed? */
  35.     
  36.     /* Variables used by the Control Panel */
  37.     
  38.     DialogPtr    CPdialogPtr;    /* a pointer to the control panel dialog */
  39.     short        CPitems;        /* number of items in the dialog */
  40.     CPprefsHandle    CPprefsRsrc;    /* handle to a prefs struct (saved as a resource) */
  41.     Boolean        CPon;            /* is the control panel function on or off? */
  42.     
  43.     /* Memory used for notifications */
  44.     
  45.     NMRec            nm;                /* a pointer to a Notification Manager record */
  46.     Str255            str;            /* a Pascal string */
  47.     
  48.     /* Whatever other variables we need to share */
  49.     
  50.         
  51. } myDataStruct, *myDataPtr, **myDataHandle;
  52.  
  53. /* This is the value the extension puts into the checkValue field of the shared
  54.  * data structure and that the control panel checks for when it is opened.
  55.  */
  56.  
  57. #define kCheckValue 0x12341234
  58.