1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
20 #ifndef INCLUDED_VCL_SOURCE_FILTER_IXPM_XPMREAD_HXX
21 #define INCLUDED_VCL_SOURCE_FILTER_IXPM_XPMREAD_HXX
23 #include <vcl/bitmap.hxx>
27 #define XPMTEMPBUFSIZE 0x00008000
28 #define XPMSTRINGBUF 0x00008000
30 #define XPMIDENTIFIER 0x00000001 // mnIdentifier includes on of the six phases
31 #define XPMDEFINITION 0x00000002 // the XPM format consists of
32 #define XPMVALUES 0x00000003
33 #define XPMCOLORS 0x00000004
34 #define XPMPIXELS 0x00000005
35 #define XPMEXTENSIONS 0x00000006
36 #define XPMENDEXT 0x00000007
38 #define XPMREMARK 0x00000001 // defines used by mnStatus
39 #define XPMDOUBLE 0x00000002
40 #define XPMSTRING 0x00000004
41 #define XPMFINISHED 0x00000008
43 #define XPMCASESENSITIVE 0x00000001
44 #define XPMCASENONSENSITIVE 0x00000002
53 class BitmapWriteAccess
;
56 class XPMReader
: public GraphicReader
62 BitmapWriteAccess
* mpAcc
;
64 BitmapWriteAccess
* mpMaskAcc
;
70 sal_uLong mnCpp
; // characters per pix
74 sal_uLong mnIdentifier
;
77 sal_uLong mnTempAvail
;
80 sal_uInt8
* mpFastColorTable
;
82 sal_uLong mnStringSize
;
83 sal_uInt8
* mpStringBuf
;
88 bool ImplGetColor( sal_uLong
);
89 bool ImplGetScanLine( sal_uLong
);
90 bool ImplGetColSub( sal_uInt8
* );
91 bool ImplGetColKey( sal_uInt8
);
92 void ImplGetRGBHex( sal_uInt8
*, sal_uLong
);
93 bool ImplGetPara( sal_uLong numb
);
94 static bool ImplCompare( sal_uInt8
const *, sal_uInt8
const *, sal_uLong
, sal_uLong nmode
= XPMCASENONSENSITIVE
);
95 sal_uLong
ImplGetULONG( sal_uLong nPara
);
98 XPMReader( SvStream
& rStm
);
101 ReadState
ReadXPM( Graphic
& rGraphic
);
104 #endif // _XPMPRIVATE
106 bool ImportXPM( SvStream
& rStream
, Graphic
& rGraphic
);
108 #endif // INCLUDED_VCL_SOURCE_FILTER_IXPM_XPMREAD_HXX
110 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */