diff options
| author | Jabier Arraiza Cenoz <jabier.arraiza@marker.es> | 2015-02-08 15:40:25 +0000 |
|---|---|---|
| committer | Jabiertxof <jtx@jtx.marker.es> | 2015-02-08 15:40:25 +0000 |
| commit | 86891a9e442c81435c6d197cb09b3dc210643bc0 (patch) | |
| tree | 4952411fd6e526907d4241e8965e93c4f185500a /src/live_effects/parameter/array.cpp | |
| parent | refactor of pointwise base (diff) | |
| download | inkscape-86891a9e442c81435c6d197cb09b3dc210643bc0.tar.gz inkscape-86891a9e442c81435c6d197cb09b3dc210643bc0.zip | |
starting whith pointwise
(bzr r13645.1.7)
Diffstat (limited to 'src/live_effects/parameter/array.cpp')
| -rw-r--r-- | src/live_effects/parameter/array.cpp | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/src/live_effects/parameter/array.cpp b/src/live_effects/parameter/array.cpp index 1b8f742da..bd2bf1870 100644 --- a/src/live_effects/parameter/array.cpp +++ b/src/live_effects/parameter/array.cpp @@ -48,6 +48,38 @@ ArrayParam<Geom::Point>::readsvg(const gchar * str) } return Geom::Point(Geom::infinity(),Geom::infinity()); } +void +sp_svg_satellite_read_d(gchar const *str, satellite *sat){ + gchar ** strarray = g_strsplit(str, "*", 0); + if(strarray.size() != 6){ + g_strfreev (strarray); + return NULL; + } + sat->setSatelliteType(SatelliteTypeMap[strarray[0]]); + sat->setActive(helperfns_read_bool(strarray[1], true)); + sat->sethasMirror(helperfns_read_bool(strarray[2], false)); + sat->setHidden(helperfns_read_bool(strarray[3], false)); + sat->setHidden(helperfns_read_bool(strarray[3], false)); + sat->setTime(sp_svg_number_read_d(strarray[4], 0.0)); + sat->setSize(sp_svg_number_read_d(strarray[5], 0.0)); + g_strfreev (strarray); +} + +template <> +std::pair<int, satellite> +ArrayParam<Geom::Point>::readsvg(const gchar * str) +{ + gchar ** strarray = g_strsplit(str, ",", 2); + int index; + Geom::satellite sat = NULL; + unsigned int success = sp_svg_number_read_d(strarray[0], &index); + success += sp_svg_satellite_read_d(strarray[1], &sat); + g_strfreev (strarray); + if (success == 2) { + return std::pair<index, sat>; + } + return std::pair<Geom::infinity(),NULL>; +} } /* namespace LivePathEffect */ |
