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 ************************************************************************/
31 #include <tools/solar.h>
32 #include <vcl/bitmap.hxx>
40 #if defined ( WIN ) || defined ( WNT )
42 #define RGBQUAD RGBQUADWIN
44 typedef struct RGBQUAD
51 RGBQUAD( const BYTE cRed
= 0, const BYTE cGreen
= 0, const BYTE cBlue
= 0 ) :
60 typedef BYTE huge
* PDIBBYTE
;
61 #define MEMCPY hmemcpy
62 #define GLOBALALLOC(nSize) ((PDIBBYTE)GlobalLock(GlobalAlloc(GHND,(nSize))))
63 #define GLOBALHANDLE(pPointer) ((HGLOBAL)GlobalHandle((*((size_t*)&(pPointer)+1))))
64 #define GLOBALFREE(pPointer) (GlobalUnlock(GLOBALHANDLE((pPointer))))
65 #define MEMSET( pDst, cByte, nCount ) \
67 PDIBBYTE pTmp = (PDIBBYTE) pDst; \
68 for ( ULONG i = 0; i < nCount; i++ )\
74 typedef BYTE
* PDIBBYTE
;
77 #define GLOBALALLOC(nSize) ((PDIBBYTE)GlobalAlloc(GMEM_FIXED,(nSize)))
78 #define GLOBALFREE(pPointer) (GlobalFree((HGLOBAL)pPointer))
79 #define GLOBALHANDLE(pPointer) ((HGLOBAL)(pPointer))
84 typedef BYTE
* PDIBBYTE
;
87 #define GLOBALALLOC(nSize) ((PDIBBYTE)new BYTE[(nSize)])
88 #define GLOBALFREE(pPointer) (delete[] (pPointer))
93 #if defined ( OS2 ) || defined ( UNX )
94 void ReadBitmap( SvStream
& rIStream
, Bitmap
& rBmp
, USHORT nDefaultHeight
= 0, ULONG nOffBits
= 0 );
95 void ReplaceInfoHeader( SvStream
& rStm
, BYTE
* pBuffer
);
98 #define RGBQUAD RGBQUADOS2
99 #define BITMAPFILEHEADER BITMAPFILEHEADEROS2
100 #define PBITMAPFILEHEADER PBITMAPFILEHEADEROS2
101 #define BITMAPINFOHEADER BITMAPINFOHEADEROS2
102 #define PBITMAPINFOHEADER PBITMAPINFOHEADEROS2
103 #define BITMAPINFO BITMAPINFOOS2
104 #define PBITMAPINFO PBITMAPINFOOS2
107 typedef struct RGBQUAD
114 RGBQUAD( const BYTE cRed
= 0, const BYTE cGreen
= 0, const BYTE cBlue
= 0 ) :
118 rgbReserved ( 0 ) {};
121 typedef struct BITMAPFILEHEADER
129 typedef BITMAPFILEHEADER
* PBITMAPFILEHEADER
;
131 typedef struct BITMAPINFOHEADER
138 UINT32 biCompression
;
140 UINT32 biXPelsPerMeter
;
141 UINT32 biYPelsPerMeter
;
143 UINT32 biClrImportant
;
145 typedef BITMAPINFOHEADER
* PBITMAPINFOHEADER
;
147 typedef struct BITMAPINFO
149 BITMAPINFOHEADER bmiHeader
;
150 RGBQUAD bmiColors
[1];
152 typedef BITMAPINFO
* PBITMAPINFO
;