From 25e85e1b809ec58ecac0f2e8fe48f74836f8e131 Mon Sep 17 00:00:00 2001 From: Pixel Date: Tue, 15 Jun 2010 00:18:43 -0700 Subject: Upgrading to CD 5.3 --- cd/test/simple/simple.c | 37 +++++++++++++++++++++++++++++++++++-- 1 file changed, 35 insertions(+), 2 deletions(-) (limited to 'cd/test/simple/simple.c') diff --git a/cd/test/simple/simple.c b/cd/test/simple/simple.c index bc0e59b..d04b96c 100755 --- a/cd/test/simple/simple.c +++ b/cd/test/simple/simple.c @@ -22,6 +22,7 @@ #include "cdprint.h" #include "cdps.h" #include "cdpdf.h" +#include "cdsvg.h" #include "cdwmf.h" #include "cdiup.h" #include "cddbuf.h" @@ -149,10 +150,12 @@ int SimpleTransform(void) int SimpleContextPlus(void) { +#ifdef USE_CONTEXTPLUS gdpiplus = !gdpiplus; SimpleKillCanvas(); SimpleCreateCanvasWindow(); SimpleDrawRepaint(); +#endif return 0; } @@ -301,6 +304,12 @@ int SimpleDrawPS(void) return 0; } +int SimpleDrawSVG(void) +{ + DrawCanvasDriverSize(CD_SVG, "simple.svg", 0); + return 0; +} + int SimpleDrawPDF(void) { DrawCanvasDriver(CD_PDF, "simple.pdf"); @@ -1209,8 +1218,8 @@ void draw_wd(void) cdFlush(); } -void SimpleDrawTest(void) -//void SimpleDrawTestHardCopy(void) +//void SimpleDrawTest(void) +void SimpleDrawTestHardCopy(void) { int w, h; cdGetCanvasSize(&w, &h, 0, 0); @@ -1237,6 +1246,8 @@ void SimpleDrawTestImageRGB(void) cdCanvas* canvas = cdCreateCanvas(CD_IMAGERGB, "2048x2048"); cdActivate(canvas); + simple_draw = DRAW_TEST; + red = calloc(size, 1); green = calloc(size, 1); blue = calloc(size, 1); @@ -1255,6 +1266,7 @@ void SimpleDrawTestImageRGB(void) void SimpleDrawVectorFont(void) { simple_draw = DRAW_TEST; + cdBackground(CD_WHITE); cdClear(); cdLineStyle(CD_CONTINUOUS); @@ -1311,3 +1323,24 @@ void SimpleDrawVectorFont(void) } cdFlush(); } + +void SimpleDrawTest(void) +//void SimpleDrawPoly(void) +{ + int w, h; + cdGetCanvasSize(&w, &h, 0, 0); + + simple_draw = DRAW_TEST; + + cdBackground(CD_WHITE); + cdClear(); + + cdInteriorStyle(CD_SOLID); + cdBegin(CD_FILL); + cdVertex(w/4, h/4); + cdVertex(w/2-w/8, h/4); + cdVertex(w/2, h/2); + cdVertex(w/2-w/8, h/2); + + cdEnd(); +} -- cgit v1.2.3