1 /* 2 * Copyright 2006, 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 9 #ifndef FLAT_ICON_IMPORTER_H 10 #define FLAT_ICON_IMPORTER_H 11 12 #ifdef ICON_O_MATIC 13 # include "Importer.h" 14 #else 15 # include <SupportDefs.h> 16 #endif 17 18 class BMessage; 19 class BPositionIO; 20 class Icon; 21 class LittleEndianBuffer; 22 class PathContainer; 23 class Shape; 24 class ShapeContainer; 25 class StyleContainer; 26 27 #ifdef ICON_O_MATIC 28 class FlatIconImporter : public Importer { 29 #else 30 class FlatIconImporter { 31 #endif 32 public: 33 FlatIconImporter(); 34 virtual ~FlatIconImporter(); 35 36 // FlatIconImporter 37 status_t Import(Icon* icon, 38 BPositionIO* stream); 39 40 status_t Import(Icon* icon, 41 uint8* buffer, size_t size); 42 43 private: 44 status_t _ParseSections(LittleEndianBuffer& buffer, 45 Icon* icon); 46 47 status_t _ParseStyles(LittleEndianBuffer& buffer, 48 StyleContainer* styles); 49 status_t _ParsePaths(LittleEndianBuffer& buffer, 50 PathContainer* paths); 51 Shape* _ReadPathSourceShape( 52 LittleEndianBuffer& buffer, 53 StyleContainer* styles, 54 PathContainer* paths); 55 status_t _ParseShapes(LittleEndianBuffer& buffer, 56 StyleContainer* styles, 57 PathContainer* paths, 58 ShapeContainer* shapes); 59 }; 60 61 #endif // FLAT_ICON_IMPORTER_H 62