Update git submodules
[LibreOffice.git] / vcl / unx / gtk3 / gtkcairo.hxx
blobc5912181fc21a3405dd3468e08e30dba51ae1260
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 #pragma once
12 #include <sal/config.h>
14 #include <vcl/cairo.hxx>
16 class GtkSalGraphics;
17 class OutputDevice;
19 namespace cairo {
21 class Gtk3Surface : public Surface
23 const GtkSalGraphics* mpGraphics;
24 cairo_t* cr;
25 CairoSurfaceSharedPtr mpSurface;
26 public:
27 /// takes over ownership of passed cairo_surface
28 explicit Gtk3Surface(CairoSurfaceSharedPtr pSurface);
29 /// create surface on subarea of given drawable
30 explicit Gtk3Surface(const GtkSalGraphics* pGraphics, int x, int y, int width, int height);
32 // Surface interface
33 virtual CairoSharedPtr getCairo() const override;
34 virtual CairoSurfaceSharedPtr getCairoSurface() const override { return mpSurface; }
35 virtual SurfaceSharedPtr getSimilar(int nContentType, int width, int height) const override;
37 virtual VclPtr<VirtualDevice> createVirtualDevice() const override;
39 virtual void flush() const override;
41 virtual ~Gtk3Surface() override;
46 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */