summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 2246a61)
raw | patch | inline | side by side (parent: 2246a61)
author | gouldtj <gouldtj@users.sourceforge.net> | |
Mon, 31 Jul 2006 05:15:25 +0000 (05:15 +0000) | ||
committer | gouldtj <gouldtj@users.sourceforge.net> | |
Mon, 31 Jul 2006 05:15:25 +0000 (05:15 +0000) |
Making this all work with the Inkscape world view.
src/extension/internal/wpg-input.cpp | patch | blob | history |
index 13335cf796d173d315a6188cb95dcd92bd201375..fc730a3ce6c03369e758d4042645dcb3206b5916 100644 (file)
#include "wpg-input.h"\r
#include "extension/system.h"\r
#include "extension/input.h"\r
+#include "document.h"\r
\r
#include "libwpg/libwpg.h"\r
#include "libwpg/WPGStreamImplementation.h"\r
FillRule m_fillRule;\r
int m_gradientIndex;\r
void writeStyle();\r
+ void printf (char * fmt, ...) {\r
+ va_list args;\r
+ va_start(args, fmt);\r
+ gchar * buf = g_strdup_vprintf(fmt, args);\r
+ va_end(args);\r
+ if (buf) {\r
+ document += buf;\r
+ g_free(buf);\r
+ }\r
+ }\r
\r
public:\r
- std::string document;\r
+ Glib::ustring document;\r
};\r
\r
InkscapePainter::InkscapePainter(): m_fillRule(AlternatingFill), m_gradientIndex(1)\r
\r
void InkscapePainter::startDocument(double width, double height) \r
{\r
+ document = "";\r
printf("<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>\n");\r
printf("<!DOCTYPE svg PUBLIC \"-//W3C//DTD SVG 1.1//EN\"");\r
printf(" \"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd\">\n");\r
if (!WPGraphics::isSupported(input)) {\r
//! \todo Dialog here\r
// fprintf(stderr, "ERROR: Unsupported file format (unsupported version) or file is encrypted!\n");\r
+ // printf("I'm giving up not supported\n");\r
return NULL;\r
}\r
\r
InkscapePainter painter;\r
WPGraphics::parse(input, &painter);\r
\r
- return 0;\r
+ //printf("I've got a doc: \n%s", painter.document.c_str());\r
+\r
+ return sp_document_new_from_mem(painter.document.c_str(), strlen(painter.document.c_str()), TRUE);\r
}\r
\r
#include "clear-n_.h"\r