 
#ifndef apt_DEFINED
#define apt_DEFINED 1
 
#ifndef class_DEFINED
#include <class.h>
#endif /* class_DEFINED */
/* 
 * This file was generated by the Andrew class system preprocessor.
 * Don't make changes to this file as it is created from apt.ch and will be
 * overwritten.  Make changes to apt.ch instead.
 */ 
 
#ifndef class_StaticInfoOnly
/* 
 * The following information was copied, as-is, from apt.ch.
 */ 
 
/* ********************************************************************** *\
 *         Copyright IBM Corporation 1988,1991 - All Rights Reserved      *
 *        For full copyright information see:'andrew/config/COPYRITE'     *
\* ********************************************************************** */

/*
	$Disclaimer: 
*Permission to use, copy, modify, and distribute this software and its 
*documentation for any purpose is hereby granted without fee, 
*provided that the above copyright notice appear in all copies and that 
*both that copyright notice, this permission notice, and the following 
*disclaimer appear in supporting documentation, and that the names of 
*IBM, Carnegie Mellon University, and other copyright holders, not be 
*used in advertising or publicity pertaining to distribution of the software 
*without specific, written prior permission.
*
*IBM, CARNEGIE MELLON UNIVERSITY, AND THE OTHER COPYRIGHT HOLDERS 
*DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING 
*ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS.  IN NO EVENT 
*SHALL IBM, CARNEGIE MELLON UNIVERSITY, OR ANY OTHER COPYRIGHT HOLDER 
*BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY 
*DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, 
*WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS 
*ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE 
*OF THIS SOFTWARE.
* $
*/






/**  SPECIFICATION -- External Facility Suite  *********************************

TITLE	The Apt Data-object

MODULE	apt.H

VERSION	0.0

AUTHOR	TC Peters
	Information Technology Center, Carnegie-Mellon University 

DESCRIPTION
	This is the suite of Methods that support the Apt Data-object.

    NB: The comment-symbol "===" indicates areas which are:
	    1 - Questionable
	    OR
	    2 - Arbitrary
	    OR
	    3 - Temporary Hacks
    Such curiosities need be resolved prior to Project Completion...


HISTORY
  02/23/88	Created (TCP)
  05/23/89	Add apt_LeftArea, etc (TCP)

END-SPECIFICATION  ************************************************************/

#define  apt_VERSION    1

/*  Placements  */
#define  apt_Left		      (1<<0)
#define  apt_Center		      (1<<1)
#define  apt_Right		      (1<<2)
#define  apt_Top		      (1<<3)
#define  apt_Middle		      (1<<4)
#define  apt_Bottom		      (1<<5)

/*  Enclosure Areas  */
#define  apt_LeftArea		      (0)
#define  apt_TopArea		      (1)
#define  apt_RightArea		      (2)
#define  apt_BottomArea		      (3)

/*  Title/Legend Formatting Options  */
#define  apt_Spread		      (1<<0)
#define  apt_LeftRight		      (1<<1)

struct apt_strings
  {
  long				      strings_count;
  char				  *((*strings)[]);
  char				     *font_name;
  long				      mode;
  };

struct apt_field
  {
  char				     *name;
  char				     *content;
  };

struct apt_fields
  {
  long				      count;
  struct apt_field		      field[1];
  };

struct apt_field_contents
  {
  long				      count;
  struct apt_field		      field[1];
  };






/*
    $Log: apt.ch,v $
*Revision 1.7  1993/05/04  01:06:01  susan
*RCS Tree Split
*
*Revision 1.6.1.1  1993/02/02  00:42:25  rr2b
*new R6tape branch
*
*Revision 1.6  1992/12/14  23:20:33  rr2b
*add $Logs back after disclaimerization took them out
*
Revision 1.4  1991/09/12  19:19:54  bobg
Update copyright notice

Revision 1.3  1990/04/11  14:11:06  gk5g
Removed initialization of variable debug from apt.h and put it in apt.c:apt__InitializeClass.  Create apt__InitializeClass.

Revision 1.2  89/05/24  19:44:52  tom
Add apt_LeftArea, etc.

Revision 1.1  89/04/28  17:45:45  tom
Initial revision

*/


