Line data Source code
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_CANVAS_SOURCE_CAIRO_CAIRO_SURFACEPROVIDER_HXX
21 : #define INCLUDED_CANVAS_SOURCE_CAIRO_CAIRO_SURFACEPROVIDER_HXX
22 :
23 : #include <rtl/ref.hxx>
24 : #include <com/sun/star/uno/XInterface.hpp>
25 :
26 : #include "cairo_cairo.hxx"
27 :
28 : class OutputDevice;
29 : class Bitmap;
30 :
31 : namespace cairocanvas
32 : {
33 : class Bitmap;
34 :
35 : /* Definition of RepaintTarget interface */
36 :
37 : /** Target interface for XCachedPrimitive implementations
38 :
39 : This interface must be implemented on all canvas
40 : implementations that hand out XCachedPrimitives
41 : */
42 2 : class SurfaceProvider : public ::com::sun::star::uno::XInterface
43 : {
44 : public:
45 2 : virtual ~SurfaceProvider() {}
46 :
47 : /** Query surface from this provider
48 :
49 : This should return the default surface to render on.
50 : */
51 : virtual ::cairo::SurfaceSharedPtr getSurface() = 0;
52 :
53 : /// create new surface in given size
54 : virtual ::cairo::SurfaceSharedPtr createSurface( const ::basegfx::B2ISize& rSize,
55 : ::cairo::Content aContent = CAIRO_CONTENT_COLOR_ALPHA ) = 0;
56 : /// create new surface from given bitmap
57 : virtual ::cairo::SurfaceSharedPtr createSurface( ::Bitmap& rBitmap ) = 0;
58 :
59 : /** convert surface between alpha and non-alpha
60 : channel. returns new surface on success, NULL otherwise
61 : */
62 : virtual ::cairo::SurfaceSharedPtr changeSurface( bool bHasAlpha, bool bCopyContent ) = 0;
63 :
64 : /** Provides the underlying vcl outputdevice this surface renders on
65 : */
66 : virtual OutputDevice* getOutputDevice() = 0;
67 : };
68 :
69 : typedef ::rtl::Reference< SurfaceProvider > SurfaceProviderRef;
70 : }
71 :
72 : #endif
73 :
74 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|