COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

	Copyright (c) GeoWorks 1991 -- All Rights Reserved

PROJECT:	PC GEOS
FILE:		ruler.def

AUTHOR:		Gene Anderson, Jun 13, 1991

REVISION HISTORY:
	Name	Date		Description
	----	----		-----------
	eca	6/13/91		Initial revision


DESCRIPTION:
	Definitions for VisRuler class
		
	$Id: ruler.def,v 1.1 97/04/04 14:23:17 newdeal Exp $

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@

SetDef  __RULER

StartLibrary    ruler

;-----------------------------------------------------------------------------
;		Types & Constants
;-----------------------------------------------------------------------------

DEFAULT_GUIDE_INFLUENCE	equ	10		;default # of pixels within
						;which guidelines are active

VIS_RULER_HEIGHT equ 10
MAX_TICK_HEIGHT  equ 8

HALF_ROOT_2	equ 46341			;= 65536/2 * root 2

GridOptions record
	GO_SHOW_GRID	: 1
	GO_SNAP_TO_GRID : 1
	:6
GridOptions end

VisRulerAttributes	record
    VRA_IGNORE_ORIGIN:1
    VRA_SHOW_GUIDES : 1	
    VRA_SHOW_GRID : 1
    VRA_SHOW_MOUSE : 1
    VRA_HORIZONTAL : 1
    VRA_MASTER : 1
    :2
VisRulerAttributes	end

VisRulerConstrainStrategy	record
	VRCS_OVERRIDE : 1
	:1
	VRCS_SET_REFERENCE : 1
	VRCS_SNAP_TO_GRID_X_ABSOLUTE : 1
	VRCS_SNAP_TO_GRID_Y_ABSOLUTE : 1
	VRCS_SNAP_TO_GRID_X_RELATIVE : 1
	VRCS_SNAP_TO_GRID_Y_RELATIVE : 1
	VRCS_SNAP_TO_GUIDES_X : 1
	VRCS_SNAP_TO_GUIDES_Y : 1
	VRCS_CONSTRAIN_TO_HORIZONTAL_AXIS : 1
	VRCS_CONSTRAIN_TO_VERTICAL_AXIS : 1
	VRCS_CONSTRAIN_TO_UNITY_SLOPE_AXIS : 1
	VRCS_CONSTRAIN_TO_NEGATIVE_UNITY_SLOPE_AXIS : 1
	VRCS_CONSTRAIN_TO_VECTOR : 1
	VRCS_CONSTRAIN_TO_VECTOR_REFLECTION : 1
	VRCS_INTERNAL : 1
VisRulerConstrainStrategy	end

VRCS_SNAP_TO_GRID_ABSOLUTE	equ	mask VRCS_SNAP_TO_GRID_X_ABSOLUTE or \
					mask VRCS_SNAP_TO_GRID_Y_ABSOLUTE

VRCS_SNAP_TO_GRID_RELATIVE	equ	mask VRCS_SNAP_TO_GRID_X_RELATIVE or \
					mask VRCS_SNAP_TO_GRID_Y_RELATIVE

VRCS_SNAP_TO_GUIDES		equ	mask VRCS_SNAP_TO_GUIDES_X or \
					mask VRCS_SNAP_TO_GUIDES_Y

VRCS_SNAP_FLAGS			equ	VRCS_SNAP_TO_GRID_ABSOLUTE or \
					VRCS_SNAP_TO_GRID_RELATIVE or \
					VRCS_SNAP_TO_GUIDES

VRCS_CONSTRAIN_TO_HV_AXES	equ	mask VRCS_CONSTRAIN_TO_HORIZONTAL_AXIS\
					or mask VRCS_CONSTRAIN_TO_VERTICAL_AXIS

VRCS_CONSTRAIN_TO_DIAGONALS	equ   mask VRCS_CONSTRAIN_TO_UNITY_SLOPE_AXIS \
			    or mask VRCS_CONSTRAIN_TO_NEGATIVE_UNITY_SLOPE_AXIS

VRCS_VECTOR_CONSTRAIN		equ	mask VRCS_CONSTRAIN_TO_VECTOR or \
				       mask VRCS_CONSTRAIN_TO_VECTOR_REFLECTION

VRCS_CONSTRAIN_FLAGS		equ	VRCS_CONSTRAIN_TO_HV_AXES or \
					VRCS_CONSTRAIN_TO_DIAGONALS or \
					VRCS_VECTOR_CONSTRAIN

VRCS_MOUSE_TWEAKING_FLAGS	equ	VRCS_SNAP_FLAGS or VRCS_CONSTRAIN_FLAGS
					

VisRulerType		etype byte, 0
VRT_INCHES		enum	VisRulerType
VRT_CENTIMETERS		enum	VisRulerType
VRT_POINTS		enum	VisRulerType
VRT_PICAS		enum	VisRulerType
VRT_CUSTOM		enum	VisRulerType, 0xfd	;custom ruler definition
VRT_NONE		enum	VisRulerType, 0xfe	;no rulers
VRT_DEFAULT		enum	VisRulerType, 0xff	;use system default

Grid	struct
	G_x	WWFixed				;pixels between horiz gridlines
	G_y	WWFixed				;pixels between vert gridlines
Grid	ends

Guide	struct
	Guide_location		DWFixed
Guide	ends

CheckHack <VRT_INCHES eq MEASURE_US>
CheckHack <VRT_CENTIMETERS eq MEASURE_METRIC>

MinUSMeasure		etype byte, 0
MUSM_EIGHTH_INCH	enum	MinUSMeasure
MUSM_QUARTER_INCH	enum	MinUSMeasure
MUSM_HALF_INCH		enum	MinUSMeasure
MUSM_ONE_INCH		enum	MinUSMeasure

MinMetricMeasure	etype byte, 0
MMM_MILLIMETER		enum	MinMetricMeasure
MMM_HALF_CENTIMETER	enum	MinMetricMeasure
MMM_CENTIMETER		enum	MinMetricMeasure

MinPointMeasure		etype byte, 0
MPM_25_POINT		enum	MinPointMeasure
MPM_50_POINT		enum	MinPointMeasure
MPM_100_POINT		enum	MinPointMeasure

MinPicaMeasure		etype byte, 0
MPM_PICA		enum	MinPicaMeasure
MPM_INCH		enum	MinPicaMeasure

MinIncrementType	union
   MIT_US	MinUSMeasure
   MIT_METRIC	MinMetricMeasure
   MIT_POINT	MinPointMeasure
   MIT_PICA	MinPicaMeasure
MinIncrementType	end

;
; Make sure the minimums are all the same
;
CheckHack <MUSM_EIGHTH_INCH eq MMM_MILLIMETER>
CheckHack <MUSM_EIGHTH_INCH eq MPM_25_POINT>
CheckHack <MUSM_EIGHTH_INCH eq MPM_PICA>

;
;	UI CONTROLLERS
;

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

RulerTypeControlClass	class	GenControlClass

MSG_RTC_TYPE_CHANGE			message
;
;	Sent from the "RulerType" list on any change
;
; Pass:
;	cl - new RulerType

RTCFeatures	record
	RTCF_DEFAULT:1
	RTCF_SPREADSHEET:1
	RTCF_INCHES:1
	RTCF_CENTIMETERS:1
	RTCF_POINTS:1
	RTCF_PICAS:1
RTCFeatures	end

RulerTypeNotificationBlock	struct
	RTNB_type	VisRulerType
RulerTypeNotificationBlock	ends

RTCToolboxFeatures	record
	RTCTF_DEFAULT:1
	RTCTF_SPREADSHEET:1
	RTCTF_INCHES:1
	RTCTF_CENTIMETERS:1
	RTCTF_POINTS:1
	RTCTF_PICAS:1
RTCToolboxFeatures	end





RTC_DEFAULT_FEATURES		equ	mask RTCF_INCHES or \
					mask RTCF_CENTIMETERS or \
					mask RTCF_POINTS or \
					mask RTCF_PICAS or \
					mask RTCF_DEFAULT

