⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 flexutils.hpp

📁 FlexGraphics是一套创建矢量图形的VCL组件
💻 HPP
📖 第 1 页 / 共 2 页
字号:
	int FWritePropDataSize;
	void __fastcall SetProcess(const TFlexFilerProcess Value);
	void __fastcall SetDicCapacity(const int Value);
	void __fastcall SetDicDeleteCount(const int Value);
	AnsiString __fastcall GetReadKey(int Index);
	int __fastcall GetPropertyDataSize(int PropType, const Variant &Value);
	bool __fastcall AddKey(const AnsiString Key, int &KeyIndex);
	int __fastcall AddWriteKey(const AnsiString Key, bool DontStore);
	bool __fastcall ReadKey(void);
	void __fastcall WriteKey(const AnsiString Key, int KeyIndex, bool DontStore);
	void __fastcall ResetWriteKeys(void);
	bool __fastcall ReadCommandHeaderAndKeys(TFlexBinHeader &Header);
	bool __fastcall WriteCommandHeaderAndKeys(Word Command, int DataSize);
	bool __fastcall ReadPropertyData(Variant &Value, int &PropType);
	void * __fastcall AllocReadData(void);
	void __fastcall ClearReadData(void);
	void * __fastcall GrowWriteData(int Size);
	void __fastcall ClearWriteData(void);
	void __fastcall CheckDontStore(Word Command, bool &DontStoreKey1, bool &DontStoreKey2);
	void __fastcall ReduceDictionary(int ACount);
	
public:
	__fastcall TFlexBinaryData(TFlexFiler* AOwner);
	__fastcall virtual ~TFlexBinaryData(void);
	void __fastcall Reset(void);
	bool __fastcall LoadStrCheck(/* out */ AnsiString &s);
	void __fastcall SaveStr(const AnsiString s);
	void __fastcall SaveStrBuf(void * Buf, int BufSize);
	bool __fastcall ReadCommand(void);
	int __fastcall ReadCommandData(/* out */ Variant &Value);
	void * __fastcall ReadCommandUserData(void);
	bool __fastcall WritePropertyCommand(const AnsiString PropName, int PropType, const Variant &Value, 
		bool DontStoreValueKey);
	void __fastcall WriteSimpleCommand(Word Command, int KeyCount, const AnsiString Key1, const AnsiString 
		Key2, bool DontStoreKey1, bool DontStoreKey2);
	void __fastcall WriteDataCommand(Word Command, void *Data, int DataSize, int KeyCount, const AnsiString 
		Key1, const AnsiString Key2, bool DontStoreKey1, bool DontStoreKey2);
	int __fastcall GetPropertyType(const Variant &PropValue);
	__property TFlexFilerProcess Process = {read=FProcess, nodefault};
	__property TFlexBinKeyStoreSet KeyDontStore = {read=FKeyDontStore, write=FKeyDontStore, nodefault};
		
	__property bool Finished = {read=FFinished, nodefault};
	__property int DicCapacity = {read=FDicCapacity, write=SetDicCapacity, nodefault};
	__property int DicDeleteCount = {read=FDicDeleteCount, write=SetDicDeleteCount, nodefault};
	__property Word ReadCmdCommand = {read=FCmdReadHeader.Command, nodefault};
	__property int ReadCmdSize = {read=FCmdReadHeader.Size, nodefault};
	__property int ReadCmdDataSize = {read=FCmdReadDataSize, nodefault};
	__property Word ReadCmdKeyCount = {read=FCmdReadHeader.KeyCount, nodefault};
	__property AnsiString ReadCmdKeys[int Index] = {read=GetReadKey};
	__property int ReadCmdKeysSize = {read=FCmdKeysSize, nodefault};
};


class DELPHICLASS TIdPool;
class PASCALIMPLEMENTATION TIdPool : public System::TObject 
{
	typedef System::TObject inherited;
	
private:
	Classes::TList* FPool;
	bool __fastcall GetUsed(unsigned Value);
	
public:
	__fastcall TIdPool(void);
	__fastcall virtual ~TIdPool(void);
	unsigned __fastcall Generate(void);
	bool __fastcall Use(unsigned Value);
	bool __fastcall Release(unsigned Value);
	unsigned __fastcall NextUsed(unsigned Value, int &Index);
	void __fastcall Clear(void);
	__property bool Used[unsigned Value] = {read=GetUsed};
	__property Classes::TList* PoolList = {read=FPool};
};


#pragma option push -b-
enum TNotifyLinkCode { ncInfo, ncDestroy, ncPropBeforeChanged, ncPropChanged, ncControlNotify };
#pragma option pop

struct TNotifyLinkInfo;
typedef TNotifyLinkInfo *PNotifyLinkInfo;

struct TNotifyLinkInfo
{
	
	TNotifyLinkCode Code;
	union
	{
		struct 
		{
			System::TObject* Control;
			TFlexNotify ControlNotify;
			
		};
		struct 
		{
			System::TObject* Prop;
			
		};
		struct 
		{
			int WParam;
			int LParam;
			
		};
		
	};
} ;

class DELPHICLASS TNotifyLink;
typedef void __fastcall (__closure *TNotifyLinkEvent)(System::TObject* Sender, TNotifyLink* Source, 
	const TNotifyLinkInfo &Info);

class PASCALIMPLEMENTATION TNotifyLink : public System::TObject 
{
	typedef System::TObject inherited;
	
private:
	Classes::TList* FLinks;
	System::TObject* FOwner;
	int FTag;
	bool FDestroying;
	TNotifyLinkEvent FOnNotify;
	TNotifyLinkEvent FOnFreeNotify;
	TNotifyLink* __fastcall GetLink(int Index);
	int __fastcall GetLinkCount(void);
	int __fastcall GetLinkRefCount(int Index);
	
public:
	__fastcall TNotifyLink(System::TObject* AOwner);
	__fastcall virtual ~TNotifyLink(void);
	int __fastcall IndexOf(TNotifyLink* Link);
	int __fastcall Subscribe(TNotifyLink* Link);
	int __fastcall Unsubscribe(TNotifyLink* Link);
	int __fastcall Notify(const TNotifyLinkInfo &Info);
	void __fastcall DestroyNotify(void);
	int __fastcall PropNotify(System::TObject* AProp, bool IsBeforeNotify);
	int __fastcall ControlNotify(System::TObject* AControl, TFlexNotify ANotify);
	__property System::TObject* Owner = {read=FOwner};
	__property int LinkCount = {read=GetLinkCount, nodefault};
	__property TNotifyLink* Links[int Index] = {read=GetLink/*, default*/};
	__property int LinksRefCount[int Index] = {read=GetLinkRefCount};
	__property int Tag = {read=FTag, write=FTag, nodefault};
	__property bool Destroying = {read=FDestroying, nodefault};
	__property TNotifyLinkEvent OnNotify = {read=FOnNotify, write=FOnNotify};
	__property TNotifyLinkEvent OnFreeNotify = {read=FOnFreeNotify, write=FOnFreeNotify};
};


typedef int __fastcall (__closure *TSortedListCompare)(void * Item1, void * Item2);

typedef Word TVarType;

typedef AnsiString UTF8String;

typedef AnsiString *PUTF8String;

typedef void __fastcall (__closure *TGetLookupInfoEvent)(Classes::TPersistent* &Ancestor, Classes::TComponent* 
	&Root, Classes::TComponent* &LookupRoot, Classes::TComponent* &RootAncestor);

