Version 5.2.6.1, tag libreoffice-5.2.6.1
[LibreOffice.git] / vcl / inc / salgdiimpl.hxx
blobc2c008e684624467d549486da667372dc2323004
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/solar.h>
29 #include <vcl/salgtype.hxx>
30 #include <vcl/region.hxx>
31 #include <vcl/salnativewidgets.hxx>
33 #include <com/sun/star/drawing/LineCap.hpp>
35 class SalGraphics;
36 class SalBitmap;
37 class SalFrame;
38 class Gradient;
39 class OpenGLContext;
40 class SalVirtualDevice;
42 class VCL_PLUGIN_PUBLIC SalGraphicsImpl
44 public:
46 virtual ~SalGraphicsImpl();
48 virtual void Init() = 0;
50 virtual void DeInit() {}
52 virtual void freeResources() = 0;
54 virtual bool setClipRegion( const vcl::Region& ) = 0;
56 // get the depth of the device
57 virtual sal_uInt16 GetBitCount() const = 0;
59 // get the width of the device
60 virtual long GetGraphicsWidth() const = 0;
62 // set the clip region to empty
63 virtual void ResetClipRegion() = 0;
65 // set the line color to transparent (= don't draw lines)
67 virtual void SetLineColor() = 0;
69 // set the line color to a specific color
70 virtual void SetLineColor( SalColor nSalColor ) = 0;
72 // set the fill color to transparent (= don't fill)
73 virtual void SetFillColor() = 0;
75 // set the fill color to a specific color, shapes will be
76 // filled accordingly
77 virtual void SetFillColor( SalColor nSalColor ) = 0;
79 // enable/disable XOR drawing
80 virtual void SetXORMode( bool bSet, bool bInvertOnly ) = 0;
82 // set line color for raster operations
83 virtual void SetROPLineColor( SalROPColor nROPColor ) = 0;
85 // set fill color for raster operations
86 virtual void SetROPFillColor( SalROPColor nROPColor ) = 0;
88 // draw --> LineColor and FillColor and RasterOp and ClipRegion
89 virtual void drawPixel( long nX, long nY ) = 0;
90 virtual void drawPixel( long nX, long nY, SalColor nSalColor ) = 0;
92 virtual void drawLine( long nX1, long nY1, long nX2, long nY2 ) = 0;
94 virtual void drawRect( long nX, long nY, long nWidth, long nHeight ) = 0;
96 virtual void drawPolyLine( sal_uInt32 nPoints, const SalPoint* pPtAry ) = 0;
98 virtual void drawPolygon( sal_uInt32 nPoints, const SalPoint* pPtAry ) = 0;
100 virtual void drawPolyPolygon( sal_uInt32 nPoly, const sal_uInt32* pPoints, PCONSTSALPOINT* pPtAry ) = 0;
101 virtual bool drawPolyPolygon( const basegfx::B2DPolyPolygon&, double fTransparency ) = 0;
103 virtual bool drawPolyLine(
104 const basegfx::B2DPolygon&,
105 double fTransparency,
106 const basegfx::B2DVector& rLineWidths,
107 basegfx::B2DLineJoin,
108 css::drawing::LineCap,
109 double fMiterMinimumAngle) = 0;
111 virtual bool drawPolyLineBezier(
112 sal_uInt32 nPoints,
113 const SalPoint* pPtAry,
114 const sal_uInt8* pFlgAry ) = 0;
116 virtual bool drawPolygonBezier(
117 sal_uInt32 nPoints,
118 const SalPoint* pPtAry,
119 const sal_uInt8* pFlgAry ) = 0;
121 virtual bool drawPolyPolygonBezier(
122 sal_uInt32 nPoly,
123 const sal_uInt32* pPoints,
124 const SalPoint* const* pPtAry,
125 const sal_uInt8* const* pFlgAry ) = 0;
127 // CopyArea --> No RasterOp, but ClipRegion
128 virtual void copyArea(
129 long nDestX, long nDestY,
130 long nSrcX, long nSrcY,
131 long nSrcWidth, long nSrcHeight,
132 bool bWindowInvalidate ) = 0;
134 // CopyBits and DrawBitmap --> RasterOp and ClipRegion
135 // CopyBits() --> pSrcGraphics == NULL, then CopyBits on same Graphics
136 virtual void copyBits( const SalTwoRect& rPosAry, SalGraphics* pSrcGraphics ) = 0;
138 virtual void drawBitmap( const SalTwoRect& rPosAry, const SalBitmap& rSalBitmap ) = 0;
140 virtual void drawBitmap(
141 const SalTwoRect& rPosAry,
142 const SalBitmap& rSalBitmap,
143 const SalBitmap& rMaskBitmap ) = 0;
145 virtual void drawMask(
146 const SalTwoRect& rPosAry,
147 const SalBitmap& rSalBitmap,
148 SalColor nMaskColor ) = 0;
150 virtual SalBitmap* getBitmap( long nX, long nY, long nWidth, long nHeight ) = 0;
152 virtual SalColor getPixel( long nX, long nY ) = 0;
154 // invert --> ClipRegion (only Windows or VirDevs)
155 virtual void invert(
156 long nX, long nY,
157 long nWidth, long nHeight,
158 SalInvert nFlags) = 0;
160 virtual void invert( sal_uInt32 nPoints, const SalPoint* pPtAry, SalInvert nFlags ) = 0;
162 virtual bool drawEPS(
163 long nX, long nY,
164 long nWidth, long nHeight,
165 void* pPtr,
166 sal_uLong nSize ) = 0;
168 virtual bool blendBitmap(
169 const SalTwoRect&,
170 const SalBitmap& rBitmap ) = 0;
172 virtual bool blendAlphaBitmap(
173 const SalTwoRect&,
174 const SalBitmap& rSrcBitmap,
175 const SalBitmap& rMaskBitmap,
176 const SalBitmap& rAlphaBitmap ) = 0;
178 virtual bool drawAlphaBitmap(
179 const SalTwoRect&,
180 const SalBitmap& rSourceBitmap,
181 const SalBitmap& rAlphaBitmap ) = 0;
183 /** draw transformed bitmap (maybe with alpha) where Null, X, Y define the coordinate system */
184 virtual bool drawTransformedBitmap(
185 const basegfx::B2DPoint& rNull,
186 const basegfx::B2DPoint& rX,
187 const basegfx::B2DPoint& rY,
188 const SalBitmap& rSourceBitmap,
189 const SalBitmap* pAlphaBitmap) = 0;
191 virtual bool drawAlphaRect(
192 long nX, long nY,
193 long nWidth, long nHeight,
194 sal_uInt8 nTransparency ) = 0;
196 virtual bool drawGradient(const tools::PolyPolygon& rPolygon, const Gradient& rGradient) = 0;
199 #endif
201 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */