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 9 10 #ifndef DOCUMENT_BUILD_H 11 #define DOCUMENT_BUILD_H 12 13 #include <stdio.h> 14 15 #include <Rect.h> 16 #include <String.h> 17 18 #include "IconBuild.h" 19 #include "nanosvg.h" 20 21 22 class SVGImporter; 23 24 _BEGIN_ICON_NAMESPACE 25 class Icon; 26 class Transformable; 27 _END_ICON_NAMESPACE 28 29 _USING_ICON_NAMESPACE 30 31 /*! Puts the information from an NSVGimage class into an Icon class. */ 32 class DocumentBuilder { 33 public: 34 35 DocumentBuilder(NSVGimage* image); 36 37 void SetTitle(const char* title); 38 void SetDimensions(uint32 width, uint32 height, BRect viewBox); 39 40 41 status_t GetIcon(Icon* icon, 42 const char* fallbackName); 43 44 private: 45 status_t _AddShape(NSVGshape* svgShape, 46 bool outline, 47 const Transformable& transform, 48 Icon* icon); 49 50 51 uint32 fWidth; 52 uint32 fHeight; 53 BRect fViewBox; 54 BString fTitle; 55 56 NSVGimage* fSource; 57 }; 58 59 #endif // DOCUMENT_BUILD_H 60