diff options
| author | Bob Jamison <ishmalius@gmail.com> | 2008-08-10 19:52:42 +0000 |
|---|---|---|
| committer | ishmal <ishmal@users.sourceforge.net> | 2008-08-10 19:52:42 +0000 |
| commit | 1cab8dabb11ed50bc67da97ad002a1e481cfefc7 (patch) | |
| tree | b47a456e1674d4bed77227ba3a4a9edd34bd06e5 /src/extension/internal/javafx-out.cpp | |
| parent | Fix for ID clash resolution: avoid finding spurious references associated wit... (diff) | |
| download | inkscape-1cab8dabb11ed50bc67da97ad002a1e481cfefc7.tar.gz inkscape-1cab8dabb11ed50bc67da97ad002a1e481cfefc7.zip | |
clean up code slightly
(bzr r6604)
Diffstat (limited to 'src/extension/internal/javafx-out.cpp')
| -rw-r--r-- | src/extension/internal/javafx-out.cpp | 44 |
1 files changed, 26 insertions, 18 deletions
diff --git a/src/extension/internal/javafx-out.cpp b/src/extension/internal/javafx-out.cpp index 070b59781..967ddd92d 100644 --- a/src/extension/internal/javafx-out.cpp +++ b/src/extension/internal/javafx-out.cpp @@ -60,9 +60,11 @@ namespace Internal static void err(const char *fmt, ...)
{
va_list args;
+ g_log(NULL, G_LOG_LEVEL_WARNING, "javafx-out err: ");
va_start(args, fmt);
g_logv(NULL, G_LOG_LEVEL_WARNING, fmt, args);
va_end(args);
+ g_log(NULL, G_LOG_LEVEL_WARNING, "\n");
}
@@ -96,7 +98,8 @@ static double effective_opacity(const SPStyle *style) /**
- * We want to control floating output format
+ * We want to control floating output format.
+ * Especially to avoid localization. (decimal ',' for example)
*/
static JavaFXOutput::String dstr(double d)
{
@@ -109,6 +112,10 @@ static JavaFXOutput::String dstr(double d) #define DSTR(d) (dstr(d).c_str())
+
+/**
+ * Format a double as an integer
+ */
static JavaFXOutput::String istr(double d)
{
char dbuf[G_ASCII_DTOSTR_BUF_SIZE+1];
@@ -120,6 +127,7 @@ static JavaFXOutput::String istr(double d) #define ISTR(d) (istr(d).c_str())
+
/**
* Format an rgba() string
*/
@@ -204,7 +212,7 @@ bool JavaFXOutput::doHeader() out("/*###################################################################\n");
out("### This JavaFX document was generated by Inkscape\n");
out("### http://www.inkscape.org\n");
- out("### Created: %s", ctime(&tim));
+ out("### Created: %s", ctime(&tim));
out("### Version: %s\n", INKSCAPE_VERSION);
out("#####################################################################\n");
out("### NOTES:\n");
@@ -263,7 +271,7 @@ bool JavaFXOutput::doTail() // Frame
out("Frame {\n");
out(" title: \"%s\"\n", name.c_str());
- out(" width: %s\n", ISTR(maxx-minx + border * 2.0));
+ out(" width: %s\n", ISTR(maxx-minx + border * 2.0));
out(" height: %s\n", ISTR(maxy-miny + border * 2.0));
out(" visible: true\n");
@@ -306,7 +314,7 @@ bool JavaFXOutput::doGradient(SPGradient *grad, const String &id) SPGradientStop stop = stops[i];
out(" Stop {\n");
out(" offset: %s\n", DSTR(stop.offset));
- out(" color: %s\n", rgba(stop.color, stop.opacity).c_str());
+ out(" color: %s\n", rgba(stop.color, stop.opacity).c_str());
out(" },\n");
}
out(" ]\n");
@@ -323,9 +331,9 @@ bool JavaFXOutput::doGradient(SPGradient *grad, const String &id) out(" RadialGradient {\n");
out(" centerX: %s\n", DSTR(g->cx.value));
out(" centerY: %s\n", DSTR(g->cy.value));
- out(" focusX: %s\n", DSTR(g->fx.value));
- out(" focusY: %s\n", DSTR(g->fy.value));
- out(" radius: %s\n", DSTR(g->r.value));
+ out(" focusX: %s\n", DSTR(g->fx.value));
+ out(" focusY: %s\n", DSTR(g->fy.value));
+ out(" radius: %s\n", DSTR(g->r.value ));
std::vector<SPGradientStop> stops = g->vector.stops;
if (stops.size() > 0)
{
@@ -336,7 +344,7 @@ bool JavaFXOutput::doGradient(SPGradient *grad, const String &id) SPGradientStop stop = stops[i];
out(" Stop {\n");
out(" offset: %s\n", DSTR(stop.offset));
- out(" color: %s\n", rgba(stop.color, stop.opacity).c_str());
+ out(" color: %s\n", rgba(stop.color, stop.opacity).c_str());
out(" },\n");
}
out(" ]\n");
@@ -411,11 +419,11 @@ bool JavaFXOutput::doStyle(SPStyle *style) out(" stroke: %s\n",
rgba(stroke.value.color, SP_SCALE24_TO_FLOAT(style->stroke_opacity.value)).c_str());
double strokewidth = style->stroke_width.value;
- unsigned linecap = style->stroke_linecap.value;
- unsigned linejoin = style->stroke_linejoin.value;
- out(" strokeWidth: %s\n", DSTR(strokewidth));
- out(" strokeLineCap: %s\n", getStrokeLineCap(linecap).c_str());
- out(" strokeLineJoin: %s\n", getStrokeLineJoin(linejoin).c_str());
+ unsigned linecap = style->stroke_linecap.value;
+ unsigned linejoin = style->stroke_linejoin.value;
+ out(" strokeWidth: %s\n", DSTR(strokewidth));
+ out(" strokeLineCap: %s\n", getStrokeLineCap(linecap).c_str());
+ out(" strokeLineJoin: %s\n", getStrokeLineJoin(linejoin).c_str());
out(" strokeMiterLimit: %s\n", DSTR(style->stroke_miterlimit.value));
if(style->stroke_dasharray_set) {
if(style->stroke_dashoffset_set) {
@@ -509,9 +517,9 @@ bool JavaFXOutput::doCurve(SPItem *item, const String &id) for (Geom::Path::const_iterator cit = pit->begin(); cit != pit->end_closed(); ++cit)
{
//### LINE
- if( dynamic_cast<Geom::LineSegment const *> (&*cit) ||
- dynamic_cast<Geom::HLineSegment const *>(&*cit) ||
- dynamic_cast<Geom::VLineSegment const *>(&*cit) )
+ if( dynamic_cast<Geom::LineSegment const *> (&*cit) ||
+ dynamic_cast<Geom::HLineSegment const *> (&*cit) ||
+ dynamic_cast<Geom::VLineSegment const *> (&*cit) )
{
Geom::Point p = cit->finalPoint();
out(" LineTo {\n");
@@ -532,8 +540,8 @@ bool JavaFXOutput::doCurve(SPItem *item, const String &id) out(" controlY1: %s\n", DSTR(p1[Y]));
out(" controlX2: %s\n", DSTR(p2[X]));
out(" controlY2: %s\n", DSTR(p2[Y]));
- out(" x: %s\n", DSTR(p3[X]));
- out(" y: %s\n", DSTR(p3[Y]));
+ out(" x: %s\n", DSTR(p3[X]));
+ out(" y: %s\n", DSTR(p3[Y]));
out(" },\n");
nrNodes++;
}
|
