2 * Copyright 2006-2007, Haiku. All rights reserved.
3 * Distributed under the terms of the MIT License.
6 * Stephan Aßmus <superstippi@gmx.de>
8 #ifndef FLAT_ICON_EXPORTER_H
9 #define FLAT_ICON_EXPORTER_H
21 class LittleEndianBuffer
;
29 #define PRINT_STATISTICS 1
36 using __gnu_cxx::hash_set
;
41 int operator()(const BPoint
& point
) const
43 return (int)point
.x
* 17 + (int)point
.y
;
47 typedef hash_set
<BPoint
, PointHash
> PointSet
;
50 class FlatIconExporter
: public Exporter
{
53 virtual ~FlatIconExporter();
56 virtual status_t
Export(const Icon
* icon
,
59 virtual const char* MIMEType();
62 status_t
Export(const Icon
* icon
, BNode
* node
,
63 const char* attrName
);
66 status_t
_Export(LittleEndianBuffer
& buffer
,
69 status_t
_WriteStyles(LittleEndianBuffer
& buffer
,
70 StyleContainer
* styles
);
71 status_t
_WritePaths(LittleEndianBuffer
& buffer
,
72 PathContainer
* paths
);
73 status_t
_WriteShapes(LittleEndianBuffer
& buffer
,
74 StyleContainer
* styles
,
76 ShapeContainer
* shapes
);
78 bool _WriteGradient(LittleEndianBuffer
& buffer
,
79 const Gradient
* gradient
);
81 bool _AnalysePath(VectorPath
* path
,
88 int32 fStyleSectionSize
;
90 int32 fGradientTransformSize
;
91 int32 fPathSectionSize
;
92 int32 fShapeSectionSize
;
96 #endif // PRINT_STATISTICS
99 #endif // FLAT_ICON_EXPORTER_H