1 /* 2 * Copyright 2006-2007, Haiku. All rights reserved. 3 * Distributed under the terms of the MIT License. 4 * 5 * Authors: 6 * Stephan Aßmus <superstippi@gmx.de> 7 */ 8 #ifndef FLAT_ICON_IMPORTER_H 9 #define FLAT_ICON_IMPORTER_H 10 11 12 #ifdef ICON_O_MATIC 13 # include "Importer.h" 14 #else 15 # include <SupportDefs.h> 16 #endif 17 18 #include "IconBuild.h" 19 20 21 class BMessage; 22 class BPositionIO; 23 24 25 _BEGIN_ICON_NAMESPACE 26 27 28 class Icon; 29 class LittleEndianBuffer; 30 class PathContainer; 31 class Shape; 32 class ShapeContainer; 33 class StyleContainer; 34 35 #ifdef ICON_O_MATIC 36 class FlatIconImporter : public Importer { 37 #else 38 class FlatIconImporter { 39 #endif 40 public: 41 FlatIconImporter(); 42 virtual ~FlatIconImporter(); 43 44 // FlatIconImporter 45 status_t Import(Icon* icon, 46 BPositionIO* stream); 47 48 status_t Import(Icon* icon, 49 uint8* buffer, size_t size); 50 51 private: 52 status_t _ParseSections(LittleEndianBuffer& buffer, 53 Icon* icon); 54 55 status_t _ParseStyles(LittleEndianBuffer& buffer, 56 StyleContainer* styles); 57 status_t _ParsePaths(LittleEndianBuffer& buffer, 58 PathContainer* paths); 59 Shape* _ReadPathSourceShape( 60 LittleEndianBuffer& buffer, 61 StyleContainer* styles, 62 PathContainer* paths); 63 status_t _ParseShapes(LittleEndianBuffer& buffer, 64 StyleContainer* styles, 65 PathContainer* paths, 66 ShapeContainer* shapes); 67 }; 68 69 70 _END_ICON_NAMESPACE 71 72 73 #endif // FLAT_ICON_IMPORTER_H 74