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

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

#ifndef ImageEnViewHPP
#define ImageEnViewHPP

#pragma delphiheader begin
#pragma option push -w-
#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 -------------------------------------------------------
#pragma pack(push, 1)
struct TBitmapInfoHeader256
{
	unsigned biSize;
	int biWidth;
	int biHeight;
	Word biPlanes;
	Word biBitCount;
	unsigned biCompression;
	unsigned biSizeImage;
	int biXPelsPerMeter;
	int biYPelsPerMeter;
	unsigned biClrUsed;
	unsigned biClrImportant;
	tagRGBQUAD Palette[2];
} ;
#pragma pack(pop)

typedef unsigned hDrawDib;

#pragma pack(push, 4)
struct TDrawDibTime
{
	int timeCount;
	int timeDraw;
	int timeDecompress;
	int timeDither;
	int timeStretch;
	int timeBlt;
	int timeSetDIBits;
} ;
#pragma pack(pop)

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 Windows::TPoint TPointArray[134217728];

typedef Windows::TPoint *PPointArray;

#pragma pack(push, 4)
struct TIEAnimPoly
{
	Windows::TPoint *Poly;
	int PolyCount;
	Graphics::TColor Color1;
	Graphics::TColor Color2;
	bool Animated;
	int AniFt;
	int C1;
	Graphics::TCanvas* Canvas;
	int RX1;
	int RY1;
	int RX2;
	int RY2;
	bool Enabled;
	bool Sizeable;
} ;
#pragma pack(pop)

typedef TIEAnimPoly *PIEAnimPoly;

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 };
#pragma option pop

typedef Set<ImageEnView__1, iesoAnimated, iesoMoveable>  TIESelectionOptions;

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

class DELPHICLASS TIEView;
#pragma pack(push, 4)
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
	
};

#pragma pack(pop)

class DELPHICLASS TImageEnView;
typedef TImageEnView* *PImageEnView;

#pragma pack(push, 4)
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;
	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(int 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 x, int y);
	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;
	int 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;
	TBitmapInfoHeader256 fBitmapInfoHeader256;
	bool fDoubleBuffer;
	bool fAutoFit;
	bool fUpdateInvalidate;
	bool fSel;
	bool fPolySelecting;
	bool fRectSelecting;
	bool fCircSelecting;
	int fRectResizing;
	int fRectMoving;
	int fMMoveX;
	int fMMoveY;
	int fHSX1;
	int fHSY1;
	int fPredX;
	int fPredY;
	int fRectMoveBX1;
	int fRectMoveBY1;
	int fRectMoveBX2;
	int fRectMoveBY2;
	TIEAnimPoly *fHPolySel;
	TIESelectionBase fSelectionBase;
	Classes::TNotifyEvent fOnSelectionChanging;
	Classes::TNotifyEvent fOnSelectionChange;
	Classes::TNotifyEvent fOnMouseInSel;
	TIESelectionOptions fSelectionOptions;
	int fStartingPolyCount;
	Classes::TList* fAnimPoly;
	Extctrls::TTimer* fAnimPolyTimer;
	TIEMouseInteract fMouseInteract;
	bool fScrollBarsAlwaysVisible;
	Hyieutils::TIEScrollBarParams* fVScrollBarParams;
	Hyieutils::TIEScrollBarParams* fHScrollBarParams;
	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);
	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 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);
	void __fastcall DrawBackground(Graphics::TCanvas* Canvas);
	PPointArray __fastcall GetPolySelArray(void);
	HIDESBASE MESSAGE void __fastcall WMKillFocus(Messages::TWMKillFocus &Msg);
	HIDESBASE MESSAGE void __fastcall WMSetFocus(Messages::TWMSetFocus &Msg);
	
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 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
		};
	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 int Zoom = {read=fZoom, write=SetZoom, nodefault};
	void __fastcall ZoomSelection(void);
	void __fastcall ZoomAt(int x, int y, int ZoomVal);
	__property ClientWidth ;
	__property ClientHeight ;
	__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};
	
__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=0};
	__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=0};
	__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
	
};

#pragma pack(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 "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(PPointArray p, int n);

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

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