1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
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/.
9 * This file incorporates work covered by the following license notice:
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 .
20 #ifndef INCLUDED_CANVAS_SOURCE_CAIRO_CAIRO_SURFACEPROVIDER_HXX
21 #define INCLUDED_CANVAS_SOURCE_CAIRO_CAIRO_SURFACEPROVIDER_HXX
23 #include <rtl/ref.hxx>
24 #include <com/sun/star/uno/XInterface.hpp>
26 #include <vcl/cairo.hxx>
36 /* Definition of RepaintTarget interface */
38 /** Target interface for XCachedPrimitive implementations
40 This interface must be implemented on all canvas
41 implementations that hand out XCachedPrimitives
43 class SurfaceProvider
: public ::com::sun::star::uno::XInterface
46 virtual ~SurfaceProvider() {}
48 /** Query surface from this provider
50 This should return the default surface to render on.
52 virtual ::cairo::SurfaceSharedPtr
getSurface() = 0;
54 /// create new surface in given size
55 virtual ::cairo::SurfaceSharedPtr
createSurface( const ::basegfx::B2ISize
& rSize
,
56 int aContent
= CAIRO_CONTENT_COLOR_ALPHA
) = 0;
57 /// create new surface from given bitmap
58 virtual ::cairo::SurfaceSharedPtr
createSurface( ::Bitmap
& rBitmap
) = 0;
60 /** convert surface between alpha and non-alpha
61 channel. returns new surface on success, NULL otherwise
63 virtual ::cairo::SurfaceSharedPtr
changeSurface( bool bHasAlpha
, bool bCopyContent
) = 0;
65 /** Provides the underlying vcl outputdevice this surface renders on
67 virtual OutputDevice
* getOutputDevice() = 0;
70 typedef ::rtl::Reference
< SurfaceProvider
> SurfaceProviderRef
;
75 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */