index 6f2dbd4a796e5b8cb84bebfff50e44e8cb44f1a1..9c1c8778ba0489ab798a00e00fbcf126375bae45 100644 (file)
-/*\r
- * A simple utility for exporting Inkscape svg Shapes as PovRay bezier\r
- * prisms. Note that this is output-only, and would thus seem to be\r
- * better placed as an 'export' rather than 'output'. However, Export\r
- * handles all or partial documents, while this outputs ALL shapes in\r
- * the current SVG document.\r
- *\r
- * Authors:\r
- * Bob Jamison <ishmal@inkscape.org>\r
- *\r
- * Copyright (C) 2008 Authors\r
- *\r
- * Released under GNU GPL, read the file 'COPYING' for more information\r
- */\r
-\r
-#ifndef EXTENSION_INTERNAL_JAVAFX_OUT_H\r
-#define EXTENSION_INTERNAL_JAVAFX_OUT_H\r
-\r
-#include <glib.h>\r
-#include "extension/implementation/implementation.h"\r
-\r
-namespace Inkscape\r
-{\r
-namespace Extension\r
-{\r
-namespace Internal\r
-{\r
-\r
-\r
-\r
-/**\r
- * Output the current svg document in JavaFX format.\r
- * \r
- * For information, @see: \r
- * https://openjfx.dev.java.net/\r
- */ \r
-class JavaFXOutput : public Inkscape::Extension::Implementation::Implementation\r
-{\r
-\r
-\r
-public:\r
-\r
- /**\r
- * Our internal String definition\r
- */\r
- typedef Glib::ustring String;\r
-\r
-\r
- /**\r
- * Check whether we can actually output using this module\r
- */\r
- virtual bool check (Inkscape::Extension::Extension * module);\r
-\r
- /**\r
- * API call to perform the output to a file\r
- */\r
- virtual void save (Inkscape::Extension::Output *mod,\r
- SPDocument *doc, const gchar *uri);\r
-\r
- /**\r
- * Inkscape runtime startup call.\r
- */\r
- static void init(void);\r
- \r
- /**\r
- * Reset variables to initial state\r
- */\r
- void reset();\r
- \r
-private:\r
-\r
- \r
- //For formatted output\r
- String outbuf;\r
- \r
-\r
- /**\r
- * Format text to our output buffer\r
- */\r
- void out(const char *fmt, ...) G_GNUC_PRINTF(2,3);\r
-\r
- //Output the parts of the file\r
-\r
- /**\r
- * Output the file header\r
- */\r
- bool doHeader(gchar const *uri);\r
-\r
- /**\r
- * Output the SVG document's curve data as POV curves\r
- */\r
- bool doCurves(SPDocument *doc, gchar const *uri);\r
-\r
- /**\r
- * Output the file footer\r
- */\r
- bool doTail(gchar const *uri);\r
-\r
-\r
-\r
- /**\r
- * Actual method to save document\r
- */\r
- bool saveDocument(SPDocument *doc, const gchar *uri);\r
-\r
- //For statistics\r
- int nrNodes;\r
- int nrSegments;\r
- int nrShapes;\r
-\r
-};\r
-\r
-\r
-\r
-\r
-} // namespace Internal\r
-} // namespace Extension\r
-} // namespace Inkscape\r
-\r
-\r
-\r
-#endif /* EXTENSION_INTERNAL_POV_OUT_H */\r
-\r
+/*
+ * A simple utility for exporting an Inkscape svg image as a JavaFX
+ * scene tree.
+ *
+ * Authors:
+ * Bob Jamison <ishmal@inkscape.org>
+ * Silveira Neto <silveiraneto@gmail.com>
+ * Jim Clarke <Jim.Clarke@sun.com>
+ *
+ * Copyright (C) 2008 Authors
+ *
+ * Released under GNU GPL, read the file 'COPYING' for more information
+ */
+
+#ifndef EXTENSION_INTERNAL_JAVAFX_OUT_H
+#define EXTENSION_INTERNAL_JAVAFX_OUT_H
+
+#include <glib.h>
+#include "extension/implementation/implementation.h"
+#include <document.h>
+#include <sp-gradient.h>
+
+namespace Inkscape
+{
+namespace Extension
+{
+namespace Internal
+{
+
+
+
+/**
+ * Output the current svg document in JavaFX format.
+ *
+ * For information, @see:
+ * https://openjfx.dev.java.net/
+ */
+class JavaFXOutput : public Inkscape::Extension::Implementation::Implementation
+{
+
+
+public:
+
+ /**
+ * Our internal String definition
+ */
+ typedef Glib::ustring String;
+
+
+ /**
+ * Check whether we can actually output using this module
+ */
+ virtual bool check (Inkscape::Extension::Extension * module);
+
+ /**
+ * API call to perform the output to a file
+ */
+ virtual void save(Inkscape::Extension::Output *mod,
+ SPDocument *doc, gchar const *filename);
+
+ /**
+ * Inkscape runtime startup call.
+ */
+ static void init(void);
+
+ /**
+ * Reset variables to initial state
+ */
+ void reset();
+
+private:
+
+ //output class name
+ String name;
+
+ //For formatted output
+ String outbuf; //main output buffer
+ String foutbuf; //header function buffer
+
+
+ /**
+ * Format text to our output buffer
+ */
+ void out(const char *fmt, ...) G_GNUC_PRINTF(2,3);
+
+ /**
+ * Format text to our function output buffer
+ */
+ void fout(const char *fmt, ...) G_GNUC_PRINTF(2,3);
+
+ //Output the parts of the file
+
+ /**
+ * Output the file header
+ */
+ bool doHeader();
+
+ /**
+ * Output gradient information to the buffer
+ */
+ bool doGradient(SPGradient *grad, const String &id);
+
+ /**
+ * Output an element's style attribute
+ */
+ bool doStyle(SPStyle *style);
+
+ /**
+ * Output the SVG document's curve data as JavaFX geometry types
+ */
+ bool doCurve(SPItem *item, const String &id);
+ bool doTreeRecursive(SPDocument *doc, SPObject *obj);
+ bool doTree(SPDocument *doc);
+
+ bool doBody(SPDocument *doc, SPObject *obj);
+
+ /**
+ * Output the file footer
+ */
+ bool doTail();
+
+
+
+ /**
+ * Actual method to save document
+ */
+ bool saveDocument(SPDocument *doc, gchar const *filename);
+
+ //For statistics
+ int nrNodes;
+ int nrShapes;
+
+ int idindex;
+
+ double minx;
+ double miny;
+ double maxx;
+ double maxy;
+
+
+};
+
+
+
+
+} // namespace Internal
+} // namespace Extension
+} // namespace Inkscape
+
+
+
+#endif /* EXTENSION_INTERNAL_POV_OUT_H */
+