xref: /AOO41X/main/vcl/inc/win/salbmp.h (revision 2123d7570813d7d92dade2ba70822a073d984013)
1*2123d757SAndrew Rist /**************************************************************
2cdf0e10cSrcweir  *
3*2123d757SAndrew Rist  * Licensed to the Apache Software Foundation (ASF) under one
4*2123d757SAndrew Rist  * or more contributor license agreements.  See the NOTICE file
5*2123d757SAndrew Rist  * distributed with this work for additional information
6*2123d757SAndrew Rist  * regarding copyright ownership.  The ASF licenses this file
7*2123d757SAndrew Rist  * to you under the Apache License, Version 2.0 (the
8*2123d757SAndrew Rist  * "License"); you may not use this file except in compliance
9*2123d757SAndrew Rist  * with the License.  You may obtain a copy of the License at
10cdf0e10cSrcweir  *
11*2123d757SAndrew Rist  *   http://www.apache.org/licenses/LICENSE-2.0
12cdf0e10cSrcweir  *
13*2123d757SAndrew Rist  * Unless required by applicable law or agreed to in writing,
14*2123d757SAndrew Rist  * software distributed under the License is distributed on an
15*2123d757SAndrew Rist  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*2123d757SAndrew Rist  * KIND, either express or implied.  See the License for the
17*2123d757SAndrew Rist  * specific language governing permissions and limitations
18*2123d757SAndrew Rist  * under the License.
19cdf0e10cSrcweir  *
20*2123d757SAndrew Rist  *************************************************************/
21*2123d757SAndrew Rist 
22*2123d757SAndrew Rist 
23cdf0e10cSrcweir 
24cdf0e10cSrcweir #ifndef _SV_SALBMP_H
25cdf0e10cSrcweir #define _SV_SALBMP_H
26cdf0e10cSrcweir 
27cdf0e10cSrcweir #include <tools/gen.hxx>
28cdf0e10cSrcweir #include <win/wincomp.hxx>
29cdf0e10cSrcweir #include <salbmp.hxx>
30cdf0e10cSrcweir 
31cdf0e10cSrcweir // --------------
32cdf0e10cSrcweir // - SalBitmap	-
33cdf0e10cSrcweir // --------------
34cdf0e10cSrcweir 
35cdf0e10cSrcweir struct	BitmapBuffer;
36cdf0e10cSrcweir class	BitmapColor;
37cdf0e10cSrcweir class	BitmapPalette;
38cdf0e10cSrcweir class	SalGraphics;
39cdf0e10cSrcweir 
40cdf0e10cSrcweir class WinSalBitmap : public SalBitmap
41cdf0e10cSrcweir {
42cdf0e10cSrcweir private:
43cdf0e10cSrcweir 
44cdf0e10cSrcweir 	Size				maSize;
45cdf0e10cSrcweir 	HGLOBAL 			mhDIB;
46cdf0e10cSrcweir 	HBITMAP 			mhDDB;
47cdf0e10cSrcweir 	sal_uInt16				mnBitCount;
48cdf0e10cSrcweir 
49cdf0e10cSrcweir public:
50cdf0e10cSrcweir 
51cdf0e10cSrcweir 	HGLOBAL 			ImplGethDIB() const { return mhDIB; }
52cdf0e10cSrcweir 	HBITMAP 			ImplGethDDB() const { return mhDDB; }
53cdf0e10cSrcweir 
54cdf0e10cSrcweir 	static HGLOBAL		ImplCreateDIB( const Size& rSize, sal_uInt16 nBitCount, const BitmapPalette& rPal );
55cdf0e10cSrcweir 	static HANDLE		ImplCopyDIBOrDDB( HANDLE hHdl, bool bDIB );
56cdf0e10cSrcweir 	static sal_uInt16		ImplGetDIBColorCount( HGLOBAL hDIB );
57cdf0e10cSrcweir 	static void 		ImplDecodeRLEBuffer( const BYTE* pSrcBuf, BYTE* pDstBuf,
58cdf0e10cSrcweir 											 const Size& rSizePixel, bool bRLE4 );
59cdf0e10cSrcweir 
60cdf0e10cSrcweir public:
61cdf0e10cSrcweir 
62cdf0e10cSrcweir 						WinSalBitmap();
63cdf0e10cSrcweir 	virtual				~WinSalBitmap();
64cdf0e10cSrcweir 
65cdf0e10cSrcweir public:
66cdf0e10cSrcweir 
67cdf0e10cSrcweir 	bool                        Create( HANDLE hBitmap, bool bDIB, bool bCopyHandle );
68cdf0e10cSrcweir 	virtual bool                Create( const Size& rSize, sal_uInt16 nBitCount, const BitmapPalette& rPal );
69cdf0e10cSrcweir 	virtual bool                Create( const SalBitmap& rSalBmpImpl );
70cdf0e10cSrcweir 	virtual bool                Create( const SalBitmap& rSalBmpImpl, SalGraphics* pGraphics );
71cdf0e10cSrcweir 	virtual bool                Create( const SalBitmap& rSalBmpImpl, sal_uInt16 nNewBitCount );
72cdf0e10cSrcweir 
73cdf0e10cSrcweir 	virtual void                Destroy();
74cdf0e10cSrcweir 
75cdf0e10cSrcweir 	virtual Size                GetSize() const { return maSize; }
76cdf0e10cSrcweir 	virtual sal_uInt16              GetBitCount() const { return mnBitCount; }
77cdf0e10cSrcweir 
78cdf0e10cSrcweir 	virtual BitmapBuffer*		AcquireBuffer( bool bReadOnly );
79cdf0e10cSrcweir 	virtual void                ReleaseBuffer( BitmapBuffer* pBuffer, bool bReadOnly );
80cdf0e10cSrcweir     virtual bool                GetSystemData( BitmapSystemData& rData );
81cdf0e10cSrcweir };
82cdf0e10cSrcweir 
83cdf0e10cSrcweir #endif // _SV_SALBMP_HXX
84