RTC_DEFAULT_TOOLBOX_FEATURES	equ	mask RTCF_INCHES or \
					mask RTCF_CENTIMETERS

RulerTypeControlClass	endc

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

GuideCreateControlClass	class	GenControlClass

MSG_GCC_CREATE_VERTICAL_GUIDELINE				message
MSG_GCC_CREATE_HORIZONTAL_GUIDELINE				message
;
;	Create a guide
;
; Pass:		nothing
; Return:	nothing

GCCFeatures	record
	GCCF_HORIZONTAL_GUIDES:1
	GCCF_VERTICAL_GUIDES:1
GCCFeatures	end





GCC_DEFAULT_FEATURES		equ	mask GCCF_HORIZONTAL_GUIDES or \
					mask GCCF_VERTICAL_GUIDES

GCC_DEFAULT_TOOLBOX_FEATURES	equ	0

GuideCreateControlClass	endc

VisRulerNotifyGuideChangeBlockHeader	struct
	VRNGCBH_header		LMemBlockHeader
	VRNGCBH_vertGuideArray	word
	VRNGCBH_horizGuideArray	word
VisRulerNotifyGuideChangeBlockHeader	ends

;
;	RulerGuideControlClass
;
RulerGuideControlClass	class	GenControlClass

MSG_RGC_SELECT_GUIDE				message
MSG_RGC_QUERY_GUIDE				message
MSG_RGC_DELETE_GUIDE				message
MSG_RGC_UPDATE_UI				message

RulerGuideControlFeatures	record

	RGCF_HV : 1
	RGCF_LIST : 1
	RGCF_POSITION : 1
	RGCF_DELETE : 1

RulerGuideControlFeatures	end

RULER_GUIDE_CONTROL_DEFAULT_FEATURES	equ	mask RulerGuideControlFeatures

	RGCI_dataBlock		hptr
	RGCI_rulerType		VisRulerType

RulerGuideControlClass	endc


RulerGridNotificationBlock	struct
	RGNB_gridSpacing	WWFixed
	RGNB_gridOptions	GridOptions
RulerGridNotificationBlock	ends

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

RulerGridControlClass	class	GenControlClass

MSG_RGC_SET_GRID_SPACING				message
MSG_RGC_SET_GRID_OPTIONS				message
;
;	Set the grid spacing based on the UI.
;
; Pass:		nothing
; Return:	nothing

RGCFeatures	record
	RGCF_GRID_SPACING:1
	RGCF_SNAP_TO_GRID:1
	RGCF_SHOW_GRID:1
RGCFeatures	end





RGC_DEFAULT_FEATURES		equ	mask RGCFeatures

RGC_DEFAULT_TOOLBOX_FEATURES	equ	0

RulerGridControlClass	endc

;******************************************************************************
;		RulerShowControlClass
;******************************************************************************
;
; This controller *does not* get notifications from the text rulers.  The
; controller maintains the state.
;
; Message(s) sent out:
; The message in RSCI_message is sent out when changes are made.
; The objects that are to receive this message need to be on the active
; list specifed in RSCI_gcnList (default GAGCNLT_DISPLAY_OBJECTS_WITH_RULERS)
; For example, your GenDisplay class could add displays to this list on:
;	MSG_SPEC_BUILD_BRANCH
;	MSG_VIS_OPEN
; and remove them on:
;	MSG_SPEC_UNBUILD_BRANCH
;	MSG_VIS_CLOSE
;
; GenApplication GCN lists to be placed on:
;	GAGCNLT_SELF_LOAD_OPTIONS
;
RulerShowControlClass	class	GenControlClass

;-----------------------------------------------------------------------------
;		Methods
;-----------------------------------------------------------------------------

;-----------------------------------------------------------------------------
;		Internal methods
;-----------------------------------------------------------------------------

MSG_RSCC_CHANGE_STATE	message

;-----------------------------------------------------------------------------
;		Hints
;-----------------------------------------------------------------------------

;-----------------------------------------------------------------------------
;		Constants & Structures
;-----------------------------------------------------------------------------

; Features flags (used with ATTR_GEN_CONTROL_REQUIRE_UI and
; ATTR_GEN_CONTROL_PROHIBIT_UI)

RSCCFeatures	record
    RSCCF_SHOW_VERTICAL:1
    RSCCF_SHOW_HORIZONTAL:1
    RSCCF_SHOW_RULERS:1
RSCCFeatures	end

; Toolbox features flags (used with ATTR_GEN_CONTROL_REQUIRE_TOOLBOX_UI and
; ATTR_GEN_CONTROL_PROHIBIT_TOOLBOX_UI)

RSCCToolboxFeatures	record
RSCCToolboxFeatures	end



RSCC_DEFAULT_FEATURES equ mask RSCCF_SHOW_VERTICAL or \
			   mask RSCCF_SHOW_HORIZONTAL
RSCC_DEFAULT_TOOLBOX_FEATURES equ 0

;-----------------------------------------------------------------------------
;		Instance Data
;-----------------------------------------------------------------------------

RulerShowControlAttributes	record
    RSCA_SHOW_VERTICAL:1
    RSCA_SHOW_HORIZONTAL:1
    :14
RulerShowControlAttributes	end

    RSCI_attrs		RulerShowControlAttributes
    RSCI_gcnList	GCNListType		;object to notify
    RSCI_message	word			;message to notify with
	;
	; Pass:
	;	cx - RulerShowControlAttributes

RulerShowControlClass	endc

;-----------------------------------------------------------------------------
;		VisRulerClass
;-----------------------------------------------------------------------------

VisRulerClass	class	VisClass
;-----------------------------------------------------------------------------
;		Methods
;-----------------------------------------------------------------------------

MSG_VIS_RULER_GAINED_SELECTION		message
;
;	Notify the ruler that its ruled object is "selected" and that the
;	ruler should update the UI to reflect its own attributes
;
;	Also registers the passed invalAD as the AD it should send out
;	whenever the ruled object needs to redraw itself (as a result
;	of a change in grid spacing, addition of a guideline, etc.)
;
;	PASS:		^lcx:dx = Object to send inval messages to
;
;	RETURN:		nothing
;
;	DESTROYED:	ax

MSG_VIS_RULER_LOST_SELECTION		message
;
;	Notify the ruler that its ruled object is no longer "selected".
;
;	PASS:		nothing
;
;	RETURN:		nothing
;
;	DESTROYED:	ax


MSG_VIS_RULER_UPDATE_CONTROLLERS	message
MSG_VIS_RULER_UPDATE_TYPE_CONTROLLER	message
MSG_VIS_RULER_UPDATE_GRID_CONTROLLER	message
MSG_VIS_RULER_UPDATE_GUIDE_CONTROLLER	message
MSG_VIS_RULER_COMBINE_GUIDE_INFO	message

MSG_VIS_RULER_RULE_LARGE_PTR		message

MSG_VIS_RULER_SET_TYPE			message
;
; Set type of ruler (eg. inches, centimeters)
;
;	PASS:	cl - RulerType
;	RETURN:	none
;

MSG_VIS_RULER_GET_TYPE			message
;
; Get type of ruler (eg. inches, centimeters)
;
;	PASS:	nothing
;	RETURN:	cl - RulerType
;

MSG_VIS_RULER_GET_CONSTRAIN_STRATEGY	message
;
;	Set default constrain strategy for the ruler
;
;	PASS:		nothing
;
;	RETURN:		cx - VisRulerConstrainStrategy
;

MSG_VIS_RULER_SET_CONSTRAIN_STRATEGY	message
;
;	Set default constrain strategy for the ruler
;
;	PASS:	cx - VisRulerConstrainStrategy bits to set
;		dx - VisRulerConstrainStrategy bits to clear
;	RETURN:	none
;

MSG_VIS_RULER_SET_IGNORE_ORIGIN	message
;
;	Set the "ignore origin" state
;
;	PASS:	cx - non-zero to ignore the origin
;	RETURN:	none
;

