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>
39 class SalVirtualDevice
;
42 class VCL_PLUGIN_PUBLIC SalGraphicsImpl
46 virtual ~SalGraphicsImpl();
48 virtual void Init() = 0;
50 virtual void DeInit() {}
52 virtual void freeResources() = 0;
54 virtual OUString
getRenderBackendName() const = 0;
56 virtual bool setClipRegion( const vcl::Region
& ) = 0;
58 // get the depth of the device
59 virtual sal_uInt16
GetBitCount() const = 0;
61 // get the width of the device
62 virtual tools::Long
GetGraphicsWidth() const = 0;
64 // set the clip region to empty
65 virtual void ResetClipRegion() = 0;
67 // set the line color to transparent (= don't draw lines)
69 virtual void SetLineColor() = 0;
71 // set the line color to a specific color
72 virtual void SetLineColor( Color nColor
) = 0;
74 // set the fill color to transparent (= don't fill)
75 virtual void SetFillColor() = 0;
77 // set the fill color to a specific color, shapes will be
79 virtual void SetFillColor( Color nColor
) = 0;
81 // enable/disable XOR drawing
82 virtual void SetXORMode( bool bSet
, bool bInvertOnly
) = 0;
84 // set line color for raster operations
85 virtual void SetROPLineColor( SalROPColor nROPColor
) = 0;
87 // set fill color for raster operations
88 virtual void SetROPFillColor( SalROPColor nROPColor
) = 0;
90 // draw --> LineColor and FillColor and RasterOp and ClipRegion
91 virtual void drawPixel( tools::Long nX
, tools::Long nY
) = 0;
92 virtual void drawPixel( tools::Long nX
, tools::Long nY
, Color nColor
) = 0;
94 virtual void drawLine( tools::Long nX1
, tools::Long nY1
, tools::Long nX2
, tools::Long nY2
) = 0;
96 virtual void drawRect( tools::Long nX
, tools::Long nY
, tools::Long nWidth
, tools::Long nHeight
) = 0;
98 virtual void drawPolyLine( sal_uInt32 nPoints
, const Point
* pPtAry
) = 0;
100 virtual void drawPolygon( sal_uInt32 nPoints
, const Point
* pPtAry
) = 0;
102 virtual void drawPolyPolygon( sal_uInt32 nPoly
, const sal_uInt32
* pPoints
, const Point
** pPtAry
) = 0;
104 virtual bool drawPolyPolygon(
105 const basegfx::B2DHomMatrix
& rObjectToDevice
,
106 const basegfx::B2DPolyPolygon
&,
107 double fTransparency
) = 0;
109 virtual bool drawPolyLine(
110 const basegfx::B2DHomMatrix
& rObjectToDevice
,
111 const basegfx::B2DPolygon
&,
112 double fTransparency
,
114 const std::vector
< double >* pStroke
, // MM01
115 basegfx::B2DLineJoin
,
116 css::drawing::LineCap
,
117 double fMiterMinimumAngle
,
118 bool bPixelSnapHairline
) = 0;
120 virtual bool drawPolyLineBezier(
123 const PolyFlags
* pFlgAry
) = 0;
125 virtual bool drawPolygonBezier(
128 const PolyFlags
* pFlgAry
) = 0;
130 virtual bool drawPolyPolygonBezier(
132 const sal_uInt32
* pPoints
,
133 const Point
* const* pPtAry
,
134 const PolyFlags
* const* pFlgAry
) = 0;
136 // CopyArea --> No RasterOp, but ClipRegion
137 virtual void copyArea(
138 tools::Long nDestX
, tools::Long nDestY
,
139 tools::Long nSrcX
, tools::Long nSrcY
,
140 tools::Long nSrcWidth
, tools::Long nSrcHeight
,
141 bool bWindowInvalidate
) = 0;
143 // CopyBits and DrawBitmap --> RasterOp and ClipRegion
144 // CopyBits() --> pSrcGraphics == NULL, then CopyBits on same Graphics
145 virtual void copyBits( const SalTwoRect
& rPosAry
, SalGraphics
* pSrcGraphics
) = 0;
147 virtual void drawBitmap( const SalTwoRect
& rPosAry
, const SalBitmap
& rSalBitmap
) = 0;
149 virtual void drawBitmap(
150 const SalTwoRect
& rPosAry
,
151 const SalBitmap
& rSalBitmap
,
152 const SalBitmap
& rMaskBitmap
) = 0;
154 virtual void drawMask(
155 const SalTwoRect
& rPosAry
,
156 const SalBitmap
& rSalBitmap
,
157 Color nMaskColor
) = 0;
159 virtual std::shared_ptr
<SalBitmap
> getBitmap( tools::Long nX
, tools::Long nY
, tools::Long nWidth
, tools::Long nHeight
) = 0;
161 virtual Color
getPixel( tools::Long nX
, tools::Long nY
) = 0;
163 // invert --> ClipRegion (only Windows or VirDevs)
165 tools::Long nX
, tools::Long nY
,
166 tools::Long nWidth
, tools::Long nHeight
,
167 SalInvert nFlags
) = 0;
169 virtual void invert( sal_uInt32 nPoints
, const Point
* pPtAry
, SalInvert nFlags
) = 0;
171 virtual bool drawEPS(
172 tools::Long nX
, tools::Long nY
,
173 tools::Long nWidth
, tools::Long nHeight
,
175 sal_uInt32 nSize
) = 0;
177 virtual bool blendBitmap(
179 const SalBitmap
& rBitmap
) = 0;
181 virtual bool blendAlphaBitmap(
183 const SalBitmap
& rSrcBitmap
,
184 const SalBitmap
& rMaskBitmap
,
185 const SalBitmap
& rAlphaBitmap
) = 0;
187 virtual bool drawAlphaBitmap(
189 const SalBitmap
& rSourceBitmap
,
190 const SalBitmap
& rAlphaBitmap
) = 0;
192 /** draw transformed bitmap (maybe with alpha) where Null, X, Y define the coordinate system */
193 virtual bool drawTransformedBitmap(
194 const basegfx::B2DPoint
& rNull
,
195 const basegfx::B2DPoint
& rX
,
196 const basegfx::B2DPoint
& rY
,
197 const SalBitmap
& rSourceBitmap
,
198 const SalBitmap
* pAlphaBitmap
) = 0;
200 virtual bool drawAlphaRect(
201 tools::Long nX
, tools::Long nY
,
202 tools::Long nWidth
, tools::Long nHeight
,
203 sal_uInt8 nTransparency
) = 0;
205 virtual bool drawGradient(const tools::PolyPolygon
& rPolygon
, const Gradient
& rGradient
) = 0;
206 virtual bool implDrawGradient(basegfx::B2DPolyPolygon
const & rPolyPolygon
, SalGradient
const & rGradient
) = 0;
208 virtual bool supportsOperation(OutDevSupportType eType
) const = 0;
213 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */