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 _SV_IMPBMP_HXX
30 : : #define _SV_IMPBMP_HXX
31 : :
32 : : #include <tools/gen.hxx>
33 : : #include <tools/solar.h>
34 : :
35 : : // ---------------
36 : : // - ImpBitmap -
37 : : // ---------------
38 : :
39 : : struct BitmapBuffer;
40 : : class SalBitmap;
41 : : class BitmapPalette;
42 : : class SalGraphics;
43 : : class Bitmap;
44 : : class OutputDevice;
45 : : class Color;
46 : : class AlphaMask;
47 : :
48 : : class ImpBitmap
49 : : {
50 : : private:
51 : :
52 : : sal_uLong mnRefCount;
53 : : sal_uLong mnChecksum;
54 : : SalBitmap* mpSalBitmap;
55 : : Size maSourceSize;
56 : :
57 : : public:
58 : :
59 : : ImpBitmap();
60 : : ~ImpBitmap();
61 : :
62 : : #if _SOLAR__PRIVATE
63 : :
64 : : public:
65 : :
66 : : void ImplSetSalBitmap( SalBitmap* pSalBitmap );
67 : 577163 : SalBitmap* ImplGetSalBitmap() const { return mpSalBitmap; }
68 : :
69 : : public:
70 : :
71 : : sal_Bool ImplCreate( const Size& rSize, sal_uInt16 nBitCount, const BitmapPalette& rPal );
72 : : sal_Bool ImplCreate( const ImpBitmap& rImpBitmap );
73 : : sal_Bool ImplCreate( const ImpBitmap& rImpBitmap, SalGraphics* pGraphics );
74 : : sal_Bool ImplCreate( const ImpBitmap& rImpBitmap, sal_uInt16 nNewBitCount );
75 : :
76 : : Size ImplGetSize() const;
77 : : Size ImplGetSourceSize() const;
78 : : void ImplSetSourceSize( const Size&);
79 : : sal_uInt16 ImplGetBitCount() const;
80 : :
81 : : BitmapBuffer* ImplAcquireBuffer( sal_Bool bReadOnly );
82 : : void ImplReleaseBuffer( BitmapBuffer* pBuffer, sal_Bool bReadOnly );
83 : :
84 : : public:
85 : :
86 : 6638559 : sal_uLong ImplGetRefCount() const { return mnRefCount; }
87 : 5716457 : void ImplIncRefCount() { mnRefCount++; }
88 : 5716453 : void ImplDecRefCount() { mnRefCount--; }
89 : :
90 : 2877 : inline void ImplSetChecksum( sal_uLong nChecksum ) { mnChecksum = nChecksum; }
91 : 71332 : inline sal_uLong ImplGetChecksum() const { return mnChecksum; }
92 : :
93 : : #endif // PRIVATE
94 : : };
95 : :
96 : : inline Size ImpBitmap::ImplGetSourceSize() const
97 : : {
98 : : return maSourceSize;
99 : : }
100 : :
101 : 9427 : inline void ImpBitmap::ImplSetSourceSize( const Size& rSize)
102 : : {
103 : 9427 : maSourceSize = rSize;
104 : 9427 : }
105 : :
106 : : #endif // _SV_IMPBMP_HXX
107 : :
108 : : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|