summaryrefslogtreecommitdiff
path: root/cd/test/simple
diff options
context:
space:
mode:
Diffstat (limited to 'cd/test/simple')
-rwxr-xr-xcd/test/simple/config.mak17
-rwxr-xr-xcd/test/simple/iupmain.c3
-rwxr-xr-xcd/test/simple/simple.c37
-rwxr-xr-xcd/test/simple/simple.h1
-rwxr-xr-xcd/test/simple/simple.led1
-rwxr-xr-xcd/test/simple/simple_led.c3
6 files changed, 57 insertions, 5 deletions
diff --git a/cd/test/simple/config.mak b/cd/test/simple/config.mak
index fee0960..2777b7d 100755
--- a/cd/test/simple/config.mak
+++ b/cd/test/simple/config.mak
@@ -1,13 +1,26 @@
APPNAME = simple
+ifdef USE_GDK
+ APPNAME = simplegdk
+ USE_GTK = Yes
+else
+ DEFINES = USE_CONTEXTPLUS
+endif
+
SRC = simple.c simple_led.c iupmain.c
-DBG = Yes
+#DBG = Yes
USE_CD=Yes
USE_IUP3=Yes
+ifeq "$(TEC_SYSNAME)" "Win32"
+ LEDC = $(IUP)/bin/$(TEC_SYSNAME)/ledc
+else
+ LEDC = $(IUP)/bin/$(TEC_UNAME)/ledc
+endif
+
simple_led.c: simple.led
- ledc -f simple_loadled -o simple_led.c simple.led
+ $(LEDC) -f simple_loadled -o simple_led.c simple.led
USE_STATIC = Yes
diff --git a/cd/test/simple/iupmain.c b/cd/test/simple/iupmain.c
index 4eb4a5d..daf058a 100755
--- a/cd/test/simple/iupmain.c
+++ b/cd/test/simple/iupmain.c
@@ -15,7 +15,9 @@ int main(int argc, char** argv)
{
IupOpen(&argc, &argv);
+#ifdef USE_CONTEXTPLUS
cdInitContextPlus();
+#endif
simple_loadled();
@@ -44,6 +46,7 @@ int main(int argc, char** argv)
IupSetFunction("SimpleDrawPDF", (Icallback) SimpleDrawPDF);
IupSetFunction("SimpleDrawPS", (Icallback) SimpleDrawPS);
IupSetFunction("SimpleDrawEPS", (Icallback) SimpleDrawEPS);
+ IupSetFunction("SimpleDrawSVG", (Icallback) SimpleDrawSVG);
IupSetFunction("SimpleDrawWMF", (Icallback) SimpleDrawWMF);
IupSetFunction("SimpleDrawPrint", (Icallback) SimpleDrawPrint);
IupSetFunction("SimpleDrawPrintDialog", (Icallback) SimpleDrawPrintDialog);
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();
+}
diff --git a/cd/test/simple/simple.h b/cd/test/simple/simple.h
index 123b31c..933b714 100755
--- a/cd/test/simple/simple.h
+++ b/cd/test/simple/simple.h
@@ -25,6 +25,7 @@ int SimpleDrawMetafile(void);
int SimpleDrawPDF(void);
int SimpleDrawPS(void);
int SimpleDrawEPS(void);
+int SimpleDrawSVG(void);
int SimpleDrawWMF(void);
int SimpleDrawPrint(void);
int SimpleDrawPrintDialog(void);
diff --git a/cd/test/simple/simple.led b/cd/test/simple/simple.led
index cdf4430..63f3dc2 100755
--- a/cd/test/simple/simple.led
+++ b/cd/test/simple/simple.led
@@ -19,6 +19,7 @@ mnSaveAs = MENU
ITEM("PDF", SimpleDrawPDF),
ITEM("PS", SimpleDrawPS),
ITEM("EPS", SimpleDrawEPS),
+ ITEM("SVG", SimpleDrawSVG),
ITEM("WMF", SimpleDrawWMF)
)
diff --git a/cd/test/simple/simple_led.c b/cd/test/simple/simple_led.c
index 07eebc8..626b849 100755
--- a/cd/test/simple/simple_led.c
+++ b/cd/test/simple/simple_led.c
@@ -1,4 +1,4 @@
-/* Arquivo gerado automaticamente por ledc 2.5 */
+/* Automatically generated by Iup ledc 2.6 */
#include <stdlib.h>
#include <stdarg.h>
@@ -44,6 +44,7 @@ void simple_loadled (void)
IupItem( "PDF", "SimpleDrawPDF" ),
IupItem( "PS", "SimpleDrawPS" ),
IupItem( "EPS", "SimpleDrawEPS" ),
+ IupItem( "SVG", "SimpleDrawSVG" ),
IupItem( "WMF", "SimpleDrawWMF" ),
NULL), NULL );
named[2] = decl( "mnFile", IupMenu(