home *** CD-ROM | disk | FTP | other *** search
/ MacFormat 1994 November / macformat-018.iso / Utility Spectacular / Developer / PTR-TCL v2.1 / Support / New TCL Source / CObject.h < prev    next >
Encoding:
C/C++ Source or Header  |  1994-02-17  |  824 b   |  45 lines  |  [TEXT/MMCC]

  1. /*
  2.  * CObject.h
  3.  * ©1994 Jon Wätte
  4.  */
  5.  
  6. #pragma once
  7.  
  8. #ifndef __COBJECT__
  9. # define __COBJECT__
  10.  
  11. #include <Types.h>
  12. #include <Memory.h>
  13. #include <Global.h>
  14. #include <stddef.h>
  15. #include "Exceptions.h"
  16. #include "oops.h"
  17. #include <TCLUtilities.h>
  18.  
  19.  
  20. #define Length(x) (((unsigned char *)(x))[0]) // for lack of a better place to put it
  21. #define topLeft(x) (*(Point*)&((x).top))
  22. #define botRight(x) (*(Point*)&((x).bottom))
  23.  
  24. extern CObject * new_CObject ( ) ;
  25.  
  26. class CObject {
  27.  
  28. public:                                        
  29.  
  30.     char *                    _clsName ;
  31.  
  32.                             CObject ( ) ;
  33.     void *                    operator new ( size_t objSize ) ;
  34.  
  35.     virtual CObject *        Copy ( void ) ;
  36.     virtual void            Dispose ( void ) ;
  37.  
  38. static void                    SubclassResponsibility ( void ) ;
  39.     virtual Boolean            Lock ( Boolean fLock ) ; // always locked
  40.     virtual Boolean            MemberOf ( char * name ) ;
  41.  
  42. } ;
  43.  
  44. #endif
  45.