• Main Page
  • Related Pages
  • Namespaces
  • Classes
  • Files
  • File List
  • File Members

gr_Painter.h

Go to the documentation of this file.
00001 /* AbiWord
00002  * Copyright (C) 2003 Dom Lachowicz <cinamod@hotmail.com>
00003  *
00004  * This program is free software; you can redistribute it and/or
00005  * modify it under the terms of the GNU General Public License
00006  * as published by the Free Software Foundation; either version 2
00007  * of the License, or (at your option) any later version.
00008  *
00009  * This program is distributed in the hope that it will be useful,
00010  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00011  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00012  * GNU General Public License for more details.
00013  *
00014  * You should have received a copy of the GNU General Public License
00015  * along with this program; if not, write to the Free Software
00016  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
00017  * 02110-1301 USA.
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     // These just call the functions with the same name in GR_Graphics.
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

Generated on Sun Feb 14 2021 for AbiWord by  doxygen 1.7.1