home *** CD-ROM | disk | FTP | other *** search
/ MacFormat 1995 March / macformat-022.iso / Shareware City / Developers / NeoIntroTCL3.0 folder / TCL / NeoDemo / Includes / CNDCamera.h < prev    next >
Encoding:
C/C++ Source or Header  |  1994-08-29  |  1.8 KB  |  65 lines  |  [TEXT/KAHL]

  1. /****
  2.  * CNDCamera.h
  3.  *
  4.  *    Persistent camera class.
  5.  *
  6.  *  Copyright © 1992 NeoLogic Systems.  All rights reserved.
  7.  *
  8.  ****/
  9.  
  10. #pragma once                        /* Include this file only once */
  11.  
  12. #include CNeoPersistNativeH
  13.  
  14. class CNDCamera;
  15.  
  16. enum {
  17.     typeNeoCamera            = 'Ncmr'
  18. };
  19.  
  20. #define cCamera                'cmra'
  21. #define kNDCameraID            20
  22. #define kShutterMax          10        /* max number of shutter speeds a camera object can have */
  23. #define kMaxCameras            10
  24.  
  25. class CNDCamera : public CNeoPersistNative {
  26. public:
  27.                         /** Instance Methods **/
  28.                         CNDCamera(const CNeoString &aName, const short aShutterCnt, const short *aSpeeds);
  29.     static CNeoPersist *New(void);
  30.     virtual NeoID        getClassID(void) const;
  31.     virtual long        getLength(void) const;
  32.     virtual long        getFileLength(void) const;
  33.  
  34.                         /** I/O Methods **/
  35.     virtual void        readObject(CNeoStream *aStream, const NeoTag aTag);
  36.     virtual void        writeObject(CNeoStream *aStream, const NeoTag aTag);
  37.  
  38.                         /** Search Methods **/
  39.     static CNDCamera *    FindByName(CNeoDatabase *aDataBase, const CNeoString &aName);
  40.  
  41.                         /** Camera Methods **/
  42.     short                addShutterSpeed(const short aSpeed);
  43.     static void            ClearCameraTable(void);
  44.     void                deleteShutterSpeed(const short aIndex);
  45.     static NeoID        GetCameraID(const short aIndex);
  46.     void                getName(CNeoString &aName);
  47.     short                getShutterCount(void);
  48.     short                getShutter(const short aIndex);
  49.     static void *        MakeCameraMenu(CNeoNode *aNode, const short aIndex, const NeoLockType aLock, void *aParam);
  50.     void                setName(const CNeoString &aName);
  51.  
  52.     static short        FCameraCnt;
  53.     static NeoID        FCamMenu2IDTable[kMaxCameras];
  54.  
  55. protected:
  56.                         /** Instance Variables **/
  57.     short                fShutterCount;                /* number of actual shutter speeds that camera has */
  58.     short                fShutters[kShutterMax];        /* holds shutter speeds of this camera */
  59.     CNeoString            fName;
  60. };
  61.  
  62. #define pCameraShutters        'CMsh'
  63. #define pShutterCount        'CMsc'
  64.  
  65.