// Borland C++ Builder
// Copyright (c) 1995, 1999 by Borland International
// All rights reserved

// (DO NOT EDIT: machine generated header) 'ImageEnView.pas' rev: 5.00

#ifndef ImageEnViewHPP
#define ImageEnViewHPP

#pragma delphiheader begin
#pragma option push -w-
#pragma option push -Vx
#include <Menus.hpp>	// Pascal unit
#include <hyieutils.hpp>	// Pascal unit
#include <hyiedefs.hpp>	// Pascal unit
#include <ExtCtrls.hpp>	// Pascal unit
#include <StdCtrls.hpp>	// Pascal unit
#include <Classes.hpp>	// Pascal unit
#include <Forms.hpp>	// Pascal unit
#include <Controls.hpp>	// Pascal unit
#include <Graphics.hpp>	// Pascal unit
#include <Messages.hpp>	// Pascal unit
#include <Windows.hpp>	// Pascal unit
#include <SysInit.hpp>	// Pascal unit
#include <System.hpp>	// Pascal unit

//-- user supplied -----------------------------------------------------------

namespace Imageenview
{
//-- type declarations -------------------------------------------------------
typedef unsigned hDrawDib;

struct TDrawDibTime
{
	int timeCount;
	int timeDraw;
	int timeDecompress;
	int timeDither;
	int timeStretch;
	int timeBlt;
	int timeSetDIBits;
} ;

typedef void __fastcall (__closure *TViewChangeEvent)(System::TObject* Sender, int Change);

#pragma option push -b-
enum TIEMouseInteractItems { miZoom, miScroll, miSelect, miSelectPolygon, miSelectCircle, miSelectZoom, 
	miSelectMagicWand };
#pragma option pop

typedef Set<TIEMouseInteractItems, miZoom, miSelectMagicWand>  TIEMouseInteract;

typedef void __fastcall (__closure *TIEBitmapChangeEvent)(System::TObject* Sender, bool destroying);
	

typedef TIEBitmapChangeEvent *PIEBitmapChangeEvent;

#pragma option push -b-
enum TIESelectionBase { iesbClientArea, iesbBitmap };
#pragma option pop

#pragma option push -b-
enum TIEBackgroundStyle { iebsSolid, iebsHorizontal, iebsVertical, iebsFDiagonal, iebsBDiagonal, iebsCross, 
	iebsDiagCross, iebsChessboard, iebsDiagonals };
#pragma option pop

#pragma option push -b-
enum ImageEnView__1 { iesoAnimated, iesoSizeable, iesoMoveable, iesoFilled };
#pragma option pop

typedef Set<ImageEnView__1, iesoAnimated, iesoFilled>  TIESelectionOptions;

#pragma option push -b-
enum TIESelOp { iespReplace, iespAdd };
#pragma option pop

class DELPHICLASS TIEView;
class PASCALIMPLEMENTATION TIEView : public Controls::TCustomControl 
{
	typedef Controls::TCustomControl inherited;
	
private:
	Forms::TFormBorderStyle FBorderStyle;
	Classes::TList* fBmpChange;
	void __fastcall SetBorderStyle(Forms::TBorderStyle Value);
	bool __fastcall GetCtl3D(void);
	HIDESBASE void __fastcall SetCtl3D(bool v);
	
protected:
	Graphics::TColor fBackGround;
	int fDPIX;
	int fDPIY;
	virtual void __fastcall SetBackGround(Graphics::TColor cl);
	virtual Graphics::TBitmap* __fastcall GetFBitmap(void);
	virtual void __fastcall CreateParams(Controls::TCreateParams &Params);
	
public:
	virtual void __fastcall SetDPIX(int dpiX);
	virtual void __fastcall SetDPIY(int dpiY);
	virtual void __fastcall SetDPI(int dpiX, int dpiY);
	virtual void __fastcall ImageChange(void);
	__fastcall virtual TIEView(Classes::TComponent* Owner);
	__fastcall virtual ~TIEView(void);
	__property int DpiX = {read=fDPIX, write=SetDPIX, nodefault};
	__property int DpiY = {read=fDPIY, write=SetDPIY, nodefault};
	__property Graphics::TBitmap* Bitmap = {read=GetFBitmap};
	void __fastcall CallBitmapChangeEvents(void);
	void __fastcall RegisterBitmapChangeEvent(TIEBitmapChangeEvent v);
	void __fastcall RemoveBitmapChangeEvent(TIEBitmapChangeEvent v);
	
__published:
	__property Graphics::TColor Background = {read=fBackGround, write=SetBackGround, default=-2147483633
		};
	__property Ctl3D  = {read=GetCtl3D, write=SetCtl3D, default=1};
	__property ParentCtl3D ;
	__property Forms::TBorderStyle BorderStyle = {read=FBorderStyle, write=SetBorderStyle, default=1};
public:
		
