1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: fltdefs.hxx,v $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
32 #include <tools/solar.h>
34 #include <vcl/bitmap.hxx>
45 #if defined ( WIN ) || defined ( WNT )
47 #define RGBQUAD RGBQUADWIN
49 typedef struct RGBQUAD
56 RGBQUAD( const BYTE cRed
= 0, const BYTE cGreen
= 0, const BYTE cBlue
= 0 ) :
65 typedef BYTE huge
* PDIBBYTE
;
66 #define MEMCPY hmemcpy
67 #define GLOBALALLOC(nSize) ((PDIBBYTE)GlobalLock(GlobalAlloc(GHND,(nSize))))
68 #define GLOBALHANDLE(pPointer) ((HGLOBAL)GlobalHandle((*((size_t*)&(pPointer)+1))))
69 #define GLOBALFREE(pPointer) (GlobalUnlock(GLOBALHANDLE((pPointer))))
70 #define MEMSET( pDst, cByte, nCount ) \
72 PDIBBYTE pTmp = (PDIBBYTE) pDst; \
73 for ( ULONG i = 0; i < nCount; i++ )\
79 typedef BYTE
* PDIBBYTE
;
82 #define GLOBALALLOC(nSize) ((PDIBBYTE)GlobalAlloc(GMEM_FIXED,(nSize)))
83 #define GLOBALFREE(pPointer) (GlobalFree((HGLOBAL)pPointer))
84 #define GLOBALHANDLE(pPointer) ((HGLOBAL)(pPointer))
89 typedef BYTE
* PDIBBYTE
;
92 #define GLOBALALLOC(nSize) ((PDIBBYTE)new BYTE[(nSize)])
93 #define GLOBALFREE(pPointer) (delete[] (pPointer))
98 #if defined ( OS2 ) || defined ( UNX )
99 void ReadBitmap( SvStream
& rIStream
, Bitmap
& rBmp
, USHORT nDefaultHeight
= 0, ULONG nOffBits
= 0 );
100 void ReplaceInfoHeader( SvStream
& rStm
, BYTE
* pBuffer
);
103 #define RGBQUAD RGBQUADOS2
104 #define BITMAPFILEHEADER BITMAPFILEHEADEROS2
105 #define PBITMAPFILEHEADER PBITMAPFILEHEADEROS2
106 #define BITMAPINFOHEADER BITMAPINFOHEADEROS2
107 #define PBITMAPINFOHEADER PBITMAPINFOHEADEROS2
108 #define BITMAPINFO BITMAPINFOOS2
109 #define PBITMAPINFO PBITMAPINFOOS2
112 typedef struct RGBQUAD
119 RGBQUAD( const BYTE cRed
= 0, const BYTE cGreen
= 0, const BYTE cBlue
= 0 ) :
123 rgbReserved ( 0 ) {};
126 typedef struct BITMAPFILEHEADER
134 typedef BITMAPFILEHEADER
* PBITMAPFILEHEADER
;
136 typedef struct BITMAPINFOHEADER
143 UINT32 biCompression
;
145 UINT32 biXPelsPerMeter
;
146 UINT32 biYPelsPerMeter
;
148 UINT32 biClrImportant
;
150 typedef BITMAPINFOHEADER
* PBITMAPINFOHEADER
;
152 typedef struct BITMAPINFO
154 BITMAPINFOHEADER bmiHeader
;
155 RGBQUAD bmiColors
[1];
157 typedef BITMAPINFO
* PBITMAPINFO
;