home *** CD-ROM | disk | FTP | other *** search
/ BBS in a Box 3 / BBS in a box - Trilogy III.iso / Files / Prog / T / The Journal / cdev / Journal cdev.h < prev   
Encoding:
C/C++ Source or Header  |  1991-03-16  |  2.0 KB  |  91 lines  |  [TEXT/KAHL]

  1. /*
  2.     FILE: Journal cdev.h
  3.     
  4.     Include file for the Journal cdev.
  5.     
  6.     This has the class definition and constants used by
  7.     the journal cdev.
  8.     
  9. */
  10.  
  11. #include <cdev.h>
  12. #include <Global.h>
  13.  
  14. /* state informaiont resource */
  15.  
  16. #define STATE_RES_TYPE    'JrnS'
  17. #define STATE_RES_ID    1000
  18.  
  19. typedef struct JournalState {
  20.     int        eventFlags ;        /* For bitmasks see journalDriverInclude.h */
  21.     int     recording ;
  22.     int        hasFile ;
  23.     int        driverRefNum ;
  24.     short    vRefNum ;
  25.     long    dirID ;
  26.     OSType    creator ;
  27.     Str63    fName ;
  28. } JrnlState, *P_JrnlState ;
  29.  
  30.  
  31.  
  32. /*  cdev subclass  */
  33.  
  34. struct Journal : cdev {
  35.  
  36.         /*  instance variables  */
  37.         
  38.     Handle        journalState ;        /* Handle to JrnlState structure */
  39.     
  40.         /*  overridden methods  */
  41.  
  42.     void            Init(void);
  43.     void            Close(void);
  44.     void            ItemHit(int theItem);
  45.     
  46.     void            DoFileButton(void) ;
  47.     void            DoStartStopButton(void) ;
  48.     void            SetButtonState(Boolean activate) ;
  49.     void            DoSetFileCreator(void) ;
  50.     
  51.     void            DoDriverStuff(Boolean isStart) ;
  52.     
  53.     void            DoHiliteControl(int theItem, Boolean theHilite) ;
  54.     void            DoSetControl(int theItem, int theValue) ;
  55. };
  56.  
  57. /* useful definitions */
  58.  
  59.  
  60. #define CHECK_ON            1
  61. #define CHECK_OFF            0
  62.  
  63. #define CONTROL_ACTIVE        0
  64. #define CONTROL_INACTIVE    255
  65.  
  66. /*  dialog item numbers  */
  67.  
  68. #define    FILE_BUTTON            1
  69. #define TIME_STAMP_CHECK    2
  70. #define START_STOP_BUTTON    3
  71. #define INSTALLED_STRING    4
  72. #define FILE_CREATOR_BUTTON    5
  73. #define FILE_CREATOR_STRING    6
  74.  
  75. #define    START_STRING        "\pStart"
  76. #define STOP_STRING            "\pStop"
  77. #define FILE_PROMPT            "\pSave journaling information in file:"
  78. #define DEFAULT_FILE_NAME    "\pJournal File"
  79. #define DEFAULT_FILE_CREATOR 'MSWD'
  80. #define CREATOR_PROMPT        "\pSelect the application to use for the journal file type:"
  81.  
  82.  
  83. /* stuff to synchronize between the INIT and the cdev
  84.     The flag is set to 1 if the driver is installed, 0 otherwise.
  85.     The cdev checks the value of the flag to see if it can access
  86.     the driver
  87. */
  88.  
  89. #define JRNL_DRIVER_FLAG_TYPE    'JrnF'    /* resource type of flag */
  90. #define    JRNL_DRIVER_FLAG_ID        1000    /* resource ID of flag */
  91.