/* 
 * End of information copied from apt.ch.
 */ 
 
#endif /* class_StaticInfoOnly *//* 
 * Include the superclass information
 */ 
#define dontDefineRoutinesFor_dataobject
#include "dataobj.ih"
#undef dontDefineRoutinesFor_dataobject

 
 
#ifndef class_StaticInfoOnly
/* 
 * Data structure for apt 
 */ 
struct apt { 
    union {
	struct basicobject_methods *apt_methods;
	struct traced traced;
	struct observable observable;
	struct dataobject dataobject;
    } header;

  struct apt_strings		      titles[4];
  struct apt_strings		      legends[4];
  long				      id;
  FILE				     *field_file;
  long				      field_index;
  struct apt_fields		     *fields;
  
};

 
/* 
 * End of data structure for apt.
 */ 
 

#endif /* class_StaticInfoOnly */

#ifndef class_StaticInfoOnly

#ifndef apt_PROGRAMMERVERSION
#define apt_PROGRAMMERVERSION 1
#endif /* apt_PROGRAMMERVERSION */

#ifdef apt_VERSION
#undef apt_VERSION
#endif /* apt_VERSION */
#define apt_VERSION ((((apt_PROGRAMMERVERSION << 16) ^ (35 << 8) ^ sizeof(struct apt)) & 0x7ffff) + 0x80000 + (2 << 20))


#endif /* class_StaticInfoOnly */
#define apt_StaticLoadOnlyThisClass()  \
{ extern struct classinfo *apt__GetClassInfo(); \
 extern struct classheader *apt_classheader_StaticExport; \
  (void) class_EnterInfo(NULL, apt_classheader_StaticExport->name, apt__GetClassInfo, NULL, apt_classheader_StaticExport->namekey); } 
 
#define apt_StaticLoad()  \
    { \
    dataobject_StaticLoad(); \
    apt_StaticLoadOnlyThisClass();  \
    } 
 
#define apt_StaticEntry  {apt_StaticLoad()} 
 
#ifndef class_StaticInfoOnly
static struct classheader apt_classheader = {
    apt_VERSION,
    "apt",
    "apt",
    (struct basicobject_methods *) &class_RoutineStruct,
};

#define apt_CLASSPROCEDURES (apt_classheader.classprocedures)
int apt_classref_;
#endif /* class_StaticInfoOnly */

#endif /* apt_DEFINED */

#if !defined(apt_ROUTINESDEFINED) && !defined(dontDefineRoutinesFor_apt) && !defined(class_StaticEntriesOnly)
#define apt_ROUTINESDEFINED

#define apt_Reference(self) \
 (((&(self)->header.traced))->refcount++)
#define apt_UnReference(self) \
 ((((&(self)->header.traced))->refcount>0)?((&(self)->header.traced))->refcount--:0)
#define apt_ReferenceCount(self) \
 (((&(self)->header.traced))->refcount)
#define apt_AddObserver(self,observer) \
    ((* ((void (*)())((self)->header.apt_methods->routines[0]))) (self,observer))
#define apt_IsObserver(self,observer) \
    ((* ((boolean (*)())((self)->header.apt_methods->routines[1]))) (self,observer))
#define apt_RemoveObserver(self,observer) \
    ((* ((void (*)())((self)->header.apt_methods->routines[2]))) (self,observer))
#define apt_NotifyObservers(self,value) \
    ((* ((void (*)())((self)->header.apt_methods->routines[3]))) (self,value))
#define apt_ObservedChanged(self,changed,value) \
    ((* ((void (*)())((self)->header.apt_methods->routines[4]))) (self,changed,value))
#define apt_AddRecipient(self,trigger,rcvr,func,rock) \
    ((* ((boolean (*)())((self)->header.apt_methods->routines[5]))) (self,trigger,rcvr,func,rock))
#define apt_DeleteRecipient(self,trigger,rcvr) \
    ((* ((void (*)())((self)->header.apt_methods->routines[6]))) (self,trigger,rcvr))
#define apt_PullTrigger(self,trigger) \
    ((* ((void (*)())((self)->header.apt_methods->routines[7]))) (self,trigger))
#define apt_DisableTrigger(self,trigger) \
    ((* ((void (*)())((self)->header.apt_methods->routines[8]))) (self,trigger))
#define apt_EnableTrigger(self,trigger) \
    ((* ((void (*)())((self)->header.apt_methods->routines[9]))) (self,trigger))
#define apt_DisableCount(self,trigger) \
    ((* ((long (*)())((self)->header.apt_methods->routines[10]))) (self,trigger))
#define apt_Read(self,file,id) \
    ((* ((long (*)())((self)->header.apt_methods->routines[11]))) (self,file,id))
#define apt_Write(self,file,writeid,level) \
    ((* ((long (*)())((self)->header.apt_methods->routines[12]))) (self,file,writeid,level))
#define apt_ReadOtherFormat(self,file,fmt,encoding,description) \
    ((* ((boolean (*)())((self)->header.apt_methods->routines[13]))) (self,file,fmt,encoding,description))
#define apt_WriteOtherFormat(self,file,writeid,level,usagetype,boundary) \
    ((* ((long (*)())((self)->header.apt_methods->routines[14]))) (self,file,writeid,level,usagetype,boundary))
#define apt_GetModified(self) \
    ((* ((long (*)())((self)->header.apt_methods->routines[15]))) (self))
#define apt_SetModified(self) \
    ((* ((void (*)())((self)->header.apt_methods->routines[16]))) (self))
#define apt_ViewName(self) \
    ((* ((char * (*)())((self)->header.apt_methods->routines[17]))) (self))
#define apt_SetAttributes(self,attributes) \
    ((* ((void (*)())((self)->header.apt_methods->routines[18]))) (self,attributes))
#define apt_Put(self,property,type,rock) \
    ((* ((void (*)())((self)->header.apt_methods->routines[19]))) (self,property,type,rock))
#define apt_Get(self,property,type,rock) \
    ((* ((short (*)())((self)->header.apt_methods->routines[20]))) (self,property,type,rock))
#define apt_ListCurrentViews(self,array,size) \
    ((* ((int (*)())((self)->header.apt_methods->routines[21]))) (self,array,size))
#define apt_RestoreModified(self,oldmodified) \
    ((* ((void (*)())((self)->header.apt_methods->routines[22]))) (self,oldmodified))
#define apt_UniqueID(self) \
 ((long)((&(self)->header.dataobject)))
#define apt_GetWriteID(self) \
 ( ((&(self)->header.dataobject))->writeID )
#define apt_SetWriteID(self,newValue) \
 ( (((&(self)->header.dataobject))->writeID) = (newValue) )
#define apt_GetID(self) \
      ( ((&(self)->header.dataobject))->id )
#define apt_SetID(self,newValue) \
      ( (((&(self)->header.dataobject))->id) = (newValue) )
#define apt_SetAreaTitle(self,title,area) \
    ((* ((void (*)())((self)->header.apt_methods->routines[23]))) (self,title,area))
#define apt_SetAreaSpreadTitle(self,title,count,area,mode) \
    ((* ((void (*)())((self)->header.apt_methods->routines[24]))) (self,title,count,area,mode))
#define apt_SetAreaTitleFontName(self,font,area) \
    ((* ((void (*)())((self)->header.apt_methods->routines[25]))) (self,font,area))
#define apt_SetAreaLegend(self,legend,area) \
    ((* ((void (*)())((self)->header.apt_methods->routines[26]))) (self,legend,area))
#define apt_SetAreaSpreadLegend(self,legend,count,area,mode) \
    ((* ((void (*)())((self)->header.apt_methods->routines[27]))) (self,legend,count,area,mode))
#define apt_SetAreaLegendFontName(self,font,area) \
    ((* ((void (*)())((self)->header.apt_methods->routines[28]))) (self,font,area))
#define apt_ReadObject(self,file,id,reader) \
    ((* ((long (*)())((self)->header.apt_methods->routines[29]))) (self,file,id,reader))
#define apt_ReadObjectField(self) \
    ((* ((struct apt_field * (*)())((self)->header.apt_methods->routines[30]))) (self))
#define apt_ParseFieldContent(self,string) \
    ((* ((char ** (*)())((self)->header.apt_methods->routines[31]))) (self,string))
#define apt_ParseFieldContents(self,string) \
    ((* ((struct apt_field_contents * (*)())((self)->header.apt_methods->routines[32]))) (self,string))
#define apt_WriteObject(self,file,id,level,writer) \
    ((* ((void (*)())((self)->header.apt_methods->routines[33]))) (self,file,id,level,writer))
#define apt_WriteObjectField(self,field) \
    ((* ((void (*)())((self)->header.apt_methods->routines[34]))) (self,field))
#define apt_AreaTitlesAnchor(self,area) \
	    (((self))->titles[area].strings)
#define apt_AreaTitlesCount(self,area) \
	    (((self))->titles[area].strings_count)
#define apt_AreaTitle(self,area) \
		    ((((self))->titles[area].strings) ?					 (*((self))->titles[area].strings)[0] : NULL)
#define apt_AreaTitles(self,area,i) \
		    ((*((self))->titles[area].strings)[i])
#define apt_AreaTitleFontName(self,area) \
	    (((self))->titles[area].font_name)
#define apt_AreaLegendsAnchor(self,area) \
	    (((self))->legends[area].strings)
#define apt_AreaLegendsCount(self,area) \
	    (((self))->legends[area].strings_count)
#define apt_AreaLegend(self,area) \
		    ((((self))->legends[area].strings) ?					 (*((self))->legends[area].strings)[0] : NULL)
#define apt_AreaLegends(self,area,i) \
	    ((*((self))->legends[area].strings)[i])
#define apt_AreaLegendFontName(self,area) \
	    (((self))->legends[area].font_name)

#define apt_NewFromObject(self) \
    ((* ((struct apt * (*)())((self)->header.apt_methods->info->procs->routines[0]))) (&apt_classheader, (self)->header.apt_methods->info->versionnumber))
#define apt_New() \
    (*((struct apt * (*)()) (apt_CLASSPROCEDURES->routines[0])))(&apt_classheader,apt_VERSION)
#define apt_Initialize(self) \
    (*((void (*)()) (apt_CLASSPROCEDURES->routines[2])))(&apt_classheader,self, apt_VERSION)

#define apt_Destroy(self) \
    ((* ((void (*)()) ((self)->header.apt_methods->info->procs->routines[1]))) (&apt_classheader, self))
#define apt_Finalize(self) \
    (*((void (*)()) (apt_CLASSPROCEDURES->routines[3])))(&apt_classheader,self)

#define apt_InitializeObject(self) \
    (*((boolean (*)()) (apt_CLASSPROCEDURES->routines[5])))(&apt_classheader,self)
#define apt_FinalizeObject(self) \
    (*((void (*)()) (apt_CLASSPROCEDURES->routines[6])))(&apt_classheader,self)
#define apt_InitializeClass() \
    (*((boolean (*)()) (apt_CLASSPROCEDURES->routines[7])))(&apt_classheader)


#endif /* !defined(apt_ROUTINESDEFINED) && !defined(dontDefineRoutinesFor_apt ) && !defined(class_StaticEntriesOnly)*/

