merged tag ooo/DEV300_m102
[LibreOffice.git] / vcl / os2 / inc / salbmp.h
blob14e51ffae8daf457d3d9416605d2c0353a2f0b0d
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2000, 2010 Oracle and/or its affiliates.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * This file is part of OpenOffice.org.
11 * OpenOffice.org is free software: you can redistribute it and/or modify
12 * it under the terms of the GNU Lesser General Public License version 3
13 * only, as published by the Free Software Foundation.
15 * OpenOffice.org is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU Lesser General Public License version 3 for more details
19 * (a copy is included in the LICENSE file that accompanied this code).
21 * You should have received a copy of the GNU Lesser General Public License
22 * version 3 along with OpenOffice.org. If not, see
23 * <http://www.openoffice.org/license.html>
24 * for a copy of the LGPLv3 License.
26 ************************************************************************/
28 #ifndef _SV_SALBMP_H
29 #define _SV_SALBMP_H
31 #include <tools/gen.hxx>
32 #include <vcl/sv.h>
33 #include <vcl/salbmp.hxx>
35 // --------------
36 // - SalBitmap -
37 // --------------
39 struct BitmapBuffer;
40 class BitmapColor;
41 class BitmapPalette;
42 class SalGraphics;
44 #define HANDLE ULONG
45 #define HBITMAP ULONG
47 class Os2SalBitmap : public SalBitmap
49 private:
51 Size maSize;
52 HANDLE mhDIB;
53 HANDLE mhDIB1Subst;
54 HBITMAP mhDDB;
55 USHORT mnBitCount;
57 public:
59 HANDLE ImplGethDIB() const { return mhDIB; }
60 HBITMAP ImplGethDDB() const { return mhDDB; }
61 HANDLE ImplGethDIB1Subst() const { return mhDIB1Subst; }
63 void ImplReplacehDIB1Subst( HANDLE hDIB1Subst );
65 static HANDLE ImplCreateDIB( const Size& rSize, USHORT nBitCount, const BitmapPalette& rPal );
66 static HANDLE ImplCreateDIB4FromDIB1( HANDLE hDIB1 );
67 static HANDLE ImplCopyDIBOrDDB( HANDLE hHdl, BOOL bDIB );
68 static USHORT ImplGetDIBColorCount( HANDLE hDIB );
69 static void ImplDecodeRLEBuffer( const BYTE* pSrcBuf, BYTE* pDstBuf,
70 const Size& rSizePixel, BOOL bRLE4 );
72 //BOOL Create( HANDLE hBitmap, BOOL bDIB, BOOL bCopyHandle );
74 public:
76 Os2SalBitmap();
77 ~Os2SalBitmap();
79 public:
81 //BOOL Create( const Size& rSize, USHORT nBitCount, const BitmapPalette& rPal );
82 //BOOL Create( const SalBitmap& rSalBmpImpl );
83 //BOOL Create( const SalBitmap& rSalBmpImpl, SalGraphics* pGraphics );
84 //BOOL Create( const SalBitmap& rSalBmpImpl, USHORT nNewBitCount );
86 //void Destroy();
88 //Size GetSize() const { return maSize; }
89 //USHORT GetBitCount() const { return mnBitCount; }
91 //BitmapBuffer* AcquireBuffer( bool bReadOnly );
92 //void ReleaseBuffer( BitmapBuffer* pBuffer, bool bReadOnly );
93 bool Create( HANDLE hBitmap, bool bDIB, bool bCopyHandle );
94 virtual bool Create( const Size& rSize, USHORT nBitCount, const BitmapPalette& rPal );
95 virtual bool Create( const SalBitmap& rSalBmpImpl );
96 virtual bool Create( const SalBitmap& rSalBmpImpl, SalGraphics* pGraphics );
97 virtual bool Create( const SalBitmap& rSalBmpImpl, USHORT nNewBitCount );
99 virtual void Destroy();
101 virtual Size GetSize() const { return maSize; }
102 virtual USHORT GetBitCount() const { return mnBitCount; }
104 virtual BitmapBuffer* AcquireBuffer( bool bReadOnly );
105 virtual void ReleaseBuffer( BitmapBuffer* pBuffer, bool bReadOnly );
106 virtual bool GetSystemData( BitmapSystemData& rData );
109 #endif // _SV_SALBMP_H