00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #ifndef MARSYAS_OUTPUT_SVG_H
00020 #define MARSYAS_OUTPUT_SVG_H
00021
00022 #include <string>
00023 #include <vector>
00024 #include <map>
00025 #include "marostring.h"
00026
00027
00028 namespace Marsyas
00029 {
00037 class marsyas_EXPORT marosvg : public marostring
00038 {
00039 private:
00040 std::map<std::string, std::map<std::string,std::string> > style_;
00041 class Style_
00042 {
00043 Style_();
00044 };
00045 class SVGObj_
00046 {
00047 public:
00048 int x_, y_, w_, h_;
00049 std::string t, n_;
00050 SVGObj_* parent_;
00051 std::vector<SVGObj_*> children_;
00052
00053 SVGObj_(SVGObj_* p, std::string t, std::string n);
00054 virtual ~SVGObj_();
00055
00056 void addChild(SVGObj_* c);
00057
00058 void posAdj(int x, int y);
00059 void sizeAdj();
00060 std::string str();
00061 };
00062 SVGObj_* curr_;
00063
00064 void output_properties(std::string property);
00065 void load_properties();
00066
00067 public:
00068 marosvg();
00069 virtual ~marosvg();
00070
00071 virtual void begin_marsystem(bool isComposite, std::string type, std::string name);
00072 virtual void end_marsystem(bool isComposite, std::string type, std::string name);
00073 virtual void begin_control(std::string type, std::string name, std::string value, bool has_state);
00074 virtual void begin_controls(int num_controls);
00075 virtual void begin_children(int num_children);
00076
00077 void style(std::string obj, std::string property, std::string value);
00078
00079 virtual std::string str();
00080 virtual void clear();
00081 };
00082
00083 }
00084
00085 #endif