MSG_VIS_RULER_SHOW_MOUSE		message
;
;	Draw the mouse tick in the ruler on ptr events
;
;	PASS:	nothing
;	RETURN:	nothing
;

MSG_VIS_RULER_HIDE_MOUSE		message
;
;	Don't dnraw the mouse tick in the ruler on ptr events
;
;	PASS:	nothing
;	RETURN:	nothing
;

MSG_VIS_RULER_DRAW_MOUSE_TICK		message
;
;	Draw a line on the ruler indicating the mouse position
;
;	PASS:	ss:[bp] - PointDWFixed location of mouse
;	RETURN: nothing

MSG_VIS_RULER_TURN_GRID_SNAPPING_ON	message
;
;	Set the default VisRulerConstrainStrategy to include grid snapping
;
;	PASS:	nothing
;	RETURN:	nothing
;

MSG_VIS_RULER_TURN_GRID_SNAPPING_OFF	message
;
;	Set the default VisRulerConstrainStrategy to not include grid snapping
;
;	PASS:	nothing
;	RETURN:	nothing
;

MSG_VIS_RULER_TURN_GUIDES_SNAPPING_ON	message
;
;	Set the default VisRulerConstrainStrategy to include guides snapping
;
;	PASS:	nothing
;	RETURN:	nothing
;

MSG_VIS_RULER_TURN_GUIDES_SNAPPING_OFF	message
;
;	Set the default VisRulerConstrainStrategy to not include guides snappin
;
;	PASS:	nothing
;	RETURN:	nothing
;

MSG_VIS_RULER_SET_MIN_INCREMENT		message
;
; Set minimum increment (eg. 1/8",1/4",1/2",1")
;
;	PASS: 	cl - MinIncrementType
;	RETURN:	none
;
MSG_VIS_RULER_VIEW_SCALE_FACTOR_CHANGED		message
;
; Set scale factor
;
;	PASS:	ss:bp - ScaleChangedParams
;	RETURN:	none
;
MSG_VIS_RULER_SET_SCALE				message
;
; Set scale factor
;
;	PASS:	dx:cx = WWFixed scale factor
;	RETURN:	none
;

MSG_VIS_RULER_SET_GRID_SPACING			message
MSG_VIS_RULER_SET_HORIZONTAL_GRID_SPACING	message
MSG_VIS_RULER_SET_VERTICAL_GRID_SPACING		message
;
;	Set the grid increments for this ruler
;
;	PASS:	cx = horizontal grid spacing
;		dx = vertical grid spacing
;
;	RETURN:	nothing

MSG_VIS_RULER_DRAW_GRID			message
;
;	Draw the grid to a gstate
;
;	PASS:	bp = gstate
;
;	RETURN:	nothing

MSG_VIS_RULER_SNAP_TO_GRID		message
MSG_VIS_RULER_SNAP_TO_GRID_X		message
MSG_VIS_RULER_SNAP_TO_GRID_Y		message
;
;	Snap the passed coordinate to the grid
;
;	PASS:	ss:bp = PointDWFixed to snap to grid
;
;	RETURN:	ss:bp = PointDWFixed snapped to grid

MSG_VIS_RULER_SET_REFERENCE		message
;
;	Define the ruler's reference point
;
;	PASS:	ss:bp = PointDWFixed
;
;	RETURN:	nothing

MSG_VIS_RULER_SNAP_RELATIVE_TO_REFERENCE		message
MSG_VIS_RULER_SNAP_RELATIVE_TO_REFERENCE_X		message
MSG_VIS_RULER_SNAP_RELATIVE_TO_REFERENCE_Y		message
;
;	Returns the point closest to the passed point that is an
;	integral number of grid spacings from the reference point
;
;	PASS:	ss:bp = PointDWFixed
;
;	RETURN:	ss:bp = PointDWFixed

