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 :
21 : #include <canvas/debug.hxx>
22 : #include <tools/diagnose_ex.h>
23 : #include <canvas/canvastools.hxx>
24 :
25 : #include "null_canvasbitmap.hxx"
26 :
27 :
28 : using namespace ::com::sun::star;
29 :
30 : namespace nullcanvas
31 : {
32 0 : CanvasBitmap::CanvasBitmap( const ::basegfx::B2ISize& rSize,
33 : const DeviceRef& rDevice,
34 : bool bHasAlpha ) :
35 0 : mpDevice( rDevice )
36 : {
37 0 : ENSURE_OR_THROW( mpDevice.is(),
38 : "CanvasBitmap::CanvasBitmap(): Invalid surface or device" );
39 :
40 : maCanvasHelper.init( rSize,
41 0 : *mpDevice.get(),
42 0 : bHasAlpha );
43 0 : }
44 :
45 0 : void CanvasBitmap::disposeThis()
46 : {
47 0 : mpDevice.clear();
48 :
49 : // forward to parent
50 0 : CanvasBitmap_Base::disposeThis();
51 0 : }
52 :
53 : #define IMPLEMENTATION_NAME "NullCanvas.CanvasBitmap"
54 : #define SERVICE_NAME "com.sun.star.rendering.CanvasBitmap"
55 :
56 0 : ::rtl::OUString SAL_CALL CanvasBitmap::getImplementationName( ) throw (uno::RuntimeException)
57 : {
58 0 : return ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( IMPLEMENTATION_NAME ) );
59 : }
60 :
61 0 : sal_Bool SAL_CALL CanvasBitmap::supportsService( const ::rtl::OUString& ServiceName ) throw (uno::RuntimeException)
62 : {
63 0 : return ServiceName == SERVICE_NAME;
64 : }
65 :
66 0 : uno::Sequence< ::rtl::OUString > SAL_CALL CanvasBitmap::getSupportedServiceNames( ) throw (uno::RuntimeException)
67 : {
68 0 : uno::Sequence< ::rtl::OUString > aRet(1);
69 0 : aRet[0] = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM ( SERVICE_NAME ) );
70 :
71 0 : return aRet;
72 : }
73 :
74 0 : }
75 :
76 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|