//-- var, const, procedure ---------------------------------------------------
extern PACKAGE Word CF_FLEXDOC;
#define fcDocument "document"
#define fcClipboard "clipboard"
#define fcLibrary "library"
#define fcObject "object"
#define fcProperty "property"
#define fcEnd "end"
#define fcBinary "flexbinary"
extern PACKAGE AnsiString fcReserved[7];
#define IndentStep "  "
extern PACKAGE AnsiString BooleanWords[2];
static const Shortint fbcUnknown = 0x0;
static const Shortint fbcDocument = 0x1;
static const Shortint fbcClipboard = 0x2;
static const Shortint fbcLibrary = 0x3;
static const Shortint fbcObject = 0x4;
static const Shortint fbcProperty = 0x5;
static const Shortint fbcComplexProperty = 0x6;
static const Shortint fbcEnd = 0x7;
static const Shortint fbcReduceDictionary = 0x8;
static const Shortint fbcBinaryEnd = 0x9;
static const Word fbcUser = 0x1000;
static const Shortint fbkIndexSizeMask = 0x3;
static const Shortint fbkIndexByte = 0x1;
static const Shortint fbkIndexWord = 0x2;
static const Shortint fbkIndexDWord = 0x3;
static const Shortint fbkIsIndex = 0x4;
static const Shortint fbkDontStore = 0x8;
static const Shortint fbpEmpty = 0x0;
static const Shortint fbpNull = 0x1;
static const Shortint fbpSmallint = 0x2;
static const Shortint fbpInteger = 0x3;
static const Shortint fbpSingle = 0x4;
static const Shortint fbpDouble = 0x5;
static const Shortint fbpCurrency = 0x6;
static const Shortint fbpDate = 0x7;
static const Shortint fbpBoolean = 0xb;
static const Shortint fbpShortInt = 0x10;
static const Shortint fbpByte = 0x11;
static const Shortint fbpWord = 0x12;
static const Shortint fbpLongWord = 0x13;
static const Shortint fbpInt64 = 0x14;
static const Word fbpString = 0x100;
static const Word fbpStrList = 0x200;
static const Word fbpHexData = 0x201;
static const Shortint crShapeCursor = 0x1;
static const Shortint crShapeAddCursor = 0x2;
static const Shortint crShapeDelCursor = 0x3;
static const Shortint crShapeCloseCursor = 0x4;
static const Shortint crShapeMoveCursor = 0x5;
static const Shortint crShapeMoveCurveCursor = 0x6;
static const Shortint crCreateControlCursor = 0x7;
static const Shortint crCreateRectCursor = 0x8;
static const Shortint crCreateEllipseCursor = 0x9;
static const Shortint crCreateTextCursor = 0xa;
static const Shortint crCreatePicCursor = 0xb;
static const Shortint crCreatePolyCursor = 0xc;
static const Shortint crZoomInCursor = 0xd;
static const Shortint crZoomOutCursor = 0xe;
static const Shortint crPanCursor = 0xf;
static const Shortint crPanningCursor = 0x10;
static const Shortint crShapeContinueCursor = 0x11;
static const Shortint crShapeMoveLineCursor = 0x12;
static const Shortint crLastFlexCursor = 0x31;
extern PACKAGE AnsiString FloatDisplayFormat;
static const Word PixelScaleFactor = 0x3e8;
extern PACKAGE bool SysGradientChecked;
extern PACKAGE bool SysGradientEnabled;
extern PACKAGE int SysGradientEllipticSteps;
static const Shortint varByte = 0x11;
static const Shortint varWord = 0x12;
static const Shortint varLongWord = 0x13;
static const Shortint varInt64 = 0x14;
static const Shortint varShortInt = 0x10;
extern PACKAGE void __fastcall LoadFlexCursors(void);
extern PACKAGE bool __fastcall StrBeginsFrom(const AnsiString S1, const AnsiString S2);
extern PACKAGE bool __fastcall FlexStrNeedQuote(const AnsiString s);
extern PACKAGE AnsiString __fastcall ExtractWord(const AnsiString s, int NumWord, char Delimiter);
extern PACKAGE Byte __fastcall HexCharsToByte(Word cw);
extern PACKAGE Word __fastcall ByteToHexChars(Byte b);
extern PACKAGE int __fastcall RectWidth(const Windows::TRect &ARect);
extern PACKAGE int __fastcall RectHeight(const Windows::TRect &ARect);
extern PACKAGE void __fastcall GetPicReadWrite(Graphics::TPicture* Picture, /* out */ Classes::TStreamProc 
	&ReadProc, /* out */ Classes::TStreamProc &WriteProc);
