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: xpmread.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 ************************************************************************/
35 #include <vcl/bitmap.hxx>
38 class BitmapWriteAccess
;
46 #define XPMTEMPBUFSIZE 0x00008000
47 #define XPMSTRINGBUF 0x00008000
49 #define XPMIDENTIFIER 0x00000001 // mnIdentifier includes on of the six phases
50 #define XPMDEFINITION 0x00000002 // the XPM format consists of
51 #define XPMVALUES 0x00000003
52 #define XPMCOLORS 0x00000004
53 #define XPMPIXELS 0x00000005
54 #define XPMEXTENSIONS 0x00000006
55 #define XPMENDEXT 0x00000007
58 #define XPMREMARK 0x00000001 // defines used by mnStatus
59 #define XPMDOUBLE 0x00000002
60 #define XPMSTRING 0x00000004
61 #define XPMFINISHED 0x00000008
63 #define XPMCASESENSITIVE 0x00000001
64 #define XPMCASENONSENSITIVE 0x00000002
81 class XPMReader
: public GraphicReader
87 BitmapWriteAccess
* mpAcc
;
89 BitmapWriteAccess
* mpMaskAcc
;
95 ULONG mnCpp
; // characters per pix
105 BYTE
* mpFastColorTable
;
112 BOOL
ImplGetString( void );
113 BOOL
ImplGetColor( ULONG
);
114 BOOL
ImplGetScanLine( ULONG
);
115 BOOL
ImplGetColSub( BYTE
* );
116 BOOL
ImplGetColKey( BYTE
);
117 void ImplGetRGBHex( BYTE
*, ULONG
);
118 BOOL
ImplGetPara( ULONG numb
);
119 BOOL
ImplCompare( BYTE
*, BYTE
*, ULONG
, ULONG nmode
= XPMCASENONSENSITIVE
);
120 ULONG
ImplGetULONG( ULONG nPara
);
123 XPMReader( SvStream
& rStm
);
124 virtual ~XPMReader();
126 ReadState
ReadXPM( Graphic
& rGraphic
);
129 #endif // _XPMPRIVATE
135 BOOL
ImportXPM( SvStream
& rStream
, Graphic
& rGraphic
);
139 #endif // _XPMREAD_HXX