 
#ifndef figobj_DEFINED
#define figobj_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 figobj.ch and will be
 * overwritten.  Make changes to figobj.ch instead.
 */ 
 
#ifndef class_StaticInfoOnly
/* 
 * The following information was copied, as-is, from figobj.ch.
 */ 
 
/* figobj.ch - fig element object */
/*
	Copyright Carnegie Mellon University 1992 - All rights reserved
	$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.
* $

  $Header: /afs/cs.cmu.edu/project/atk-dist/6.2/atk/figure/RCS/figobj.ch,v 1.4 1993/05/04 01:18:42 susan Exp $
*/

#include <rect.h>
#include <point.h>

#define figobj_NULLREF (-1)

/* status values for NotifyObservers */
#define figobj_DATACHANGED 1

/* return values for Build() */
enum figobj_Status { 
    figobj_Done,
    figobj_NotDone,
    figobj_Failed
};

/* return values for HitMe(). */
enum figobj_HitVal {
    figobj_Miss,	/* miss (ptref is undefined) */
    figobj_HitInside,	/* inside body (ptref is undefined) */
    figobj_HitBody,	/* on body part (indicated by a ptref) */
    figobj_HitHandle 	/* on handle (indicated by a ptref) */
};

/* Hints for objects to tell the constraint manager what
    a particular handle does for the object. */
enum figobj_HandleType {
    figobj_None,
    figobj_ULCorner,
    figobj_LLCorner,
    figobj_LRCorner,
    figobj_URCorner,
    figobj_MiddleLeft,
    figobj_MiddleRight,
    figobj_MiddleTop,
    figobj_MiddleBottom,
    figobj_Center,
    figobj_LeftEndpoint,
    figobj_RightEndpoint,
    figobj_InteriorPoint,
    figobj_Point
};

struct figobj_Attachment {
    boolean on;
    long rposx, rposy;
    long offx, offy;
};






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

 
 
#ifndef class_StaticInfoOnly
/* 
 * Data structure for figobj 
 */ 
struct figobj { 
    union {
	struct basicobject_methods *figobj_methods;
	struct traced traced;
	struct observable observable;
	struct dataobject dataobject;
    } header;
      long parentref;
      struct figogrp *parent;
      struct figure *figo;
      boolean isgroup, isinset;
      long attrused;
      long x, y;
      struct figattr *attr;
      struct figattr *iattr;
      struct rectangle bounds, selbounds;
      long pt_size;
      long numpts;
      struct point *pts;
      struct figobj_Attachment *vas;
      boolean anyattachmentsactive;

};

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

#endif /* class_StaticInfoOnly */

#ifndef class_StaticInfoOnly

#ifndef figobj_PROGRAMMERVERSION
#define figobj_PROGRAMMERVERSION 1
#endif /* figobj_PROGRAMMERVERSION */

#ifdef figobj_VERSION
#undef figobj_VERSION
#endif /* figobj_VERSION */
#define figobj_VERSION ((((figobj_PROGRAMMERVERSION << 16) ^ (54 << 8) ^ sizeof(struct figobj)) & 0x7ffff) + 0x80000 + (2 << 20))


#endif /* class_StaticInfoOnly */
#define figobj_StaticLoadOnlyThisClass()  \
{ extern struct classinfo *figobj__GetClassInfo(); \
 extern struct classheader *figobj_classheader_StaticExport; \
  (void) class_EnterInfo(NULL, figobj_classheader_StaticExport->name, figobj__GetClassInfo, NULL, figobj_classheader_StaticExport->namekey); } 
 
#define figobj_StaticLoad()  \
    { \
    dataobject_StaticLoad(); \
    figobj_StaticLoadOnlyThisClass();  \
    } 
 
#define figobj_StaticEntry  {figobj_StaticLoad()} 
 
#ifndef class_StaticInfoOnly
static struct classheader figobj_classheader = {
    figobj_VERSION,
    "figobj",
    "figobj",
    (struct basicobject_methods *) &class_RoutineStruct,
};

#define figobj_CLASSPROCEDURES (figobj_classheader.classprocedures)
int figobj_classref_;
#endif /* class_StaticInfoOnly */

#endif /* figobj_DEFINED */

#if !defined(figobj_ROUTINESDEFINED) && !defined(dontDefineRoutinesFor_figobj) && !defined(class_StaticEntriesOnly)
#define figobj_ROUTINESDEFINED

#define figobj_Reference(self) \
 (((&(self)->header.traced))->refcount++)
#define figobj_UnReference(self) \
 ((((&(self)->header.traced))->refcount>0)?((&(self)->header.traced))->refcount--:0)
#define figobj_ReferenceCount(self) \
 (((&(self)->header.traced))->refcount)
#define figobj_AddObserver(self,observer) \
    ((* ((void (*)())((self)->header.figobj_methods->routines[0]))) (self,observer))
#define figobj_IsObserver(self,observer) \
    ((* ((boolean (*)())((self)->header.figobj_methods->routines[1]))) (self,observer))
#define figobj_RemoveObserver(self,observer) \
    ((* ((void (*)())((self)->header.figobj_methods->routines[2]))) (self,observer))
#define figobj_NotifyObservers(self,value) \
    ((* ((void (*)())((self)->header.figobj_methods->routines[3]))) (self,value))
#define figobj_ObservedChanged(self,changed,value) \
    ((* ((void (*)())((self)->header.figobj_methods->routines[4]))) (self,changed,value))
#define figobj_AddRecipient(self,trigger,rcvr,func,rock) \
    ((* ((boolean (*)())((self)->header.figobj_methods->routines[5]))) (self,trigger,rcvr,func,rock))
#define figobj_DeleteRecipient(self,trigger,rcvr) \
    ((* ((void (*)())((self)->header.figobj_methods->routines[6]))) (self,trigger,rcvr))
#define figobj_PullTrigger(self,trigger) \
    ((* ((void (*)())((self)->header.figobj_methods->routines[7]))) (self,trigger))
#define figobj_DisableTrigger(self,trigger) \
    ((* ((void (*)())((self)->header.figobj_methods->routines[8]))) (self,trigger))
#define figobj_EnableTrigger(self,trigger) \
    ((* ((void (*)())((self)->header.figobj_methods->routines[9]))) (self,trigger))
#define figobj_DisableCount(self,trigger) \
    ((* ((long (*)())((self)->header.figobj_methods->routines[10]))) (self,trigger))
#define figobj_Read(self,file,id) \
    ((* ((long (*)())((self)->header.figobj_methods->routines[11]))) (self,file,id))
#define figobj_Write(self,file,writeid,level) \
    ((* ((long (*)())((self)->header.figobj_methods->routines[12]))) (self,file,writeid,level))
#define figobj_ReadOtherFormat(self,file,fmt,encoding,description) \
    ((* ((boolean (*)())((self)->header.figobj_methods->routines[13]))) (self,file,fmt,encoding,description))
#define figobj_WriteOtherFormat(self,file,writeid,level,usagetype,boundary) \
    ((* ((long (*)())((self)->header.figobj_methods->routines[14]))) (self,file,writeid,level,usagetype,boundary))
#define figobj_GetModified(self) \
    ((* ((long (*)())((self)->header.figobj_methods->routines[15]))) (self))
#define figobj_SetModified(self) \
    ((* ((void (*)())((self)->header.figobj_methods->routines[16]))) (self))
#define figobj_ViewName(self) \
    ((* ((char * (*)())((self)->header.figobj_methods->routines[17]))) (self))
#define figobj_SetAttributes(self,attributes) \
    ((* ((void (*)())((self)->header.figobj_methods->routines[18]))) (self,attributes))
#define figobj_Put(self,property,type,rock) \
    ((* ((void (*)())((self)->header.figobj_methods->routines[19]))) (self,property,type,rock))
#define figobj_Get(self,property,type,rock) \
    ((* ((short (*)())((self)->header.figobj_methods->routines[20]))) (self,property,type,rock))
#define figobj_ListCurrentViews(self,array,size) \
    ((* ((int (*)())((self)->header.figobj_methods->routines[21]))) (self,array,size))
#define figobj_RestoreModified(self,oldmodified) \
    ((* ((void (*)())((self)->header.figobj_methods->routines[22]))) (self,oldmodified))
#define figobj_UniqueID(self) \
 ((long)((&(self)->header.dataobject)))
#define figobj_GetWriteID(self) \
 ( ((&(self)->header.dataobject))->writeID )
#define figobj_SetWriteID(self,newValue) \
 ( (((&(self)->header.dataobject))->writeID) = (newValue) )
#define figobj_GetID(self) \
      ( ((&(self)->header.dataobject))->id )
#define figobj_SetID(self,newValue) \
      ( (((&(self)->header.dataobject))->id) = (newValue) )
#define figobj_WriteBody(self,fp) \
    ((* ((void (*)())((self)->header.figobj_methods->routines[23]))) (self,fp))
#define figobj_ReadBody(self,file,recompute) \
    ((* ((long (*)())((self)->header.figobj_methods->routines[24]))) (self,file,recompute))
#define figobj_ToolName(self,v,rock) \
    ((* ((char * (*)())((self)->header.figobj_methods->routines[25]))) (self,v,rock))
#define figobj_ToolModify(self,v,rock) \
    ((* ((void (*)())((self)->header.figobj_methods->routines[26]))) (self,v,rock))
#define figobj_Instantiate(self,v,rock) \
    ((* ((struct figobj * (*)())((self)->header.figobj_methods->routines[27]))) (self,v,rock))
#define figobj_Draw(self,v) \
    ((* ((void (*)())((self)->header.figobj_methods->routines[28]))) (self,v))
#define figobj_Sketch(self,v) \
    ((* ((void (*)())((self)->header.figobj_methods->routines[29]))) (self,v))
#define figobj_DrawAttachments(self,v) \
    ((* ((void (*)())((self)->header.figobj_methods->routines[30]))) (self,v))
#define figobj_ClearAttachments(self) \
    ((* ((void (*)())((self)->header.figobj_methods->routines[31]))) (self))
#define figobj_PrintObject(self,v,file,prefix) \
    ((* ((void (*)())((self)->header.figobj_methods->routines[32]))) (self,v,file,prefix))
#define figobj_Select(self,v) \
    ((* ((void (*)())((self)->header.figobj_methods->routines[33]))) (self,v))
#define figobj_SetNumHandles(self,num) \
    ((* ((void (*)())((self)->header.figobj_methods->routines[34]))) (self,num))
#define figobj_Build(self,action,v,x,y,clicks) \
    ((* ((enum figobj_Status (*)())((self)->header.figobj_methods->routines[35]))) (self,action,v,x,y,clicks))
#define figobj_HitMe(self,x,y,delta,ptref) \
    ((* ((enum figobj_HitVal (*)())((self)->header.figobj_methods->routines[36]))) (self,x,y,delta,ptref))
#define figobj_BasicHitMe(self,x,y,delta,ptref) \
    ((* ((enum figobj_HitVal (*)())((self)->header.figobj_methods->routines[37]))) (self,x,y,delta,ptref))
#define figobj_Reshape(self,action,v,x,y,handle,ptref) \
    ((* ((boolean (*)())((self)->header.figobj_methods->routines[38]))) (self,action,v,x,y,handle,ptref))
#define figobj_AddParts(self,action,v,x,y,handle,ptref) \
    ((* ((boolean (*)())((self)->header.figobj_methods->routines[39]))) (self,action,v,x,y,handle,ptref))
#define figobj_DeleteParts(self,action,v,x,y,handle,ptref) \
    ((* ((boolean (*)())((self)->header.figobj_methods->routines[40]))) (self,action,v,x,y,handle,ptref))
#define figobj_MoveHandle(self,x,y,ptref) \
    ((* ((void (*)())((self)->header.figobj_methods->routines[41]))) (self,x,y,ptref))
#define figobj_Reposition(self,xd,yd) \
    ((* ((void (*)())((self)->header.figobj_methods->routines[42]))) (self,xd,yd))
#define figobj_InheritVAttributes(self,attr,mask) \
    ((* ((void (*)())((self)->header.figobj_methods->routines[43]))) (self,attr,mask))
#define figobj_UpdateVAttributes(self,attr,mask) \
    ((* ((unsigned long (*)())((self)->header.figobj_methods->routines[44]))) (self,attr,mask))
#define figobj_RecomputeBounds(self) \
    ((* ((void (*)())((self)->header.figobj_methods->routines[45]))) (self))
#define figobj_GetBounds(self,vv) \
    ((* ((struct rectangle * (*)())((self)->header.figobj_methods->routines[46]))) (self,vv))
#define figobj_GetSelectedBounds(self,vv) \
    ((* ((struct rectangle * (*)())((self)->header.figobj_methods->routines[47]))) (self,vv))
#define figobj_ComputeSelectedBounds(self) \
    ((* ((void (*)())((self)->header.figobj_methods->routines[48]))) (self))
#define figobj_UpdateParentBounds(self) \
    ((* ((void (*)())((self)->header.figobj_methods->routines[49]))) (self))
#define figobj_SetParent(self,parentref,ancestor) \
    ((* ((void (*)())((self)->header.figobj_methods->routines[50]))) (self,parentref,ancestor))
#define figobj_GetHandleType(self,ptref) \
    ((* ((enum figobj_HandleType (*)())((self)->header.figobj_methods->routines[51]))) (self,ptref))
#define figobj_GetCanonicalHandles(self) \
    ((* ((long * (*)())((self)->header.figobj_methods->routines[52]))) (self))
#define figobj_StabilizeAttachments(self,keepproport) \
    ((* ((void (*)())((self)->header.figobj_methods->routines[53]))) (self,keepproport))
#define figobj_GetParent(self) \
  (((self))->parent)
#define figobj_GetParentRef(self) \
  (((self))->parentref)
#define figobj_GetAncestorFig(self) \
  (((self))->figo)
#define figobj_IsGroup(self) \
  (((self))->isgroup)
#define figobj_IsInset(self) \
  (((self))->isinset)
#define figobj_AttributesUsed(self) \
  (((self))->attrused)
#define figobj_GetHandles(self) \
  (((self))->pts)
#define figobj_GetNumHandles(self) \
  (((self))->numpts)
#define figobj_SetHandle(self,num,x,y) \
  (point_SetPt(&(((self))->pts[num]), (x), (y)))
#define figobj_PosX(self) \
  (((self))->x)
#define figobj_PosY(self) \
  (((self))->y)
#define figobj_SetBoundsRect(self,left,top,width,height) \
  (rectangle_SetRectSize(&(((self))->bounds), (left), (top), (width), (height)))
#define figobj_GetVAttributes(self) \
  (((self))->attr)
#define figobj_GetIVAttributes(self) \
  (((self))->iattr)
#define figobj_GetReadOnly(self) \
  (((self))->figo && figure_GetReadOnly(((self))->figo))
#define figobj_IsAttachmentActive(self,num) \
  (((self))->vas[num].on)
#define figobj_SetAttachmentActive(self,num,val) \
  (((self))->vas[num].on = (val), ((self))->anyattachmentsactive = ((self))->anyattachmentsactive || (val))
#define figobj_SetAttachmentPosX(self,num,pos) \
 (((self))->vas[num].rposx=(pos))
#define figobj_SetAttachmentOffX(self,num,offset) \
 (((self))->vas[num].offx=(offset))
#define figobj_GetAttachmentPosX(self,num) \
 (((self))->vas[num].rposx)
#define figobj_GetAttachmentOffX(self,num) \
 (((self))->vas[num].offx)
#define figobj_SetAttachmentPosY(self,num,pos) \
 (((self))->vas[num].rposy=(pos))
#define figobj_SetAttachmentOffY(self,num,offset) \
 (((self))->vas[num].offy=(offset))
#define figobj_GetAttachmentPosY(self,num) \
 (((self))->vas[num].rposy)
#define figobj_GetAttachmentOffY(self,num) \
 (((self))->vas[num].offy)
#define figobj_GetHandleX(self,num) \
 (((self))->pts[num].x)
#define figobj_GetHandleY(self,num) \
 (((self))->pts[num].y)

#define figobj_NewFromObject(self) \
    ((* ((struct figobj * (*)())((self)->header.figobj_methods->info->procs->routines[0]))) (&figobj_classheader, (self)->header.figobj_methods->info->versionnumber))
#define figobj_New() \
    (*((struct figobj * (*)()) (figobj_CLASSPROCEDURES->routines[0])))(&figobj_classheader,figobj_VERSION)
#define figobj_Initialize(self) \
    (*((void (*)()) (figobj_CLASSPROCEDURES->routines[2])))(&figobj_classheader,self, figobj_VERSION)

#define figobj_Destroy(self) \
    ((* ((void (*)()) ((self)->header.figobj_methods->info->procs->routines[1]))) (&figobj_classheader, self))
#define figobj_Finalize(self) \
    (*((void (*)()) (figobj_CLASSPROCEDURES->routines[3])))(&figobj_classheader,self)

#define figobj_InitializeObject(self) \
    (*((boolean (*)()) (figobj_CLASSPROCEDURES->routines[5])))(&figobj_classheader,self)
#define figobj_FinalizeObject(self) \
    (*((void (*)()) (figobj_CLASSPROCEDURES->routines[6])))(&figobj_classheader,self)
#define figobj_InitializeClass() \
    (*((boolean (*)()) (figobj_CLASSPROCEDURES->routines[7])))(&figobj_classheader)


#endif /* !defined(figobj_ROUTINESDEFINED) && !defined(dontDefineRoutinesFor_figobj ) && !defined(class_StaticEntriesOnly)*/

