home *** CD-ROM | disk | FTP | other *** search
/ CD Actual 9 / CDACTUAL9.iso / progs / CB / DATA.Z / GRAPHICS.HPP < prev    next >
Encoding:
C/C++ Source or Header  |  1996-11-06  |  35.7 KB  |  871 lines

  1. //----------------------------------------------------------------------------
  2. // Graphics.hpp - dcc32 generated hdr (DO NOT EDIT) rev: -2
  3. // From: Graphics.pas
  4. //----------------------------------------------------------------------------
  5. #ifndef GraphicsHPP
  6. #define GraphicsHPP
  7. //----------------------------------------------------------------------------
  8. #ifndef ClassesHPP
  9. #include <Classes.hpp>
  10. #endif
  11.  
  12. #ifndef SysUtilsHPP
  13. #include <SysUtils.hpp>
  14. #endif
  15.  
  16. #ifndef WindowsHPP
  17. #include <Windows.hpp>
  18. #endif
  19.  
  20. #ifndef SystemHPP
  21. #include <System.hpp>
  22. #endif
  23.  
  24. namespace Graphics
  25. {
  26. //-- type declarations -------------------------------------------------------
  27. enum TColor {clMin=-0x7fffffff-1, clMax=0x7fffffff};
  28.  
  29. typedef System::Integer HMETAFILE;
  30.  
  31. typedef System::Integer HENHMETAFILE;
  32.  
  33. class __declspec(delphiclass) EInvalidGraphic;
  34. class __declspec(pascalimplementation) EInvalidGraphic : public Sysutils::Exception
  35. {
  36.     typedef EInvalidGraphic ThisClass;
  37.     typedef Sysutils::Exception inherited;
  38.     
  39. public:
  40.     /* !! Exception.Create */ __fastcall EInvalidGraphic(const System::AnsiString Msg) : Sysutils::Exception(
  41.         Msg) { }
  42.     /* !! Exception.CreateFmt */ __fastcall EInvalidGraphic(const System::AnsiString Msg, const TVarRec 
  43.         *Args, const System::Integer Args_Size) : Sysutils::Exception(Msg, Args, Args_Size) { }
  44.     /* !! Exception.CreateRes */ __fastcall EInvalidGraphic(System::Integer Ident) : Sysutils::Exception(
  45.         Ident) { }
  46.     /* !! Exception.CreateResFmt */ __fastcall EInvalidGraphic(System::Integer Ident, const TVarRec *Args
  47.         , const System::Integer Args_Size) : Sysutils::Exception(Ident, Args, Args_Size) { }
  48.     /* !! Exception.CreateHelp */ __fastcall EInvalidGraphic(const System::AnsiString Msg, System::Integer 
  49.         AHelpContext) : Sysutils::Exception(Msg, AHelpContext) { }
  50.     /* !! Exception.CreateFmtHelp */ __fastcall EInvalidGraphic(const System::AnsiString Msg, const TVarRec 
  51.         *Args, const System::Integer Args_Size, System::Integer AHelpContext) : Sysutils::Exception(Msg, Args
  52.         , Args_Size, AHelpContext) { }
  53.     /* !! Exception.CreateResHelp */ __fastcall EInvalidGraphic(System::Integer Ident, System::Integer 
  54.         AHelpContext) : Sysutils::Exception(Ident, AHelpContext) { }
  55.     /* !! Exception.CreateResFmtHelp */ __fastcall EInvalidGraphic(System::Integer Ident, const TVarRec 
  56.         *Args, const System::Integer Args_Size, System::Integer AHelpContext) : Sysutils::Exception(Ident, 
  57.         Args, Args_Size, AHelpContext) { }
  58.     
  59. public:
  60.     /* !! TObject.Destroy */ __fastcall virtual ~EInvalidGraphic(void) { }
  61.     
  62. };
  63.  
  64. class __declspec(delphiclass) EInvalidGraphicOperation;
  65. class __declspec(pascalimplementation) EInvalidGraphicOperation : public Sysutils::Exception
  66. {
  67.     typedef EInvalidGraphicOperation ThisClass;
  68.     typedef Sysutils::Exception inherited;
  69.     
  70. public:
  71.     /* !! Exception.Create */ __fastcall EInvalidGraphicOperation(const System::AnsiString Msg) : Sysutils::Exception(
  72.         Msg) { }
  73.     /* !! Exception.CreateFmt */ __fastcall EInvalidGraphicOperation(const System::AnsiString Msg, const 
  74.         TVarRec *Args, const System::Integer Args_Size) : Sysutils::Exception(Msg, Args, Args_Size) { }
  75.     /* !! Exception.CreateRes */ __fastcall EInvalidGraphicOperation(System::Integer Ident) : Sysutils::Exception(
  76.         Ident) { }
  77.     /* !! Exception.CreateResFmt */ __fastcall EInvalidGraphicOperation(System::Integer Ident, const TVarRec 
  78.         *Args, const System::Integer Args_Size) : Sysutils::Exception(Ident, Args, Args_Size) { }
  79.     /* !! Exception.CreateHelp */ __fastcall EInvalidGraphicOperation(const System::AnsiString Msg, System::Integer 
  80.         AHelpContext) : Sysutils::Exception(Msg, AHelpContext) { }
  81.     /* !! Exception.CreateFmtHelp */ __fastcall EInvalidGraphicOperation(const System::AnsiString Msg, 
  82.         const TVarRec *Args, const System::Integer Args_Size, System::Integer AHelpContext) : Sysutils::Exception(
  83.         Msg, Args, Args_Size, AHelpContext) { }
  84.     /* !! Exception.CreateResHelp */ __fastcall EInvalidGraphicOperation(System::Integer Ident, System::Integer 
  85.         AHelpContext) : Sysutils::Exception(Ident, AHelpContext) { }
  86.     /* !! Exception.CreateResFmtHelp */ __fastcall EInvalidGraphicOperation(System::Integer Ident, const 
  87.         TVarRec *Args, const System::Integer Args_Size, System::Integer AHelpContext) : Sysutils::Exception(
  88.         Ident, Args, Args_Size, AHelpContext) { }
  89.     
  90. public:
  91.     /* !! TObject.Destroy */ __fastcall virtual ~EInvalidGraphicOperation(void) { }
  92.     
  93. };
  94.  
  95. struct TResData
  96. {
  97.     System::Integer Handle;
  98. } ;
  99.  
  100. enum TFontStyle { fsBold, fsItalic, fsUnderline, fsStrikeOut };
  101.  
  102. typedef Set<TFontStyle, fsBold, fsStrikeOut>  TFontStyles;
  103.  
  104. enum TFontPitch { fpDefault, fpVariable, fpFixed };
  105.  
  106. typedef SmallString<31>  TFontName;
  107.  
  108. typedef System::Byte TFontCharset;
  109.  
  110. struct TFontData
  111. {
  112.     System::Integer Handle;
  113.     System::Integer Height;
  114.     TFontPitch Pitch;
  115.     TFontStyles Style;
  116.     TFontCharset Charset;
  117.     TFontName Name;
  118. } ;
  119.  
  120. typedef DummySet<TFontStyle, fsBold, fsStrikeOut>  TDummyFontStyles;
  121.  
  122. typedef DummySmallString<31>  TDummyFontName;
  123.  
  124. struct TDummyFontData
  125. {
  126.     System::Integer Handle;
  127.     System::Integer Height;
  128.     TFontPitch Pitch;
  129.     TDummyFontStyles Style;
  130.     TFontCharset Charset;
  131.     TDummyFontName Name;
  132. } ;
  133.  
  134. enum TPenStyle { psSolid, psDash, psDot, psDashDot, psDashDotDot, psClear, psInsideFrame };
  135.  
  136. enum TPenMode { pmBlack, pmWhite, pmNop, pmNot, pmCopy, pmNotCopy, pmMergePenNot, pmMaskPenNot, pmMergeNotPen, 
  137.     pmMaskNotPen, pmMerge, pmNotMerge, pmMask, pmNotMask, pmXor, pmNotXor };
  138.  
  139. struct TPenData
  140. {
  141.     System::Integer Handle;
  142.     TColor Color;
  143.     System::Integer Width;
  144.     TPenStyle Style;
  145. } ;
  146.  
  147. enum TBrushStyle { bsSolid, bsClear, bsHorizontal, bsVertical, bsFDiagonal, bsBDiagonal, bsCross, bsDiagCross 
  148.     };
  149.  
  150. class __declspec(delphiclass) TBitmap;
  151. class __declspec(delphiclass) TGraphic;
  152. class __declspec(delphiclass) TCanvas;
  153. class __declspec(pascalimplementation) TGraphic : public Classes::TPersistent
  154. {
  155.     typedef TGraphic ThisClass;
  156.     typedef Classes::TPersistent inherited;
  157.     
  158. private:
  159.     Classes::TNotifyEvent FOnChange;
  160.     System::Boolean FModified;
  161.     System::Byte FReserved;
  162.     void __fastcall SetModified(System::Boolean Value);
  163.     
  164. protected:
  165.     __fastcall virtual TGraphic(void);
  166.     void __fastcall Changed(System::TObject *Sender);
  167.     virtual void __fastcall DefineProperties(Classes::TFiler *Filer);
  168.     virtual void __fastcall Draw(TCanvas *ACanvas, const Windows::TRect &Rect) = 0;
  169.     virtual System::Boolean __fastcall Equals(TGraphic *Graphic);
  170.     virtual System::Boolean __fastcall GetEmpty(void) = 0;
  171.     virtual System::Integer __fastcall GetHeight(void) = 0;
  172.     virtual System::Integer __fastcall GetWidth(void) = 0;
  173.     virtual void __fastcall ReadData(Classes::TStream *Stream);
  174.     virtual void __fastcall SetHeight(System::Integer Value) = 0;
  175.     virtual void __fastcall SetWidth(System::Integer Value) = 0;
  176.     virtual void __fastcall WriteData(Classes::TStream *Stream);
  177.     
  178. public:
  179.     virtual void __fastcall LoadFromFile(const System::AnsiString Filename);
  180.     virtual void __fastcall SaveToFile(const System::AnsiString Filename);
  181.     virtual void __fastcall LoadFromStream(Classes::TStream *Stream) = 0;
  182.     virtual void __fastcall SaveToStream(Classes::TStream *Stream) = 0;
  183.     virtual void __fastcall LoadFromClipboardFormat(System::Word AFormat, System::Integer AData, System::Integer 
  184.         APalette) = 0;
  185.     virtual void __fastcall SaveToClipboardFormat(System::Word &AFormat, System::Integer &AData, System::Integer 
  186.         &APalette) = 0;
  187.     __property System::Boolean Empty = {read=GetEmpty, nodefault};
  188.     __property System::Integer Height = {read=GetHeight, write=SetHeight, nodefault};
  189.     __property System::Boolean Modified = {read=FModified, write=SetModified, nodefault};
  190.     __property System::Integer Width = {read=GetWidth, write=SetWidth, nodefault};
  191.     __property Classes::TNotifyEvent OnChange = {read=FOnChange, write=FOnChange};
  192. public:
  193.     /* !! TObject.Destroy */ __fastcall virtual ~TGraphic(void) { }
  194.     
  195. };
  196.  
  197. class __declspec(delphiclass) TBitmapImage;
  198. class __declspec(delphiclass) TInternalImage;
  199. class __declspec(pascalimplementation) TInternalImage : public System::TObject
  200. {
  201.     typedef TInternalImage ThisClass;
  202.     typedef System::TObject inherited;
  203.     
  204. private:
  205.     System::Integer FRefCount;
  206.     Classes::TCustomMemoryStream *FMemoryImage;
  207.     void __fastcall Reference(void);
  208.     void __fastcall Release(void);
  209.     virtual void __fastcall FreeHandle(void) = 0;
  210. public:
  211.     /* !! TObject.Create */ __fastcall TInternalImage(void) : System::TObject() { }
  212.     /* !! TObject.Destroy */ __fastcall virtual ~TInternalImage(void) { }
  213.     
  214. };
  215.  
  216. enum TDIBType { dtNone, dtWin, dtPM };
  217.  
  218. class __declspec(pascalimplementation) TBitmapImage : public TInternalImage
  219. {
  220.     typedef TBitmapImage ThisClass;
  221.     typedef TInternalImage inherited;
  222.     
  223. private:
  224.     System::Integer FHandle;
  225.     System::Integer FPalette;
  226.     System::Integer FWidth;
  227.     System::Integer FHeight;
  228.     void *FDIBHeader;
  229.     void *FDIBBits;
  230.     System::Boolean FMonochrome;
  231.     TDIBType FDIBType;
  232.     virtual void __fastcall FreeHandle(void);
  233. public:
  234.     /* !! TObject.Create */ __fastcall TBitmapImage(void) : Graphics::TInternalImage() { }
  235.     /* !! TObject.Destroy */ __fastcall virtual ~TBitmapImage(void) { }
  236.     
  237. };
  238.  
  239. class __declspec(pascalimplementation) TBitmap : public TGraphic
  240. {
  241.     typedef TBitmap ThisClass;
  242.     typedef TGraphic inherited;
  243.     
  244. private:
  245.     TBitmapImage *FImage;
  246.     TCanvas *FCanvas;
  247.     System::Boolean FIgnorePalette;
  248.     void __fastcall Changing(System::TObject *Sender);
  249.     void __fastcall CopyImage(System::Integer AHandle, System::Integer APalette, System::Integer AWidth
  250.         , System::Integer AHeight, System::Boolean AMonochrome);
  251.     void __fastcall FreeContext(void);
  252.     TCanvas *__fastcall GetCanvas(void);
  253.     virtual System::Integer __fastcall GetHandle(void);
  254.     System::Boolean __fastcall GetMonochrome(void);
  255.     System::Integer __fastcall GetPalette(void);
  256.     TColor __fastcall GetTransparentColor(void);
  257.     void __fastcall HandleNeeded(void);
  258.     void __fastcall ReadStream(System::Longint Size, Classes::TStream *Stream);
  259.     void __fastcall ReadStreamDIB(Classes::TCustomMemoryStream *Image);
  260.     void __fastcall SetHandle(System::Integer Value);
  261.     void __fastcall SetMonochrome(System::Boolean Value);
  262.     void __fastcall SetPalette(System::Integer Value);
  263.     void __fastcall MemoryImageNeeded(void);
  264.     void __fastcall PaletteNeeded(void);
  265.     void __fastcall NewImage(System::Integer NewHandle, System::Integer NewPalette, System::Integer NewWidth
  266.         , System::Integer NewHeight, System::Boolean NewMonochrome, Classes::TCustomMemoryStream *NewImage
  267.         , TDIBType NewDIBType, System::Pointer NewDIBHeader, System::Pointer NewDIBBits);
  268.     void __fastcall WriteStream(Classes::TStream *Stream, System::Boolean WriteSize);
  269.     
  270. protected:
  271.     virtual void __fastcall Draw(TCanvas *ACanvas, const Windows::TRect &Rect);
  272.     virtual System::Boolean __fastcall GetEmpty(void);
  273.     virtual System::Integer __fastcall GetHeight(void);
  274.     virtual System::Integer __fastcall GetWidth(void);
  275.     virtual void __fastcall ReadData(Classes::TStream *Stream);
  276.     virtual void __fastcall SetWidth(System::Integer Value);
  277.     virtual void __fastcall SetHeight(System::Integer Value);
  278.     virtual void __fastcall WriteData(Classes::TStream *Stream);
  279.     
  280. public:
  281.     __fastcall virtual TBitmap(void);
  282.     __fastcall virtual ~TBitmap(void);
  283.     virtual void __fastcall Assign(Classes::TPersistent *Source);
  284.     void __fastcall Dormant(void);
  285.     void __fastcall FreeImage(void);
  286.     virtual void __fastcall LoadFromClipboardFormat(System::Word AFormat, System::Integer AData, System::Integer 
  287.         APalette);
  288.     virtual void __fastcall LoadFromStream(Classes::TStream *Stream);
  289.     void __fastcall LoadFromResourceName(System::Integer Instance, const System::AnsiString ResName);
  290.     void __fastcall LoadFromResourceID(System::Integer Instance, System::Integer ResID);
  291.     System::Integer __fastcall ReleaseHandle(void);
  292.     System::Integer __fastcall ReleasePalette(void);
  293.     virtual void __fastcall SaveToClipboardFormat(System::Word &Format, System::Integer &Data, System::Integer 
  294.         &APalette);
  295.     virtual void __fastcall SaveToStream(Classes::TStream *Stream);
  296.     __property TCanvas * Canvas = {read=GetCanvas, nodefault};
  297.     __property System::Integer Handle = {read=GetHandle, write=SetHandle, nodefault};
  298.     __property System::Boolean Monochrome = {read=GetMonochrome, write=SetMonochrome, nodefault};
  299.     __property System::Integer Palette = {read=GetPalette, write=SetPalette, nodefault};
  300.     __property System::Boolean IgnorePalette = {read=FIgnorePalette, write=FIgnorePalette, nodefault};
  301.     __property TColor TransparentColor = {read=GetTransparentColor, nodefault};
  302. };
  303.  
  304. struct TBrushData
  305. {
  306.     System::Integer Handle;
  307.     TColor Color;
  308.     TBitmap *Bitmap;
  309.     TBrushStyle Style;
  310. } ;
  311.  
  312. struct TResource;
  313. typedef TResource *PResource;
  314.  
  315. struct TResource
  316. {
  317.     TResource *Next;
  318.     System::Integer RefCount;
  319.     System::Integer Handle;
  320.     System::Word HashCode;
  321.     union
  322.     {
  323.         TBrushData Brush;
  324.         TPenData Pen;
  325.         TDummyFontData Font;
  326.         TResData Data;
  327.         
  328.     };
  329. } ;
  330.  
  331. class __declspec(delphiclass) TGraphicsObject;
  332. class __declspec(pascalimplementation) TGraphicsObject : public Classes::TPersistent
  333. {
  334.     typedef TGraphicsObject ThisClass;
  335.     typedef Classes::TPersistent inherited;
  336.     
  337. private:
  338.     Classes::TNotifyEvent FOnChange;
  339.     TResource *FResource;
  340.     
  341. protected:
  342.     virtual void __fastcall Changed(void);
  343.     
  344. public:
  345.     __property Classes::TNotifyEvent OnChange = {read=FOnChange, write=FOnChange};
  346. public:
  347.     /* !! TObject.Create */ __fastcall TGraphicsObject(void) : Classes::TPersistent() { }
  348.     /* !! TObject.Destroy */ __fastcall virtual ~TGraphicsObject(void) { }
  349.     
  350. };
  351.  
  352. class __declspec(delphiclass) TFont;
  353. class __declspec(pascalimplementation) TFont : public TGraphicsObject
  354. {
  355.     typedef TFont ThisClass;
  356.     typedef TGraphicsObject inherited;
  357.     
  358. private:
  359.     TColor FColor;
  360.     System::Integer FPixelsPerInch;
  361.     void __fastcall GetData(TFontData &FontData);
  362.     void __fastcall SetData(const TFontData &FontData);
  363.     
  364. protected:
  365.     System::Integer __fastcall GetHandle(void);
  366.     System::Integer __fastcall GetHeight(void);
  367.     TFontName __fastcall GetName(void);
  368.     TFontPitch __fastcall GetPitch(void);
  369.     System::Integer __fastcall GetSize(void);
  370.     TFontStyles __fastcall GetStyle(void);
  371.     TFontCharset __fastcall GetCharset(void);
  372.     void __fastcall SetColor(TColor Value);
  373.     void __fastcall SetHandle(System::Integer Value);
  374.     void __fastcall SetHeight(System::Integer Value);
  375.     void __fastcall SetName(const TFontName &Value);
  376.     void __fastcall SetPitch(TFontPitch Value);
  377.     void __fastcall SetSize(System::Integer Value);
  378.     void __fastcall SetStyle( TFontStyles Value);
  379.     void __fastcall SetCharset(TFontCharset Value);
  380.     
  381. public:
  382.     __fastcall TFont(void);
  383.     __fastcall virtual ~TFont(void);
  384.     virtual void __fastcall Assign(Classes::TPersistent *Source);
  385.     __property System::Integer Handle = {read=GetHandle, write=SetHandle, nodefault};
  386.     __property System::Integer PixelsPerInch = {read=FPixelsPerInch, write=FPixelsPerInch, nodefault};
  387.     
  388. __published:
  389.     __property TFontCharset Charset = {read=GetCharset, write=SetCharset, default=1};
  390.     __property TColor Color = {read=FColor, write=SetColor, nodefault};
  391.     __property System::Integer Height = {read=GetHeight, write=SetHeight, nodefault};
  392.     __property TFontName Name = {read=GetName, write=SetName};
  393.     __property TFontPitch Pitch = {read=GetPitch, write=SetPitch, default=0};
  394.     __property System::Integer Size = {read=GetSize, write=SetSize, stored=false, nodefault};
  395.     __property TFontStyles Style = {read=GetStyle, write=SetStyle, nodefault};
  396. };
  397.  
  398. class __declspec(delphiclass) TPen;
  399. class __declspec(pascalimplementation) TPen : public TGraphicsObject
  400. {
  401.     typedef TPen ThisClass;
  402.     typedef TGraphicsObject inherited;
  403.     
  404. private:
  405.     TPenMode FMode;
  406.     void __fastcall GetData(TPenData &PenData);
  407.     void __fastcall SetData(const TPenData &PenData);
  408.     
  409. protected:
  410.     TColor __fastcall GetColor(void);
  411.     void __fastcall SetColor(TColor Value);
  412.     System::Integer __fastcall GetHandle(void);
  413.     void __fastcall SetHandle(System::Integer Value);
  414.     void __fastcall SetMode(TPenMode Value);
  415.     TPenStyle __fastcall GetStyle(void);
  416.     void __fastcall SetStyle(TPenStyle Value);
  417.     System::Integer __fastcall GetWidth(void);
  418.     void __fastcall SetWidth(System::Integer Value);
  419.     
  420. public:
  421.     __fastcall TPen(void);
  422.     __fastcall virtual ~TPen(void);
  423.     virtual void __fastcall Assign(Classes::TPersistent *Source);
  424.     __property System::Integer Handle = {read=GetHandle, write=SetHandle, nodefault};
  425.     
  426. __published:
  427.     __property TColor Color = {read=GetColor, write=SetColor, default=0};
  428.     __property TPenMode Mode = {read=FMode, write=SetMode, default=4};
  429.     __property TPenStyle Style = {read=GetStyle, write=SetStyle, default=0};
  430.     __property System::Integer Width = {read=GetWidth, write=SetWidth, default=1};
  431. };
  432.  
  433. class __declspec(delphiclass) TBrush;
  434. class __declspec(pascalimplementation) TBrush : public TGraphicsObject
  435. {
  436.     typedef TBrush ThisClass;
  437.     typedef TGraphicsObject inherited;
  438.     
  439. private:
  440.     void __fastcall GetData(TBrushData &BrushData);
  441.     void __fastcall SetData(const TBrushData &BrushData);
  442.     
  443. protected:
  444.     TBitmap *__fastcall GetBitmap(void);
  445.     void __fastcall SetBitmap(TBitmap *Value);
  446.     TColor __fastcall GetColor(void);
  447.     void __fastcall SetColor(TColor Value);
  448.     System::Integer __fastcall GetHandle(void);
  449.     void __fastcall SetHandle(System::Integer Value);
  450.     TBrushStyle __fastcall GetStyle(void);
  451.     void __fastcall SetStyle(TBrushStyle Value);
  452.     
  453. public:
  454.     __fastcall TBrush(void);
  455.     __fastcall virtual ~TBrush(void);
  456.     virtual void __fastcall Assign(Classes::TPersistent *Source);
  457.     __property TBitmap * Bitmap = {read=GetBitmap, write=SetBitmap, nodefault};
  458.     __property System::Integer Handle = {read=GetHandle, write=SetHandle, nodefault};
  459.     
  460. __published:
  461.     __property TColor Color = {read=GetColor, write=SetColor, default=16777215};
  462.     __property TBrushStyle Style = {read=GetStyle, write=SetStyle, default=0};
  463. };
  464.  
  465. enum TFillStyle { fsSurface, fsBorder };
  466.  
  467. enum TFillMode { fmAlternate, fmWinding };
  468.  
  469. typedef System::Integer TCopyMode;
  470.  
  471. enum TCanvasStates { csHandleValid, csFontValid, csPenValid, csBrushValid };
  472.  
  473. typedef Set<TCanvasStates, csHandleValid, csBrushValid>  TCanvasState;
  474.  
  475. class __declspec(pascalimplementation) TCanvas : public Classes::TPersistent
  476. {
  477.     typedef TCanvas ThisClass;
  478.     typedef Classes::TPersistent inherited;
  479.     
  480. private:
  481.     System::Integer FHandle;
  482.     TCanvasState State;
  483.     TFont *FFont;
  484.     TPen *FPen;
  485.     TBrush *FBrush;
  486.     Windows::TPoint FPenPos;
  487.     System::Longint FCopyMode;
  488.     Classes::TNotifyEvent FOnChange;
  489.     Classes::TNotifyEvent FOnChanging;
  490.     void __fastcall CreateBrush(void);
  491.     void __fastcall CreateFont(void);
  492.     void __fastcall CreatePen(void);
  493.     void __fastcall BrushChanged(System::TObject *ABrush);
  494.     void __fastcall DeselectHandles(void);
  495.     Windows::TRect __fastcall GetClipRect(void);
  496.     System::Integer __fastcall GetHandle(void);
  497.     Windows::TPoint __fastcall GetPenPos(void);
  498.     TColor __fastcall GetPixel(System::Integer X, System::Integer Y);
  499.     void __fastcall FontChanged(System::TObject *AFont);
  500.     void __fastcall PenChanged(System::TObject *APen);
  501.     void __fastcall SetBrush(TBrush *Value);
  502.     void __fastcall SetFont(TFont *Value);
  503.     void __fastcall SetHandle(System::Integer Value);
  504.     void __fastcall SetPen(TPen *Value);
  505.     void __fastcall SetPenPos(const Windows::TPoint &Value);
  506.     void __fastcall SetPixel(System::Integer X, System::Integer Y, TColor Value);
  507.     
  508. protected:
  509.     virtual void __fastcall Changed(void);
  510.     virtual void __fastcall Changing(void);
  511.     virtual void __fastcall CreateHandle(void);
  512.     void __fastcall RequiredState( TCanvasState ReqState);
  513.     
  514. public:
  515.     __fastcall TCanvas(void);
  516.     __fastcall virtual ~TCanvas(void);
  517.     void __fastcall Arc(System::Integer X1, System::Integer Y1, System::Integer X2, System::Integer Y2, 
  518.         System::Integer X3, System::Integer Y3, System::Integer X4, System::Integer Y4);
  519.     void __fastcall BrushCopy(const Windows::TRect &Dest, TBitmap *Bitmap, const Windows::TRect &Source
  520.         , TColor Color);
  521.     void __fastcall Chord(System::Integer X1, System::Integer Y1, System::Integer X2, System::Integer Y2
  522.         , System::Integer X3, System::Integer Y3, System::Integer X4, System::Integer Y4);
  523.     void __fastcall CopyRect(const Windows::TRect &Dest, TCanvas *Canvas, const Windows::TRect &Source)
  524.         ;
  525.     void __fastcall Draw(System::Integer X, System::Integer Y, TGraphic *Graphic);
  526.     void __fastcall DrawFocusRect(const Windows::TRect &Rect);
  527.     void __fastcall Ellipse(System::Integer X1, System::Integer Y1, System::Integer X2, System::Integer 
  528.         Y2);
  529.     void __fastcall FillRect(const Windows::TRect &Rect);
  530.     void __fastcall FloodFill(System::Integer X, System::Integer Y, TColor Color, TFillStyle FillStyle)
  531.         ;
  532.     void __fastcall FrameRect(const Windows::TRect &Rect);
  533.     void __fastcall LineTo(System::Integer X, System::Integer Y);
  534.     void __fastcall MoveTo(System::Integer X, System::Integer Y);
  535.     void __fastcall Pie(System::Integer X1, System::Integer Y1, System::Integer X2, System::Integer Y2, 
  536.         System::Integer X3, System::Integer Y3, System::Integer X4, System::Integer Y4);
  537.     void __fastcall Polygon(const TPoint *Points, const System::Integer Points_Size);
  538.     void __fastcall Polyline(const TPoint *Points, const System::Integer Points_Size);
  539.     void __fastcall Rectangle(System::Integer X1, System::Integer Y1, System::Integer X2, System::Integer 
  540.         Y2);
  541.     void __fastcall Refresh(void);
  542.     void __fastcall RoundRect(System::Integer X1, System::Integer Y1, System::Integer X2, System::Integer 
  543.         Y2, System::Integer X3, System::Integer Y3);
  544.     void __fastcall StretchDraw(const Windows::TRect &Rect, TGraphic *Graphic);
  545.     System::Integer __fastcall TextHeight(const System::AnsiString Text);
  546.     void __fastcall TextOut(System::Integer X, System::Integer Y, const System::AnsiString Text);
  547.     void __fastcall TextRect(const Windows::TRect &Rect, System::Integer X, System::Integer Y, const System::AnsiString 
  548.         Text);
  549.     System::Integer __fastcall TextWidth(const System::AnsiString Text);
  550.     __property Windows::TRect ClipRect = {read=GetClipRect};
  551.     __property System::Integer Handle = {read=GetHandle, write=SetHandle, nodefault};
  552.     __property Windows::TPoint PenPos = {read=GetPenPos, write=SetPenPos};
  553.     __property TColor Pixels[System::Integer X][System::Integer Y] = {read=GetPixel, write=SetPixel};
  554.     __property Classes::TNotifyEvent OnChange = {read=FOnChange, write=FOnChange};
  555.     __property Classes::TNotifyEvent OnChanging = {read=FOnChanging, write=FOnChanging};
  556.     
  557. __published:
  558.     __property TBrush * Brush = {read=FBrush, write=SetBrush, nodefault};
  559.     __property System::Longint CopyMode = {read=FCopyMode, write=FCopyMode, default=13369376};
  560.     __property TFont * Font = {read=FFont, write=SetFont, nodefault};
  561.     __property TPen * Pen = {read=FPen, write=SetPen, nodefault};
  562. };
  563.  
  564. typedef System::TMetaClass *TGraphicClass;
  565.  
  566. class __declspec(delphiclass) TPicture;
  567. class __declspec(delphiclass) TIcon;
  568. class __declspec(delphiclass) TMetafile;
  569. class __declspec(pascalimplementation) TPicture : public Classes::TPersistent
  570. {
  571.     typedef TPicture ThisClass;
  572.     typedef Classes::TPersistent inherited;
  573.     
  574. private:
  575.     TGraphic *FGraphic;
  576.     Classes::TNotifyEvent FOnChange;
  577.     void __fastcall ForceType(System::TMetaClass * GraphicType);
  578.     TBitmap *__fastcall GetBitmap(void);
  579.     System::Integer __fastcall GetHeight(void);
  580.     TIcon *__fastcall GetIcon(void);
  581.     TMetafile *__fastcall GetMetafile(void);
  582.     System::Integer __fastcall GetWidth(void);
  583.     void __fastcall ReadData(Classes::TStream *Stream);
  584.     void __fastcall SetBitmap(TBitmap *Value);
  585.     void __fastcall SetGraphic(TGraphic *Value);
  586.     void __fastcall SetIcon(TIcon *Value);
  587.     void __fastcall SetMetafile(TMetafile *Value);
  588.     void __fastcall WriteData(Classes::TStream *Stream);
  589.     
  590. protected:
  591.     virtual void __fastcall AssignTo(Classes::TPersistent *Dest);
  592.     void __fastcall Changed(System::TObject *Sender);
  593.     virtual void __fastcall DefineProperties(Classes::TFiler *Filer);
  594.     
  595. public:
  596.     __fastcall virtual ~TPicture(void);
  597.     void __fastcall LoadFromFile(const System::AnsiString Filename);
  598.     void __fastcall SaveToFile(const System::AnsiString Filename);
  599.     void __fastcall LoadFromClipboardFormat(System::Word AFormat, System::Integer AData, System::Integer 
  600.         APalette);
  601.     void __fastcall SaveToClipboardFormat(System::Word &AFormat, System::Integer &AData, System::Integer 
  602.         &APalette);
  603.     static /* class method */ System::Boolean __fastcall SupportsClipboardFormat(const System::TMetaClass * const vmt, 
  604.         System::Word AFormat);
  605.     virtual void __fastcall Assign(Classes::TPersistent *Source);
  606.     static /* class method */ void __fastcall RegisterFileFormat(const System::TMetaClass * const vmt, 
  607.         const System::AnsiString AExtension, const System::AnsiString ADescription, System::TMetaClass * AGraphicClass
  608.         );
  609.     static /* class method */ void __fastcall RegisterFileFormatRes(const System::TMetaClass * const vmt, 
  610.         const System::AnsiString AExtension, System::Integer ADescriptionResID, System::TMetaClass * AGraphicClass
  611.         );
  612.     static /* class method */ void __fastcall RegisterClipboardFormat(const System::TMetaClass * const vmt, 
  613.         System::Word AFormat, System::TMetaClass * AGraphicClass);
  614.     __property TBitmap * Bitmap = {read=GetBitmap, write=SetBitmap, nodefault};
  615.     __property TGraphic * Graphic = {read=FGraphic, write=SetGraphic, nodefault};
  616.     __property System::Integer Height = {read=GetHeight, nodefault};
  617.     __property TIcon * Icon = {read=GetIcon, write=SetIcon, nodefault};
  618.     __property TMetafile * Metafile = {read=GetMetafile, write=SetMetafile, nodefault};
  619.     __property System::Integer Width = {read=GetWidth, nodefault};
  620.     __property Classes::TNotifyEvent OnChange = {read=FOnChange, write=FOnChange};
  621. public:
  622.     /* !! TObject.Create */ __fastcall TPicture(void) : Classes::TPersistent() { }
  623.     
  624. };
  625.  
  626. class __declspec(delphiclass) TMetafileCanvas;
  627. class __declspec(pascalimplementation) TMetafileCanvas : public TCanvas
  628. {
  629.     typedef TMetafileCanvas ThisClass;
  630.     typedef TCanvas inherited;
  631.     
  632. private:
  633.     TMetafile *FMetafile;
  634.     
  635. public:
  636.     __fastcall TMetafileCanvas(TMetafile *AMetafile, System::Integer ReferenceDevice);
  637.     __fastcall TMetafileCanvas(TMetafile *AMetafile, System::Integer ReferenceDevice, const System::AnsiString 
  638.         CreatedBy, const System::AnsiString Description);
  639.     __fastcall virtual ~TMetafileCanvas(void);
  640. };
  641.  
  642. class __declspec(delphiclass) TMetafileImage;
  643. class __declspec(pascalimplementation) TMetafileImage : public System::TObject
  644. {
  645.     typedef TMetafileImage ThisClass;
  646.     typedef System::TObject inherited;
  647.     
  648. private:
  649.     System::Integer FRefCount;
  650.     System::Integer FHandle;
  651.     System::Integer FWidth;
  652.     System::Integer FHeight;
  653.     System::Integer FPalette;
  654.     System::Word FInch;
  655.     System::Integer FTempWidth;
  656.     System::Integer FTempHeight;
  657.     void __fastcall Reference(void);
  658.     void __fastcall Release(void);
  659. public:
  660.     /* !! TObject.Create */ __fastcall TMetafileImage(void) : System::TObject() { }
  661.     /* !! TObject.Destroy */ __fastcall virtual ~TMetafileImage(void) { }
  662.     
  663. };
  664.  
  665. class __declspec(pascalimplementation) TMetafile : public TGraphic
  666. {
  667.     typedef TMetafile ThisClass;
  668.     typedef TGraphic inherited;
  669.     
  670. private:
  671.     TMetafileImage *FImage;
  672.     System::Boolean FEnhanced;
  673.     System::AnsiString __fastcall GetAuthor(void);
  674.     System::AnsiString __fastcall GetDesc(void);
  675.     System::Integer __fastcall GetHandle(void);
  676.     System::Word __fastcall GetInch(void);
  677.     System::Integer __fastcall GetMMHeight(void);
  678.     System::Integer __fastcall GetMMWidth(void);
  679.     System::Integer __fastcall GetPalette(void);
  680.     void __fastcall NewImage(void);
  681.     void __fastcall SetHandle(System::Integer Value);
  682.     void __fastcall SetInch(System::Word Value);
  683.     void __fastcall SetMMHeight(System::Integer Value);
  684.     void __fastcall SetMMWidth(System::Integer Value);
  685.     void __fastcall UniqueImage(void);
  686.     
  687. protected:
  688.     virtual System::Boolean __fastcall GetEmpty(void);
  689.     virtual System::Integer __fastcall GetHeight(void);
  690.     virtual System::Integer __fastcall GetWidth(void);
  691.     virtual void __fastcall Draw(TCanvas *ACanvas, const Windows::TRect &Rect);
  692.     virtual void __fastcall ReadData(Classes::TStream *Stream);
  693.     void __fastcall ReadEMFStream(Classes::TStream *Stream);
  694.     void __fastcall ReadWMFStream(Classes::TStream *Stream, System::Longint Length);
  695.     virtual void __fastcall SetHeight(System::Integer Value);
  696.     virtual void __fastcall SetWidth(System::Integer Value);
  697.     System::Boolean __fastcall TestEMF(Classes::TStream *Stream);
  698.     virtual void __fastcall WriteData(Classes::TStream *Stream);
  699.     void __fastcall WriteEMFStream(Classes::TStream *Stream);
  700.     void __fastcall WriteWMFStream(Classes::TStream *Stream);
  701.     
  702. public:
  703.     __fastcall virtual TMetafile(void);
  704.     __fastcall virtual ~TMetafile(void);
  705.     void __fastcall Clear(void);
  706.     virtual void __fastcall LoadFromStream(Classes::TStream *Stream);
  707.     virtual void __fastcall SaveToFile(const System::AnsiString Filename);
  708.     virtual void __fastcall SaveToStream(Classes::TStream *Stream);
  709.     virtual void __fastcall LoadFromClipboardFormat(System::Word AFormat, System::Integer AData, System::Integer 
  710.         APalette);
  711.     virtual void __fastcall SaveToClipboardFormat(System::Word &AFormat, System::Integer &AData, System::Integer 
  712.         &APalette);
  713.     virtual void __fastcall Assign(Classes::TPersistent *Source);
  714.     __property System::AnsiString CreatedBy = {read=GetAuthor, nodefault};
  715.     __property System::AnsiString Description = {read=GetDesc, nodefault};
  716.     __property System::Boolean Enhanced = {read=FEnhanced, write=FEnhanced, default=1};
  717.     __property System::Integer Handle = {read=GetHandle, write=SetHandle, nodefault};
  718.     __property System::Integer MMWidth = {read=GetMMWidth, write=SetMMWidth, nodefault};
  719.     __property System::Integer MMHeight = {read=GetMMHeight, write=SetMMHeight, nodefault};
  720.     __property System::Word Inch = {read=GetInch, write=SetInch, nodefault};
  721.     __property System::Integer Palette = {read=GetPalette, nodefault};
  722. };
  723.  
  724. class __declspec(delphiclass) TIconImage;
  725. class __declspec(pascalimplementation) TIconImage : public TInternalImage
  726. {
  727.     typedef TIconImage ThisClass;
  728.     typedef TInternalImage inherited;
  729.     
  730. private:
  731.     System::Integer FHandle;
  732.     virtual void __fastcall FreeHandle(void);
  733. public:
  734.     /* !! TObject.Create */ __fastcall TIconImage(void) : Graphics::TInternalImage() { }
  735.     /* !! TObject.Destroy */ __fastcall virtual ~TIconImage(void) { }
  736.     
  737. };
  738.  
  739. class __declspec(pascalimplementation) TIcon : public TGraphic
  740. {
  741.     typedef TIcon ThisClass;
  742.     typedef TGraphic inherited;
  743.     
  744. private:
  745.     TIconImage *FImage;
  746.     System::Integer __fastcall GetHandle(void);
  747.     void __fastcall HandleNeeded(void);
  748.     void __fastcall ImageNeeded(void);
  749.     void __fastcall NewImage(System::Integer NewHandle, Classes::TMemoryStream *NewImage);
  750.     void __fastcall SetHandle(System::Integer Value);
  751.     
  752. protected:
  753.     virtual void __fastcall Draw(TCanvas *ACanvas, const Windows::TRect &Rect);
  754.     virtual System::Boolean __fastcall GetEmpty(void);
  755.     virtual System::Integer __fastcall GetHeight(void);
  756.     virtual System::Integer __fastcall GetWidth(void);
  757.     virtual void __fastcall SetHeight(System::Integer Value);
  758.     virtual void __fastcall SetWidth(System::Integer Value);
  759.     virtual void __fastcall LoadFromClipboardFormat(System::Word AFormat, System::Integer AData, System::Integer 
  760.         APalette);
  761.     virtual void __fastcall SaveToClipboardFormat(System::Word &Format, System::Integer &Data, System::Integer 
  762.         &APalette);
  763.     
  764. public:
  765.     __fastcall virtual TIcon(void);
  766.     __fastcall virtual ~TIcon(void);
  767.     virtual void __fastcall Assign(Classes::TPersistent *Source);
  768.     virtual void __fastcall LoadFromStream(Classes::TStream *Stream);
  769.     System::Integer __fastcall ReleaseHandle(void);
  770.     virtual void __fastcall SaveToStream(Classes::TStream *Stream);
  771.     __property System::Integer Handle = {read=GetHandle, write=SetHandle, nodefault};
  772. };
  773.  
  774. //-- var, const, procedure ---------------------------------------------------
  775. #define clScrollBar System::Integer(-2147483648)
  776. #define clBackground System::Integer(-2147483647)
  777. #define clActiveCaption System::Integer(-2147483646)
  778. #define clInactiveCaption System::Integer(-2147483645)
  779. #define clMenu System::Integer(-2147483644)
  780. #define clWindow System::Integer(-2147483643)
  781. #define clWindowFrame System::Integer(-2147483642)
  782. #define clMenuText System::Integer(-2147483641)
  783. #define clWindowText System::Integer(-2147483640)
  784. #define clCaptionText System::Integer(-2147483639)
  785. #define clActiveBorder System::Integer(-2147483638)
  786. #define clInactiveBorder System::Integer(-2147483637)
  787. #define clAppWorkSpace System::Integer(-2147483636)
  788. #define clHighlight System::Integer(-2147483635)
  789. #define clHighlightText System::Integer(-2147483634)
  790. #define clBtnFace System::Integer(-2147483633)
  791. #define clBtnShadow System::Integer(-2147483632)
  792. #define clGrayText System::Integer(-2147483631)
  793. #define clBtnText System::Integer(-2147483630)
  794. #define clInactiveCaptionText System::Integer(-2147483629)
  795. #define clBtnHighlight System::Integer(-2147483628)
  796. #define cl3DDkShadow System::Integer(-2147483627)
  797. #define cl3DLight System::Integer(-2147483626)
  798. #define clInfoText System::Integer(-2147483625)
  799. #define clInfoBk System::Integer(-2147483624)
  800. #define clBlack TColor(0)
  801. #define clMaroon TColor(128)
  802. #define clGreen TColor(32768)
  803. #define clOlive TColor(32896)
  804. #define clNavy TColor(8388608)
  805. #define clPurple TColor(8388736)
  806. #define clTeal TColor(8421376)
  807. #define clGray TColor(8421504)
  808. #define clSilver TColor(12632256)
  809. #define clRed TColor(255)
  810. #define clLime TColor(65280)
  811. #define clYellow TColor(65535)
  812. #define clBlue TColor(16711680)
  813. #define clFuchsia TColor(16711935)
  814. #define clAqua TColor(16776960)
  815. #define clLtGray TColor(12632256)
  816. #define clDkGray TColor(8421504)
  817. #define clWhite TColor(16777215)
  818. #define clNone TColor(536870911)
  819. #define clDefault TColor(536870912)
  820. #define cmBlackness System::Byte(66)
  821. #define cmDstInvert System::Integer(5570569)
  822. #define cmMergeCopy System::Integer(12583114)
  823. #define cmMergePaint System::Integer(12255782)
  824. #define cmNotSrcCopy System::Integer(3342344)
  825. #define cmNotSrcErase System::Integer(1114278)
  826. #define cmPatCopy System::Integer(15728673)
  827. #define cmPatInvert System::Integer(5898313)
  828. #define cmPatPaint System::Integer(16452105)
  829. #define cmSrcAnd System::Integer(8913094)
  830. #define cmSrcCopy System::Integer(13369376)
  831. #define cmSrcErase System::Integer(4457256)
  832. #define cmSrcInvert System::Integer(6684742)
  833. #define cmSrcPaint System::Integer(15597702)
  834. #define cmWhiteness System::Integer(16711778)
  835. extern TFontData DefFontData;
  836. extern void __fastcall PaletteChanged(void);
  837. extern System::Longint __fastcall ColorToRGB(TColor Color);
  838. extern System::AnsiString __fastcall ColorToString(TColor Color);
  839. extern TColor __fastcall StringToColor(const System::AnsiString S);
  840. extern void __fastcall GetColorValues(Classes::TGetStrProc Proc);
  841. extern System::Boolean __fastcall ColorToIdent(System::Longint Color,  System::AnsiString &Ident);
  842. extern System::Boolean __fastcall IdentToColor(const System::AnsiString Ident, System::Longint &Color
  843.     );
  844. extern void __fastcall GetCharsetValues(Classes::TGetStrProc Proc);
  845. extern System::Boolean __fastcall CharsetToIdent(System::Longint Charset,  System::AnsiString &Ident
  846.     );
  847. extern System::Boolean __fastcall IdentToCharset(const System::AnsiString Ident, System::Longint &Charset
  848.     );
  849. extern System::Pointer __fastcall MemAlloc(System::Longint Size);
  850. extern void __fastcall GetDIBSizes(System::Integer Bitmap, System::Integer &InfoHeaderSize, System::Integer 
  851.     &ImageSize);
  852. extern System::Boolean __fastcall GetDIB(System::Integer Bitmap, System::Integer Palette, void *BitmapInfo
  853.     , void *Bits);
  854. extern void __fastcall FreeMemoryContexts(void);
  855. extern System::Integer __fastcall CopyPalette(System::Integer Palette);
  856. extern System::AnsiString __fastcall GraphicFilter(System::TMetaClass * GraphicClass);
  857. extern System::AnsiString __fastcall GraphicExtension(System::TMetaClass * GraphicClass);
  858. extern void __fastcall InitGraphics(void);
  859. //-- template instantiations -------------------------------------------------
  860. template class TCanvasState ;
  861. template class TDummyFontStyles ;
  862. template class SmallString<31> ;
  863. template class TFontStyles ;
  864.  
  865. }    /* namespace Graphics */
  866. #if !defined(NO_IMPLICIT_NAMESPACE_USE)
  867. using namespace Graphics;
  868. #endif
  869. //-- end unit ----------------------------------------------------------------
  870. #endif    // Graphics
  871.