1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
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/.
9 * This file incorporates work covered by the following license notice:
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 .
20 #ifndef INCLUDED_VCL_INC_SALGDIIMPL_HXX
21 #define INCLUDED_VCL_INC_SALGDIIMPL_HXX
23 #include <vcl/dllapi.h>
25 #include <tools/color.hxx>
26 #include <tools/poly.hxx>
28 #include <vcl/salgtype.hxx>
29 #include <vcl/region.hxx>
30 #include <vcl/vclenum.hxx>
32 #include <com/sun/star/drawing/LineCap.hpp>
38 class SalVirtualDevice
;
42 Implementation class for SalGraphics.
44 This class allows having an implementation of drawing calls that is separate from SalGraphics,
45 and SalGraphics can forward all such calls to SalGraphicsImpl. For example X11SalGraphics
46 may internally use either Xlib-based X11SalGraphicsImpl or Skia-based SkiaSalGraphicsImpl,
47 and the latter may be used also by other SalGraphics implementations. All the functions
48 here should be implementations of the relevant SalGraphics functions.
50 class VCL_PLUGIN_PUBLIC SalGraphicsImpl
55 void setAntiAlias(bool bNew
)
60 bool getAntiAlias() const
69 virtual ~SalGraphicsImpl();
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).
75 virtual void Init() = 0;
77 virtual void DeInit() {}
79 virtual void freeResources() = 0;
81 virtual OUString
getRenderBackendName() const = 0;
83 virtual bool setClipRegion( const vcl::Region
& ) = 0;
85 virtual sal_uInt16
GetBitCount() const = 0;
87 virtual tools::Long
GetGraphicsWidth() const = 0;
89 virtual void ResetClipRegion() = 0;
91 virtual void SetLineColor() = 0;
93 virtual void SetLineColor( Color nColor
) = 0;
95 virtual void SetFillColor() = 0;
97 virtual void SetFillColor( Color nColor
) = 0;
99 virtual void SetXORMode( bool bSet
, bool bInvertOnly
) = 0;
101 virtual void SetROPLineColor( SalROPColor nROPColor
) = 0;
103 virtual void SetROPFillColor( SalROPColor nROPColor
) = 0;
105 virtual void drawPixel( tools::Long nX
, tools::Long nY
) = 0;
106 virtual void drawPixel( tools::Long nX
, tools::Long nY
, Color nColor
) = 0;
108 virtual void drawLine( tools::Long nX1
, tools::Long nY1
, tools::Long nX2
, tools::Long nY2
) = 0;
110 virtual void drawRect( tools::Long nX
, tools::Long nY
, tools::Long nWidth
, tools::Long nHeight
) = 0;
112 virtual void drawPolyLine( sal_uInt32 nPoints
, const Point
* pPtAry
) = 0;
114 virtual void drawPolygon( sal_uInt32 nPoints
, const Point
* pPtAry
) = 0;
116 virtual void drawPolyPolygon( sal_uInt32 nPoly
, const sal_uInt32
* pPoints
, const Point
** pPtAry
) = 0;
118 virtual bool drawPolyPolygon(
119 const basegfx::B2DHomMatrix
& rObjectToDevice
,
120 const basegfx::B2DPolyPolygon
&,
121 double fTransparency
) = 0;
123 virtual bool drawPolyLine(
124 const basegfx::B2DHomMatrix
& rObjectToDevice
,
125 const basegfx::B2DPolygon
&,
126 double fTransparency
,
128 const std::vector
< double >* pStroke
,
129 basegfx::B2DLineJoin
,
130 css::drawing::LineCap
,
131 double fMiterMinimumAngle
,
132 bool bPixelSnapHairline
) = 0;
134 virtual bool drawPolyLineBezier(
137 const PolyFlags
* pFlgAry
) = 0;
139 virtual bool drawPolygonBezier(
142 const PolyFlags
* pFlgAry
) = 0;
144 virtual bool drawPolyPolygonBezier(
146 const sal_uInt32
* pPoints
,
147 const Point
* const* pPtAry
,
148 const PolyFlags
* const* pFlgAry
) = 0;
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;
156 virtual void copyBits( const SalTwoRect
& rPosAry
, SalGraphics
* pSrcGraphics
) = 0;
158 virtual void drawBitmap( const SalTwoRect
& rPosAry
, const SalBitmap
& rSalBitmap
) = 0;
160 virtual void drawBitmap(
161 const SalTwoRect
& rPosAry
,
162 const SalBitmap
& rSalBitmap
,
163 const SalBitmap
& rMaskBitmap
) = 0;
165 virtual void drawMask(
166 const SalTwoRect
& rPosAry
,
167 const SalBitmap
& rSalBitmap
,
168 Color nMaskColor
) = 0;
170 virtual std::shared_ptr
<SalBitmap
> getBitmap( tools::Long nX
, tools::Long nY
, tools::Long nWidth
, tools::Long nHeight
) = 0;
172 virtual Color
getPixel( tools::Long nX
, tools::Long nY
) = 0;
175 tools::Long nX
, tools::Long nY
,
176 tools::Long nWidth
, tools::Long nHeight
,
177 SalInvert nFlags
) = 0;
179 virtual void invert( sal_uInt32 nPoints
, const Point
* pPtAry
, SalInvert nFlags
) = 0;
181 virtual bool drawEPS(
182 tools::Long nX
, tools::Long nY
,
183 tools::Long nWidth
, tools::Long nHeight
,
185 sal_uInt32 nSize
) = 0;
187 virtual bool blendBitmap(
189 const SalBitmap
& rBitmap
) = 0;
191 virtual bool blendAlphaBitmap(
193 const SalBitmap
& rSrcBitmap
,
194 const SalBitmap
& rMaskBitmap
,
195 const SalBitmap
& rAlphaBitmap
) = 0;
197 virtual bool drawAlphaBitmap(
199 const SalBitmap
& rSourceBitmap
,
200 const SalBitmap
& rAlphaBitmap
) = 0;
202 virtual bool drawTransformedBitmap(
203 const basegfx::B2DPoint
& rNull
,
204 const basegfx::B2DPoint
& rX
,
205 const basegfx::B2DPoint
& rY
,
206 const SalBitmap
& rSourceBitmap
,
207 const SalBitmap
* pAlphaBitmap
,
210 virtual bool hasFastDrawTransformedBitmap() const = 0;
212 virtual bool drawAlphaRect(
213 tools::Long nX
, tools::Long nY
,
214 tools::Long nWidth
, tools::Long nHeight
,
215 sal_uInt8 nTransparency
) = 0;
217 virtual bool drawGradient(const tools::PolyPolygon
& rPolygon
, const Gradient
& rGradient
) = 0;
218 virtual bool implDrawGradient(basegfx::B2DPolyPolygon
const & rPolyPolygon
, SalGradient
const & rGradient
) = 0;
220 virtual bool supportsOperation(OutDevSupportType eType
) const = 0;
225 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */