LibreOffice Module vcl (master) 1
cairo.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_CAIRO_HXX
21#define INCLUDED_VCL_CAIRO_HXX
22
23#include <sal/config.h>
24#include <vcl/vclptr.hxx>
25#include <memory>
26
27typedef struct _cairo_surface cairo_surface_t;
28typedef struct _cairo cairo_t;
29
30class VirtualDevice;
31
32namespace cairo {
33
34 typedef std::shared_ptr<cairo_surface_t> CairoSurfaceSharedPtr;
35 typedef std::shared_ptr<cairo_t> CairoSharedPtr;
36 struct Surface;
37 typedef std::shared_ptr<Surface> SurfaceSharedPtr;
38
44 struct Surface
45 {
46 public:
47 virtual ~Surface() {}
48
49 // Query methods
50 virtual CairoSharedPtr getCairo() const = 0;
52 virtual SurfaceSharedPtr getSimilar(int cairo_content_type, int width, int height) const = 0;
53
56
59 virtual bool Resize( int /*width*/, int /*height*/ ) { return false; }
60
62 virtual void flush() const = 0;
63 };
64
65}
66
67#endif
68
69/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
struct _cairo_surface cairo_surface_t
Definition: CairoCommon.hxx:72
struct _cairo cairo_t
Definition: CairoCommon.hxx:71
std::shared_ptr< Surface > SurfaceSharedPtr
Definition: cairo.hxx:36
std::shared_ptr< cairo_t > CairoSharedPtr
Definition: cairo.hxx:35
std::shared_ptr< cairo_surface_t > CairoSurfaceSharedPtr
Definition: cairo.hxx:34
Cairo surface interface.
Definition: cairo.hxx:45
virtual ~Surface()
Definition: cairo.hxx:47
virtual void flush() const =0
Flush all pending output to surface.
virtual CairoSurfaceSharedPtr getCairoSurface() const =0
virtual bool Resize(int, int)
Resize the surface (possibly destroying content), only possible for X11 typically so on failure calle...
Definition: cairo.hxx:59
virtual VclPtr< VirtualDevice > createVirtualDevice() const =0
factory for VirDev on this surface
virtual SurfaceSharedPtr getSimilar(int cairo_content_type, int width, int height) const =0
virtual CairoSharedPtr getCairo() const =0