#ifndef _SHEAR_
#define _SHEAR_

#if 0
#include <Quickdraw.h>

#include <fp.h>

#include <ToolUtils.h>
#include <Limits.h>
#endif

#include <GSTypes.h>
#include <MiniCadCallBacks.x.h>


const shiftKeyMask = 512;

// DLOG constants
const short	kDragDialogID = 11001;


// ICON constants
const short kShearByDragIconID = 11000;

//Str# constants
const short kHelpStrListID = 11000;
const short kDataBarStrListID = 10001;
const short kShearToolHelpString = 1;
const short kClickOnFixedPointHelpString = 2;
const short kClickAndDragHelpString = 3;
const short kConstrainHelpString = 4;
const short kDragStartAlert = 5;


// ICN# constants
const short kShearByDragRadioButton = 1;
const short kShearByAngleRadioButton = 2;

// CURS constants
const short kDefineFixedPtCURSID = 154;
const short kDefineDragCURSID = 107;

// Misc constants
const short kNumberOfRadioButtonModes  = 1;
const short kNumberOfRadioButtons  = 2;

struct ToolFlagsType {
	unsigned short		f15:1;
	unsigned short		f14:1;
	unsigned short		f13:1;
	unsigned short		f12:1;
	unsigned short		f11:1;
	unsigned short		f10:1;
	unsigned short		f9:1;
	unsigned short		f8:1;
	unsigned short		f7:1;
	unsigned short		f6:1;
	unsigned short		f5:1;
	unsigned short		f4:1;
	unsigned short		f3:1;
	unsigned short		f2:1;
	unsigned short		drawFinal:1;
	unsigned short		doDrag:1;
};

struct ToolDataType	{
	ToolFlagsType 		flags;
	short				cursor;
	WorldPt				fixedPt;
};

struct Mat2X2Type {
	WorldPt		row1;
	WorldPt 		row2;
};

struct TransformInfoType {
	Mat2X2Type		mat;
	WorldPt			startPt;
	WorldPt			drawPt;
	ToolDataType	toolData;
	Boolean			hasOpenEvent;
};
typedef TransformInfoType *TransDataPtr;


//static void InitializeToolData(ToolDataType* toolData);

static void InitializeTransInfo(TransformInfoType* transInfo);					
extern "C" void DrawShearedObjs(const WorldPt& startPt, const WorldPt& drawPt,
									 CallBackPtr cbp, TransformInfoType* transInfo);
static void SetShearFactors(CallBackPtr cbp, TransformInfoType* transInfo);
static void TransformPt(WorldPt &pt,CallBackPtr cbp, TransformInfoType* transInfo);

//
// Callbacks				
//
extern "C" void TransformAndDrawObject(Handle h ,CallBackPtr cbp, TransformInfoType* transInfo);
extern "C" void ConvertSelectionToPolyObjs(Handle obj ,CallBackPtr cbp, void*);
extern "C" void ResetObject(Handle h ,CallBackPtr cbp, void*);

//static void DoDataDisplaySetUp(CallBackPtr cbp);

static void DisplayTransInfo(TransformInfoType* transInfo);

#endif