LibreOffice Module vcl (master)  1
svpvd.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_HEADLESS_SVPVD_HXX
21 #define INCLUDED_VCL_INC_HEADLESS_SVPVD_HXX
22 
23 #include <salvd.hxx>
24 #include <vcl/salgtype.hxx>
26 
27 #include <vector>
28 
29 class SvpSalGraphics;
30 typedef struct _cairo_surface cairo_surface_t;
31 
33 {
37  bool m_bOwnsSurface; // nearly always true, except for edge case of tdf#127529
39  std::vector< SvpSalGraphics* > m_aGraphics;
40 
41  void CreateSurface(long nNewDX, long nNewDY, sal_uInt8 *const pBuffer);
42 
43 protected:
44  SvpSalGraphics* AddGraphics(SvpSalGraphics* aGraphics);
45 
46 public:
47  SvpSalVirtualDevice(DeviceFormat eFormat, cairo_surface_t* pRefSurface, cairo_surface_t* pPreExistingTarget);
48  virtual ~SvpSalVirtualDevice() override;
49 
50  // SalVirtualDevice
51  virtual SalGraphics* AcquireGraphics() override;
52  virtual void ReleaseGraphics( SalGraphics* pGraphics ) override;
53 
54  virtual bool SetSize( long nNewDX, long nNewDY ) override;
55  virtual bool SetSizeUsingBuffer( long nNewDX, long nNewDY,
56  sal_uInt8 * pBuffer
57  ) override;
58 
59  cairo_surface_t* GetSurface() const { return m_pSurface; }
60 
61  // SalGeometryProvider
62  virtual long GetWidth() const override;
63  virtual long GetHeight() const override;
64 };
65 
66 #endif // INCLUDED_VCL_INC_HEADLESS_SVPVD_HXX
67 
68 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
#define VCL_DLLPUBLIC
Definition: dllapi.h:29
cairo_surface_t * GetSurface() const
Definition: svpvd.hxx:59
virtual long GetWidth() const =0
basegfx::B2IVector m_aFrameSize
Definition: svpvd.hxx:38
virtual bool SetSize(long nNewDX, long nNewDY)=0
virtual SalGraphics * AcquireGraphics()=0
cairo_surface_t *const m_pRefSurface
Definition: svpvd.hxx:35
virtual bool SetSizeUsingBuffer(long nNewDX, long nNewDY, sal_uInt8 *)
Definition: salvd.hxx:47
virtual void ReleaseGraphics(SalGraphics *pGraphics)=0
cairo_surface_t * m_pSurface
Definition: svpvd.hxx:36
std::vector< SvpSalGraphics * > m_aGraphics
Definition: svpvd.hxx:39
DeviceFormat
Definition: salgtype.hxx:28
DeviceFormat const m_eFormat
Definition: svpvd.hxx:34
unsigned char sal_uInt8
virtual long GetHeight() const =0
A non-visible drawable/buffer (e.g. an X11 Pixmap).
Definition: salvd.hxx:28
struct _cairo_surface cairo_surface_t
Definition: svpgdi.hxx:70