MSG_VIS_RULER_GET_GRID_SPACING			message
MSG_VIS_RULER_GET_STRATEGIC_GRID_SPACING	message
;
;	Returns a grid spacing that will look nice on the screen at
;	the current scale factor.
;
;	PASS:	nothing
;
;	RETURN:	dx:cx = WWFixed horizontal grid spacing
;		bp:ax = WWFixed vertical grid spacing


MSG_VIS_RULER_CREATE_GUIDE_ARRAY		message

MSG_VIS_RULER_ADD_HORIZONTAL_GUIDE		message
MSG_VIS_RULER_ADD_VERTICAL_GUIDE		message
;
;	PASS:	ss:bp = DWFixed location
;
;	RETURN:	nothing

MSG_VIS_RULER_DRAW_GUIDES			message
MSG_VIS_RULER_DRAW_GUIDE_INDICATORS		message

MSG_VIS_RULER_SNAP_TO_GUIDES			message
MSG_VIS_RULER_SNAP_TO_GUIDES_X			message
MSG_VIS_RULER_SNAP_TO_GUIDES_Y			message
;
;	Snap the passed coordinate to the guides
;
;	PASS:	ss:bp = PointDWFixed to snap to guides
;
;	RETURN:	ss:bp = PointDWFixed snapped to guides

MSG_VIS_RULER_CONSTRAIN_TO_AXES			message
MSG_VIS_RULER_CONSTRAIN_TO_HORIZONTAL_AXIS	message
MSG_VIS_RULER_CONSTRAIN_TO_VERTICAL_AXIS	message
MSG_VIS_RULER_CONSTRAIN_TO_DIAGONALS		message
MSG_VIS_RULER_CONSTRAIN_X_TO_UNITY_SLOPE_AXIS	message
MSG_VIS_RULER_CONSTRAIN_Y_TO_UNITY_SLOPE_AXIS	message
MSG_VIS_RULER_CONSTRAIN_X_TO_NEGATIVE_UNITY_SLOPE_AXIS	message
MSG_VIS_RULER_CONSTRAIN_Y_TO_NEGATIVE_UNITY_SLOPE_AXIS	message

MSG_VIS_RULER_SET_ORIGIN			message
MSG_VIS_RULER_GET_ORIGIN			message

MSG_VIS_RULER_SET_VECTOR			message
MSG_VIS_RULER_CONSTRAIN_TO_VECTOR		message
MSG_VIS_RULER_CONSTRAIN_X_TO_VECTOR		message
MSG_VIS_RULER_CONSTRAIN_Y_TO_VECTOR		message
MSG_VIS_RULER_CONSTRAIN_X_TO_VECTOR_REFLECTION		message
MSG_VIS_RULER_CONSTRAIN_Y_TO_VECTOR_REFLECTION		message

MSG_VIS_RULER_GET_DESIRED_SIZE			message

MSG_VIS_RULER_GET_GUIDE_INFLUENCE		message
MSG_VIS_RULER_SET_GUIDE_INFLUENCE		message
MSG_VIS_RULER_SELECT_HORIZONTAL_GUIDE		message
MSG_VIS_RULER_SELECT_VERTICAL_GUIDE		message
MSG_VIS_RULER_DESELECT_ALL_HORIZONTAL_GUIDES	message
MSG_VIS_RULER_DESELECT_ALL_VERTICAL_GUIDES	message
MSG_VIS_RULER_DELETE_HORIZONTAL_GUIDE		message
MSG_VIS_RULER_DELETE_VERTICAL_GUIDE		message

MSG_VIS_RULER_SHOW_GRID				message
MSG_VIS_RULER_HIDE_GRID				message

MSG_VIS_RULER_INVALIDATE_WITH_SLAVES		message
;
;	Invalidates the ruler and its slave. This is provided 'cause
;	if this were done via MSG_VIS_INVALIDATE, multiple invalidations
;	would pile up for the slave on other messages that also call
;	MSG_VIS_INVALIDATE.
;
;	PASS:		nothing
;	RETURN:		nothing
;

