COMMENT @----------------------------------------------------------------------

	Copyright (c) GeoWorks 1988 -- All Rights Reserved

PROJECT:	PC GEOS
FILE:		bitmap.temp

AUTHOR:		Jon Witort

REVISION HISTORY:
	Name	Date		Description
	----	----		-----------
	Jon	1/91		Initial version

DESCRIPTION:
	This file contains the definitions for the bitmap library.

	$Id: bitmap.def,v 1.1 97/04/04 14:22:43 newdeal Exp $
------------------------------------------------------------------------------@
SetDef __BITMAP

StartLibrary	bitmap

include ui.def
include graphics.def
include ec.def

BITMAP_TEXT	equ	0

;------------------------------------------------------------------------
;		VisBitmapToolControlClass
;------------------------------------------------------------------------
VisBitmapNotifyCurrentTool	struct
	VBNCT_toolClass		fptr.ClassStruct
VisBitmapNotifyCurrentTool	ends

VisBitmapNotifyCurrentFormat	struct
	VBNCF_format		BMFormat
	VBNCF_xdpi		word		;pixels per inch
	VBNCF_ydpi		word		;pixels per inch
	VBNCF_width		word		;width of the bitmap (points)
	VBNCF_height		word		;height of the bitmap (points)
VisBitmapNotifyCurrentFormat	ends

;
; GenApplication GCN lists to be placed on:
;	GAGCNLT_SELF_LOAD_OPTIONS


VisBitmapToolControlClass	class	GenControlClass
MSG_VBTC_SET_TOOL					message
MSG_VBTC_GET_TOOL_CLASS					message

ATTR_VIS_BITMAP_TOOL_CONTROL_POSITION_FOR_ADDED_TOOLS	vardata	word

VBTCFeatures	record
	VBTCF_SELECTION		: 1
	VBTCF_PENCIL		: 1
	VBTCF_ERASER		: 1
	VBTCF_LINE		: 1
	VBTCF_RECT		: 1
	VBTCF_DRAW_RECT		: 1
	VBTCF_ELLIPSE		: 1
	VBTCF_DRAW_ELLIPSE	: 1
	VBTCF_FLOOD_FILL	: 1
	VBTCF_FATBITS		: 1
VBTCFeatures	end

WORKING_VBTC_FEATURES	equ	mask VBTCFeatures and \
				not mask VBTCF_DRAW_RECT and \
				not mask VBTCF_DRAW_ELLIPSE

VBTC_DEFAULT_FEATURES		equ	WORKING_VBTC_FEATURES
VBTC_DEFAULT_TOOLBOX_FEATURES	equ	WORKING_VBTC_FEATURES
VisBitmapToolControlClass	endc


VisBitmapFormatControlClass	class	GenControlClass
MSG_VBFC_SET_FORMAT				message
MSG_VBFC_ESTIMATE_BITMAP_SIZE			message
MSG_VBFC_SET_FORMAT_NOW				message

VBFCFeatures	record
	:10
	VBFCF_8BIT		: 1
	VBFCF_MONO		: 1
	VBFCF_4BIT		: 1
	VBFCF_72_DPI		: 1
	VBFCF_300_DPI		: 1
	VBFCF_CUSTOM_DPI	: 1
VBFCFeatures	end

VBFC_DEFAULT_FEATURES		equ	mask VBFCFeatures
VBFC_DEFAULT_TOOLBOX_FEATURES	equ	mask VBFCFeatures

; Added to allow features to be turned off in controller
;
TempVisBitmapFormatInstance	struct
    TVBFI_format		BMFormat
    TVBFI_resolution		word
TempVisBitmapFormatInstance	ends

TEMP_VIS_BITMAP_FORMAT_INSTANCE	vardata	TempVisBitmapFormatInstance

VisBitmapFormatControlClass	endc

VisBitmapEditBitmapParams	struct
	
	VBEBP_token		word
	VBEBP_ax		word
	VBEBP_bx		word
	VBEBP_cx		word
	VBEBP_dx		word

	VBEBP_invalRect		Rectangle
	
	VBEBP_maskColor		word
	VBEBP_routine           fptr    ;callback passed di = gstate handle
	VBEBP_maskRoutine       fptr    ;callback passed di = bitmap's mask
					;callbacks must be vfptr for XIP geodes

VisBitmapEditBitmapParams	ends

VisBitmapSetTransferGStringParams	struct

	VBSTGSP_vmFile		hptr
	VBSTGSP_vmBlock		word
	VBSTGSP_location	Point

VisBitmapSetTransferGStringParams	ends

;------------------------------------------------------------------------
;		VisBitmapToolItemClass
;------------------------------------------------------------------------
VisBitmapToolItemClass		class	GenItemClass

MSG_VBTI_GET_TOOL_CLASS		message
;
;	Returns the class of the tool this list entry represents
;
;	PASS:		nothing
;
;	RETURN:		cx:dx = class of tool
;

MSG_VBTI_SELECT_SELF_IF_MATCH		message
;
;	Object selects itself as the exclusive if the passed data match
;	the entry's instance data.
;
;	PASS:		cx:dx = class of tool
;
;	RETURN:		nothing
;

	VBTII_toolClass		fptr.ClassStruct

VisBitmapToolItemClass		endc


;------------------------------------------------------------------------------
;	VisBitmap Class
;------------------------------------------------------------------------------
VisBitmapClass	class	VisClass
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;
;				METHODS
;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

MSG_VIS_BITMAP_SET_VM_FILE		message
;
; Set the default file handle with which the bitmap object is associated.
;
;	If the VisBitmap's object block is within a VM file, then that
;	file is used (and sending this message won't affect anything).
;
; Pass:
;	cx - VMFileHandle
; Return:
;	none

MSG_VIS_BITMAP_GET_VM_FILE		message
;
; Return the file handle where the bitmap stores its bitmap data
;
; Pass:
;	nothing
; Return:
;	ax - VMFileHandle

MSG_VIS_BITMAP_CREATE_BITMAP		message
;
;	Allocates a bitmap and initizes it. Also allocates a
;	backup bitmap if VBUF_USES_BACKUP_BITMAP is set in the VisBitmap's
;	instance data.
;
;PASS:		cx,dx	= width. height of bitmap in pixels to be allocated
;		bp 	= gstring to initialize bitmap with (0 for none)
;
;RETURN:	nothing
;


MSG_VIS_BITMAP_CREATE_TOOL		message
;
;	Creates a tool of the passed class.
;
;	PASS:		cx:dx = class pointer of desired tool type
;
;	RETURN:		^lcx:dx = new tool
;


MSG_VIS_BITMAP_CREATE_BACKUP_BITMAP	message
;
;	Creates a backup bitmap if needed. No need to send this message
;	if you sent a MSG_VIS_BITMAP_CREATE_BITMAP already
;
;PASS:		nothing
;
;RETURN:	nothing
;

;
;  not yet implemented
;
VisBitmapBecomeDormatFlags	record
	VBBDF_KILL_MAIN_GSTATE : 1
	VBBDF_KILL_SCREEN_GSTATE : 1
	VBBDF_KILL_BACKUP_GSTATE : 1
	VBBDF_KILL_BACKUP_THREAD : 1
	VBBDF_KILL_BACKUP_BITMAP : 1
	VBBDF_KILL_TOOL : 1
	VBBDF_KILL_TRANSFER_GSTRING : 1
VisBitmapBecomeDormatFlags	end

MSG_VIS_BITMAP_BECOME_DORMANT	message
;
;	Destroys any possible data structures related to editing
;	the VisBitmap, presumably to free up memory when it is expected
;	that it won't be used.
;
;	The VisBitmap is written in an "allocate as necessary" style,
;	meaning that gstates and backup bitmaps, etc., are generated on
;	an as needed basis. Ergo, this message has no opposite.
;
;PASS:		nothing
;
;RETURN:	nothing
;

RectAndGState	struct
	RAG_rect	Rectangle
	RAG_gstate	hptr.GState
RectAndGState	ends

RectDWFixed	struct
	RDWF_left	DWFixed
	RDWF_top	DWFixed
	RDWF_right	DWFixed
	RDWF_bottom	DWFixed
RectDWFixed	ends

MSG_VIS_BITMAP_RESIZE_REAL_ESTATE		message
;
;	Resizes the bitmap's dimensions and draws itself through a gstate
;	into the newly resized bitmap
;
;	PASS:		ss:bp = RectAndGState:
;
;			RAG_gstate = gstate to transform original bitmap
;					through before drawing to newly resized
;					bitmap
;
;			RAG_rect = new bitmap coordinates (in old
;					bitmap coordinates)
;
;	RETURN:		nothing
;


MSG_VIS_BITMAP_GET_BITMAP_SIZE_IN_PIXELS		message
;
;	Return the size of the bitmap in pixels
;
;	PASS:		nothing
;
;	RETURN:		cx,dx = width,height of bitmap in points


MSG_VIS_BITMAP_GET_BITMAP_SIZE_IN_POINTS		message
;
;	Return the size of the bitmap in points
;
;	PASS:		nothing
;
;	RETURN:		cx,dx = width,height of bitmap in points


MSG_VIS_BITMAP_MOVE_INSIDE_VIS_BOUNDS		message
;
;	Move the bitmap around inside its vis bounds. If any area in
;	the bitmaps coordinates outside the bitmap is exposed, the
;	bitmap is expanded.
;
;	PASS:		cx,dx = x,y to move bitmap relative to vis bounds
;
;	RETURN:		nothing
;


MSG_VIS_BITMAP_CONTORT				message
;
;	(For lack of a better name) this method takes an arbitrary
;	gstate and translates the bitmap through it. It resizes
;	itself to accomodate any size changes that may occur as
;	a result.
;
;	PASS:		bp = gstate to contort through
;
;	RETURN:		nothing
;


MSG_VIS_BITMAP_VIS_BOUNDS_MATCH_BITMAP_BOUNDS	message
;
;	Sets the VisBitmap's vis bounds to match its bitmap bounds
;
;	PASS:		nothing
;
;	RETURN:		nothing
;


MSG_VIS_BITMAP_BITMAP_BOUNDS_MATCH_VIS_BOUNDS	message
;
;	Sets the VisBitmap's bitmap bounds to match its vis bounds
;
;	PASS:		nothing
;
;	RETURN:		nothing
;


MSG_VIS_BITMAP_BACKUP_GSTRING_TO_BITMAP	message
;
;	Writes the last edit (stored in a temporary gstring) into a bitmap
;
;PASS:
;	bp = gstate to draw to
;	cx = gstate of gstring to draw
;	dx = mem handle to free after drawing (0 for none)
;
;RETURN:
;	nothing
;	


MSG_VIS_BITMAP_DRAW_BITMAP_TO_GSTATE	message
;
;	Draw the main bitmap to the passed gstate
;
;PASS:		bp = gstate
;		cx,dx - coordinates to draw the bitmap at
;
;RETURN:	nothing
;


MSG_VIS_BITMAP_CREATE_SCRATCH_GSTRING	message
;
;	Creates a gstring for tools to write temporary changes to.
;
;PASS:		nothing
;
;RETURN:	bp = gstring
;		dx = mem handle allocated fromm gstring
;

if BITMAP_TEXT
MSG_VIS_BITMAP_PREPARE_VTFB		message
;
;	Prepares the VisTextForBitmaps for editing
;
;PASS:		cx,dx = desired location of VTFB
;
;RETURN:	nothing
;

MSG_VIS_BITMAP_GET_VTFB_OD		message
;
;	Returns the OD of the VisBitmap's VisTextForBitmaps. If none exists,
;	one is instantiated, and its OD is returned.
;
;PASS:		nothing
;
;RETURN:	^lcx:dx = VTFB

endif

MSG_VIS_BITMAP_GET_SCREEN_GSTATE	message
;
;	Returns a gstate for drawing to the screen
;
;	PASS:		nothing
;
;	RETURN:		bp = screen gstate
;

VisBitmapMouseManagerRequestTypes		etype	word
VBMMRT_GRAB_MOUSE		enum	VisBitmapMouseManagerRequestTypes
VBMMRT_SEND_ALL_PTR_EVENTS	enum	VisBitmapMouseManagerRequestTypes
VBMMRT_RELEASE_MOUSE		enum	VisBitmapMouseManagerRequestTypes

MSG_VIS_BITMAP_MOUSE_MANAGER		message
;
;	Handles mouse related requests from the tools
;
;	PASS:		bp = VisBitmapMouseManagerRequestTypes
;
;	RETURN:		nothing
;


VisBitmapGetEditingGStatesParams struct

	VBGEGSP_requestor	optr
	VBGEGSP_finishMsg	word
	VBGEGSP_undoTitle	optr

VisBitmapGetEditingGStatesParams ends

MSG_VIS_BITMAP_GET_EDITING_GSTATES		message
;
;	Inform the bitmap that an edit is about to begin.
;
;	PASS:		ss:[bp] - VisBitmapGetEditingGStatesParams
;
;	RETURN:		cx - edit ID to be passed to VisBitmapEditBitmap
;			bp - screen gstate
;

MSG_VIS_BITMAP_NOTIFY_CURRENT_EDIT_FINISHED		message
;
;	Informs the bitmap that the tool is done editing.
;
;	PASS:		cx - edit ID returned by MSG_VIS_BITMAP_GET_EDITING_GSTATES
;
;	RETURN:		nothing
;

MSG_VIS_BITMAP_FORCE_CURRENT_EDIT_TO_FINISH	message
;
;	Force the current tool to end any editing.
;
;PASS:		nothing
;RETURN:	nothing


if BITMAP_TEXT
MSG_VIS_BITMAP_CHECK_TEXT_HEIGHT		message
;
;	Determines whether or not the text object would grow out of the
;	bitmap's bounds if it were resized to the passed height; if so,
;	the maximum height for which the text object will not run out
;	of bounds is returned.
;
;	PASS:		cx = top of text object IN DOCUMENT COORDINATES
;			dx = proposed height of text object
;
;	RETURN:		dx= height text object should use in resizing


MSG_VIS_BITMAP_CREATE_VTFB		message
;
;	Creates a VisTextForBitmaps object for the VisBitmap to use.
;
;	PASS:		nothing
;
;	RETURN:		^lcx:dx = newly created VisTextForBitmaps object

endif

MSG_VIS_BITMAP_WRITE_CHANGES		message
;
;	Takes any edits that are stored in the temporary workspace and
;	writes them into the bitmap (so that they can no longer be undone).
;
;	PASS:		nothing
;
;	RETURN:		nothing


MSG_VIS_BITMAP_UNDO			message
;
;	Undoes the last user edit so that it will not be written into the
;	main (permanent) bitmap.  Calling this method a second time will
;	reinstate the user edits (undo the undo).
;

;	PASS:		nothing
;
;	RETURN:		nothing


MSG_VIS_BITMAP_GET_MAIN_GSTATE			message
;
;	Returns the gstate handle to the object's main bitmap
;
;	PASS:		nothing
;
;	RETURN:		bp = gstate


MSG_VIS_BITMAP_GET_MAIN_BITMAP			message
;
;	Returns the bitmap handle to the object's main bitmap
;
;	PASS:		nothing
;
;	RETURN:		cx = vm file handle
;			dx = vm block handle

MSG_VIS_BITMAP_GET_BACKUP_GSTATE			message
;
;	Returns the gstate handle to the object's backup bitmap
;
;	PASS:		nothing
;
;	RETURN:		bp = gstate (0 for no backup bitmap)


MSG_VIS_BITMAP_GET_BACKUP_BITMAP			message
;
;	Returns the bitmap handle to the object's backup bitmap
;
;	PASS:		nothing
;
;	RETURN:		cx = vm file handle 
;			dx = vm block handle (0 for no backup bitmap)


MSG_VIS_BITMAP_CLIP_GSTATE_TO_VIS_BOUNDS	message
;
;	Set the clip rect of the passed gstate to the vis bounds
;	of the bitmap.
;
;	PASS		bp - gstate
;
;	RETURN		bp - gstate with clip rect set


MSG_VIS_BITMAP_COPY_SELECTION		message
;
;	Returns a gstring representing the selected area
;
;	PASS:		cx - vm file handle
;			dx - vm block handle
;
;	RETURN:		nothing

MSG_VIS_BITMAP_SPAWN_SELECTION_ANTS		message
;
;	Starts a continual timer which instucts the bitmap to hilight the
;	selected region.
;
;	PASS:		nothing
;
;	RETURN:		nothing
;

MSG_VIS_BITMAP_KILL_SELECTION_ANTS		message
;
;	Kills the timer which instucts the bitmap to hilight the
;	selected region.
;
;	PASS:		nothing
;
;	RETURN:		nothing
;

MSG_VIS_BITMAP_DRAW_SELECTION_ANTS		message
;
;	Stroke the selection path with the current ant mask
;
;	PASS:		nothing
;
;	RETURN:		nothing

MSG_VIS_BITMAP_MAKE_SURE_NO_SELECTION_ANTS		message
;
;	Ensure that there are no selection ants currently on screen.
;	This method doesn't kill the timer (MSG_VIS_BITMAP_KILL_SELECTION_ANTS
;	does), only erases the current ants momentarily.
;
;	PASS:		nothing
;
;	RETURN:		nothing

MSG_VIS_BITMAP_ADVANCE_SELECTION_ANTS		message
;
;	Change the selection ant mask to give the illusion of marching ants.
;
;	PASS:		nothing
;
;	RETURN:		nothing

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;
;	The following methods are defined in bitmapGState.asm
;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

MSG_VIS_BITMAP_SET_AREA_COLOR		message
;
;	Sets the area color for the object
;
;	PASS:		ch - flag:
;				enum of type ColorFlag:
;					CF_INDEX (0)
;						cl = index
;					CF_RGB (1)
;						cl = red
;						dl = green
;						dh = blue
;
;	RETURN:		ch = CF_RGB
;			cl, dh, dl = red, blue, green
;
;			(i.e., if you passed the color as an index, it
;			is converted to RGB)

MSG_VIS_BITMAP_SET_LINE_COLOR		message
;
;	Sets the line color for the object
;
;	PASS:		ch - flag:
;				enum of type ColorFlag:
;					CF_INDEX (0)
;						cl = index
;					CF_RGB (1)
;						cl = red
;						dl = green
;						dh = blue
;
;	RETURN:		ch = CF_RGB
;			cl, dh, dl = red, blue, green
;
;			(i.e., if you passed the color as an index, it
;			is converted to RGB)

MSG_VIS_BITMAP_SET_BACK_COLOR		message
;
;	Sets the background color for the object
;
;	PASS:		ch - flag:
;				enum of type ColorFlag:
;					CF_INDEX (0)
;						cl = index
;					CF_RGB (1)
;						cl = red
;						dl = green
;						dh = blue
;
;	RETURN:		ch = CF_RGB
;			cl, dh, dl = red, blue, green
;
;			(i.e., if you passed the color as an index, it
;			is converted to RGB)

MSG_VIS_BITMAP_SET_LINE_WIDTH		message
;
;	Sets the line width for the object
;
;	PASS:		cx = line width
;
;	RETURN:		nothing

if BITMAP_TEXT

MSG_VIS_BITMAP_SET_TEXT_COLOR		message
;
;	Sets the text color in the bitmap's text object
;
;	PASS:		ch - flag:
;				enum of type ColorFlag:
;					CF_INDEX (0)
;						cl = index
;					CF_RGB (1)
;						cl = red
;						dl = green
;						dh = blue
;
;	RETURN:		nothing

endif

MSG_VIS_BITMAP_SET_GSTATE_STUFF		message
;
;	Sets the area color for the object
;
;	PASS:		ss:bp = pointer to VisBitMapGraphicsStateStuff record
;
;	RETURN:		nothing

MSG_VIS_BITMAP_APPLY_GSTATE_STUFF	message
;
;	Applies the data in the object's BitmapGStateStuff instance data
;	to the passed gstate.
;
;	PASS:		bp = gstate
;
;	RETURN:		nothing

MSG_VIS_BITMAP_CREATE_GSTRING_TRANSFER_FORMAT		message
;
;	Generates a gstring representing the current selection
;
;	PASS:		bp - vm file handle
;			cx,dx - origin or gstring
;
;	RETURN:		carry set if successful
;				ax - vm block handle of transfer item
;				cx,dx - wdith, height of transfer

MSG_VIS_BITMAP_SET_TRANSFER_GSTRING			message
;
;	Sets the passed gstring to be the VisBitmap's "transfer gstring",
;	(the gstring that floats on top of the bitmap during pasting
;	operations).
;
;	PASS:		ss:[bp] - VisBitmapSetTransferGStringParams
;
;	RETURN:		nothing
;


MSG_VIS_BITMAP_NOTIFY_CURRENT_TOOL_CHANGE		message
;
;	Sends a tool-related notification.
;
;	PASS:		nothing
;
;	RETURN:		nothing
;


MSG_VIS_BITMAP_NOTIFY_CURRENT_FORMAT_CHANGE		message
;
;	Sends a format-related notification.
;
;	PASS:		nothing
;
;	RETURN:		nothing
;

MSG_VIS_BITMAP_NOTIFY_SELECT_STATE_CHANGE		message
;
;	Sends a select state-related notification.
;
;	PASS:		nothing
;
;	RETURN:		nothing
;


MSG_VIS_BITMAP_CREATE_TRANSFER_FORMAT		message
; 
; Save the VisBitmap's bitmap in the passed VM file so that it can be
; later extracted by MSG_VIS_BITMAP_REPLACE_WITH_TRANSFER_FORMAT.
;
; Context:	Probably sent to a vis bitmap object some kind of managing
;		object (ie, a grobj BitmapGuardian)
; Source:	Some kind of "paste" operation 
; Destination:  VisBitmap
; Interception: Unlikely
;
;
; Pass:		cx - VM file handle in which to create transfer data
;			
; Return:	ax - vm block
;
; Destroyed:	nothing 



MSG_VIS_BITMAP_REPLACE_WITH_TRANSFER_FORMAT	message
; 
; Replace the VisBitmap's bitmap with the one passed in the VM chain
;
; Context:	Probably sent to a vis bitmap object some kind of managing
;		object (ie, a grobj BitmapGuardian)
; Source:	Some kind of "paste" operation 
; Destination:  VisBitmap
; Interception: Unlikely
;
; Pass:		cx - vm file handle of transfer file
;		dx - vm block handle (same as that returned by 
; 			MSG_VIS_BITMAP_CREATE_TRANSFER_FORMAT)
;			
; Return:	nothing
;
; Destroyed:	ax


MSG_VIS_BITMAP_SET_FORMAT_AND_RESOLUTION	message
; 
; Set the bitmap's BMFormat and resolution, converting the existing
; bitmap if necessary.
;
; Context:	User requests change
; Source:	UI (perhaps a VisBitmapFormatControl?)
; Destination:  VisBitmap
; Interception: Unlikely
;
;
; Pass:		cl - BMFormat
;		dx - x dpi
;		bp - y dpi
;			
; Return:	nothing
;
; Destroyed:	ax

MSG_VIS_BITMAP_EDIT_BITMAP			message
; 
; Call a graphics routine on all of the VisBitmap's relevant gstates
; (screen, bitmap, backup bitmap, etc.)
;
; Context:	Some object (likely a tool) wants to edit the bitmap.
; Source:	VisBitmap having received a
;		MSG_VIS_BITMAP_REQUEST_EDITING_GSTATES to ensure that all
;		relevant gstates have been allocated.
; Destination:  VisBitmap
; Interception: Subclass could intercept if additional gstates need updating
;		during editing.
;
; Pass:		ss:[bp] - VisBitmapEditBitmapParams
;
;		ss:[bp].VBEBP_routine protocol should look like:
;
;			PASS:	di - gstate
;				ax,bx,cx,dx - as passed with
;					      MSG_VIS_BITMAP_EDIT_BITMAP in
;					      VisBitmapEditBitmapParams
;
;			RETURN:	nothing
;
; Return:	nothing
;
; Destroyed:	ax


MSG_VIS_BITMAP_DISPLAY_INTERACTIVE_FEEDBACK			message
; 
; Call a graphics routine on all of the VisBitmap's relevant gstates
; to refect an edit-in-progress.
;
; Context:	Some object (likely a tool) is editing the bitmap and
;		wants to inform the user about the current state of the
;		edit
; Source:	Unrestricted (likely a drag-type tool)
; Destination:  VisBitmap
; Interception: Subclass could intercept if additional gstates need updating
;		during editing.
;
; Pass:		ss:[bp] - VisBitmapEditBitmapParams
;
;		ss:[bp].VBEBP_routine protocol should look like:
;
;			PASS:	di - gstate
;				ax,bx,cx,dx - as passed with
;					      MSG_VIS_BITMAP_EDIT_BITMAP in
;					      VisBitmapEditBitmapParams
;
;			RETURN:	nothing
;
; Return:	nothing
;
; Destroyed:	ax

MSG_VIS_BITMAP_INITIATE_FATBITS			message
; 
; Initiates a window containing fatbits for the main bitmap.
;
; Context:	User wants to edit fatbits
; Source:	Unrestricted (likely a fatbits tool)
; Destination:  VisBitmap
; Interception: Unlikely
;
; Pass:		cx,dx - bitmap location about which to center fatbits
;		bp - 	ImageBitSize
;
; Return:	nothing
;
; Destroyed:	ax

MSG_VIS_BITMAP_SET_VIS_BOUNDS 	message
;
; 	Sets the vis bounds of the object.  It is sent from the VisBitmapClass
; object to itself when it senses that its Vis bounds should change.
; App writers may want to subclass the VisBitmap to examine the passed
; rectangle, modify it, and set the bounds itself
;
; Pass:	ss:[bp] - A Rectangle structure containing (desired)
;		new Vis Bounds
; Return: nothing
; Destroyed: nothing

		
MSG_VIS_BITMAP_INVALIDATE_IF_TRANSPARENT	message
;
;	Visually invalidates the bitmap if its VBUF_TRANSPARENT bit is
;	set.
;
;	PASS:		nothing
;
;	RETURN:		nothing
;

MSG_VIS_BITMAP_GET_TRANSFER_BITMAP	message
;
;	Returns the VM block handle and position of the bitmap's
;	transfer gstring, if any. The VM block is within the VM file
;	accessible by MSG_VIS_BITMAP_GET_VM_FILE
;
;	PASS:		nothing
;
;	RETURN:		bp - VM block handle (0 for none)
;			cx,dx - position of transfer bitmap in bitmap coords
;

MSG_VIS_BITMAP_DRAW_BACKUP_BITMAP_TO_GSTATE	message
;
;	For jon's use only
;

MSG_VIS_BITMAP_SET_FATBITS_MODE			message
;
;  Notifies the VisBitmap to turn on or turn off fatbits mode. This is
;  normal sent by the fatbits object itself, to turn on fatbits on a
;  start select, and to turn it off on an end select.
;
;	PASS:		cx - nonzero for fatbits mode
;
;	RETURN:		nothing

MSG_VIS_BITMAP_DESTROY_SCREEN_GSTATE			message
;
;
;	PASS:		nothing
;
;	RETURN:		nothing

MSG_VIS_BITMAP_GET_INTERACTIVE_DISPLAY_GSTATE		message
;
;	Returns the gstate the bitmap should use to display interactive
;	feedback in the bitmap (this will either be the main bitmap, or
;	the copy stored in vardata
;
;	PASS:		nothing
;
;	RETURN:		^hbp - GState to draw to
;

MSG_VIS_BITMAP_GET_INTERACTIVE_DISPLAY_BITMAP		message
;
;	Returns the bitmap that the fatbits window should use when drawing.
;
;	PASS:		nothing
;
;	RETURN:		cx - vm file handle
;			dx - vm block handle to bitmap
;

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;
;				INSTANCE DATA
;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
VisBitmapUndoFlags	record
	VBUF_EXPOSED_HAPPENING : 1
	VBUF_HAD_SELECTION_BEFORE_LAST_ACTION : 1
	VBUF_MOUSE_EVENTS_IN_BITMAP_COORDS : 1
	VBUF_ANTS_DRAWN : 1
	VBUF_TRANSPARENT : 1
	VBUF_LAST_EDIT_UNDONE : 1
	VBUF_USES_BACKUP_BITMAP : 1
	VBUF_UNDOABLE : 1
VisBitmapUndoFlags	end

VisBitmapKit	struct
	VBK_bitmap	word		;offset within vm file
	VBK_gstate	hptr.GState
VisBitmapKit	ends

	VBI_undoFlags			VisBitmapUndoFlags

	VBI_vmFile			hptr.VMFileHandle
	noreloc VBI_vmFile

	VBI_mainKit	VisBitmapKit
	noreloc VBI_mainKit
	VBI_backupKit	VisBitmapKit
	noreloc VBI_backupKit

VisBitmapEditingKit	struct
	VBEK_screen			hptr.GState
	VBEK_bitmap			hptr.GState
	VBEK_gstring			hptr.GState
	VBEK_memBlock			hptr.LMemBlockHeader
VisBitmapEditingKit	ends

	VBI_editingKit			VisBitmapEditingKit
	noreloc VBI_editingKit
	;
	;	VBI_gStateStuff contains some graphics state information
	;	that should be used whenever writing to the main bitmap
	;

;
;	BitMapGraphicsStateStuff contains some preferred GState settings
;	for the bitmap. The colors are stored in the following format:
;
;		high byte of high word - flag:
;			enum of type ColorFlag:
;				CF_INDEX (0)
;					low byte of high word = index
;					low word = garbage
;				CF_RGB (1)
;					low byte of high word = red
;					high byte of low word = blue
;					low byte of low word = green
;
VisBitmapGraphicsStateStuff	struct
	VBGSS_areaColor		dword
	VBGSS_lineColor		dword
	VBGSS_backColor		dword
	VBGSS_lineWidth		word
VisBitmapGraphicsStateStuff	ends

	VBI_gStateStuff			VisBitmapGraphicsStateStuff

	;
	;	VBI_screenGState will contain a graphics state with a
	;	window on the screen when the user is making edits that must
	;	show up both in the bitmap and on the screen (this will
	;	usually be the case).
	;
	VBI_screenGState		hptr.GState
	noreloc	VBI_screenGState
	VBI_transferGString		hptr.GState
	noreloc	VBI_transferGString
	VBI_transferGStringPos		Point
	VBI_transferBitmap		lptr
	VBI_transferBitmapPos		Point

	VBI_lastEdit			hptr.GState
	noreloc VBI_lastEdit

	;
	;	Handle to the process thread that updates the backup
	;	bitmap. Ya know what I mean.
	;
	VBI_backupThread		hptr.HandleThread
	noreloc VBI_backupThread

	;
	;	VBI_visText contains the pointer to the VisText object
	;	associated with this VisBitmap
	;
if BITMAP_TEXT
	VBI_visText			optr
endif

	VBI_tool			optr
	VBI_mouseGrab			optr

	VBI_antTimer			hptr.HandleTimer
	noreloc VBI_antTimer
	VBI_antMaskOffset		word
	VBI_bitmapToVisHOffset		word
	VBI_bitmapToVisVOffset		word
	VBI_bmFormat			BMFormat
	VBI_xResolution			word
	VBI_yResolution			word
	VBI_finishEditingOD		optr
	VBI_finishEditingMsg		word

	VBI_fatbits			optr
	noreloc VBI_fatbits
	VBI_fatbitsWindow		optr
	noreloc VBI_fatbitsWindow

	;
	; The number of unended start undo chains this bitmap has
	; registered so far
	;
	VBI_undoDepth			word

	;
	; The number of undo actions registed in the current chain
	;

	VBI_nUndoActions		word

	;
	; Misc options.
	;

VisBitmapDisplayKit	struct
	VBDK_bitmap	word		;offset within vm file
	VBDK_gstate	word		
VisBitmapDisplayKit	ends

ATTR_BITMAP_INTERACTIVE_DISPLAY_KIT		vardata	VisBitmapDisplayKit

ATTR_BITMAP_DO_NOT_COMPACT_BITMAP	vardata

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;
;				FATAL ERRORS
;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
	;
	;	BITMAP_NOT_ALLOCATED is our error for when GrCreateBitmap
	;	chokes and returns nothing
	;
	BITMAP_NOT_ALLOCATED				enum	FatalErrors

	PASSED_AND_RETURNED_GSTRINGS_ARE_DIFFERENT	enum	FatalErrors
	NULL_TOOL_KNOWS_GSTATE_HANDLE?			enum	FatalErrors
	OPERATION_REQUIRES_BITMAP			enum	FatalErrors
	NO_PASSED_VM_FILE_AND_VIS_BITMAP_NOT_IN_VM_BLOCK enum	FatalErrors
	VIS_BITMAP_FREEING_TOOL_WITH_MOUSE_GRAB		 enum	FatalErrors

VisBitmapClass	endc

;------------------------------------------------------------------------------
;	BitmapBackupProcess Class
;------------------------------------------------------------------------------
BitmapBackupProcessClass	class	ProcessClass

MSG_BACKUP_GSTRING_TO_BITMAP		message
;
;	Writes the last user edit from the temporary store space
;	out into the main bitmap.
;
;PASS:		bp = gstate of bitmap to draw to
;		cx = gstate of gstring to draw
;		dx = memory handle of gstring *if* you want it freed,
;		     0 otherwise
;
;RETURN:	nothing
;

BitmapBackupProcessClass	endc


;------------------------------------------------------------------------------
;	Tool Class
;------------------------------------------------------------------------------
ToolClass	class	MetaClass
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;
;				METHODS
;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
MSG_TOOL_DRAW			message
MSG_TOOL_ENABLE_CONSTRAIN	message
MSG_TOOL_DISABLE_CONSTRAIN	message

MSG_TOOL_AFTER_CREATE		message
MSG_TOOL_TEST_POINT_IN_BOUNDS	message
MSG_TOOL_REQUEST_EDITING_KIT	message
MSG_TOOL_FINISH_EDITING		message

MSG_TOOL_GET_POINTER_IMAGE	message
;
;	Returns the PointerDef representing the tool
;
;	PASS:		nothing
;
;	RETURN:		if tool has a pointer image:
;
;			ax = mask MRF_SET_POINTER_IMAGE
;			^lcx:dx = PointerDef
;
;			else:
;
;			ax = 0
;

MSG_TOOL_SET_FATBITS_MODE		message
;
;  Notifies the tool to turn on or turn off fatbits mode
;
;	PASS:		cx - nonzero for fatbits mode
;
;	RETURN:		nothing

MSG_TOOL_CONSTRAIN_MOUSE		message
;
;  Lets the tool have a go at constraining the mouse
;
;	PASS:		cx,dx - initial mouse location
;
;	RETURN:		cx,dx - constrained

MSG_TOOL_CLEANUP_AFTER_EXPOSE		message

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;
;			STRUCTURES/RECORDS/ENUMS
;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;


ToolEditingKit	struct

	TEK_screenGState	hptr.GState
	TEK_gstate1		hptr.GState
	TEK_gstate2		hptr.GState

ToolEditingKit	ends



;
;	ConstrainStrategy contains the information needed to implement
;	the constrain feature for various tools. There is a table of these
;	records (one for each tool) in the file 'ptrTool.asm'
;
ConstrainStrategy	record
	: 10

	;
	;	The following 4 flags are set if the corresponding axis
	;	is OK to constrain to; i.e., constrain will map the
	;	coordinates to the closest OK axis.
	;
	;	CS_X_AXIS:			The horizontal axis
	;
	;	CS_Y_AXIS:			The vertical axis
	;
	;	CS_X_EQUALS_Y_AXIS:		The diagonal axis with
	;					slope = 1 (Runs from top left
	;					to bottom right of screen)
	;
	;	CS_X_EQUALS_MINUS_Y_AXIS:	The diagonal axis with
	;					slop = -1 (Runs from bottom
	;					left to top right of screen)
	;
	;
	;	For those graphically minded readers, here's a little picture.
	;
	;
	;	     x ->
	;
	;      A     Y     B
	;	\    |    /
	;	 \   |   /
	;	  \  |  /
	;	   \ | /
	;	    \|/
	;  y	-----+-----X
	;  	    /|\
	;  |	   / | \
	;  v	  /  |  \
	;	 /   |   \
	;	/    |    \
	;
	;
	;
	;	The axis labeled X corresponds to CS_X_AXIS
	;	The axis labeled Y corresponds to CS_Y_AXIS
	;	The axis labeled A corresponds to CS_X_EQUALS_Y_AXIS
	;	The axis labeled B corresponds to CS_X_EQUALS_MINUS_Y_AXIS
	;
	;	Notice that the CS_X_EQUALS_MINUS_Y_AXIS actually runs from
	;	top left to lower right, contrary to the way it always was
	;	in your geometry class, due to the fact that y increases as
	;	you go down.
	;
	CS_X_AXIS : 1
	CS_Y_AXIS : 1
	CS_X_EQUALS_Y_AXIS : 1
	CS_X_EQUALS_MINUS_Y_AXIS : 1

	;
	;	CS_INITIAL_DIRECTION should be set if the first axis
	;	constrained to should be the only axis to be constrained
	;	to on future calls.
	;
	CS_INITIAL_DIRECTION : 1

	;
	;	CS_NEVER_CONSTRAIN set if the tool should never be constrained
	;
	CS_NEVER_CONSTRAIN : 1
ConstrainStrategy	end

;
;	CS_DIAGONAL_CONSTRAINT = axes sith slopes 1, -1
;
;	CS_HV_CONSTRAINT = horizontal and vertical axes
;
;	CS_ALL_CONSTRAINT = both of the above
;
;	p.s.	I don't know whether or not you have an opinion on the
;		terminology I've used here, but I personally think that
;		it STINKS. The reason is that this constaint is masquerading
;		as a ConstrainStrategy flag (the leading CS_), but unlike
;		true flags is used WITHOUT the 'mask' operator. This pisses
;		me off, but seems to be an accepted tradition. Watch this
;		space for further updates.
;
CS_DIAGONAL_CONSTRAINT = mask CS_X_EQUALS_Y_AXIS or \
			 mask CS_X_EQUALS_MINUS_Y_AXIS

CS_HV_CONSTRAINT = mask CS_X_AXIS or mask CS_Y_AXIS

CS_ALL_CONSTRAINT = CS_DIAGONAL_CONSTRAINT or CS_HV_CONSTRAINT

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;
;				INSTANCE DATA
;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
	TI_bitmap			optr
	TI_editToken			word
	TI_initialX			word
	TI_initialY			word
	TI_previousX			word
	TI_previousY			word

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;
;				FATAL ERRORS
;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

ToolClass	endc

;------------------------------------------------------------------------------
;	DragTool Class
;------------------------------------------------------------------------------
DragToolClass	class	ToolClass
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;
;				METHODS
;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

MSG_DRAG_TOOL_DRAW_OUTLINE	message

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;
;			STRUCTURES/RECORDS/ENUMS
;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;
;				INSTANCE DATA
;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;
;				FATAL ERRORS
;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

DragToolClass	endc

;------------------------------------------------------------------------------
;	LineTool Class
;------------------------------------------------------------------------------
LineToolClass	class	DragToolClass
LineToolClass	endc

;------------------------------------------------------------------------------
;	RectTool Class
;------------------------------------------------------------------------------
RectToolClass	class	DragToolClass
RectToolClass	endc

;------------------------------------------------------------------------------
;	DrawRectTool Class
;------------------------------------------------------------------------------
DrawRectToolClass	class	RectToolClass
DrawRectToolClass	endc

;------------------------------------------------------------------------------
;	EllipseTool Class
;------------------------------------------------------------------------------
EllipseToolClass	class	DragToolClass
EllipseToolClass	endc

;------------------------------------------------------------------------------
;	DrawEllipseTool Class
;------------------------------------------------------------------------------
DrawEllipseToolClass	class	EllipseToolClass
DrawEllipseToolClass	endc

;------------------------------------------------------------------------------
;	PencilTool Class
;------------------------------------------------------------------------------
PencilToolClass	class	ToolClass
PencilToolClass	endc

;------------------------------------------------------------------------------
;	EraserTool Class
;------------------------------------------------------------------------------
EraserToolClass	class	ToolClass

	ETI_radius	word

EraserToolClass	endc

;------------------------------------------------------------------------------
;	EraserTool Class
;------------------------------------------------------------------------------
FatbitsToolClass	class	ToolClass
FatbitsToolClass	endc

;------------------------------------------------------------------------------
;	FloodFillTool Class
;------------------------------------------------------------------------------

FloodFillToolClass	class	ToolClass
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;
;				METHODS
;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
MSG_FLOOD_FILL_TOOL_FILL_SCAN_LINE	message
MSG_FILL				message

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;
;			STRUCTURES/RECORDS/ENUMS
;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;
;				INSTANCE DATA
;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;


;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;
;				FATAL ERRORS
;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

FloodFillToolClass	endc

if BITMAP_TEXT

;------------------------------------------------------------------------------
;	TextTool Class
;------------------------------------------------------------------------------

TextToolClass	class	DragToolClass
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;
;				METHODS
;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;
;			STRUCTURES/RECORDS/ENUMS
;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;
;				INSTANCE DATA
;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

	TTI_visText	optr

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;
;				FATAL ERRORS
;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

TextToolClass	endc

endif

;------------------------------------------------------------------------------
;	SelectionTool Class
;------------------------------------------------------------------------------

SelectionToolClass	class	DragToolClass
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;
;				METHODS
;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;
;			STRUCTURES/RECORDS/ENUMS
;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
ANT_TIMER_PERIOD	equ	7
ANT_TIMER_DELAY		equ	0

;
;	The following constants are used to determine the "mode" that the
;	user is in. The three possible modes are:
;
;	1 - User clicked, then let up, so that no MSG_META_DRAG_SELECT came in.
;	2 - User is dragging open a new selected area
;	3 - User is moving around the current selected area
;
;	Modes 1 and 2 are represented by the negative constants below.
;	Mode 3 is represented by a 
SelectionMode	etype	byte
SM_START_WITHOUT_DRAG		enum	SelectionMode
SM_DEFINING_NEW_SELECTION	enum	SelectionMode
SM_MOVING_CURRENT_SELECTION	enum	SelectionMode

SELECTION_TOOL_PTR_WITHOUT_DRAG	enum	FatalErrors
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;
;				INSTANCE DATA
;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

	STI_selectedInitialX	word
	STI_selectedInitialY	word
	STI_selectedPreviousX	word
	STI_selectedPreviousY	word

	STI_selectedGString	hptr		;handle to selected gstring

	STI_dragX		word
	STI_dragY		word

	STI_selectionMode	SelectionMode

SelectionToolClass	endc

VisFatbitsClass	class	VisClass

MSG_VIS_FATBITS_INVALIDATE_RECTANGLE				message
MSG_VIS_FATBITS_SET_VIS_BITMAP					message
MSG_VIS_FATBITS_SET_IMPORTANT_LOCATION_AND_IMAGE_BIT_SIZE	message

	VFI_visBitmap		optr
	VFI_lastMouse		Point
	VFI_importantLocation	Point
	VFI_upperLeft		Point
	VFI_imageBitSize	ImageBitSize
	

VisFatbitsClass	endc

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;
;				Utility routines
;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;


global ToolGrabMouse:far
global ToolSendAllPtrEvents:far
global ToolReleaseMouse:far
global ToolCallBitmap:far
global DrawBitmapToGState:far

global TOOLGRABMOUSE:far
global TOOLSENDALLPTREVENTS:far
global TOOLRELEASEMOUSE:far
;;;global TOOLCALLBITMAP:far NOT SUPPORTED

global DRAWBITMAPTOGSTATE:far
global BitmapCopyClipboardToGString:far
global CopyBitmapToTransferFile:far

EndLibrary	bitmap
