#ifndef POBJECT_H
#define POBJECT_H

/* ==========================================================================
**
**                               PObject.h
**
**      Defines the basic struct from which all Precognition objects
**      are defined.
**
**   ©1991 WILLISoft
**
** ==========================================================================
*/
#include <exec/types.h>

typedef void Class;


typedef struct PObject
   {
      Class *isa;        /* Points to the objects 'Class' structure. */
      char  *PObjectName; /* Used by interface builder. */
   } PObject;

/* All 'objects' are derrived from this structrure, i.e. they have
** an 'isa' pointer as their first member.  The 'isa' pointer points
** to the 'Class' structure for the object.
**
** NOTE: PObjects do NOT need to have an PObjectName associated with
** them.  This field is used by the Application builder to attach
** a variable name.
*/


/*
** All object methods must provide at least the following operations:
*/


void  CleanUp( 
#ifdef ANSI_HEADERS
                     PObject *self 
#endif
            );

/* Deallocates all but the base storage for an object.  e.g. given
** a structure like:
**
**    struct Abc
**       {
**          Class *isa;
**          char *FirstName, *LastName;
**       };
**
** which once initialized, has FirstName & LastName pointing to
** 2 40 char buffers, 'CleanUp( Abc )' would deallocate the strings
** 'FirstName' & 'LastName', but not Abc itself.
**
** ==========================================================
**       YOU SHOULD CALL CleanUp FOR EVERY OBJECT
** ==========================================================
*/

void PObject_Init( 
#ifdef ANSI_HEADERS
                     PObject *self 
#endif
                  );


const char *ClassName( 
#ifdef ANSI_HEADERS
                        const PObject *self 
#endif
                     );
   /*
   ** Returns the name of the class to which the object belonds.
   ** (Useful for debugging.)
   */


#ifdef BUILDER

/* 
** These are used by Interface Builder program only. 
*/

char *ObjectName( PObject *self );

void SetObjectName( PObject *self, char *name );


#endif

#endif
