Version 6.1.4.1, tag libreoffice-6.1.4.1
[LibreOffice.git] / vcl / unx / gtk3 / cairo_gtk3_cairo.hxx
blob1f9333191c63378ac99c83df6765b489dafe511a
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/.
8 */
10 #ifndef INCLUDED_CANVAS_SOURCE_CAIRO_CAIRO_GTK3_CAIRO_HXX
11 #define INCLUDED_CANVAS_SOURCE_CAIRO_CAIRO_GTK3_CAIRO_HXX
13 #include <sal/config.h>
15 #include <sal/types.h>
17 #include <vcl/cairo.hxx>
19 class GtkSalGraphics;
20 class OutputDevice;
22 namespace cairo {
24 class Gtk3Surface : public Surface
26 const GtkSalGraphics* mpGraphics;
27 cairo_t* cr;
28 CairoSurfaceSharedPtr mpSurface;
29 public:
30 /// takes over ownership of passed cairo_surface
31 explicit Gtk3Surface(const CairoSurfaceSharedPtr& pSurface);
32 /// create surface on subarea of given drawable
33 explicit Gtk3Surface(const GtkSalGraphics* pGraphics, int x, int y, int width, int height);
35 // Surface interface
36 virtual CairoSharedPtr getCairo() const override;
37 virtual CairoSurfaceSharedPtr getCairoSurface() const override { return mpSurface; }
38 virtual SurfaceSharedPtr getSimilar(int nContentType, int width, int height) const override;
40 virtual VclPtr<VirtualDevice> createVirtualDevice() const override;
42 virtual void flush() const override;
44 virtual ~Gtk3Surface() override;
49 #endif
51 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */