00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef GR_PAINTER_H
00021 #define GR_PAINTER_H
00022
00023 #include "xap_Features.h"
00024 #include "gr_Graphics.h"
00025
00026 class ABI_EXPORT GR_Painter
00027 {
00028 public:
00029
00030 GR_Painter (GR_Graphics * pGr);
00031 GR_Painter (GR_Graphics * pGr, bool bCaret);
00032 ~GR_Painter ();
00033
00034 void drawLine(UT_sint32 x1, UT_sint32 y1, UT_sint32 x2, UT_sint32 y2);
00035 #if XAP_DONTUSE_XOR
00036 #else
00037 void xorLine(UT_sint32 x1, UT_sint32 y1, UT_sint32 x2, UT_sint32 y2);
00038 void xorRect(UT_sint32 x, UT_sint32 y, UT_sint32 w, UT_sint32 h);
00039 void xorRect(const UT_Rect& r);
00040 #endif
00041 void invertRect(const UT_Rect* pRect);
00042
00043 void fillRect(const UT_RGBColor& c, UT_sint32 x, UT_sint32 y,
00044 UT_sint32 w, UT_sint32 h);
00045 void fillRect(GR_Image *pImg, const UT_Rect &src, const UT_Rect & dest);
00046 void fillRect(const UT_RGBColor& c, const UT_Rect &r);
00047
00048 void clearArea(UT_sint32 x, UT_sint32 y, UT_sint32 w, UT_sint32 h);
00049 void drawImage(GR_Image* pImg, UT_sint32 xDest, UT_sint32 yDest);
00050 void fillRect(GR_Graphics::GR_Color3D c,
00051 UT_sint32 x,
00052 UT_sint32 y,
00053 UT_sint32 w,
00054 UT_sint32 h);
00055
00056 void fillRect(GR_Graphics::GR_Color3D c, UT_Rect &r);
00057 void polygon(UT_RGBColor& c, UT_Point *pts, UT_uint32 nPoints);
00058 void polyLine(UT_Point * pts, UT_uint32 nPoints);
00059 void drawGlyph(UT_uint32 glyph_idx, UT_sint32 xoff, UT_sint32 yoff);
00060 void drawChars(const UT_UCSChar* pChars,
00061 int iCharOffset,
00062 int iLength,
00063 UT_sint32 xoff,
00064 UT_sint32 yoff,
00065 int* pCharWidths = NULL);
00066
00067 void drawCharsRelativeToBaseline(const UT_UCSChar* pChars,
00068 int iCharOffset,
00069 int iLength,
00070 UT_sint32 xoff,
00071 UT_sint32 yoff,
00072 int* pCharWidths = NULL);
00073
00074 void renderChars(GR_RenderInfo & ri);
00075
00076
00077 GR_Image * genImageFromRectangle(const UT_Rect & r);
00078
00079 private:
00080
00081 GR_Painter ();
00082 GR_Painter (const GR_Painter & rhs);
00083 GR_Painter& operator=(const GR_Painter & rhs);
00084
00085 GR_Graphics * m_pGr;
00086 GR_CaretDisabler * m_pCaretDisabler;
00087 UT_GenericVector<GR_CaretDisabler *> m_vecDisablers;
00088 };
00089
00090 #endif // GR_PAINTER_H