30 #ifndef __SVG_PARSER_H 
   31 #define __SVG_PARSER_H 
   39 #include <glibmm/ustring.h> 
   41 #include <libxml++/libxml++.h> 
   43 #include <ETL/stringf> 
  111         xmlpp::DomParser parser;
 
  112         xmlpp::Document document;
 
  113         xmlpp::Element* nodeRoot;
 
  115         Glib::ustring height;
 
  116         Glib::ustring docname;
 
  121         std::list<LinearGradient*> lg;
 
  122         std::list<RadialGradient*> rg;
 
  134         void parser_node(
const xmlpp::Node* node);
 
  136         void parser_svg(
const xmlpp::Node* node);
 
  137         void parser_canvas(
const xmlpp::Node* node);
 
  138         void parser_graphics(
const xmlpp::Node* node,xmlpp::Element* root,
String parent_style,
SVGMatrix* mtx_parent);
 
  141         void parser_layer(
const xmlpp::Node* node,xmlpp::Element* root,
String parent_style,
SVGMatrix* mtx);
 
  142         void parser_rect(
const xmlpp::Element* nodeElement,xmlpp::Element* root,
String fill, 
String fill_opacity, 
String opacity);
 
  144         std::list<BLine *> parser_path_polygon(Glib::ustring polygon_points, 
SVGMatrix* mtx);
 
  148         void parser_effects(
const xmlpp::Element* nodeElement,xmlpp::Element* root,
String parent_style,
SVGMatrix* mtx);
 
  151         void parser_defs(
const xmlpp::Node* node);
 
  152         void parser_linearGradient(
const xmlpp::Node* node);
 
  153         void parser_radialGradient(
const xmlpp::Node* node);
 
  157         BLine* newBLine(std::list<Vertex*> *points,
bool loop);
 
  160         void build_transform(xmlpp::Element* root,
SVGMatrix* mtx);
 
  161         std::list<ColorStop*>* find_colorStop(
String name);
 
  165         void build_stop_color(xmlpp::Element* root, std::list<ColorStop*> *stops);
 
  166         void build_stop_color(xmlpp::Element* root, std::list<ColorStop*> *stops,
String name);
 
  167         Color adjustGamma(
float r,
float g,
float b,
float a);
 
  169         void build_gamma(xmlpp::Element* root,
float gamma);
 
  170         void build_rotate(xmlpp::Element* root,
float dx,
float dy,
float angle);
 
  171         void build_translate(xmlpp::Element* root,
float dx,
float dy);
 
  172         void build_points(xmlpp::Element* root,std::list<Vertex*> p);
 
  173         void build_vertex(xmlpp::Element* root , 
Vertex *p);
 
  174         void build_bline(xmlpp::Element* root,std::list<Vertex*> p,
bool loop,
String blineguid);
 
  176         void build_param (xmlpp::Element* root,
String name,
String type,
float value);
 
  177         void build_param (xmlpp::Element* root,
String name,
String type,
int value);
 
  178         void build_integer (xmlpp::Element* root,
String name, 
int value);
 
  179         void build_real (xmlpp::Element* root,
String name,
float value);
 
  180         void build_vector (xmlpp::Element* root,
String name,
float x,
float y);
 
  181         void build_vector (xmlpp::Element* root,
String name,
float x,
float y,
String guid);
 
  182         void build_color(xmlpp::Element* root,
float r,
float g,
float b,
float a);
 
  183         xmlpp::Element* nodeStartBasicLayer(xmlpp::Element* root);
 
  184         xmlpp::Element* nodeStartBasicLayer(xmlpp::Element* root, 
String name);
 
  189         void coor2vect(
float *x,
float *y);
 
  190         void setTg2(
Vertex* p,
float p1x,
float p1y,
float p2x,
float p2y);
 
  191         void setTg1(
Vertex *p,
float p1x,
float p1y,
float p2x,
float p2y);
 
  192         void setSplit(
Vertex* p,
bool val);
 
  193         int isFirst(
Vertex* nodo,
float a, 
float b);
 
  194         Vertex* newVertex(
float x,
float y);
 
  198         SVGMatrix* newSVGMatrix(
float a,
float b,
float c,
float d,
float e,
float f);
 
  201         void transformPoint2D(
SVGMatrix *mtx,
float *a,
float *b);
 
  205         float getRadian(
float sexa);
 
  213         std::vector<String> get_tokens_path(
String path);
 
  219         int getColor(
String name, 
int position);
 
  220         float getDimension(
const String ac);
 
  222         void removeS(
String *input);
 
  223         void removeIntoS(
String *input);
 
  224         std::vector<String> tokenize(
const String& str,
const String& delimiters);
 
  225         void get_canvas_name(
String _filepath);