//
// Copyright © Vector Works, Inc. 2006.
// All Rights Reserved.
// 

#pragma once

namespace VectorWorks
{
	// EDrawPadTransferMode should be in sync with ETransferMode found in DrawPad.Defs.X.h
	enum EDrawPadTransferMode {
		eDrawPadTransferMode_Copy 								= 0,
		eDrawPadTransferMode_Or 								= 1,
		eDrawPadTransferMode_Xor 								= 2,
		eDrawPadTransferMode_Erase 								= 3,
		eDrawPadTransferMode_NotCopy 							= 4,
		eDrawPadTransferMode_NotOr 								= 5,
		eDrawPadTransferMode_NotXor 							= 6,
		eDrawPadTransferMode_NotErase 							= 7,
		eDrawPadTransferMode_WhiteIsTransparent					= 8,
		eDrawPadTransferMode_kAlphaTransparency					= 9,
		eDrawPadTransferMode_kPremultipliedAlphaTransparency	= 10
	};
	
	// ----------------------------------------------------------------------------------------------------
	// {6eef7e80-90f8-11db-b606-0800200c9a66}
	static const VWIID IID_DrawPad = { 0x6eef7e80, 0x90f8, 0x11db, { 0xb6, 0x06, 0x08, 0x00, 0x20, 0x0c, 0x9a, 0x66 } };
			
	class DYNAMIC_ATTRIBUTE IDrawPad : public IVWUnknown
	{
	public:
		virtual VCOMError VCOM_CALLTYPE	InitializeInDevice(unsigned long deviceHandle, void* devDC) = 0;
		virtual VCOMError VCOM_CALLTYPE	InitializeInMemory(const ViewRect& rect) = 0;
		virtual VCOMError VCOM_CALLTYPE SetCanvasColor(const GSColor& color) = 0;
		virtual VCOMError VCOM_CALLTYPE SetPen(Sint16 inPenSize, const GSColor& inForeColor,
												const GSColor& inBackColor, Sint16 inStyle, 
												Sint16 inUnscaledPenSize = -1) = 0;
								
		virtual VCOMError VCOM_CALLTYPE FillRect(const ViewRect& rect) = 0;
		virtual VCOMError VCOM_CALLTYPE FrameRect(const ViewRect& rect) = 0;
		
		virtual VCOMError VCOM_CALLTYPE SetClipRect(const ViewRect& rect) = 0;
		virtual VCOMError VCOM_CALLTYPE SetPenFgColor(const GSColor& inColor) = 0;
		virtual VCOMError VCOM_CALLTYPE GetTextWidth(const TXString& string, Uint32& outWidth) = 0;
		virtual VCOMError VCOM_CALLTYPE TextMoveTo(Sint16 x, Sint16 y) = 0;
		virtual VCOMError VCOM_CALLTYPE DrawTextString(const TXString& string) = 0; 
		virtual VCOMError VCOM_CALLTYPE DPMoveTo(Sint16 x, Sint16 y) = 0;
		virtual VCOMError VCOM_CALLTYPE DPLineTo(Sint16 x, Sint16 y) = 0;
		virtual VCOMError VCOM_CALLTYPE GetCharacterWidth(const char ch, Uint32& outWidt) = 0;
		virtual VCOMError VCOM_CALLTYPE CopyBitsOut(const GSRect32& srcRect, IDrawPad* pDestDrawPad, const GSRect32& destRect, EDrawPadTransferMode mode) = 0;
		virtual VCOMError VCOM_CALLTYPE DrawDashedLine(const ViewPt& m1, const ViewPt& m2, short lineStyle, short thickness) = 0;
		
		virtual VCOMError VCOM_CALLTYPE CreatePoly(GSPolyRef& outPolyRef) = 0;
		virtual VCOMError VCOM_CALLTYPE AddPolyPt(const GSPolyRef& inPolyRef, const ViewPt& inPt) = 0;
		virtual VCOMError VCOM_CALLTYPE ReleasePoly(const GSPolyRef& inPolyRef) = 0;
		virtual VCOMError VCOM_CALLTYPE FillPoly(const GSPolyRef& inPolyRef) = 0;
		virtual VCOMError VCOM_CALLTYPE CaptureDevice() = 0;
		virtual VCOMError VCOM_CALLTYPE ReleaseDevice() = 0;

		virtual VCOMError VCOM_CALLTYPE SetTextFont(const DPFont& font) = 0;
		virtual VCOMError VCOM_CALLTYPE SetTextAngle(double textAngle, bool baselineMirror) = 0;
		virtual VCOMError VCOM_CALLTYPE GetTextFont(DPFont& outFont) = 0;
		virtual VCOMError VCOM_CALLTYPE GetTextAngle(double& outTextAngle, bool& outBaselineMirror) = 0;

		virtual VCOMError VCOM_CALLTYPE GetOSDeviceContext(Uint32& outDevice) = 0;
	};

	// ----------------------------------------------------------------------------------------------------
	typedef VCOMPtr<IDrawPad>		IDrawPadPtr;
}


