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>
40 #define XPMTEMPBUFSIZE 0x00008000
41 #define XPMSTRINGBUF 0x00008000
43 #define XPMIDENTIFIER 0x00000001 // mnIdentifier includes on of the six phases
44 #define XPMDEFINITION 0x00000002 // the XPM format consists of
45 #define XPMVALUES 0x00000003
46 #define XPMCOLORS 0x00000004
47 #define XPMPIXELS 0x00000005
48 #define XPMEXTENSIONS 0x00000006
49 #define XPMENDEXT 0x00000007
52 #define XPMREMARK 0x00000001 // defines used by mnStatus
53 #define XPMDOUBLE 0x00000002
54 #define XPMSTRING 0x00000004
55 #define XPMFINISHED 0x00000008
57 #define XPMCASESENSITIVE 0x00000001
58 #define XPMCASENONSENSITIVE 0x00000002
75 class BitmapWriteAccess
;
78 class XPMReader
: public GraphicReader
84 BitmapWriteAccess
* mpAcc
;
86 BitmapWriteAccess
* mpMaskAcc
;
92 ULONG mnCpp
; // characters per pix
102 BYTE
* mpFastColorTable
;
109 BOOL
ImplGetString( void );
110 BOOL
ImplGetColor( ULONG
);
111 BOOL
ImplGetScanLine( ULONG
);
112 BOOL
ImplGetColSub( BYTE
* );
113 BOOL
ImplGetColKey( BYTE
);
114 void ImplGetRGBHex( BYTE
*, ULONG
);
115 BOOL
ImplGetPara( ULONG numb
);
116 BOOL
ImplCompare( BYTE
*, BYTE
*, ULONG
, ULONG nmode
= XPMCASENONSENSITIVE
);
117 ULONG
ImplGetULONG( ULONG nPara
);
120 XPMReader( SvStream
& rStm
);
121 virtual ~XPMReader();
123 ReadState
ReadXPM( Graphic
& rGraphic
);
126 #endif // _XPMPRIVATE
132 BOOL
ImportXPM( SvStream
& rStream
, Graphic
& rGraphic
);
134 #endif // _XPMREAD_HXX