home *** CD-ROM | disk | FTP | other *** search
/ Education Sampler 1992 [NeXTSTEP] / Education_1992_Sampler.iso / Programming / Source / PacMan / PreferencesBrain.h < prev    next >
Encoding:
Text File  |  1992-06-27  |  3.1 KB  |  80 lines

  1.  
  2. /* Generated by Interface Builder */
  3.  
  4. // This object is the central clearing house for the preferences.  It
  5. // handles I/O between the Preferences Panel controls and it stores stuff
  6. // in the defaults database.  It also tells the app when things change.
  7. // The app can also query it to find the state of various preferences.
  8.  
  9. #import <objc/Object.h>     /* superclass */
  10. #import <appkit/Matrix.h>     /* matrix controls' methods */
  11. #import <appkit/Control.h>     /* various controls' methods */
  12. #import <appkit/defaults.h>    /* preferences (defaults) */
  13. #import <appkit/Slider.h>
  14. #import <stdio.h>        /* strcpy */
  15. #import <stdlib.h>        /* malloc */
  16. #import "GameBrain.h"        /* where to send change alerts */
  17. #import "GameView.h"        /* for sound on/off */
  18.  
  19.  
  20. @interface PreferencesBrain:Object
  21. {    
  22.     // various controls on the Preferences... Panel
  23.     id    speedButtons;        // buttons to set game speed on pref panel
  24.     id    preferencesPanel;    // preferences panel instance
  25.     id    musicButtons;        // radio buttons for music on/off
  26.     id    effectButtons;        // radio buttons for sound effects on/off
  27.     id  demoSwitch;            // "Demo Sound" switch
  28.     id  alertSwitch;        // "Alerts" switch
  29.     id  autoUnPauseSwitch;    // "Auto Unpause" switch
  30.     id  autoStartSwitch;    // "New Game on Launch" switch
  31.  
  32.     id  gameScreen;            // GameView instance/subclass
  33.     id  gameBrain;            // GameBrain instance
  34.     
  35.     // instance variables to hold preferences and game status:
  36.     int speed;
  37.     BOOL music, effects, alert, demoSound, autoUnPause, autoStart;
  38.     char *defaultPlayerName, *version;    // used for internal purposes.
  39. }
  40.  
  41. - init;                    // designated initializer
  42.  
  43. // methods called by the app to access the various preferences
  44. - (BOOL)firstTimeCheck;    // first time running this version?
  45. - preferencesPanel;        // returns the id of the Preferences Panel
  46. - (int)speed;            // return game speed
  47. - (BOOL)music;            // return music status
  48. - (BOOL)effects;        // return effects status
  49. - setDefaultPlayerName:(char *)aString;    // change default player name
  50. - (const char *)defaultPlayerName;  // return ptr to defaultPlayerName string
  51. - revert:sender;        // return to default values
  52. - setAutoUnPause:(BOOL)al;
  53. - (BOOL)autoUnPause;
  54. - (BOOL)alert;
  55. - (BOOL)demoSound;
  56. - (BOOL)autoStart;
  57. - setAutoStart:(BOOL)al;
  58. - setAlert:(BOOL)al;
  59.  
  60.     
  61. // Interface Builder (IB) methods:
  62. //    (called by various controls on the Preferences Panel)
  63. - readDefaults:sender;        // read preferences from defaults database
  64. - writeDefaults:sender;        // write preferences to defaults database
  65. - speedChange:sender;        // target of speed pref. matrix
  66. - preferences:sender;        // called by Preferences... menu item
  67. - musicChange:sender;        // target of music on/off matrix on pref panel
  68. - effectsChange:sender;        // target of effect on/off matr. on pref panel
  69. - alertChange:sender;        // turn alert panels on/off
  70. - autoStartChange:sender;    // auto start game on launch on/off
  71. - demoSoundChange:sender;    // turn off sound only in demo
  72. - setBack:sender;            // set the background image
  73. - revertBack:sender;        // revert to default background image
  74. - back1:sender;                // call up background #1
  75. - back2:sender;                // call up background #1
  76. - back3:sender;                // call up background #1
  77. - unPauseChange:sender;        // turn off auto un-pausing
  78.  
  79. @end
  80.