LibreOffice Module vcl (master) 1
salgdiimpl.hxx
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2/*
3 * This file is part of the LibreOffice project.
4 *
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 *
9 * This file incorporates work covered by the following license notice:
10 *
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18 */
19
20#ifndef INCLUDED_VCL_INC_SALGDIIMPL_HXX
21#define INCLUDED_VCL_INC_SALGDIIMPL_HXX
22
23#include <vcl/dllapi.h>
24
25#include <tools/color.hxx>
26#include <tools/poly.hxx>
27
28#include <vcl/salgtype.hxx>
29#include <vcl/region.hxx>
30#include <vcl/vclenum.hxx>
31
32#include <com/sun/star/drawing/LineCap.hpp>
33
34class SalGraphics;
35class SalBitmap;
36class SalFrame;
37class Gradient;
39struct SalGradient;
40
51{
53public:
54
55 void setAntiAlias(bool bNew)
56 {
57 m_bAntiAlias = bNew;
58 }
59
60 bool getAntiAlias() const
61 {
62 return m_bAntiAlias;
63 }
64
66 : m_bAntiAlias(false)
67 {}
68
69 virtual ~SalGraphicsImpl();
70
71 // All the functions are implementations of functions from the SalGraphics class,
72 // so see the SalGraphics class for documentation (both uppercase and lowercase
73 // function variants).
74
75 virtual void Init() = 0;
76
77 virtual void DeInit() {}
78
79 virtual void freeResources() = 0;
80
81 virtual OUString getRenderBackendName() const = 0;
82
83 virtual bool setClipRegion( const vcl::Region& ) = 0;
84
85 virtual sal_uInt16 GetBitCount() const = 0;
86
87 virtual tools::Long GetGraphicsWidth() const = 0;
88
89 virtual void ResetClipRegion() = 0;
90
91 virtual void SetLineColor() = 0;
92
93 virtual void SetLineColor( Color nColor ) = 0;
94
95 virtual void SetFillColor() = 0;
96
97 virtual void SetFillColor( Color nColor ) = 0;
98
99 virtual void SetXORMode( bool bSet, bool bInvertOnly ) = 0;
100
101 virtual void SetROPLineColor( SalROPColor nROPColor ) = 0;
102
103 virtual void SetROPFillColor( SalROPColor nROPColor ) = 0;
104
105 virtual void drawPixel( tools::Long nX, tools::Long nY ) = 0;
106 virtual void drawPixel( tools::Long nX, tools::Long nY, Color nColor ) = 0;
107
108 virtual void drawLine( tools::Long nX1, tools::Long nY1, tools::Long nX2, tools::Long nY2 ) = 0;
109
110 virtual void drawRect( tools::Long nX, tools::Long nY, tools::Long nWidth, tools::Long nHeight ) = 0;
111
112 virtual void drawPolyLine( sal_uInt32 nPoints, const Point* pPtAry ) = 0;
113
114 virtual void drawPolygon( sal_uInt32 nPoints, const Point* pPtAry ) = 0;
115
116 virtual void drawPolyPolygon( sal_uInt32 nPoly, const sal_uInt32* pPoints, const Point** pPtAry ) = 0;
117
118 virtual bool drawPolyPolygon(
119 const basegfx::B2DHomMatrix& rObjectToDevice,
121 double fTransparency) = 0;
122
123 virtual bool drawPolyLine(
124 const basegfx::B2DHomMatrix& rObjectToDevice,
125 const basegfx::B2DPolygon&,
126 double fTransparency,
127 double fLineWidth,
128 const std::vector< double >* pStroke,
130 css::drawing::LineCap,
131 double fMiterMinimumAngle,
132 bool bPixelSnapHairline) = 0;
133
134 virtual bool drawPolyLineBezier(
135 sal_uInt32 nPoints,
136 const Point* pPtAry,
137 const PolyFlags* pFlgAry ) = 0;
138
139 virtual bool drawPolygonBezier(
140 sal_uInt32 nPoints,
141 const Point* pPtAry,
142 const PolyFlags* pFlgAry ) = 0;
143
145 sal_uInt32 nPoly,
146 const sal_uInt32* pPoints,
147 const Point* const* pPtAry,
148 const PolyFlags* const* pFlgAry ) = 0;
149
150 virtual void copyArea(
151 tools::Long nDestX, tools::Long nDestY,
152 tools::Long nSrcX, tools::Long nSrcY,
153 tools::Long nSrcWidth, tools::Long nSrcHeight,
154 bool bWindowInvalidate ) = 0;
155
156 virtual void copyBits( const SalTwoRect& rPosAry, SalGraphics* pSrcGraphics ) = 0;
157
158 virtual void drawBitmap( const SalTwoRect& rPosAry, const SalBitmap& rSalBitmap ) = 0;
159
160 virtual void drawBitmap(
161 const SalTwoRect& rPosAry,
162 const SalBitmap& rSalBitmap,
163 const SalBitmap& rMaskBitmap ) = 0;
164
165 virtual void drawMask(
166 const SalTwoRect& rPosAry,
167 const SalBitmap& rSalBitmap,
168 Color nMaskColor ) = 0;
169
170 virtual std::shared_ptr<SalBitmap> getBitmap( tools::Long nX, tools::Long nY, tools::Long nWidth, tools::Long nHeight ) = 0;
171
172 virtual Color getPixel( tools::Long nX, tools::Long nY ) = 0;
173
174 virtual void invert(
176 tools::Long nWidth, tools::Long nHeight,
177 SalInvert nFlags) = 0;
178
179 virtual void invert( sal_uInt32 nPoints, const Point* pPtAry, SalInvert nFlags ) = 0;
180
181 virtual bool drawEPS(
183 tools::Long nWidth, tools::Long nHeight,
184 void* pPtr,
185 sal_uInt32 nSize ) = 0;
186
187 virtual bool blendBitmap(
188 const SalTwoRect&,
189 const SalBitmap& rBitmap ) = 0;
190
191 virtual bool blendAlphaBitmap(
192 const SalTwoRect&,
193 const SalBitmap& rSrcBitmap,
194 const SalBitmap& rMaskBitmap,
195 const SalBitmap& rAlphaBitmap ) = 0;
196
197 virtual bool drawAlphaBitmap(
198 const SalTwoRect&,
199 const SalBitmap& rSourceBitmap,
200 const SalBitmap& rAlphaBitmap ) = 0;
201
203 const basegfx::B2DPoint& rNull,
204 const basegfx::B2DPoint& rX,
205 const basegfx::B2DPoint& rY,
206 const SalBitmap& rSourceBitmap,
207 const SalBitmap* pAlphaBitmap,
208 double fAlpha) = 0;
209
210 virtual bool hasFastDrawTransformedBitmap() const = 0;
211
212 virtual bool drawAlphaRect(
214 tools::Long nWidth, tools::Long nHeight,
215 sal_uInt8 nTransparency ) = 0;
216
217 virtual bool drawGradient(const tools::PolyPolygon& rPolygon, const Gradient& rGradient) = 0;
218 virtual bool implDrawGradient(basegfx::B2DPolyPolygon const & rPolyPolygon, SalGradient const & rGradient) = 0;
219
220 virtual bool supportsOperation(OutDevSupportType eType) const = 0;
221};
222
223#endif
224
225/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
A SalFrame is a system window (e.g. an X11 window).
Definition: salframe.hxx:115
Implementation class for SalGraphics.
Definition: salgdiimpl.hxx:51
virtual bool drawPolyLine(const basegfx::B2DHomMatrix &rObjectToDevice, const basegfx::B2DPolygon &, double fTransparency, double fLineWidth, const std::vector< double > *pStroke, basegfx::B2DLineJoin, css::drawing::LineCap, double fMiterMinimumAngle, bool bPixelSnapHairline)=0
virtual void SetFillColor(Color nColor)=0
virtual void drawMask(const SalTwoRect &rPosAry, const SalBitmap &rSalBitmap, Color nMaskColor)=0
virtual void drawPixel(tools::Long nX, tools::Long nY, Color nColor)=0
virtual void ResetClipRegion()=0
virtual bool supportsOperation(OutDevSupportType eType) const =0
virtual bool drawAlphaBitmap(const SalTwoRect &, const SalBitmap &rSourceBitmap, const SalBitmap &rAlphaBitmap)=0
virtual void invert(tools::Long nX, tools::Long nY, tools::Long nWidth, tools::Long nHeight, SalInvert nFlags)=0
virtual void drawPolyLine(sal_uInt32 nPoints, const Point *pPtAry)=0
virtual void drawLine(tools::Long nX1, tools::Long nY1, tools::Long nX2, tools::Long nY2)=0
virtual void drawPixel(tools::Long nX, tools::Long nY)=0
virtual void copyBits(const SalTwoRect &rPosAry, SalGraphics *pSrcGraphics)=0
virtual void drawRect(tools::Long nX, tools::Long nY, tools::Long nWidth, tools::Long nHeight)=0
virtual void copyArea(tools::Long nDestX, tools::Long nDestY, tools::Long nSrcX, tools::Long nSrcY, tools::Long nSrcWidth, tools::Long nSrcHeight, bool bWindowInvalidate)=0
virtual bool blendAlphaBitmap(const SalTwoRect &, const SalBitmap &rSrcBitmap, const SalBitmap &rMaskBitmap, const SalBitmap &rAlphaBitmap)=0
virtual bool drawTransformedBitmap(const basegfx::B2DPoint &rNull, const basegfx::B2DPoint &rX, const basegfx::B2DPoint &rY, const SalBitmap &rSourceBitmap, const SalBitmap *pAlphaBitmap, double fAlpha)=0
virtual bool setClipRegion(const vcl::Region &)=0
virtual void drawBitmap(const SalTwoRect &rPosAry, const SalBitmap &rSalBitmap, const SalBitmap &rMaskBitmap)=0
virtual void SetROPLineColor(SalROPColor nROPColor)=0
virtual void SetFillColor()=0
virtual bool drawPolyPolygon(const basegfx::B2DHomMatrix &rObjectToDevice, const basegfx::B2DPolyPolygon &, double fTransparency)=0
virtual void SetXORMode(bool bSet, bool bInvertOnly)=0
virtual void Init()=0
virtual std::shared_ptr< SalBitmap > getBitmap(tools::Long nX, tools::Long nY, tools::Long nWidth, tools::Long nHeight)=0
virtual void invert(sal_uInt32 nPoints, const Point *pPtAry, SalInvert nFlags)=0
virtual bool drawPolyPolygonBezier(sal_uInt32 nPoly, const sal_uInt32 *pPoints, const Point *const *pPtAry, const PolyFlags *const *pFlgAry)=0
virtual bool drawGradient(const tools::PolyPolygon &rPolygon, const Gradient &rGradient)=0
virtual void SetLineColor()=0
virtual Color getPixel(tools::Long nX, tools::Long nY)=0
virtual tools::Long GetGraphicsWidth() const =0
bool getAntiAlias() const
Definition: salgdiimpl.hxx:60
virtual void SetLineColor(Color nColor)=0
virtual bool drawPolygonBezier(sal_uInt32 nPoints, const Point *pPtAry, const PolyFlags *pFlgAry)=0
virtual bool implDrawGradient(basegfx::B2DPolyPolygon const &rPolyPolygon, SalGradient const &rGradient)=0
virtual void drawBitmap(const SalTwoRect &rPosAry, const SalBitmap &rSalBitmap)=0
virtual bool drawEPS(tools::Long nX, tools::Long nY, tools::Long nWidth, tools::Long nHeight, void *pPtr, sal_uInt32 nSize)=0
virtual void SetROPFillColor(SalROPColor nROPColor)=0
virtual bool blendBitmap(const SalTwoRect &, const SalBitmap &rBitmap)=0
virtual void DeInit()
Definition: salgdiimpl.hxx:77
virtual void freeResources()=0
virtual void drawPolygon(sal_uInt32 nPoints, const Point *pPtAry)=0
virtual OUString getRenderBackendName() const =0
virtual bool hasFastDrawTransformedBitmap() const =0
virtual bool drawAlphaRect(tools::Long nX, tools::Long nY, tools::Long nWidth, tools::Long nHeight, sal_uInt8 nTransparency)=0
virtual sal_uInt16 GetBitCount() const =0
virtual bool drawPolyLineBezier(sal_uInt32 nPoints, const Point *pPtAry, const PolyFlags *pFlgAry)=0
void setAntiAlias(bool bNew)
Definition: salgdiimpl.hxx:55
virtual void drawPolyPolygon(sal_uInt32 nPoly, const sal_uInt32 *pPoints, const Point **pPtAry)=0
A non-visible drawable/buffer (e.g. an X11 Pixmap).
Definition: salvd.hxx:30
#define VCL_PLUGIN_PUBLIC
Definition: dllapi.h:40
long Long
PolyFlags
SalROPColor
Definition: salgtype.hxx:70
SalInvert
Definition: salgtype.hxx:74
unsigned char sal_uInt8
OutDevSupportType
Definition: vclenum.hxx:174