	#pragma option push -w-inl
	/* TWinControl.CreateParented */ inline __fastcall TIEView(HWND ParentWindow) : Controls::TCustomControl(
		ParentWindow) { }
	#pragma option pop
	
};


class DELPHICLASS TImageEnView;
typedef TImageEnView* *PImageEnView;

class PASCALIMPLEMENTATION TImageEnView : public TIEView 
{
	typedef TIEView inherited;
	
private:
	Graphics::TBitmap* fUndoBitmap;
	Controls::TCursor fLCursor;
	Controls::TCursor fCursor;
	Classes::TNotifyEvent fOnImageChange;
	TViewChangeEvent fOnViewChange;
	bool fCenter;
	bool fDBToDraw;
	Hyiedefs::TResampleFilter fZoomFilter;
	Hyiedefs::TResampleFilter fSaveZoomFilter;
	int fStable;
	bool fDelayZoomFilter;
	TIEBackgroundStyle fBackgroundStyle;
	bool fMagicWandMaxFilter;
	int fMagicWandTolerance;
	double fRXScroll;
	double fRYScroll;
	bool fDisplayGrid;
	int fHSVX1;
	int fHSVY1;
	int fo1x;
	int fo1y;
	int fo2x;
	int fo2y;
	int frx;
	int fry;
	Graphics::TBitmap* fTBitmap;
	int fBitmapWidth;
	int fBitmapHeight;
	void __fastcall AniPolyFunc(System::TObject* Sender);
	void __fastcall SetViewX(int v);
	void __fastcall SetViewY(int v);
	void __fastcall SetZoom(double v);
	int __fastcall GetSelX1(void);
	int __fastcall GetSelY1(void);
	int __fastcall GetSelX2(void);
	int __fastcall GetSelY2(void);
	void __fastcall SetCenter(bool v);
	TIEMouseInteract __fastcall GetMouseInteract(void);
	void __fastcall SetBackgroundStyle(TIEBackgroundStyle v);
	void __fastcall DoSelectionChange(void);
	void __fastcall DoSelectionChanging(void);
	void __fastcall SetSelectionOptions(TIESelectionOptions v);
	int __fastcall GetResizingGrip(int x, int y);
	int __fastcall GetMovingGrip(int x, int y);
	int __fastcall SelectResizeEx(int grip, int newx, int newy);
	int __fastcall SelectMoveEx(int fMoving, int ox, int oy);
	HIDESBASE void __fastcall SetCursor(Controls::TCursor Value);
	bool __fastcall GetScrollBarsAlwaysVisible(void);
	void __fastcall SetScrollBarsAlwaysVisible(bool v);
	void __fastcall SetDisplayGrid(bool v);
	
protected:
	int fViewX;
	int fViewY;
	double fZoom;
	double fZoomD100;
	double f100DZoom;
	unsigned fHDrawDib;
	unsigned fHDrawDib2;
	Stdctrls::TScrollStyle fScrollBars;
	int fLockPaint;
	int fOffX;
	int fOffY;
	int fExtX;
	int fExtY;
	int fZZWW;
	int fZZHH;
	Graphics::TBitmap* fBitmap;
	#pragma pack(push, 1)
	Hyiedefs::TBitmapInfoHeader256 fBitmapInfoHeader256;
	#pragma pack(pop)
	
	bool fDoubleBuffer;
	bool fAutoFit;
	bool fUpdateInvalidate;
	bool fSel;
	bool fPolySelecting;
	bool fRectSelecting;
	bool fCircSelecting;
	int fRectResizing;
	int fSelectMoving;
	int fMMoveX;
	int fMMoveY;
	int fHSX1;
	int fHSY1;
	int fPredX;
	int fPredY;
	Hyiedefs::TIEAnimPoly *fHPolySel;
	TIESelectionBase fSelectionBase;
	Classes::TNotifyEvent fOnSelectionChanging;
	Classes::TNotifyEvent fOnSelectionChange;
	Classes::TNotifyEvent fOnMouseInSel;
	TIESelectionOptions fSelectionOptions;
	int fStartingPolyCount;
	Hyieutils::TIEMask* fSelectionMask;
	Classes::TList* fAnimPoly;
	Extctrls::TTimer* fAnimPolyTimer;
	TIEMouseInteract fMouseInteract;
	bool fScrollBarsAlwaysVisible;
	Hyieutils::TIEScrollBarParams* fVScrollBarParams;
	Hyieutils::TIEScrollBarParams* fHScrollBarParams;
	Hyieutils::TIEMouseWheelParams* fMouseWheelParams;
	virtual void __fastcall SetBackGround(Graphics::TColor cl);
	void __fastcall PolyDraw1(void);
	virtual void __fastcall SetScrollBars(Stdctrls::TScrollStyle v);
	void __fastcall GetMaxViewXY(int &mx, int &my);
	HIDESBASE MESSAGE void __fastcall WMSize(Messages::TWMSize &Message);
	HIDESBASE MESSAGE void __fastcall WMEraseBkgnd(Messages::TMessage &Message);
	HIDESBASE MESSAGE void __fastcall WMVScroll(Messages::TMessage &Message);
	HIDESBASE MESSAGE void __fastcall WMHScroll(Messages::TMessage &Message);
	HIDESBASE MESSAGE void __fastcall WMMouseWheel(Messages::TMessage &Message);
	void __fastcall SaveCursor(Controls::TCursor newc);
	void __fastcall RestoreCursor(void);
	void __fastcall ShowSelectionEx(bool d);
	void __fastcall HideSelectionEx(bool dd);
	HPALETTE __fastcall _CreatePalette(void);
	int __fastcall GetIdealComponentWidth(void);
	int __fastcall GetIdealComponentHeight(void);
	DYNAMIC bool __fastcall PaletteChanged(bool Foreground);
	DYNAMIC void __fastcall MouseDown(Controls::TMouseButton Button, Classes::TShiftState Shift, int X, 
		int Y);
	DYNAMIC void __fastcall MouseMove(Classes::TShiftState Shift, int X, int Y);
	DYNAMIC void __fastcall MouseUp(Controls::TMouseButton Button, Classes::TShiftState Shift, int X, int 
		Y);
	HIDESBASE MESSAGE void __fastcall WMLButtonDblClk(Messages::TWMMouse &Message);
	Windows::TPoint __fastcall GetPolySel(int idx);
	int __fastcall GetPolySelCount(void);
	virtual void __fastcall SetMouseInteract(TIEMouseInteract v);
	void __fastcall AnimPolygonAddPtEx(int ap, int x, int y);
	void __fastcall AnimPolygonMove(int ap, int ox, int oy, int max_x, int max_y);
	void __fastcall AnimPolygonAddBreak(int ap);
	void __fastcall AnimPolygonRemoveLast(int ap);
	void __fastcall AnimPolygonRemoveLastPoint(int ap);
	void __fastcall SetSelColor1(Graphics::TColor c);
	void __fastcall SetSelColor2(Graphics::TColor c);
	Graphics::TColor __fastcall GetSelColor1(void);
	Graphics::TColor __fastcall GetSelColor2(void);
	virtual void __fastcall ViewChange(int c);
	void __fastcall SetZoomFilter(Hyiedefs::TResampleFilter v);
	virtual void __fastcall SubMouseMoveScroll(int scx, int scy);
	void __fastcall MouseMoveScroll(void);
	virtual Graphics::TBitmap* __fastcall GetFBitmap(void);
	void __fastcall SetVisibleSelection(bool vv);
	bool __fastcall GetVisibleSelection(void);
	Hyiedefs::PPointArray __fastcall GetPolySelArray(void);
	HIDESBASE MESSAGE void __fastcall WMKillFocus(Messages::TWMKillFocus &Msg);
	HIDESBASE MESSAGE void __fastcall WMSetFocus(Messages::TWMSetFocus &Msg);
	DYNAMIC void __fastcall KeyDown(Word &Key, Classes::TShiftState Shift);
	DYNAMIC void __fastcall KeyUp(Word &Key, Classes::TShiftState Shift);
	virtual void __fastcall EndSelect(void);
	void __fastcall AddSelPointEx(int x, int y);
	void __fastcall AddSelBreakEx(void);
	void __fastcall SelectEx(int x1, int y1, int x2, int y2, TIESelOp Op);
	HIDESBASE virtual int __fastcall GetClientWidth(void);
	HIDESBASE virtual int __fastcall GetClientHeight(void);
	
public:
	__fastcall virtual TImageEnView(Classes::TComponent* Owner);
	__fastcall virtual ~TImageEnView(void);
	virtual void __fastcall Paint(void);
	virtual void __fastcall Select(int x1, int y1, int x2, int y2, TIESelOp Op);
	void __fastcall SelectMagicWand(int x, int y, TIESelOp Op);
	void __fastcall DeSelect(void);
	__property int SelX1 = {read=GetSelX1, nodefault};
	__property int SelY1 = {read=GetSelY1, nodefault};
	__property int SelX2 = {read=GetSelX2, nodefault};
	__property int SelY2 = {read=GetSelY2, nodefault};
	virtual void __fastcall AddSelPoint(int x, int y);
	void __fastcall AddSelBreak(void);
	__property Windows::TPoint PolySel[int idx] = {read=GetPolySel};
	__property int PolySelCount = {read=GetPolySelCount, nodefault};
	__property Hyiedefs::PPointArray PolySelPoints = {read=GetPolySelArray};
	__property bool Selected = {read=fSel, nodefault};
	__property bool VisibleSelection = {read=GetVisibleSelection, write=SetVisibleSelection, nodefault}
		;
	__property bool MagicWandMaxFilter = {read=fMagicWandMaxFilter, write=fMagicWandMaxFilter, nodefault
		};
	__property int MagicWandTolerance = {read=fMagicWandTolerance, write=fMagicWandTolerance, nodefault
		};
	bool __fastcall IsPointInsideSelection(int x, int y);
	int __fastcall AnimPolygonNew(Graphics::TColor VColor1, Graphics::TColor VColor2, bool VAnimated, bool 
		VSizeable);
	void __fastcall AnimPolygonDel(int ap);
	void __fastcall AnimPolygonAddPt(int ap, int x, int y);
	void __fastcall AnimPolygonClear(int ap);
	void __fastcall CopyFromPolygon(Graphics::TBitmap* Source, const Windows::TPoint * Polygon, const int 
		Polygon_Size, int PolygonLen, const Windows::TPoint &Position);
	void __fastcall CopyToPolygon(Graphics::TBitmap* Dest, const Windows::TPoint * Polygon, const int Polygon_Size
		, int PolygonLen, const Windows::TPoint &Position);
	virtual void __fastcall Update(void);
	void __fastcall Fit(void);
	__property int ViewX = {read=fViewX, write=SetViewX, nodefault};
	__property int ViewY = {read=fViewY, write=SetViewY, nodefault};
	void __fastcall SetViewXY(int x, int y);
	__property double Zoom = {read=fZoom, write=SetZoom};
	void __fastcall ZoomSelection(void);
	void __fastcall ZoomAt(int x, int y, double ZoomVal);
	__property ClientWidth  = {read=GetClientWidth};
	__property ClientHeight  = {read=GetClientHeight};
	__property int IdealComponentWidth = {read=GetIdealComponentWidth, nodefault};
	__property int IdealComponentHeight = {read=GetIdealComponentHeight, nodefault};
	void __fastcall LockPaint(void);
	int __fastcall UnLockPaint(void);
	int __fastcall NPUnLockPaint(void);
	__property int LockPaintCount = {read=fLockPaint, nodefault};
	HIDESBASE virtual void __fastcall PaintTo(Graphics::TCanvas* Canvas);
	void __fastcall DrawTo(Graphics::TCanvas* Canvas);
	__property int OffsetX = {read=fOffX, nodefault};
	__property int OffsetY = {read=fOffY, nodefault};
	__property int ExtentX = {read=fExtX, nodefault};
	__property int ExtentY = {read=fExtY, nodefault};
	__property bool ScrollBarsAlwaysVisible = {read=GetScrollBarsAlwaysVisible, write=SetScrollBarsAlwaysVisible
		, default=0};
	__property Hyieutils::TIEScrollBarParams* VScrollBarParams = {read=fVScrollBarParams};
	__property Hyieutils::TIEScrollBarParams* HScrollBarParams = {read=fHScrollBarParams};
	__property MouseCapture ;
	Graphics::TCanvas* __fastcall GetCanvas(void);
	virtual void __fastcall Assign(Classes::TPersistent* Source);
	void __fastcall AssignSelTo(Classes::TPersistent* Dest);
	virtual void __fastcall ImageChange(void);
	int __fastcall YScr2Bmp(int y);
	int __fastcall XScr2Bmp(int x);
	int __fastcall YBmp2Scr(int y);
	int __fastcall XBmp2Scr(int x);
	virtual void __fastcall SetBounds(int ALeft, int ATop, int AWidth, int AHeight);
	__property Graphics::TColor SelColor1 = {read=GetSelColor1, write=SetSelColor1, default=0};
	__property Graphics::TColor SelColor2 = {read=GetSelColor2, write=SetSelColor2, default=16777215};
	void __fastcall Clear(void);
	void __fastcall Blank(void);
	__property bool DisplayGrid = {read=fDisplayGrid, write=SetDisplayGrid, nodefault};
	__property Hyieutils::TIEMouseWheelParams* MouseWheelParams = {read=fMouseWheelParams};
	
__published:
	__property Hyiedefs::TResampleFilter ZoomFilter = {read=fZoomFilter, write=SetZoomFilter, default=0
		};
	__property Stdctrls::TScrollStyle ScrollBars = {read=fScrollBars, write=SetScrollBars, default=0};
	__property TViewChangeEvent OnViewChange = {read=fOnViewChange, write=fOnViewChange};
	__property Classes::TNotifyEvent OnImageChange = {read=fOnImageChange, write=fOnImageChange};
	__property TIESelectionOptions SelectionOptions = {read=fSelectionOptions, write=SetSelectionOptions
		, default=7};
	__property bool Center = {read=fCenter, write=SetCenter, default=0};
	__property TIEMouseInteract MouseInteract = {read=GetMouseInteract, write=SetMouseInteract, default=0
		};
	__property bool DoubleBuffer = {read=fDoubleBuffer, write=fDoubleBuffer, default=1};
	__property bool AutoFit = {read=fAutoFit, write=fAutoFit, default=0};
	__property TIESelectionBase SelectionBase = {read=fSelectionBase, write=fSelectionBase, default=0};
		
	__property TIEBackgroundStyle BackgroundStyle = {read=fBackgroundStyle, write=SetBackgroundStyle, default=0
		};
	__property Classes::TNotifyEvent OnSelectionChange = {read=fOnSelectionChange, write=fOnSelectionChange
		};
	__property Classes::TNotifyEvent OnSelectionChanging = {read=fOnSelectionChanging, write=fOnSelectionChanging
		};
	__property Classes::TNotifyEvent OnMouseInSel = {read=fOnMouseInSel, write=fOnMouseInSel};
	__property bool DelayZoomFilter = {read=fDelayZoomFilter, write=fDelayZoomFilter, default=1};
	__property Anchors ;
	__property Controls::TCursor Cursor = {read=fCursor, write=SetCursor, default=1785};
	__property Align ;
	__property DragCursor ;
	__property DragMode ;
	__property Enabled ;
	__property ParentShowHint ;
	__property PopupMenu ;
	__property ShowHint ;
	__property Visible ;
	__property TabOrder ;
	__property TabStop ;
	__property OnClick ;
	__property OnDblClick ;
	__property OnDragDrop ;
	__property OnDragOver ;
	__property OnEndDrag ;
	__property OnMouseDown ;
	__property OnMouseMove ;
	__property OnMouseUp ;
	__property OnStartDrag ;
	__property OnKeyDown ;
	__property OnKeyPress ;
	__property OnKeyUp ;
public:
	#pragma option push -w-inl
	/* TWinControl.CreateParented */ inline __fastcall TImageEnView(HWND ParentWindow) : TIEView(ParentWindow
		) { }
	#pragma option pop
	
};


//-- var, const, procedure ---------------------------------------------------
static const Shortint DDF_UPDATE = 0x2;
static const Shortint DDF_SAME_HDC = 0x4;
static const Shortint DDF_SAME_DRAW = 0x8;
static const Shortint DDF_DONTDRAW = 0x10;
static const Shortint DDF_ANIMATE = 0x20;
static const Shortint DDF_BUFFER = 0x40;
static const Byte DDF_JUSTDRAWIT = 0x80;
static const Word DDF_FULLSCREEN = 0x100;
static const Word DDF_BACKGROUNDPAL = 0x200;
static const Word DDF_NOTKEYFRAME = 0x400;
static const Word DDF_HURRYUP = 0x800;
static const Word DDF_HALFTONE = 0x1000;
static const Shortint DDF_PREROLL = 0x10;
static const Shortint DDF_SAME_DIB = 0x8;
static const Shortint DDF_SAME_SIZE = 0x8;
static const Shortint PD_CAN_DRAW_DIB = 0x1;
static const Shortint PD_CAN_STRETCHDIB = 0x2;
static const Shortint PD_STRETCHDIB_1_1_OK = 0x4;
static const Shortint PD_STRETCHDIB_1_2_OK = 0x8;
static const Shortint PD_STRETCHDIB_1_N_OK = 0x10;
extern PACKAGE int gAnimDim;
extern PACKAGE int gSystemColors;
extern PACKAGE int gSystemDPIX;
extern PACKAGE int gSystemDPIY;
extern PACKAGE bool gMMX;
extern PACKAGE __int64 gDebugTime1;
extern PACKAGE __int64 gDebugTime2;
extern "C" bool __stdcall DrawDibBegin(unsigned hdd, unsigned hDC, int dxDest, int dyDest, tagBITMAPINFOHEADER 
	&lpbi, int dxSrc, int dySrc, unsigned wFlags);
extern "C" bool __stdcall DrawDibChangePalette(unsigned hdd, int iStart, int iLen, tagPALETTEENTRY &
	lppe);
extern "C" bool __stdcall DrawDibClose(unsigned hdd);
extern "C" bool __stdcall DrawDibDraw(unsigned hdd, unsigned hDC, int xDst, int yDst, int dxDst, int 
	dyDst, tagBITMAPINFOHEADER &lpbi, void * Bits, int xSrc, int ySrc, int dxSrc, int dySrc, unsigned wFlags
	);
extern "C" bool __stdcall DrawDibEnd(unsigned hdd);
extern "C" void * __stdcall DrawDibGetBuffer(unsigned hdd, tagBITMAPINFOHEADER &lpbi, unsigned dwSize
	, unsigned dwFlags);
extern "C" unsigned __stdcall DrawDibGetPalette(unsigned hdd);
extern "C" unsigned __stdcall DrawDibOpen(void);
extern "C" bool __stdcall DrawDibProfileDisplay(tagBITMAPINFOHEADER &lpbi);
extern "C" unsigned __stdcall DrawDibRealize(unsigned hdd, unsigned hDC, BOOL fBackground);
extern "C" bool __stdcall DrawDibSetPalette(unsigned hdd, unsigned hpal);
extern "C" bool __stdcall DrawDibStart(unsigned hdd, int rate);
extern "C" bool __stdcall DrawDibStop(unsigned hdd);
extern "C" bool __stdcall DrawDibTime(unsigned hdd, TDrawDibTime &lpddtime);
extern PACKAGE void __fastcall SetSBPageSize(unsigned HScrollBar, int fnBar, int PageSize, bool Redraw
	);
extern PACKAGE void __fastcall InitializeBitmapInfoHeader(HBITMAP Bitmap, tagBITMAPINFOHEADER &BI, int 
	Colors);
extern PACKAGE bool __fastcall _IsRectangle(Hyiedefs::PPointArray p, int n);

}	/* namespace Imageenview */
#if !defined(NO_IMPLICIT_NAMESPACE_USE)
using namespace Imageenview;
#endif
#pragma option pop	// -w-
#pragma option pop	// -Vx

#pragma delphiheader end.
//-- end unit ----------------------------------------------------------------
#endif	// ImageEnView
