home *** CD-ROM | disk | FTP | other *** search
/ BCI NET 2 / BCI NET 2.iso / archives / programming / gui / precog2_1.lha / Precognition2_1 / include / PObject.h < prev    next >
Encoding:
C/C++ Source or Header  |  1994-12-15  |  2.1 KB  |  84 lines

  1. #ifndef POBJECT_H
  2. #define POBJECT_H
  3.  
  4. /* ==========================================================================
  5. **
  6. **                               PObject.h
  7. **
  8. **      Defines the basic struct from which all Precognition objects
  9. **      are defined.
  10. **
  11. **   ©1991 WILLISoft
  12. **
  13. ** ==========================================================================
  14. */
  15. #include <exec/types.h>
  16.  
  17. #include "parms.h"
  18.  
  19. typedef void PClass;
  20.  
  21.  
  22. typedef struct PObject
  23.    {
  24.       const PClass *isa;        /* Points to the objects 'PClass' structure. */
  25.       char  *PObjectName;       /* Used by interface builder. */
  26.    } PObject;
  27.  
  28. /* All 'objects' are derrived from this structrure, i.e. they have
  29. ** an 'isa' pointer as their first member.  The 'isa' pointer points
  30. ** to the 'PClass' structure for the object.
  31. **
  32. ** NOTE: PObjects do NOT need to have an PObjectName associated with
  33. ** them.  This field is used by the Application builder to attach
  34. ** a variable name.
  35. */
  36.  
  37.  
  38. /*
  39. ** All object methods must provide at least the following operations:
  40. */
  41.  
  42.  
  43. void  CleanUp __PARMS(( PObject *self ));
  44.  
  45. /* Deallocates all but the base storage for an object.  e.g. given
  46. ** a structure like:
  47. **
  48. **    struct Abc
  49. **       {
  50. **          PClass *isa;
  51. **          char *FirstName, *LastName;
  52. **       };
  53. **
  54. ** which once initialized, has FirstName & LastName pointing to
  55. ** 2 40 char buffers, 'CleanUp( Abc )' would deallocate the strings
  56. ** 'FirstName' & 'LastName', but not Abc itself.
  57. **
  58. ** ==========================================================
  59. **       YOU SHOULD CALL CleanUp FOR EVERY OBJECT
  60. ** ==========================================================
  61. */
  62.  
  63. void PObject_Init __PARMS((
  64.                      PObject *self
  65.                   ));
  66.  
  67.  
  68. char *ClassName __PARMS((
  69.                         PObject *self
  70.                      ));
  71.    /*
  72.    ** Returns the name of the class to which the object belongs.
  73.    ** (Useful for debugging.)
  74.    */
  75.  
  76. /* Additions for missing Builder prototypes -- EDB */
  77.  
  78. void SetObjectName __PARMS(( PObject *self, char *name ));
  79.  
  80. BOOL isa __PARMS(( PObject *self,
  81.           const PClass *class ));
  82.  
  83. #endif
  84.