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