1fb07ece0SStephan Aßmus /* 2325a6253SAxel Dörfler * Copyright 2006-2007, Haiku. All rights reserved. 3fb07ece0SStephan Aßmus * Distributed under the terms of the MIT License. 4fb07ece0SStephan Aßmus * 5fb07ece0SStephan Aßmus * Authors: 6fb07ece0SStephan Aßmus * Stephan Aßmus <superstippi@gmx.de> 7fb07ece0SStephan Aßmus */ 8fb07ece0SStephan Aßmus #ifndef FLAT_ICON_IMPORTER_H 9fb07ece0SStephan Aßmus #define FLAT_ICON_IMPORTER_H 10fb07ece0SStephan Aßmus 11325a6253SAxel Dörfler 12014c7e94SStephan Aßmus #ifdef ICON_O_MATIC 13014c7e94SStephan Aßmus # include "Importer.h" 14014c7e94SStephan Aßmus #else 15fb07ece0SStephan Aßmus # include <SupportDefs.h> 16014c7e94SStephan Aßmus #endif 17fb07ece0SStephan Aßmus 18*64279352SZardshard #include "Container.h" 1925dc253dSIngo Weinhold #include "IconBuild.h" 2025dc253dSIngo Weinhold 2125dc253dSIngo Weinhold 22fb07ece0SStephan Aßmus class BMessage; 23fb07ece0SStephan Aßmus class BPositionIO; 24325a6253SAxel Dörfler 2525dc253dSIngo Weinhold 2625dc253dSIngo Weinhold _BEGIN_ICON_NAMESPACE 2725dc253dSIngo Weinhold 28325a6253SAxel Dörfler 29fb07ece0SStephan Aßmus class Icon; 30fb07ece0SStephan Aßmus class LittleEndianBuffer; 31fb07ece0SStephan Aßmus class PathContainer; 32014c7e94SStephan Aßmus class Shape; 33*64279352SZardshard class Style; 34*64279352SZardshard class VectorPath; 35fb07ece0SStephan Aßmus 36014c7e94SStephan Aßmus #ifdef ICON_O_MATIC 37014c7e94SStephan Aßmus class FlatIconImporter : public Importer { 38014c7e94SStephan Aßmus #else 39fb07ece0SStephan Aßmus class FlatIconImporter { 40014c7e94SStephan Aßmus #endif 41fb07ece0SStephan Aßmus public: 42fb07ece0SStephan Aßmus FlatIconImporter(); 43fb07ece0SStephan Aßmus virtual ~FlatIconImporter(); 44fb07ece0SStephan Aßmus 4586133f5eSStephan Aßmus // FlatIconImporter 4686133f5eSStephan Aßmus status_t Import(Icon* icon, 47fb07ece0SStephan Aßmus BPositionIO* stream); 48fb07ece0SStephan Aßmus 49fb07ece0SStephan Aßmus status_t Import(Icon* icon, 50fb07ece0SStephan Aßmus uint8* buffer, size_t size); 51fb07ece0SStephan Aßmus 52fb07ece0SStephan Aßmus private: 53fb07ece0SStephan Aßmus status_t _ParseSections(LittleEndianBuffer& buffer, 54fb07ece0SStephan Aßmus Icon* icon); 55fb07ece0SStephan Aßmus 56fb07ece0SStephan Aßmus status_t _ParseStyles(LittleEndianBuffer& buffer, 57*64279352SZardshard Container<Style>* styles); 58fb07ece0SStephan Aßmus status_t _ParsePaths(LittleEndianBuffer& buffer, 59*64279352SZardshard Container<VectorPath>* paths); 60014c7e94SStephan Aßmus Shape* _ReadPathSourceShape( 61014c7e94SStephan Aßmus LittleEndianBuffer& buffer, 62*64279352SZardshard Container<Style>* styles, 63*64279352SZardshard Container<VectorPath>* paths); 64fb07ece0SStephan Aßmus status_t _ParseShapes(LittleEndianBuffer& buffer, 65*64279352SZardshard Container<Style>* styles, 66*64279352SZardshard Container<VectorPath>* paths, 67*64279352SZardshard Container<Shape>* shapes); 68fb07ece0SStephan Aßmus }; 69fb07ece0SStephan Aßmus 7025dc253dSIngo Weinhold 7125dc253dSIngo Weinhold _END_ICON_NAMESPACE 7225dc253dSIngo Weinhold 73325a6253SAxel Dörfler 74fb07ece0SStephan Aßmus #endif // FLAT_ICON_IMPORTER_H 75