Branch data Line data Source code
1 : : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : : /*************************************************************************
3 : : *
4 : : * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 : : *
6 : : * Copyright 2000, 2010 Oracle and/or its affiliates.
7 : : *
8 : : * OpenOffice.org - a multi-platform office productivity suite
9 : : *
10 : : * This file is part of OpenOffice.org.
11 : : *
12 : : * OpenOffice.org is free software: you can redistribute it and/or modify
13 : : * it under the terms of the GNU Lesser General Public License version 3
14 : : * only, as published by the Free Software Foundation.
15 : : *
16 : : * OpenOffice.org is distributed in the hope that it will be useful,
17 : : * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 : : * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 : : * GNU Lesser General Public License version 3 for more details
20 : : * (a copy is included in the LICENSE file that accompanied this code).
21 : : *
22 : : * You should have received a copy of the GNU Lesser General Public License
23 : : * version 3 along with OpenOffice.org. If not, see
24 : : * <http://www.openoffice.org/license.html>
25 : : * for a copy of the LGPLv3 License.
26 : : *
27 : : ************************************************************************/
28 : :
29 : : #ifndef _NULLCANVAS_CANVASBITMAP_HXX
30 : : #define _NULLCANVAS_CANVASBITMAP_HXX
31 : :
32 : : #include <cppuhelper/compbase3.hxx>
33 : :
34 : : #include <com/sun/star/lang/XServiceInfo.hpp>
35 : : #include <com/sun/star/rendering/XBitmapCanvas.hpp>
36 : : #include <com/sun/star/rendering/XIntegerBitmap.hpp>
37 : :
38 : : #include <basegfx/vector/b2isize.hxx>
39 : :
40 : : #include <boost/shared_ptr.hpp>
41 : :
42 : : #include <canvas/base/integerbitmapbase.hxx>
43 : : #include <canvas/base/disambiguationhelper.hxx>
44 : :
45 : : #include "null_canvashelper.hxx"
46 : : #include "null_spritecanvas.hxx"
47 : : #include "null_usagecounter.hxx"
48 : :
49 : :
50 : : /* Definition of CanvasBitmap class */
51 : :
52 : : namespace nullcanvas
53 : : {
54 : : typedef ::cppu::WeakComponentImplHelper3< ::com::sun::star::rendering::XBitmapCanvas,
55 : : ::com::sun::star::rendering::XIntegerBitmap,
56 : : ::com::sun::star::lang::XServiceInfo > CanvasBitmapBase_Base;
57 : : typedef ::canvas::IntegerBitmapBase< ::canvas::DisambiguationHelper< CanvasBitmapBase_Base >,
58 : : CanvasHelper,
59 : : ::osl::MutexGuard,
60 : : ::cppu::OWeakObject > CanvasBitmap_Base;
61 : :
62 : 0 : class CanvasBitmap : public CanvasBitmap_Base,
63 : : private UsageCounter< CanvasBitmap >
64 : : {
65 : : public:
66 : : /** Create a canvas bitmap for the given surface
67 : :
68 : : @param rSize
69 : : Size of the bitmap
70 : :
71 : : @param rDevice
72 : : Reference device, with which bitmap should be compatible
73 : : */
74 : : CanvasBitmap( const ::basegfx::B2ISize& rSize,
75 : : const DeviceRef& rDevice,
76 : : bool bHasAlpha );
77 : :
78 : : /// Dispose all internal references
79 : : virtual void disposeThis();
80 : :
81 : : // XServiceInfo
82 : : virtual ::rtl::OUString SAL_CALL getImplementationName( ) throw (::com::sun::star::uno::RuntimeException);
83 : : virtual sal_Bool SAL_CALL supportsService( const ::rtl::OUString& ServiceName ) throw (::com::sun::star::uno::RuntimeException);
84 : : virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames( ) throw (::com::sun::star::uno::RuntimeException);
85 : :
86 : : private:
87 : : /** MUST hold here, too, since CanvasHelper only contains a
88 : : raw pointer (without refcounting)
89 : : */
90 : : DeviceRef mpDevice;
91 : : };
92 : : }
93 : :
94 : : #endif /* _NULLCANVAS_CANVASBITMAP_HXX */
95 : :
96 : : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|