extern PACKAGE Windows::TRect __fastcall NormalizeRect(const Windows::TRect &R);
extern PACKAGE bool __fastcall PointInRect(const Windows::TPoint &p, const Windows::TRect &R);
extern PACKAGE HRGN __fastcall IntersectClipRgn(Graphics::TCanvas* ACanvas, HRGN ClipRgn);
extern PACKAGE HRGN __fastcall IntersectClipPath(HDC DC);
extern PACKAGE void __fastcall PaintGradient(Graphics::TCanvas* ACanvas, const Windows::TRect &ARect
	, TGradientStyle Style, Graphics::TColor Color, Graphics::TColor EndColor, Graphics::TPenMode PenMode
	);
extern PACKAGE HRGN __fastcall CreateTransparentClipRgn(HDC DC, int Width, int Height, Windows::TRect 
	&Dest, Graphics::TColor TransparentColor);
extern PACKAGE void __fastcall ExcludeBitmapTransparency(Graphics::TBitmap* Bmp, Windows::TRect &R, 
	HRGN &ClipRgn);
extern PACKAGE void __fastcall PaintTailed(Graphics::TCanvas* ACanvas, const Windows::TRect &PaintRect
	, const Windows::TRect &RefreshRect, Graphics::TBitmap* ABitmap, PTiledBitmapCache BitmapCache);
extern PACKAGE void __fastcall PaintBitmap(Graphics::TCanvas* ACanvas, const Windows::TRect &PaintRect
	, const Windows::TRect &RefreshRect, Graphics::TBitmap* ABitmap, TBitmapDisplay BitmapDisplay, PTiledBitmapCache 
	BitmapCache, int Scale, bool ClipTransparent);
extern PACKAGE int __fastcall ScaleValue(int Value, int Scale);
extern PACKAGE int __fastcall UnScaleValue(int Value, int Scale);
extern PACKAGE int __fastcall ScalePixels(int Value);
extern PACKAGE int __fastcall UnScalePixels(int Value);
extern PACKAGE int __fastcall ListScan(void * Value, void * List, int Count);
extern PACKAGE int __fastcall ListScanEx(void * Value, void * List, int Index, int Count);
extern PACKAGE int __fastcall ListScanLess(void * Value, void * List, int Count);
extern PACKAGE int __fastcall SortedListFind(Classes::PPointerList List, int Count, void * Item, TSortedListCompare 
	Compare, bool Exact);
extern PACKAGE int __fastcall ListSortItem(Classes::PPointerList List, int Count, int ItemIndex, TSortedListCompare 
	Compare);
extern PACKAGE void __fastcall ListQuickSort(Classes::PPointerList List, int L, int R, TSortedListCompare 
	Compare);
extern PACKAGE bool __fastcall IsClassParent(TMetaClass* AClass, TMetaClass* AParentClass);
extern PACKAGE AnsiString __fastcall DotFloatToStr(const Extended Value);
extern PACKAGE Extended __fastcall DotStrToFloat(AnsiString Value);
extern PACKAGE int __fastcall UnicodeToUtf8(char * Dest, wchar_t * Source, int MaxBytes)/* overload */
	;
extern PACKAGE unsigned __fastcall UnicodeToUtf8(char * Dest, unsigned MaxDestBytes, wchar_t * Source
	, unsigned SourceChars)/* overload */;
extern PACKAGE int __fastcall Utf8ToUnicode(wchar_t * Dest, char * Source, int MaxChars)/* overload */
	;
extern PACKAGE unsigned __fastcall Utf8ToUnicode(wchar_t * Dest, unsigned MaxDestChars, char * Source
	, unsigned SourceBytes)/* overload */;
extern PACKAGE AnsiString __fastcall UTF8Encode(const WideString WS);
extern PACKAGE WideString __fastcall UTF8Decode(const AnsiString S);
extern PACKAGE AnsiString __fastcall AnsiToUtf8(const AnsiString S);
extern PACKAGE AnsiString __fastcall Utf8ToAnsi(const AnsiString S);
extern PACKAGE bool __fastcall AncestorIsValid(Classes::TPersistent* Ancestor, Classes::TComponent* 
	Root, Classes::TComponent* RootAncestor);
extern PACKAGE bool __fastcall IsDefaultPropertyValue(System::TObject* Instance, Typinfo::PPropInfo 
	PropInfo, TGetLookupInfoEvent OnGetLookupInfo);

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

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

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -