summaryrefslogtreecommitdiff
path: root/test/cdtest/drivers.c
diff options
context:
space:
mode:
authorscuri <scuri>2009-12-02 20:30:55 +0000
committerscuri <scuri>2009-12-02 20:30:55 +0000
commit0a186150f085c34462b8c6cd5257849c73f80b65 (patch)
treef78781174c5f64d032efa0760a0ac06af8f8447b /test/cdtest/drivers.c
parent3914ec6505021df1b3edac7a0b2648ace33e4ef4 (diff)
New: driver SVG.
Diffstat (limited to 'test/cdtest/drivers.c')
-rw-r--r--test/cdtest/drivers.c26
1 files changed, 26 insertions, 0 deletions
diff --git a/test/cdtest/drivers.c b/test/cdtest/drivers.c
index 62e92aa..dd23331 100644
--- a/test/cdtest/drivers.c
+++ b/test/cdtest/drivers.c
@@ -33,6 +33,7 @@ extern tCTC ctgc;
#define DGN
#define PDF
#define CDDBG
+#define SVG
static int LoadCanvas(char* ctx_name, cdContext* ctx, char *filename)
{
@@ -197,6 +198,27 @@ static int fEPS(void)
}
#endif
+/*-------------------------------------------------------------------------*/
+/* Copia o conteudo do canvas para um arquivo SVG. */
+/*-------------------------------------------------------------------------*/
+#ifdef SVG
+#include <cdsvg.h>
+
+static int fSVG(void)
+{
+ char filename[1024]="*.svg";
+ char data[1024];
+
+ if (IupGetFile(filename)>=0)
+ {
+ sprintf(data, "%s -s%d", filename, (int)(ctgc.res * 25.4));
+ return SaveCanvas("CD_SVG", CD_SVG, data);
+ }
+
+ return IUP_DEFAULT;
+}
+#endif
+
#ifdef PDF
#include <cdpdf.h>
@@ -428,6 +450,10 @@ void DriversInit(void)
IupSetFunction("cmdPS", (Icallback) fPS);
IupSetFunction("cmdEPS", (Icallback) fEPS);
#endif
+#ifdef SVG
+ IupSetAttribute(IupGetHandle("itSVG"), IUP_ACTIVE, IUP_YES);
+ IupSetFunction("cmdSVG", (Icallback) fSVG);
+#endif
#ifdef PDF
IupSetAttribute(IupGetHandle("itPDF"), IUP_ACTIVE, IUP_YES);
IupSetFunction("cmdPDF", (Icallback) fPDF);