LibreOffice Module vcl (master)  1
salgdiimpl.hxx
Go to the documentation of this file.
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3  * This file is part of the LibreOffice project.
4  *
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/.
8  *
9  * This file incorporates work covered by the following license notice:
10  *
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 .
18  */
19 
20 #ifndef INCLUDED_VCL_INC_SALGDIIMPL_HXX
21 #define INCLUDED_VCL_INC_SALGDIIMPL_HXX
22 
23 #include <vcl/dllapi.h>
24 
25 #include <tools/color.hxx>
26 #include <tools/poly.hxx>
27 
28 #include <vcl/salgtype.hxx>
29 #include <vcl/region.hxx>
30 #include <vcl/vclenum.hxx>
31 
32 #include <com/sun/star/drawing/LineCap.hpp>
33 
34 class SalGraphics;
35 class SalBitmap;
36 class SalFrame;
37 class Gradient;
38 class OpenGLContext;
39 class SalVirtualDevice;
40 
42 {
43 public:
44 
45  virtual ~SalGraphicsImpl();
46 
47  virtual void Init() = 0;
48 
49  virtual void DeInit() {}
50 
51  virtual void freeResources() = 0;
52 
53  virtual OUString getRenderBackendName() const = 0;
54 
55  virtual bool setClipRegion( const vcl::Region& ) = 0;
56  //
57  // get the depth of the device
58  virtual sal_uInt16 GetBitCount() const = 0;
59 
60  // get the width of the device
61  virtual long GetGraphicsWidth() const = 0;
62 
63  // set the clip region to empty
64  virtual void ResetClipRegion() = 0;
65 
66  // set the line color to transparent (= don't draw lines)
67 
68  virtual void SetLineColor() = 0;
69 
70  // set the line color to a specific color
71  virtual void SetLineColor( Color nColor ) = 0;
72 
73  // set the fill color to transparent (= don't fill)
74  virtual void SetFillColor() = 0;
75 
76  // set the fill color to a specific color, shapes will be
77  // filled accordingly
78  virtual void SetFillColor( Color nColor ) = 0;
79 
80  // enable/disable XOR drawing
81  virtual void SetXORMode( bool bSet, bool bInvertOnly ) = 0;
82 
83  // set line color for raster operations
84  virtual void SetROPLineColor( SalROPColor nROPColor ) = 0;
85 
86  // set fill color for raster operations
87  virtual void SetROPFillColor( SalROPColor nROPColor ) = 0;
88 
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, Color nColor ) = 0;
92 
93  virtual void drawLine( long nX1, long nY1, long nX2, long nY2 ) = 0;
94 
95  virtual void drawRect( long nX, long nY, long nWidth, long nHeight ) = 0;
96 
97  virtual void drawPolyLine( sal_uInt32 nPoints, const SalPoint* pPtAry ) = 0;
98 
99  virtual void drawPolygon( sal_uInt32 nPoints, const SalPoint* pPtAry ) = 0;
100 
101  virtual void drawPolyPolygon( sal_uInt32 nPoly, const sal_uInt32* pPoints, PCONSTSALPOINT* pPtAry ) = 0;
102 
103  virtual bool drawPolyPolygon(
104  const basegfx::B2DHomMatrix& rObjectToDevice,
106  double fTransparency) = 0;
107 
108  virtual bool drawPolyLine(
109  const basegfx::B2DHomMatrix& rObjectToDevice,
110  const basegfx::B2DPolygon&,
111  double fTransparency,
112  const basegfx::B2DVector& rLineWidths,
113  const std::vector< double >* pStroke, // MM01
115  css::drawing::LineCap,
116  double fMiterMinimumAngle,
117  bool bPixelSnapHairline) = 0;
118 
119  virtual bool drawPolyLineBezier(
120  sal_uInt32 nPoints,
121  const SalPoint* pPtAry,
122  const PolyFlags* pFlgAry ) = 0;
123 
124  virtual bool drawPolygonBezier(
125  sal_uInt32 nPoints,
126  const SalPoint* pPtAry,
127  const PolyFlags* pFlgAry ) = 0;
128 
129  virtual bool drawPolyPolygonBezier(
130  sal_uInt32 nPoly,
131  const sal_uInt32* pPoints,
132  const SalPoint* const* pPtAry,
133  const PolyFlags* const* pFlgAry ) = 0;
134 
135  // CopyArea --> No RasterOp, but ClipRegion
136  virtual void copyArea(
137  long nDestX, long nDestY,
138  long nSrcX, long nSrcY,
139  long nSrcWidth, long nSrcHeight,
140  bool bWindowInvalidate ) = 0;
141 
142  // CopyBits and DrawBitmap --> RasterOp and ClipRegion
143  // CopyBits() --> pSrcGraphics == NULL, then CopyBits on same Graphics
144  virtual void copyBits( const SalTwoRect& rPosAry, SalGraphics* pSrcGraphics ) = 0;
145 
146  virtual void drawBitmap( const SalTwoRect& rPosAry, const SalBitmap& rSalBitmap ) = 0;
147 
148  virtual void drawBitmap(
149  const SalTwoRect& rPosAry,
150  const SalBitmap& rSalBitmap,
151  const SalBitmap& rMaskBitmap ) = 0;
152 
153  virtual void drawMask(
154  const SalTwoRect& rPosAry,
155  const SalBitmap& rSalBitmap,
156  Color nMaskColor ) = 0;
157 
158  virtual std::shared_ptr<SalBitmap> getBitmap( long nX, long nY, long nWidth, long nHeight ) = 0;
159 
160  virtual Color getPixel( long nX, long nY ) = 0;
161 
162  // invert --> ClipRegion (only Windows or VirDevs)
163  virtual void invert(
164  long nX, long nY,
165  long nWidth, long nHeight,
166  SalInvert nFlags) = 0;
167 
168  virtual void invert( sal_uInt32 nPoints, const SalPoint* pPtAry, SalInvert nFlags ) = 0;
169 
170  virtual bool drawEPS(
171  long nX, long nY,
172  long nWidth, long nHeight,
173  void* pPtr,
174  sal_uInt32 nSize ) = 0;
175 
176  virtual bool blendBitmap(
177  const SalTwoRect&,
178  const SalBitmap& rBitmap ) = 0;
179 
180  virtual bool blendAlphaBitmap(
181  const SalTwoRect&,
182  const SalBitmap& rSrcBitmap,
183  const SalBitmap& rMaskBitmap,
184  const SalBitmap& rAlphaBitmap ) = 0;
185 
186  virtual bool drawAlphaBitmap(
187  const SalTwoRect&,
188  const SalBitmap& rSourceBitmap,
189  const SalBitmap& rAlphaBitmap ) = 0;
190 
192  virtual bool drawTransformedBitmap(
193  const basegfx::B2DPoint& rNull,
194  const basegfx::B2DPoint& rX,
195  const basegfx::B2DPoint& rY,
196  const SalBitmap& rSourceBitmap,
197  const SalBitmap* pAlphaBitmap) = 0;
198 
199  virtual bool drawAlphaRect(
200  long nX, long nY,
201  long nWidth, long nHeight,
202  sal_uInt8 nTransparency ) = 0;
203 
204  virtual bool drawGradient(const tools::PolyPolygon& rPolygon, const Gradient& rGradient) = 0;
205 
206  virtual bool supportsOperation(OutDevSupportType eType) const = 0;
207 };
208 
209 #endif
210 
211 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
void Init()
SalROPColor
Definition: salgtype.hxx:80
void drawPolygon(VirtualDevice *dev, bool drawFrame, tools::Polygon const &rect, Size const &pSize)
OutDevSupportType
Definition: vclenum.hxx:195
virtual void DeInit()
Definition: salgdiimpl.hxx:49
void drawLine(VirtualDevice *dev, Point const &orig, Point const &dest, Size const &pSize)
SalInvert
Definition: salgtype.hxx:84
#define VCL_PLUGIN_PUBLIC
Definition: dllapi.h:40
A SalFrame is a system window (e.g. an X11 window).
Definition: salframe.hxx:112
unsigned char sal_uInt8
A non-visible drawable/buffer (e.g. an X11 Pixmap).
Definition: salvd.hxx:28
void SetLineColor(const css::uno::Reference< css::beans::XPropertySet > &xGridProperties, sal_Int32 nColor)
PolyFlags