summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--mak.vc9/cdgdiplus.vcproj5
-rw-r--r--mak.vc9/cdpdf.vcproj2
-rw-r--r--mak.vc9/cdtest.vcproj2
-rw-r--r--mak.vc9/cdtestsimple.vcproj2
-rw-r--r--src/drv/cdirgb.c2
-rw-r--r--src/sim/sim_text.c2
-rw-r--r--test/cdtest/cdtest.dsp107
-rw-r--r--test/cdtest/config.mak8
-rw-r--r--test/simple/config.mak21
-rw-r--r--test/simple/makefile.linux18
-rw-r--r--test/simple/makefile.mingw320
-rw-r--r--test/simple/simple.c2
-rw-r--r--test/simple/simple.dsp83
-rw-r--r--test/simple/teste.cpp219
14 files changed, 23 insertions, 470 deletions
diff --git a/mak.vc9/cdgdiplus.vcproj b/mak.vc9/cdgdiplus.vcproj
index dcb6238..99b7fd3 100644
--- a/mak.vc9/cdgdiplus.vcproj
+++ b/mak.vc9/cdgdiplus.vcproj
@@ -1,9 +1,10 @@
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject
ProjectType="Visual C++"
- Version="9.00"
+ Version="9,00"
Name="cdgdiplus"
ProjectGUID="{51A96255-7EAB-4F36-A6E5-1BAF6245FA18}"
+ TargetFrameworkVersion="0"
>
<Platforms>
<Platform
@@ -64,7 +65,7 @@
/>
<Tool
Name="VCLibrarianTool"
- OutputFile="..\lib\cdgdiplus.lib"
+ OutputFile="..\lib\cdcontextplus.lib"
SuppressStartupBanner="true"
/>
<Tool
diff --git a/mak.vc9/cdpdf.vcproj b/mak.vc9/cdpdf.vcproj
index da0e4bf..a106b1a 100644
--- a/mak.vc9/cdpdf.vcproj
+++ b/mak.vc9/cdpdf.vcproj
@@ -66,7 +66,7 @@
/>
<Tool
Name="VCLibrarianTool"
- OutputFile="..\lib\cdpdflib.lib"
+ OutputFile="..\lib\cdpdf.lib"
SuppressStartupBanner="true"
/>
<Tool
diff --git a/mak.vc9/cdtest.vcproj b/mak.vc9/cdtest.vcproj
index 4cab635..09989f0 100644
--- a/mak.vc9/cdtest.vcproj
+++ b/mak.vc9/cdtest.vcproj
@@ -72,7 +72,7 @@
<Tool
Name="VCLinkerTool"
AdditionalOptions="/MACHINE:I386"
- AdditionalDependencies="freetype6.lib comctl32.lib cd.lib iupcd.lib cdgdiplus.lib iup.lib iupwin.lib gdiplus.lib cdpdflib.lib pdflib.lib"
+ AdditionalDependencies="freetype6.lib comctl32.lib cd.lib iupcd.lib cdcontextplus.lib iup.lib iupwin.lib gdiplus.lib cdpdf.lib pdflib.lib"
OutputFile="..\bin/cdtest.exe"
LinkIncremental="2"
SuppressStartupBanner="true"
diff --git a/mak.vc9/cdtestsimple.vcproj b/mak.vc9/cdtestsimple.vcproj
index b4e898e..0131f0f 100644
--- a/mak.vc9/cdtestsimple.vcproj
+++ b/mak.vc9/cdtestsimple.vcproj
@@ -68,7 +68,7 @@
<Tool
Name="VCLinkerTool"
AdditionalOptions="/MACHINE:I386"
- AdditionalDependencies="freetype6.lib cd.lib iupcd.lib iup.lib iupwin.lib comctl32.lib cdgdiplus.lib gdiplus.lib cdpdflib.lib iupcontrols.lib"
+ AdditionalDependencies="freetype6.lib cd.lib iupcd.lib iup.lib iupwin.lib comctl32.lib cdcontextplus.lib gdiplus.lib cdpdf.lib pdflib.lib iupcontrols.lib"
OutputFile="..\bin/cdtestsimple.exe"
LinkIncremental="2"
SuppressStartupBanner="true"
diff --git a/src/drv/cdirgb.c b/src/drv/cdirgb.c
index 2666a5a..7f6f64b 100644
--- a/src/drv/cdirgb.c
+++ b/src/drv/cdirgb.c
@@ -493,7 +493,7 @@ static void irgbClipText(cdCtxCanvas *ctxcanvas, int x, int y, const char *s, in
slot = face->glyph;
/* move the reference point to the baseline-left */
- simGetPenPos(simulation->canvas, x, y, s, strlen(s), &matrix, &pen);
+ simGetPenPos(simulation->canvas, x, y, s, len, &matrix, &pen);
while(i<len)
{
diff --git a/src/sim/sim_text.c b/src/sim/sim_text.c
index afc7cde..05789b1 100644
--- a/src/sim/sim_text.c
+++ b/src/sim/sim_text.c
@@ -386,7 +386,7 @@ void cdtextSIM(cdCtxCanvas* ctxcanvas, int x, int y, const char* s, int len)
y = _cdInvertYAxis(canvas, y); /* y is already inverted, invert back to cartesian space */
/* move the reference point to the baseline-left */
- simGetPenPos(simulation->canvas, x, y, s, strlen(s), &matrix, &pen);
+ simGetPenPos(simulation->canvas, x, y, s, len, &matrix, &pen);
while(i<len)
{
diff --git a/test/cdtest/cdtest.dsp b/test/cdtest/cdtest.dsp
deleted file mode 100644
index 80c1421..0000000
--- a/test/cdtest/cdtest.dsp
+++ /dev/null
@@ -1,107 +0,0 @@
-# Microsoft Developer Studio Project File - Name="cdtest" - Package Owner=<4>
-# Microsoft Developer Studio Generated Build File, Format Version 6.00
-# ** DO NOT EDIT **
-
-# TARGTYPE "Win32 (x86) Application" 0x0101
-
-CFG=cdtest - Win32 Debug
-!MESSAGE This is not a valid makefile. To build this project using NMAKE,
-!MESSAGE use the Export Makefile command and run
-!MESSAGE
-!MESSAGE NMAKE /f "cdtest.mak".
-!MESSAGE
-!MESSAGE You can specify a configuration when running NMAKE
-!MESSAGE by defining the macro CFG on the command line. For example:
-!MESSAGE
-!MESSAGE NMAKE /f "cdtest.mak" CFG="cdtest - Win32 Debug"
-!MESSAGE
-!MESSAGE Possible choices for configuration are:
-!MESSAGE
-!MESSAGE "cdtest - Win32 Debug" (based on "Win32 (x86) Application")
-!MESSAGE
-
-# Begin Project
-# PROP AllowPerConfigDependencies 0
-# PROP Scc_ProjName ""
-# PROP Scc_LocalPath ""
-CPP=cl.exe
-MTL=midl.exe
-RSC=rc.exe
-
-!IF "$(CFG)" == "cdtest - Win32 Debug"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 1
-# PROP BASE Output_Dir "..\bin"
-# PROP BASE Intermediate_Dir "..\obj\cdtest"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 1
-# PROP Output_Dir "..\bin"
-# PROP Intermediate_Dir "..\obj\cdtest"
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /MTd /I "..\..\include" /I "..\..\..\iup\include" /Z7 /W3 /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "CDTEST_WIN32" /D "_CRT_SECURE_NO_DEPRECATE" /D "_MBCS" /Fp"..\obj/cdtest.pch" /Fo"$(IntDir)/" /Fd"..\obj/cdtest" /GZ /c /GX
-# ADD CPP /nologo /MTd /I "..\..\include" /I "..\..\..\iup\include" /Z7 /W3 /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "CDTEST_WIN32" /D "_CRT_SECURE_NO_DEPRECATE" /D "_MBCS" /Fp"..\obj/cdtest.pch" /Fo"$(IntDir)/" /Fd"..\obj/cdtest" /GZ /c /GX
-# ADD BASE MTL /nologo /D"_DEBUG" /mktyplib203 /tlb"..\bin\cdtest.tlb" /win32
-# ADD MTL /nologo /D"_DEBUG" /mktyplib203 /tlb"..\bin\cdtest.tlb" /win32
-# ADD BASE RSC /l 1046 /d "_DEBUG"
-# ADD RSC /l 1046 /d "_DEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib comctl32.lib cd.lib cdiup.lib cdgdiplus.lib iup.lib gdiplus.lib cdpdflib.lib /nologo /out:"..\bin\cdtest.exe" /incremental:yes /libpath:"..\..\lib" /libpath:"..\..\..\iup\lib" /debug /pdb:"..\bin\cdtest.pdb" /pdbtype:sept /subsystem:windows /MACHINE:I386
-# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib comctl32.lib cd.lib cdiup.lib cdgdiplus.lib iup.lib gdiplus.lib cdpdflib.lib /nologo /out:"..\bin\cdtest.exe" /incremental:yes /libpath:"..\..\lib" /libpath:"..\..\..\iup\lib" /debug /pdb:"..\bin\cdtest.pdb" /pdbtype:sept /subsystem:windows /MACHINE:I386
-
-!ENDIF
-
-# Begin Target
-
-# Name "cdtest - Win32 Debug"
-# Begin Group "Source Files"
-
-# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
-# Begin Source File
-
-SOURCE=Cdtest.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\cdtest.led
-# End Source File
-# Begin Source File
-
-SOURCE=cdtest.rc
-# End Source File
-# Begin Source File
-
-SOURCE=cdtest_led.c
-# End Source File
-# Begin Source File
-
-SOURCE=Colorbar.c
-# End Source File
-# Begin Source File
-
-SOURCE=Drivers.c
-# End Source File
-# Begin Source File
-
-SOURCE=List.c
-# End Source File
-# Begin Source File
-
-SOURCE=Rubber.c
-# End Source File
-# End Group
-# Begin Group "Header Files"
-
-# PROP Default_Filter "h;hpp;hxx;hm;inl"
-# Begin Source File
-
-SOURCE=Cdtest.h
-# End Source File
-# End Group
-# End Target
-# End Project
-
diff --git a/test/cdtest/config.mak b/test/cdtest/config.mak
index 9453944..e04e7d1 100644
--- a/test/cdtest/config.mak
+++ b/test/cdtest/config.mak
@@ -7,7 +7,7 @@ ifeq "$(TEC_SYSNAME)" "Win32"
endif
USE_CD=Yes
-USE_IUP=Yes
+USE_IUP3=Yes
cdtest_led.c: cdtest.led
ledc -f cdtest_loadled -o cdtest_led.c cdtest.led
@@ -15,10 +15,10 @@ cdtest_led.c: cdtest.led
USE_STATIC = Yes
#IUP = ../../../iup
-CD = ../..
+#CD = ../..
ifneq ($(findstring Win, $(TEC_SYSNAME)), )
- LIBS = cdpdflib
+ LIBS = cdpdflib pdflib
else
- SLIB = $(CD)/lib/$(TEC_UNAME)/libcdpdflib.a
+ SLIB = $(CD)/lib/$(TEC_UNAME)/libcdpdf.a $(CD)/lib/$(TEC_UNAME)/libpdflib.a
endif
diff --git a/test/simple/config.mak b/test/simple/config.mak
index 319568a..fee0960 100644
--- a/test/simple/config.mak
+++ b/test/simple/config.mak
@@ -1,11 +1,10 @@
APPNAME = simple
-#SRC = simple.c simple_led.c iupmain.c
-SRC = teste.cpp
+SRC = simple.c simple_led.c iupmain.c
-#DBG = Yes
+DBG = Yes
USE_CD=Yes
-USE_IUP=Yes
+USE_IUP3=Yes
simple_led.c: simple.led
ledc -f simple_loadled -o simple_led.c simple.led
@@ -15,11 +14,11 @@ USE_STATIC = Yes
#IUP = ../../../iup
#CD = ../..
-USE_IM = Yes
+#USE_IM = Yes
-#ifneq ($(findstring Win, $(TEC_SYSNAME)), )
-# LIBS = cdpdflib cdgdiplus gdiplus
-#else
-# SLIB = $(CD)/lib/$(TEC_UNAME)/libcdpdflib.a $(CD)/lib/$(TEC_UNAME)/libcdxrender.a
-# LIBS = Xrender Xft
-#endif
+ifneq ($(findstring Win, $(TEC_SYSNAME)), )
+ LIBS = cdpdf pdflib cdcontextplus gdiplus
+else
+ SLIB = $(CD)/lib/$(TEC_UNAME)/libcdpdf.a $(CD)/lib/$(TEC_UNAME)/libpdflib.a $(CD)/lib/$(TEC_UNAME)/libcdcontextplus.a
+ LIBS = Xrender Xft
+endif
diff --git a/test/simple/makefile.linux b/test/simple/makefile.linux
deleted file mode 100644
index 5d014e0..0000000
--- a/test/simple/makefile.linux
+++ /dev/null
@@ -1,18 +0,0 @@
-CC = gcc
-
-CFLAGS = -I../cd/include -I../iup/include -I/usr/X11R6/include
-
-LIBS = -L../cd/lib/Linux26 -L../iup/lib/Linux26 -L/usr/X11R6/lib \
- -lcdiup -lcd -liup \
- -lXm -lXpm -lXmu -lXt -lXext -lX11
-
-OBJS = simple.o iupmain.o
-
-simple.o: simple.c simple.h
- $(CC) -o $@ -c simple.c $(CFLAGS)
-
-iupmain.o: iupmain.c simple.h
- $(CC) -o $@ -c iupmain.c $(CFLAGS)
-
-simple: $(OBJS)
- $(CC) -o $@ $(OBJS) $(LIBS)
diff --git a/test/simple/makefile.mingw3 b/test/simple/makefile.mingw3
deleted file mode 100644
index cf735e8..0000000
--- a/test/simple/makefile.mingw3
+++ /dev/null
@@ -1,20 +0,0 @@
-CC = gcc
-
-CFLAGS = -I../cd/include -I../iup/include
-
-LIBS = -L../cd/lib/mingw3 -L../iup/lib/mingw3 \
- -lcdiup -lcd -liup \
- -lkernel32 -luser32 -lgdi32 -lcomdlg32 -lole32 -lcomctl32
-
-OBJS = simple.o iupmain.o
-
-all: simple.exe
-
-simple.o: simple.c simple.h
- $(CC) -o $@ -c simple.c $(CFLAGS)
-
-iupmain.o: iupmain.c simple.h
- $(CC) -o $@ -c iupmain.c $(CFLAGS)
-
-simple.exe: $(OBJS)
- $(CC) -o $@ $(OBJS) $(LIBS)
diff --git a/test/simple/simple.c b/test/simple/simple.c
index c75398b..bc0e59b 100644
--- a/test/simple/simple.c
+++ b/test/simple/simple.c
@@ -303,7 +303,7 @@ int SimpleDrawPS(void)
int SimpleDrawPDF(void)
{
-// DrawCanvasDriver(CD_PDF, "simple.pdf");
+ DrawCanvasDriver(CD_PDF, "simple.pdf");
return 0;
}
diff --git a/test/simple/simple.dsp b/test/simple/simple.dsp
deleted file mode 100644
index c69b8df..0000000
--- a/test/simple/simple.dsp
+++ /dev/null
@@ -1,83 +0,0 @@
-# Microsoft Developer Studio Project File - Name="simple" - Package Owner=<4>
-# Microsoft Developer Studio Generated Build File, Format Version 6.00
-# ** DO NOT EDIT **
-
-# TARGTYPE "Win32 (x86) Application" 0x0101
-
-CFG=simple - Win32 Debug
-!MESSAGE This is not a valid makefile. To build this project using NMAKE,
-!MESSAGE use the Export Makefile command and run
-!MESSAGE
-!MESSAGE NMAKE /f "simple.mak".
-!MESSAGE
-!MESSAGE You can specify a configuration when running NMAKE
-!MESSAGE by defining the macro CFG on the command line. For example:
-!MESSAGE
-!MESSAGE NMAKE /f "simple.mak" CFG="simple - Win32 Debug"
-!MESSAGE
-!MESSAGE Possible choices for configuration are:
-!MESSAGE
-!MESSAGE "simple - Win32 Debug" (based on "Win32 (x86) Application")
-!MESSAGE
-
-# Begin Project
-# PROP AllowPerConfigDependencies 0
-# PROP Scc_ProjName ""
-# PROP Scc_LocalPath ""
-CPP=cl.exe
-MTL=midl.exe
-RSC=rc.exe
-
-!IF "$(CFG)" == "simple - Win32 Debug"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 1
-# PROP BASE Output_Dir "..\bin"
-# PROP BASE Intermediate_Dir "..\obj\simple"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 1
-# PROP Output_Dir "..\bin"
-# PROP Intermediate_Dir "..\obj\simple"
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /MT /I "..\..\include" /I "..\..\..\iup\include" /Z7 /W4 /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "__CD__" /D "simple" /D "_CRT_SECURE_NO_DEPRECATE" /D "_MBCS" /Fp".\..\obj\simple/simple.pch" /Fo".\..\obj\simple/" /Fd".\..\obj\simple/" /GZ /c /GX
-# ADD CPP /nologo /MT /I "..\..\include" /I "..\..\..\iup\include" /Z7 /W4 /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "__CD__" /D "simple" /D "_CRT_SECURE_NO_DEPRECATE" /D "_MBCS" /Fp".\..\obj\simple/simple.pch" /Fo".\..\obj\simple/" /Fd".\..\obj\simple/" /GZ /c /GX
-# ADD BASE MTL /nologo /tlb".\..\bin\simple.tlb" /win32
-# ADD MTL /nologo /tlb".\..\bin\simple.tlb" /win32
-# ADD BASE RSC /l 1046 /d "_DEBUG"
-# ADD RSC /l 1046 /d "_DEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib cd.lib cdiup.lib iup.lib comctl32.lib cdgdiplus.lib gdiplus.lib cdpdflib.lib iupcontrols.lib /nologo /out:"..\bin\simple.exe" /incremental:yes /libpath:"..\..\lib" /libpath:"..\..\..\iup\lib" /debug /pdb:".\..\bin\simple.pdb" /pdbtype:sept /subsystem:windows /MACHINE:I386
-# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib cd.lib cdiup.lib iup.lib comctl32.lib cdgdiplus.lib gdiplus.lib cdpdflib.lib iupcontrols.lib /nologo /out:"..\bin\simple.exe" /incremental:yes /libpath:"..\..\lib" /libpath:"..\..\..\iup\lib" /debug /pdb:".\..\bin\simple.pdb" /pdbtype:sept /subsystem:windows /MACHINE:I386
-
-!ENDIF
-
-# Begin Target
-
-# Name "simple - Win32 Debug"
-# Begin Source File
-
-SOURCE=iupmain.c
-# End Source File
-# Begin Source File
-
-SOURCE=simple.c
-# End Source File
-# Begin Source File
-
-SOURCE=simple.h
-# End Source File
-# Begin Source File
-
-SOURCE=simple.led
-# End Source File
-# Begin Source File
-
-SOURCE=simple_led.c
-# End Source File
-# End Target
-# End Project
-
diff --git a/test/simple/teste.cpp b/test/simple/teste.cpp
deleted file mode 100644
index 83fbbac..0000000
--- a/test/simple/teste.cpp
+++ /dev/null
@@ -1,219 +0,0 @@
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-#include <io.h>
-
-#include "iup.h"
-#include "cd.h"
-#include "cdiup.h"
-#include "cdirgb.h"
-
-/***************************************************************************
-* callbacks do IUP *
-****************************************************************************/
-int Draw( Ihandle *dial )
-{
- cdCanvas *cnv = (cdCanvas *) IupGetAttribute(dial, "CDCANVAS");
- cdCanvas *imgCnv = (cdCanvas *) IupGetAttribute(dial, "IMGCNV");
-
- if (cnv==NULL)
- return IUP_DEFAULT;
-
- int width, height;
- cdCanvasGetSize(cnv, &width, &height, NULL, NULL);
-
- cdCanvasInteriorStyle(cnv, CD_SOLID);
- cdCanvasForeground(cnv, CD_WHITE);
- cdCanvasBox(cnv, 0, width, 0, height);
-
- if (imgCnv==NULL)
- return IUP_DEFAULT;
-
- int w, h;
- cdCanvasGetSize(imgCnv, &w, &h, NULL, NULL);
-
- unsigned char* red = cdRedImage(imgCnv);
- unsigned char* green = cdGreenImage(imgCnv);
- unsigned char* blue = cdBlueImage(imgCnv);
-
- int dx = width - w;
- int dy = height - h;
-
- cdCanvasPutImageRectRGB(cnv, w, h, red, green, blue, (int)(dx / 2.0), (int)(dy / 2.0), 0, 0, 0, 0, 0, 0);
-
- return IUP_DEFAULT;
-}
-
-int repaint (Ihandle *self, float x, float y)
-{
- Ihandle *dial = (Ihandle *) IupGetDialog(self);
-
- cdCanvas *cnv = (cdCanvas *) IupGetAttribute(dial, "CDCANVAS");
-
- Draw(dial);
-
- return IUP_DEFAULT;
-}
-
-static int Resize (Ihandle *self, int larg, int alt)
-{
- Ihandle *dial = IupGetDialog(self);
-
- if (dial==NULL) return IUP_DEFAULT;
-
- cdCanvas *cnv = (cdCanvas *) IupGetAttribute(dial, "CDCANVAS");
-
- if (cnv!=NULL)
- cdCanvasActivate(cnv);
-
- Draw(dial);
-
- return IUP_DEFAULT;
-}
-
-static int doexit(Ihandle *self)
-{
- return IUP_CLOSE;
-}
-
-cdCanvas* buildBackImage(Ihandle* dial)
-{
- unsigned char* r = (unsigned char*) IupGetAttribute(dial, "BUFFRED");
- unsigned char* g = (unsigned char*) IupGetAttribute(dial, "BUFFGREEN");
- unsigned char* b = (unsigned char*) IupGetAttribute(dial, "BUFFBLUE");
-
- cdCanvas* imgCnv = (cdCanvas*) IupGetAttribute(dial, "IMGCNV");
-
- if (imgCnv!=NULL)
- delete imgCnv;
-
- if (r!=NULL)
- delete r;
- if (g!=NULL)
- delete g;
- if (b!=NULL)
- delete b;
-
- int w = 200;
- int h = 200;
-
- int size = w * h;
-
- r = new unsigned char[size];
- g = new unsigned char[size];
- b = new unsigned char[size];
-
- char data[100];
- sprintf(data, "%dx%d %p %p %p", w, h, r, g, b);
- imgCnv = cdCreateCanvas(CD_IMAGERGB, data);
-
- IupSetAttribute(dial, "BUFFRED", (char*) r);
- IupSetAttribute(dial, "BUFFGREEN", (char*) g);
- IupSetAttribute(dial, "BUFFBLUE", (char*) b);
-
- IupSetAttribute(dial, "IMGCNV", (char*) imgCnv);
-
- return imgCnv;
-}
-
-void drawInImage(cdCanvas* cnv)
-{
- int w, h;
- cdCanvasGetSize(cnv, &w, &h, NULL, NULL);
-
- cdCanvasBegin(cnv, CD_CLIP);
-#if 0
- cdCanvasVertex(cnv, 0, 0);
- cdCanvasVertex(cnv, w, 0);
- cdCanvasVertex(cnv, w, h);
- cdCanvasVertex(cnv, 0, h);
-#else
- cdCanvasVertex(cnv, -100, -100);
- cdCanvasVertex(cnv, w+100, -100);
- cdCanvasVertex(cnv, w+100, h+100);
- cdCanvasVertex(cnv, -100, h+100);
-#endif
- cdCanvasEnd(cnv);
-
- cdCanvasClip(cnv, CD_CLIPPOLYGON);
-
- cdCanvasInteriorStyle(cnv, CD_SOLID);
- cdCanvasForeground(cnv, CD_WHITE);
- cdCanvasBox(cnv, 0, w, 0, h);
-
- cdCanvasForeground(cnv, CD_RED);
- cdCanvasTextAlignment(cnv, CD_CENTER);
- cdCanvasText(cnv, w/2, h/2, "SCURI É BOIOLA!");
-}
-
-static int tofly(Ihandle *self)
-{
- Ihandle *dial = IupGetDialog(self);
-
- cdCanvas* back = buildBackImage(dial);
-
- if (back!=NULL)
- drawInImage(back);
-
- Draw(dial);
-
- return IUP_DEFAULT;
-}
-
-Ihandle *BuildDialog(void)
-{
- Ihandle *saida = IupItem ("Saida", "acao_sai");
- Ihandle *voe = IupItem ("Voe", "acao_voar");
- Ihandle *main_menu = IupMenu ( saida, voe, NULL );
-
- Ihandle *tela = IupCanvas("rpaint");
- IupSetAttribute(tela, IUP_BUTTON_CB, "buttonCb");
- IupSetAttribute(tela, IUP_MOTION_CB, "motionCb");
-
- Ihandle *hbox = IupHbox ( tela, NULL );
-
- Ihandle *dial = IupDialog ( hbox );
-
- IupSetHandle( "main_menu", main_menu );
- IupSetHandle( "tela", tela );
- IupSetAttribute( dial, IUP_MENU, "main_menu" );
- IupSetAttribute( dial, IUP_SIZE, "HALFxHALF" );
- IupSetAttribute( tela, IUP_SIZE, "300x200" );
- IupSetAttribute( tela, IUP_RESIZE_CB, "resize_cb");
-
- IupSetFunction( "rpaint", (Icallback) repaint );
- IupSetFunction( "acao_sai", (Icallback) doexit );
- IupSetFunction( "acao_voar", (Icallback) tofly );
- IupSetFunction( "resize_cb", (Icallback) Resize );
-
- IupMap(dial);
-
- return dial;
-}
-
-int main (void)
-{
- Ihandle *dial;
-
- /* Abre IUP */
- IupOpen();
-
- dial = BuildDialog();
-
- cdCanvas *cnv = cdCreateCanvas( CD_IUP, IupGetHandle("tela") );
-
- IupSetAttribute(dial, "CDCANVAS", (char *) cnv);
-
- /* Exibe dialogo */
- IupShow(dial);
-
- /* Interage com o usuario */
- IupMainLoop();
-
- cdKillCanvas( cnv );
-
- /* Fecha IUP */
- IupClose();
-
- return 1;
-}