Go to the documentation of this file.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, bool bDisableCarets = true);
00031 ~GR_Painter ();
00032
00033 void drawLine(UT_sint32 x1, UT_sint32 y1, UT_sint32 x2, UT_sint32 y2);
00034 #if XAP_DONTUSE_XOR
00035 #else
00036 void xorLine(UT_sint32 x1, UT_sint32 y1, UT_sint32 x2, UT_sint32 y2);
00037 void xorRect(UT_sint32 x, UT_sint32 y, UT_sint32 w, UT_sint32 h);
00038 void xorRect(const UT_Rect& r);
00039 #endif
00040 void invertRect(const UT_Rect* pRect);
00041
00042 void fillRect(const UT_RGBColor& c, UT_sint32 x, UT_sint32 y,
00043 UT_sint32 w, UT_sint32 h);
00044 void fillRect(GR_Image *pImg, const UT_Rect &src, const UT_Rect & dest);
00045 void fillRect(const UT_RGBColor& c, const UT_Rect &r);
00046 void fillRect(GR_Graphics::GR_Color3D c,
00047 UT_sint32 x,
00048 UT_sint32 y,
00049 UT_sint32 w,
00050 UT_sint32 h);
00051
00052 void fillRect(GR_Graphics::GR_Color3D c, const UT_Rect &r);
00053
00054 void clearArea(UT_sint32 x, UT_sint32 y, UT_sint32 w, UT_sint32 h);
00055 void drawImage(GR_Image* pImg, UT_sint32 xDest, UT_sint32 yDest);
00056 void polygon(const UT_RGBColor& c, const UT_Point *pts, UT_uint32 nPoints);
00057 void polyLine(const UT_Point * pts, UT_uint32 nPoints);
00058 void drawGlyph(UT_uint32 glyph_idx, UT_sint32 xoff, UT_sint32 yoff);
00059 void drawChars(const UT_UCSChar* pChars,
00060 int iCharOffset,
00061 int iLength,
00062 UT_sint32 xoff,
00063 UT_sint32 yoff,
00064 int* pCharWidths = NULL);
00065
00066 void drawCharsRelativeToBaseline(const UT_UCSChar* pChars,
00067 int iCharOffset,
00068 int iLength,
00069 UT_sint32 xoff,
00070 UT_sint32 yoff,
00071 int* pCharWidths = NULL);
00072
00073 void renderChars(GR_RenderInfo & ri);
00074
00075
00076 GR_Image * genImageFromRectangle(const UT_Rect & r);
00077
00078
00079 void beginDoubleBuffering();
00080 void endDoubleBuffering();
00081
00082 void suspendDrawing();
00083 void resumeDrawing();
00084
00085 private:
00086
00087 GR_Painter ();
00088 GR_Painter (const GR_Painter & rhs);
00089 GR_Painter& operator=(const GR_Painter & rhs);
00090
00091 GR_Graphics * m_pGr;
00092 bool m_bCaretsDisabled;
00093
00094 bool m_bDoubleBufferingToken;
00095 bool m_bSuspendDrawingToken;
00096 };
00097
00098 #endif // GR_PAINTER_H