ftp.nice.ch/pub/next/text/etext/eText5-0.93.Source.NIHS.tar.gz#/eText5/eTImage.subproj/eTImage.h

This is eTImage.h in view mode; [Download] [Up]

///////////////////////////////////////////////////////////////////////////////
//	FILENAME:	eTImage.h 
//	SUMMARY:	Interface for Image annotations with Action support
//	SUPERCLASS:	Object
//	INTERFACE:	None
//	PROTOCOLS:	<Annotation,HTMDSupport,ASCIISupport,LaTeXSupport,Tool,
//				InspectableTarget,DocNotification>
//	AUTHOR:		Rohit Khare
//	COPYRIGHT:	(c) 1994 California Institure of Technology, eText Project
///////////////////////////////////////////////////////////////////////////////
//	DESCRIPTION
//		This is a class with two faces: it is useful as an abstract
//	implementation of the <Annotation> protocol suitable for staic-image-like
//	annotation development (contrast eTView) AND it is a simple annotation
//	class for imageable data in its default implementation.
//		It uses eTImageComponent to hold its image data.
///////////////////////////////////////////////////////////////////////////////
//	HISTORY
//	11/26/94:	Added captionMode for text-graphics.
//	10/30/94:	Modified to support <InspectableTarget>
//	07/16/94:	Rewritten from scratch, integrating ImageAnnotation and Image
///////////////////////////////////////////////////////////////////////////////

#import "Component.subproj/eTImageComponent.h"
#import "eTextKernel.h"

@interface eTImage:Object <DocNotification,Annotation,Tool,ASCIISupport,LaTeXSupport,HTMDSupport>
{
	id		theText;
	id		etDoc;
	
	id		imageComponent;
	id		image;
	id		altImageComponent;
	id		altImage;
	char 	*description;
	NXSize	size;
	BOOL	usesButtonStyle;
	BOOL	isDraggable;
	BOOL	highlighted;	// usesHighlightedStyle ????
	BOOL	state;			// button-emulation
	BOOL	captionMode;	// override to display text string in cell.
}

// "Delegate" methods
	// User Interaction
		- click:(NXEvent*)e;
		- doubleClick:(NXEvent*)e;
		- inspect:(NXEvent*)e;
		- drag: (Pasteboard *)draggingPboard image:(NXImage **)proxyImage;
			// client fills in for drag

// "Client" methods -- feel free to access ivars directly.
	// Getter/Setter methods
		- setImageComponent: newImageComponent;
		- setAltImageComponent: newAltImageComponent;	
		- setDescription: (const char *) newDescription;
		- setUsesButtonStyle:(BOOL)newState;
		- setDraggable:(BOOL)newState;
		- setSize:(const NXSize *)newSize;
		- setState:(int) newState;	// can't do BOOL because of NS's Cell class
		- setCaptionMode;
		- eTextObj;
		- etDoc;
		- imageComponent;
		- altImageComponent;
		- (char *) description;
		- (char **) getDescription;		// be careful of reallocing this
		- (BOOL) usesButtonStyle;
		- (BOOL) isDraggable;
		- (NXSize *) size;
		- (BOOL) state;
		- (BOOL) captionMode;
	// State Flushing
		- updateGraphics;

// "Private" Methods; really, default implementations
	// Lifecycle
		+ toolAwake:theApp;
		- init;
		- free;		// NOTE: we free none of our ivars; subclasses must!
		- initFromPboard:thePB inDoc:theDoc linked:(BOOL) linked;
	// Drawing
		- calcCellSize:(NXSize *)theSize;
		- drawSelf:(const NXRect *)rect inView:view;
		- highlight:(const NXRect *)rect inView:view lit:(BOOL)flag;
		- (BOOL)	trackMouse:(NXEvent *)theEvent
					inRect:(const NXRect *)rect
					ofView:view;
	// File I/O
		- readRichText:(NXStream *)stream forView:view;
		- writeRichText:(NXStream *)stream forView:view;
	// Drag-and-Drop
		- (NXDragOperation)draggingSourceOperationMaskForLocal:(BOOL)flag;
		- draggedImage:(NXImage *)image endedAt:(NXPoint *)screenPoint
		  deposited:(BOOL)flag;

@end

These are the contents of the former NiCE NeXT User Group NeXTSTEP/OpenStep software archive, currently hosted by Netfuture.ch.