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 
31 #include <com/sun/star/drawing/LineCap.hpp>
32 
33 class SalGraphics;
34 class SalBitmap;
35 class SalFrame;
36 class Gradient;
37 class OpenGLContext;
38 class SalVirtualDevice;
39 
41 {
42 public:
43 
44  virtual ~SalGraphicsImpl();
45 
46  virtual void Init() = 0;
47 
48  virtual void DeInit() {}
49 
50  virtual void freeResources() = 0;
51 
52  virtual bool setClipRegion( const vcl::Region& ) = 0;
53  //
54  // get the depth of the device
55  virtual sal_uInt16 GetBitCount() const = 0;
56 
57  // get the width of the device
58  virtual long GetGraphicsWidth() const = 0;
59 
60  // set the clip region to empty
61  virtual void ResetClipRegion() = 0;
62 
63  // set the line color to transparent (= don't draw lines)
64 
65  virtual void SetLineColor() = 0;
66 
67  // set the line color to a specific color
68  virtual void SetLineColor( Color nColor ) = 0;
69 
70  // set the fill color to transparent (= don't fill)
71  virtual void SetFillColor() = 0;
72 
73  // set the fill color to a specific color, shapes will be
74  // filled accordingly
75  virtual void SetFillColor( Color nColor ) = 0;
76 
77  // enable/disable XOR drawing
78  virtual void SetXORMode( bool bSet, bool bInvertOnly ) = 0;
79 
80  // set line color for raster operations
81  virtual void SetROPLineColor( SalROPColor nROPColor ) = 0;
82 
83  // set fill color for raster operations
84  virtual void SetROPFillColor( SalROPColor nROPColor ) = 0;
85 
86  // draw --> LineColor and FillColor and RasterOp and ClipRegion
87  virtual void drawPixel( long nX, long nY ) = 0;
88  virtual void drawPixel( long nX, long nY, Color nColor ) = 0;
89 
90  virtual void drawLine( long nX1, long nY1, long nX2, long nY2 ) = 0;
91 
92  virtual void drawRect( long nX, long nY, long nWidth, long nHeight ) = 0;
93 
94  virtual void drawPolyLine( sal_uInt32 nPoints, const SalPoint* pPtAry ) = 0;
95 
96  virtual void drawPolygon( sal_uInt32 nPoints, const SalPoint* pPtAry ) = 0;
97 
98  virtual void drawPolyPolygon( sal_uInt32 nPoly, const sal_uInt32* pPoints, PCONSTSALPOINT* pPtAry ) = 0;
99 
100  virtual bool drawPolyPolygon(
101  const basegfx::B2DHomMatrix& rObjectToDevice,
103  double fTransparency) = 0;
104 
105  virtual bool drawPolyLine(
106  const basegfx::B2DHomMatrix& rObjectToDevice,
107  const basegfx::B2DPolygon&,
108  double fTransparency,
109  const basegfx::B2DVector& rLineWidths,
111  css::drawing::LineCap,
112  double fMiterMinimumAngle,
113  bool bPixelSnapHairline) = 0;
114 
115  virtual bool drawPolyLineBezier(
116  sal_uInt32 nPoints,
117  const SalPoint* pPtAry,
118  const PolyFlags* pFlgAry ) = 0;
119 
120  virtual bool drawPolygonBezier(
121  sal_uInt32 nPoints,
122  const SalPoint* pPtAry,
123  const PolyFlags* pFlgAry ) = 0;
124 
125  virtual bool drawPolyPolygonBezier(
126  sal_uInt32 nPoly,
127  const sal_uInt32* pPoints,
128  const SalPoint* const* pPtAry,
129  const PolyFlags* const* pFlgAry ) = 0;
130 
131  // CopyArea --> No RasterOp, but ClipRegion
132  virtual void copyArea(
133  long nDestX, long nDestY,
134  long nSrcX, long nSrcY,
135  long nSrcWidth, long nSrcHeight,
136  bool bWindowInvalidate ) = 0;
137 
138  // CopyBits and DrawBitmap --> RasterOp and ClipRegion
139  // CopyBits() --> pSrcGraphics == NULL, then CopyBits on same Graphics
140  virtual void copyBits( const SalTwoRect& rPosAry, SalGraphics* pSrcGraphics ) = 0;
141 
142  virtual void drawBitmap( const SalTwoRect& rPosAry, const SalBitmap& rSalBitmap ) = 0;
143 
144  virtual void drawBitmap(
145  const SalTwoRect& rPosAry,
146  const SalBitmap& rSalBitmap,
147  const SalBitmap& rMaskBitmap ) = 0;
148 
149  virtual void drawMask(
150  const SalTwoRect& rPosAry,
151  const SalBitmap& rSalBitmap,
152  Color nMaskColor ) = 0;
153 
154  virtual std::shared_ptr<SalBitmap> getBitmap( long nX, long nY, long nWidth, long nHeight ) = 0;
155 
156  virtual Color getPixel( long nX, long nY ) = 0;
157 
158  // invert --> ClipRegion (only Windows or VirDevs)
159  virtual void invert(
160  long nX, long nY,
161  long nWidth, long nHeight,
162  SalInvert nFlags) = 0;
163 
164  virtual void invert( sal_uInt32 nPoints, const SalPoint* pPtAry, SalInvert nFlags ) = 0;
165 
166  virtual bool drawEPS(
167  long nX, long nY,
168  long nWidth, long nHeight,
169  void* pPtr,
170  sal_uInt32 nSize ) = 0;
171 
172  virtual bool blendBitmap(
173  const SalTwoRect&,
174  const SalBitmap& rBitmap ) = 0;
175 
176  virtual bool blendAlphaBitmap(
177  const SalTwoRect&,
178  const SalBitmap& rSrcBitmap,
179  const SalBitmap& rMaskBitmap,
180  const SalBitmap& rAlphaBitmap ) = 0;
181 
182  virtual bool drawAlphaBitmap(
183  const SalTwoRect&,
184  const SalBitmap& rSourceBitmap,
185  const SalBitmap& rAlphaBitmap ) = 0;
186 
188  virtual bool drawTransformedBitmap(
189  const basegfx::B2DPoint& rNull,
190  const basegfx::B2DPoint& rX,
191  const basegfx::B2DPoint& rY,
192  const SalBitmap& rSourceBitmap,
193  const SalBitmap* pAlphaBitmap) = 0;
194 
195  virtual bool drawAlphaRect(
196  long nX, long nY,
197  long nWidth, long nHeight,
198  sal_uInt8 nTransparency ) = 0;
199 
200  virtual bool drawGradient(const tools::PolyPolygon& rPolygon, const Gradient& rGradient) = 0;
201 };
202 
203 #endif
204 
205 /* 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)
virtual void DeInit()
Definition: salgdiimpl.hxx:48
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