1 /* === S Y N F I G ========================================================= */
2 /*! \file layer_svg.cpp
3 ** \brief Implementation of the Svg layer
8 ** Copyright (c) 2002-2005 Robert B. Quattlebaum Jr., Adrian Bentley
9 ** Copyright (c) 2008 Chris Moore
10 ** Copyright (c) 2009 Carlos A. Sosa Navarro
12 ** This package is free software; you can redistribute it and/or
13 ** modify it under the terms of the GNU General Public License as
14 ** published by the Free Software Foundation; either version 2 of
15 ** the License, or (at your option) any later version.
17 ** This package is distributed in the hope that it will be useful,
18 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
19 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
20 ** General Public License for more details.
23 /* ========================================================================= */
25 /* === H E A D E R S ======================================================= */
34 #include <synfig/string.h>
35 #include <synfig/paramdesc.h>
36 #include <synfig/value.h>
37 #include <synfig/valuenode.h>
39 #include "layer_svg.h"
43 /* === U S I N G =========================================================== */
47 using namespace synfig;
49 /* === G L O B A L S ======================================================= */
51 SYNFIG_LAYER_INIT(svg_layer);
52 SYNFIG_LAYER_SET_NAME(svg_layer,"svg_layer");
53 SYNFIG_LAYER_SET_LOCAL_NAME(svg_layer,N_("Import Svg"));
54 SYNFIG_LAYER_SET_CATEGORY(svg_layer,N_("NotVisible"));//this is auxiliar
55 SYNFIG_LAYER_SET_VERSION(svg_layer,"0.1");
56 SYNFIG_LAYER_SET_CVS_ID(svg_layer,"$Id: layer_svg.cpp 2240 2008-11-22 15:35:33Z dooglus $");
58 /* === P R O C E D U R E S ================================================= */
60 svg_layer::svg_layer():
67 svg_layer::set_param(const String & param, const ValueBase &value)
69 if(param=="filename"){
70 Canvas::Handle canvas;
71 //if ext of filename == "svg" then
72 canvas=open_svg(value.get(String()),errors,warnings);
73 //else other parsers maybe
75 canvas->set_inline(get_canvas());
76 set_sub_canvas(canvas);
80 return Layer_PasteCanvas::set_param(param,value);
84 svg_layer::get_param(const String ¶m)const
90 return Layer_PasteCanvas::get_param(param);
94 svg_layer::get_param_vocab()const
96 Layer::Vocab ret(Layer_PasteCanvas::get_param_vocab());
98 ret.push_back(ParamDesc("filename")
99 .set_local_name(_("Filename"))