LibreOffice Module vcl (master) 1
unx/salvd.h
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_UNX_SALVD_H
21#define INCLUDED_VCL_INC_UNX_SALVD_H
22
23#include <X11/Xlib.h>
24
25#include <unx/saldisp.hxx>
26#include <unx/saltype.h>
27#include <salvd.hxx>
28
29#include <memory>
30
31class SalDisplay;
32class X11SalGraphics;
33typedef struct _cairo_surface cairo_surface_t;
34
36{
38 std::unique_ptr<X11SalGraphics> pGraphics_;
39
40 Pixmap hDrawable_;
42
43 int nDX_;
44 int nDY_;
45 sal_uInt16 nDepth_;
46 bool bGraphics_; // is Graphics used
49 bool m_bOwnsSurface; // nearly always true, except for edge case of tdf#127529
50
51public:
53 DeviceFormat eFormat, const SystemGraphicsData *pData, std::unique_ptr<X11SalGraphics> pNewGraphics);
54
55 virtual ~X11SalVirtualDevice() override;
56
58 {
59 return pDisplay_->GetDisplay();
60 }
62 {
63 return pDisplay_;
64 }
65 Pixmap GetDrawable() const { return hDrawable_; }
67 sal_uInt16 GetDepth() const { return nDepth_; }
68 const SalX11Screen& GetXScreenNumber() const { return m_nXScreen; }
69
70 virtual SalGraphics* AcquireGraphics() override;
71 virtual void ReleaseGraphics( SalGraphics* pGraphics ) override;
72
74 virtual bool SetSize( tools::Long nNewDX, tools::Long nNewDY ) override;
75
76 // SalGeometryProvider
77 virtual tools::Long GetWidth() const override { return nDX_; }
78 virtual tools::Long GetHeight() const override { return nDY_; }
79};
80
81#endif // INCLUDED_VCL_INC_UNX_SALVD_H
82
83/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
struct _cairo_surface cairo_surface_t
Definition: CairoCommon.hxx:46
Display * GetDisplay() const
Definition: saldisp.hxx:326
A non-visible drawable/buffer (e.g. an X11 Pixmap).
Definition: salvd.hxx:30
Pixmap GetDrawable() const
Definition: unx/salvd.h:65
X11SalVirtualDevice(const SalGraphics &rGraphics, tools::Long &nDX, tools::Long &nDY, DeviceFormat eFormat, const SystemGraphicsData *pData, std::unique_ptr< X11SalGraphics > pNewGraphics)
sal_uInt16 nDepth_
Definition: unx/salvd.h:45
virtual tools::Long GetHeight() const override
Definition: unx/salvd.h:78
virtual ~X11SalVirtualDevice() override
virtual bool SetSize(tools::Long nNewDX, tools::Long nNewDY) override
Set new size, without saving the old contents.
cairo_surface_t * GetSurface() const
Definition: unx/salvd.h:66
std::unique_ptr< X11SalGraphics > pGraphics_
Definition: unx/salvd.h:38
sal_uInt16 GetDepth() const
Definition: unx/salvd.h:67
virtual SalGraphics * AcquireGraphics() override
virtual tools::Long GetWidth() const override
Definition: unx/salvd.h:77
SalX11Screen m_nXScreen
Definition: unx/salvd.h:41
Display * GetXDisplay() const
Definition: unx/salvd.h:57
SalDisplay * GetDisplay() const
Definition: unx/salvd.h:61
virtual void ReleaseGraphics(SalGraphics *pGraphics) override
cairo_surface_t * m_pSurface
Definition: unx/salvd.h:48
SalDisplay * pDisplay_
Definition: unx/salvd.h:37
const SalX11Screen & GetXScreenNumber() const
Definition: unx/salvd.h:68
Display
long Long
DeviceFormat
Definition: salgtype.hxx:28