MSG_VIS_RULER_SET_CONSTRAIN_TRANSFORM			message
;
;  MSG_VIS_RULER_SET_CONSTRAIN_TRANSFORM is sent to the ruler so that it can
;  properly constrain mouse events when the events are taken as happening
;  within some transformed coordinate system (eg. a rotated/skewed GrObj)
;
; Context:	Likely a transformed object is about to request a series
;		of constrains, so it passes in the appropriate transform.
; Source:	Any transformed object sending MSG_VIS_RULER_RULE_LARGE_PTR
;		to the ruler with VRCS_VECTOR_CONSTRAIN set.
; Destination:	Any VisRuler
; Interception:	Unlikely
;
; Pass: 	ss:[bp] - TMatrix representing the transform
; Return: 	nothing
; 		ax - destroyed
;		cx,dx,bp - preserved
;

MSG_VIS_RULER_CLEAR_CONSTRAIN_TRANSFORM			message
;
;  MSG_VIS_RULER_CLEAR_CONSTRAIN_TRANSFORM is sent to the ruler to clear
;  any transform that it may have been using for transformed vector constrains.
;
; Context:	Likely an untransformed object wants to ensure that no
;		transform is being used to constrain it.
; Source:	Any untransformed object sending MSG_VIS_RULER_RULE_LARGE_PTR
;		to the ruler with VRCS_VECTOR_CONSTRAIN set.
; Destination:	Any VisRuler
; Interception:	Unlikely
;
; Pass: 	nothing
; Return: 	nothing
; 		ax - destroyed
;		cx,dx,bp - preserved
;

;-----------------------------------------------------------------------------

;		Instance Data
;-----------------------------------------------------------------------------
    VRI_rulerAttrs	VisRulerAttributes
    VRI_type		VisRulerType		;measurement type
    VRI_constrainStrategy	VisRulerConstrainStrategy
    VRI_minIncrement	MinIncrementType	;minimum increment displayed
    VRI_scale		WWFixed			;scale factor
    VRI_origin		DWFixed			;0,0 of the ruler in doc coords
    VRI_reference	PointDWFixed
    VRI_mouseMark	sdword
    VRI_window		hptr.Window
	noreloc VRI_window
    VRI_slave		optr
    VRI_grid		Grid
    VRI_vectorSlope	WWFixed			;slope of vector
    VRI_guideArray	optr.ChunkArrayHeader
    VRI_guideInfluence	word			;influence of guides in pixels
    VRI_desiredSize	word
    VRI_reserved	word
    VRI_invalOD		optr
	noreloc VRI_invalOD
    VRI_transformGState	hptr.GState
	noreloc VRI_transformGState
VisRulerClass	endc

;-----------------------------------------------------------------------------
;		RulerContentClass
;------------------------------------------------------------------------------

RulerContentClass	class	VisContentClass
RulerContentClass	endc

;-----------------------------------------------------------------------------
;		RulerViewClass
;------------------------------------------------------------------------------

RulerViewAttributes	record
    RVA_HORIZONTAL:1
    RVA_NO_SCROLLBAR:1
    ; This flag is OFF by default -- if it's on, then this ruler is
    ; associated with a view that doesn't have a scrollbar, so no room
    ; will be left for one.

    :6
RulerViewAttributes	end

RulerViewClass		class	GenViewClass

    RVI_attrs		RulerViewAttributes
RulerViewClass		endc

;-----------------------------------------------------------------------------
;		Exported library routines
;------------------------------------------------------------------------------

global	RulerScaleDocToWinCoords:far
;
; Utility routine for ruler subclasses to scale for drawing
;
;	PASS:		*ds:si - ptr to VisRuler instance
;			dx:cx.ax - point to scale (DWFixed)
;	RETURN:		dx:cx.ax - scaled point (DWFixed)
;
global	RulerScaleWinToDocCoords:far

;-----------------------------------------------------------------------------
;		Exported C stubs
;------------------------------------------------------------------------------
global	RULERSCALEDOCTOWINCOORDS:far
global	RULERSCALEWINTODOCCOORDS:far

EndLibrary	ruler


