Version 6.1.4.1, tag libreoffice-6.1.4.1
[LibreOffice.git] / vcl / inc / salgdiimpl.hxx
blob89c6f4dba61dc17d92978fba73d61ad1ebdb9e68
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
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/color.hxx>
28 #include <tools/poly.hxx>
29 #include <tools/solar.h>
31 #include <vcl/salgtype.hxx>
32 #include <vcl/region.hxx>
33 #include <vcl/salnativewidgets.hxx>
35 #include <com/sun/star/drawing/LineCap.hpp>
37 class SalGraphics;
38 class SalBitmap;
39 class SalFrame;
40 class Gradient;
41 class OpenGLContext;
42 class SalVirtualDevice;
44 class VCL_PLUGIN_PUBLIC SalGraphicsImpl
46 public:
48 virtual ~SalGraphicsImpl();
50 virtual void Init() = 0;
52 virtual void DeInit() {}
54 virtual void freeResources() = 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 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
78 // filled accordingly
79 virtual void SetFillColor( Color nColor ) = 0;
81 // enable/disable XOR drawing
82 virtual void SetXORMode( bool bSet ) = 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( long nX, long nY ) = 0;
92 virtual void drawPixel( long nX, long nY, Color nColor ) = 0;
94 virtual void drawLine( long nX1, long nY1, long nX2, long nY2 ) = 0;
96 virtual void drawRect( long nX, long nY, long nWidth, long nHeight ) = 0;
98 virtual void drawPolyLine( sal_uInt32 nPoints, const SalPoint* pPtAry ) = 0;
100 virtual void drawPolygon( sal_uInt32 nPoints, const SalPoint* pPtAry ) = 0;
102 virtual void drawPolyPolygon( sal_uInt32 nPoly, const sal_uInt32* pPoints, PCONSTSALPOINT* pPtAry ) = 0;
103 virtual bool drawPolyPolygon( const basegfx::B2DPolyPolygon&, double fTransparency ) = 0;
105 virtual bool drawPolyLine(
106 const basegfx::B2DPolygon&,
107 double fTransparency,
108 const basegfx::B2DVector& rLineWidths,
109 basegfx::B2DLineJoin,
110 css::drawing::LineCap,
111 double fMiterMinimumAngle) = 0;
113 virtual bool drawPolyLineBezier(
114 sal_uInt32 nPoints,
115 const SalPoint* pPtAry,
116 const PolyFlags* pFlgAry ) = 0;
118 virtual bool drawPolygonBezier(
119 sal_uInt32 nPoints,
120 const SalPoint* pPtAry,
121 const PolyFlags* pFlgAry ) = 0;
123 virtual bool drawPolyPolygonBezier(
124 sal_uInt32 nPoly,
125 const sal_uInt32* pPoints,
126 const SalPoint* const* pPtAry,
127 const PolyFlags* const* pFlgAry ) = 0;
129 // CopyArea --> No RasterOp, but ClipRegion
130 virtual void copyArea(
131 long nDestX, long nDestY,
132 long nSrcX, long nSrcY,
133 long nSrcWidth, long nSrcHeight,
134 bool bWindowInvalidate ) = 0;
136 // CopyBits and DrawBitmap --> RasterOp and ClipRegion
137 // CopyBits() --> pSrcGraphics == NULL, then CopyBits on same Graphics
138 virtual void copyBits( const SalTwoRect& rPosAry, SalGraphics* pSrcGraphics ) = 0;
140 virtual void drawBitmap( const SalTwoRect& rPosAry, const SalBitmap& rSalBitmap ) = 0;
142 virtual void drawBitmap(
143 const SalTwoRect& rPosAry,
144 const SalBitmap& rSalBitmap,
145 const SalBitmap& rMaskBitmap ) = 0;
147 virtual void drawMask(
148 const SalTwoRect& rPosAry,
149 const SalBitmap& rSalBitmap,
150 Color nMaskColor ) = 0;
152 virtual SalBitmap* getBitmap( long nX, long nY, long nWidth, long nHeight ) = 0;
154 virtual Color getPixel( long nX, long nY ) = 0;
156 // invert --> ClipRegion (only Windows or VirDevs)
157 virtual void invert(
158 long nX, long nY,
159 long nWidth, long nHeight,
160 SalInvert nFlags) = 0;
162 virtual void invert( sal_uInt32 nPoints, const SalPoint* pPtAry, SalInvert nFlags ) = 0;
164 virtual bool drawEPS(
165 long nX, long nY,
166 long nWidth, long nHeight,
167 void* pPtr,
168 sal_uLong nSize ) = 0;
170 virtual bool blendBitmap(
171 const SalTwoRect&,
172 const SalBitmap& rBitmap ) = 0;
174 virtual bool blendAlphaBitmap(
175 const SalTwoRect&,
176 const SalBitmap& rSrcBitmap,
177 const SalBitmap& rMaskBitmap,
178 const SalBitmap& rAlphaBitmap ) = 0;
180 virtual bool drawAlphaBitmap(
181 const SalTwoRect&,
182 const SalBitmap& rSourceBitmap,
183 const SalBitmap& rAlphaBitmap ) = 0;
185 /** draw transformed bitmap (maybe with alpha) where Null, X, Y define the coordinate system */
186 virtual bool drawTransformedBitmap(
187 const basegfx::B2DPoint& rNull,
188 const basegfx::B2DPoint& rX,
189 const basegfx::B2DPoint& rY,
190 const SalBitmap& rSourceBitmap,
191 const SalBitmap* pAlphaBitmap) = 0;
193 virtual bool drawAlphaRect(
194 long nX, long nY,
195 long nWidth, long nHeight,
196 sal_uInt8 nTransparency ) = 0;
198 virtual bool drawGradient(const tools::PolyPolygon& rPolygon, const Gradient& rGradient) = 0;
201 #endif
203 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */