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 <rtl/ustring.hxx>
27 #include <tools/poly.hxx>
28 #include <tools/solar.h>
30 #include <vcl/salgtype.hxx>
31 #include <vcl/region.hxx>
32 #include <vcl/salnativewidgets.hxx>
34 #include <com/sun/star/drawing/LineCap.hpp>
41 class SalVirtualDevice
;
43 class VCL_PLUGIN_PUBLIC SalGraphicsImpl
47 virtual ~SalGraphicsImpl();
49 virtual void Init() = 0;
51 virtual void DeInit() {}
53 virtual void freeResources() = 0;
55 virtual bool setClipRegion( const vcl::Region
& ) = 0;
57 // get the depth of the device
58 virtual sal_uInt16
GetBitCount() const = 0;
60 // get the width of the device
61 virtual long GetGraphicsWidth() const = 0;
63 // set the clip region to empty
64 virtual void ResetClipRegion() = 0;
66 // set the line color to transparent (= don't draw lines)
68 virtual void SetLineColor() = 0;
70 // set the line color to a specific color
71 virtual void SetLineColor( SalColor nSalColor
) = 0;
73 // set the fill color to transparent (= don't fill)
74 virtual void SetFillColor() = 0;
76 // set the fill color to a specific color, shapes will be
78 virtual void SetFillColor( SalColor nSalColor
) = 0;
80 // enable/disable XOR drawing
81 virtual void SetXORMode( bool bSet
) = 0;
83 // set line color for raster operations
84 virtual void SetROPLineColor( SalROPColor nROPColor
) = 0;
86 // set fill color for raster operations
87 virtual void SetROPFillColor( SalROPColor nROPColor
) = 0;
89 // draw --> LineColor and FillColor and RasterOp and ClipRegion
90 virtual void drawPixel( long nX
, long nY
) = 0;
91 virtual void drawPixel( long nX
, long nY
, SalColor nSalColor
) = 0;
93 virtual void drawLine( long nX1
, long nY1
, long nX2
, long nY2
) = 0;
95 virtual void drawRect( long nX
, long nY
, long nWidth
, long nHeight
) = 0;
97 virtual void drawPolyLine( sal_uInt32 nPoints
, const SalPoint
* pPtAry
) = 0;
99 virtual void drawPolygon( sal_uInt32 nPoints
, const SalPoint
* pPtAry
) = 0;
101 virtual void drawPolyPolygon( sal_uInt32 nPoly
, const sal_uInt32
* pPoints
, PCONSTSALPOINT
* pPtAry
) = 0;
102 virtual bool drawPolyPolygon( const basegfx::B2DPolyPolygon
&, double fTransparency
) = 0;
104 virtual bool drawPolyLine(
105 const basegfx::B2DPolygon
&,
106 double fTransparency
,
107 const basegfx::B2DVector
& rLineWidths
,
108 basegfx::B2DLineJoin
,
109 css::drawing::LineCap
,
110 double fMiterMinimumAngle
) = 0;
112 virtual bool drawPolyLineBezier(
114 const SalPoint
* pPtAry
,
115 const PolyFlags
* pFlgAry
) = 0;
117 virtual bool drawPolygonBezier(
119 const SalPoint
* pPtAry
,
120 const PolyFlags
* pFlgAry
) = 0;
122 virtual bool drawPolyPolygonBezier(
124 const sal_uInt32
* pPoints
,
125 const SalPoint
* const* pPtAry
,
126 const PolyFlags
* const* pFlgAry
) = 0;
128 // CopyArea --> No RasterOp, but ClipRegion
129 virtual void copyArea(
130 long nDestX
, long nDestY
,
131 long nSrcX
, long nSrcY
,
132 long nSrcWidth
, long nSrcHeight
,
133 bool bWindowInvalidate
) = 0;
135 // CopyBits and DrawBitmap --> RasterOp and ClipRegion
136 // CopyBits() --> pSrcGraphics == NULL, then CopyBits on same Graphics
137 virtual void copyBits( const SalTwoRect
& rPosAry
, SalGraphics
* pSrcGraphics
) = 0;
139 virtual void drawBitmap( const SalTwoRect
& rPosAry
, const SalBitmap
& rSalBitmap
) = 0;
141 virtual void drawBitmap(
142 const SalTwoRect
& rPosAry
,
143 const SalBitmap
& rSalBitmap
,
144 const SalBitmap
& rMaskBitmap
) = 0;
146 virtual void drawMask(
147 const SalTwoRect
& rPosAry
,
148 const SalBitmap
& rSalBitmap
,
149 SalColor nMaskColor
) = 0;
151 virtual SalBitmap
* getBitmap( long nX
, long nY
, long nWidth
, long nHeight
) = 0;
153 virtual SalColor
getPixel( long nX
, long nY
) = 0;
155 // invert --> ClipRegion (only Windows or VirDevs)
158 long nWidth
, long nHeight
,
159 SalInvert nFlags
) = 0;
161 virtual void invert( sal_uInt32 nPoints
, const SalPoint
* pPtAry
, SalInvert nFlags
) = 0;
163 virtual bool drawEPS(
165 long nWidth
, long nHeight
,
167 sal_uLong nSize
) = 0;
169 virtual bool blendBitmap(
171 const SalBitmap
& rBitmap
) = 0;
173 virtual bool blendAlphaBitmap(
175 const SalBitmap
& rSrcBitmap
,
176 const SalBitmap
& rMaskBitmap
,
177 const SalBitmap
& rAlphaBitmap
) = 0;
179 virtual bool drawAlphaBitmap(
181 const SalBitmap
& rSourceBitmap
,
182 const SalBitmap
& rAlphaBitmap
) = 0;
184 /** draw transformed bitmap (maybe with alpha) where Null, X, Y define the coordinate system */
185 virtual bool drawTransformedBitmap(
186 const basegfx::B2DPoint
& rNull
,
187 const basegfx::B2DPoint
& rX
,
188 const basegfx::B2DPoint
& rY
,
189 const SalBitmap
& rSourceBitmap
,
190 const SalBitmap
* pAlphaBitmap
) = 0;
192 virtual bool drawAlphaRect(
194 long nWidth
, long nHeight
,
195 sal_uInt8 nTransparency
) = 0;
197 virtual bool drawGradient(const tools::PolyPolygon
& rPolygon
, const Gradient
& rGradient
) = 0;
202 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */