 
#ifndef raster_DEFINED
#define raster_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 raster.ch and will be
 * overwritten.  Make changes to raster.ch instead.
 */ 
 
#ifndef class_StaticInfoOnly
/* 
 * The following information was copied, as-is, from raster.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.
* $
*/


 

/*

	A raster  refers to a rasterimage containing the raw bits.  It can specify
	scaling, cropping, reflection, rotation, and inversion of the image from the raw bits.

	For a description of the data stream, see itc/be2/raster/rasterspec.d
*/

#include <rect.h>

#include <rastimg.ih>	/* because some macros call routines from it */

#define  raster_PROGRAMMERVERSION    1

/* status values for notify observer */
#define  raster_BITSCHANGED    2  /* the parameters in the
					struct raster have changed */
#define  raster_BOUNDSCHANGED  3  /* the raster is viewing a different
					part of the rasterimage */







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

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

	struct rasterimage *pix;	/* the image storage */
	boolean	readOnly;
	struct rectangle subraster;	/* choose subraster of rasterimage */

	/* the raster may be a negative image or reflection of the bits in the
	    underlying raster: */
	char  options;
		/* bits of 'option' value */
#define  raster_INVERT	(1<<0)	/* exchange black and white */
#define  raster_FLIP	(1<<1)	/* exch top and bottom */
#define  raster_FLOP	(1<<2)	/* exch left and right */
#define  raster_ROTATE	(1<<3)	/* rotate 90 clockwise */

#define raster_UNITSCALE  136533	 /*0x20000 print at nominal screen size */
	/*  default print scaling is 0x10000 which means 1/2 screen size */

	long xScale, yScale;	/* scaling for printing */

};

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

#endif /* class_StaticInfoOnly */

#ifndef class_StaticInfoOnly

#ifndef raster_PROGRAMMERVERSION
#define raster_PROGRAMMERVERSION 1
#endif /* raster_PROGRAMMERVERSION */

#ifdef raster_VERSION
#undef raster_VERSION
#endif /* raster_VERSION */
#define raster_VERSION ((((raster_PROGRAMMERVERSION << 16) ^ (28 << 8) ^ sizeof(struct raster)) & 0x7ffff) + 0x80000 + (65 << 20))


#endif /* class_StaticInfoOnly */
#define raster_StaticLoadOnlyThisClass()  \
{ extern struct classinfo *raster__GetClassInfo(); \
 extern struct classheader *raster_classheader_StaticExport; \
  (void) class_EnterInfo(NULL, raster_classheader_StaticExport->name, raster__GetClassInfo, NULL, raster_classheader_StaticExport->namekey); } 
 
#define raster_StaticLoad()  \
    { \
    dataobject_StaticLoad(); \
    raster_StaticLoadOnlyThisClass();  \
    } 
 
#define raster_StaticEntry  {raster_StaticLoad()} 
 
#ifndef class_StaticInfoOnly
static struct classheader raster_classheader = {
    raster_VERSION,
    "raster",
    "raster",
    (struct basicobject_methods *) &class_RoutineStruct,
};

#define raster_CLASSPROCEDURES (raster_classheader.classprocedures)
int raster_classref_;
#endif /* class_StaticInfoOnly */

#endif /* raster_DEFINED */

#if !defined(raster_ROUTINESDEFINED) && !defined(dontDefineRoutinesFor_raster) && !defined(class_StaticEntriesOnly)
#define raster_ROUTINESDEFINED

#define raster_Reference(self) \
 (((&(self)->header.traced))->refcount++)
#define raster_UnReference(self) \
 ((((&(self)->header.traced))->refcount>0)?((&(self)->header.traced))->refcount--:0)
#define raster_ReferenceCount(self) \
 (((&(self)->header.traced))->refcount)
#define raster_AddObserver(self,observer) \
    ((* ((void (*)())((self)->header.raster_methods->routines[0]))) (self,observer))
#define raster_IsObserver(self,observer) \
    ((* ((boolean (*)())((self)->header.raster_methods->routines[1]))) (self,observer))
#define raster_RemoveObserver(self,observer) \
    ((* ((void (*)())((self)->header.raster_methods->routines[2]))) (self,observer))
#define raster_NotifyObservers(self,value) \
    ((* ((void (*)())((self)->header.raster_methods->routines[3]))) (self,value))
#define raster_ObservedChanged(self,changed,value) \
    ((* ((void (*)())((self)->header.raster_methods->routines[4]))) (self,changed,value))
#define raster_AddRecipient(self,trigger,rcvr,func,rock) \
    ((* ((boolean (*)())((self)->header.raster_methods->routines[5]))) (self,trigger,rcvr,func,rock))
#define raster_DeleteRecipient(self,trigger,rcvr) \
    ((* ((void (*)())((self)->header.raster_methods->routines[6]))) (self,trigger,rcvr))
#define raster_PullTrigger(self,trigger) \
    ((* ((void (*)())((self)->header.raster_methods->routines[7]))) (self,trigger))
#define raster_DisableTrigger(self,trigger) \
    ((* ((void (*)())((self)->header.raster_methods->routines[8]))) (self,trigger))
#define raster_EnableTrigger(self,trigger) \
    ((* ((void (*)())((self)->header.raster_methods->routines[9]))) (self,trigger))
#define raster_DisableCount(self,trigger) \
    ((* ((long (*)())((self)->header.raster_methods->routines[10]))) (self,trigger))
#define raster_Read(self,file,id) \
    ((* ((long (*)())((self)->header.raster_methods->routines[11]))) (self,file,id))
#define raster_Write(self,file,writeid,level) \
    ((* ((long (*)())((self)->header.raster_methods->routines[12]))) (self,file,writeid,level))
#define raster_ReadOtherFormat(self,file,fmt,encoding,description) \
    ((* ((boolean (*)())((self)->header.raster_methods->routines[13]))) (self,file,fmt,encoding,description))
#define raster_WriteOtherFormat(self,file,writeid,level,usagetype,boundary) \
    ((* ((long (*)())((self)->header.raster_methods->routines[14]))) (self,file,writeid,level,usagetype,boundary))
#define raster_GetModified(self) \
    ((* ((long (*)())((self)->header.raster_methods->routines[15]))) (self))
#define raster_SetModified(self) \
    ((* ((void (*)())((self)->header.raster_methods->routines[16]))) (self))
#define raster_ViewName(self) \
    ((* ((char * (*)())((self)->header.raster_methods->routines[17]))) (self))
#define raster_SetAttributes(self,attributes) \
    ((* ((void (*)())((self)->header.raster_methods->routines[18]))) (self,attributes))
#define raster_Put(self,property,type,rock) \
    ((* ((void (*)())((self)->header.raster_methods->routines[19]))) (self,property,type,rock))
#define raster_Get(self,property,type,rock) \
    ((* ((short (*)())((self)->header.raster_methods->routines[20]))) (self,property,type,rock))
#define raster_ListCurrentViews(self,array,size) \
    ((* ((int (*)())((self)->header.raster_methods->routines[21]))) (self,array,size))
#define raster_RestoreModified(self,oldmodified) \
    ((* ((void (*)())((self)->header.raster_methods->routines[22]))) (self,oldmodified))
#define raster_UniqueID(self) \
 ((long)((&(self)->header.dataobject)))
#define raster_GetWriteID(self) \
 ( ((&(self)->header.dataobject))->writeID )
#define raster_SetWriteID(self,newValue) \
 ( (((&(self)->header.dataobject))->writeID) = (newValue) )
#define raster_GetID(self) \
      ( ((&(self)->header.dataobject))->id )
#define raster_SetID(self,newValue) \
      ( (((&(self)->header.dataobject))->id) = (newValue) )
#define raster_SetPix(self,pix) \
    ((* ((void (*)())((self)->header.raster_methods->routines[23]))) (self,pix))
#define raster_Resize(self,width,height) \
    ((* ((void (*)())((self)->header.raster_methods->routines[24]))) (self,width,height))
#define raster_ReadSubRaster(self,file,r) \
    ((* ((long (*)())((self)->header.raster_methods->routines[25]))) (self,file,r))
#define raster_WriteSubRaster(self,file,objectid,subraster) \
    ((* ((long (*)())((self)->header.raster_methods->routines[26]))) (self,file,objectid,subraster))
#define raster_WriteShare(self,file,subraster) \
    ((* ((void (*)())((self)->header.raster_methods->routines[27]))) (self,file,subraster))
#define raster_Clear(self) \
		(rasterimage_Clear((self)->pix))
#define raster_GetWidth(self) \
	(rasterimage_GetWidth((self)->pix))
#define raster_GetHeight(self) \
	(rasterimage_GetHeight((self)->pix))
#define raster_GetPix(self) \
		((self)->pix)

#define raster_NewFromObject(self) \
    ((* ((struct raster * (*)())((self)->header.raster_methods->info->procs->routines[0]))) (&raster_classheader, (self)->header.raster_methods->info->versionnumber))
#define raster_New() \
    (*((struct raster * (*)()) (raster_CLASSPROCEDURES->routines[0])))(&raster_classheader,raster_VERSION)
#define raster_Initialize(self) \
    (*((void (*)()) (raster_CLASSPROCEDURES->routines[2])))(&raster_classheader,self, raster_VERSION)

#define raster_Destroy(self) \
    ((* ((void (*)()) ((self)->header.raster_methods->info->procs->routines[1]))) (&raster_classheader, self))
#define raster_Finalize(self) \
    (*((void (*)()) (raster_CLASSPROCEDURES->routines[3])))(&raster_classheader,self)

#define raster_InitializeObject(self) \
    (*((boolean (*)()) (raster_CLASSPROCEDURES->routines[5])))(&raster_classheader,self)
#define raster_FinalizeObject(self) \
    (*((void (*)()) (raster_CLASSPROCEDURES->routines[6])))(&raster_classheader,self)
#define raster_Create(width,height) \
    (*((struct raster * (*)()) (raster_CLASSPROCEDURES->routines[7])))(&raster_classheader,width,height)


#endif /* !defined(raster_ROUTINESDEFINED) && !defined(dontDefineRoutinesFor_raster ) && !defined(class_StaticEntriesOnly)*/

