diff options
Diffstat (limited to 'iup/srccd')
-rwxr-xr-x | iup/srccd/Makefile | 6 | ||||
-rwxr-xr-x | iup/srccd/config.mak | 14 | ||||
-rwxr-xr-x | iup/srccd/iup_cd.c | 70 | ||||
-rwxr-xr-x | iup/srccd/iupcd.def | 2 | ||||
-rw-r--r-- | iup/srccd/iupcd.dep | 3 | ||||
-rwxr-xr-x | iup/srccd/make_uname | 3 | ||||
-rwxr-xr-x | iup/srccd/make_uname.bat | 4 |
7 files changed, 102 insertions, 0 deletions
diff --git a/iup/srccd/Makefile b/iup/srccd/Makefile new file mode 100755 index 0000000..43a3f09 --- /dev/null +++ b/iup/srccd/Makefile @@ -0,0 +1,6 @@ + +.PHONY: do_all iupcd +do_all: iupcd + +iupcd: + @$(MAKE) --no-print-directory -f ../tecmake_compact.mak diff --git a/iup/srccd/config.mak b/iup/srccd/config.mak new file mode 100755 index 0000000..3e5a9fe --- /dev/null +++ b/iup/srccd/config.mak @@ -0,0 +1,14 @@ +PROJNAME = iup +LIBNAME = iupcd +OPT = YES + +DEFINES = CD_NO_OLD_INTERFACE +SRC = iup_cd.c +DEF_FILE = iupcd.def + +USE_CD=YES +# Can not use USE_IUP because Tecmake will include "iupcd" in linker + +INCLUDES = ../include +LIBS = iup +LDIR = ../lib/$(TEC_UNAME) diff --git a/iup/srccd/iup_cd.c b/iup/srccd/iup_cd.c new file mode 100755 index 0000000..5998775 --- /dev/null +++ b/iup/srccd/iup_cd.c @@ -0,0 +1,70 @@ +/** \file + * \brief IUP Driver + * + * See Copyright Notice in "iup.h" + */ + +#include <stdlib.h> +#include <stdio.h> + +#include "iup.h" + +#include <cd.h> +#include <cd_private.h> +#include <cdiup.h> +#include <cdnative.h> + + +static void (*cdcreatecanvasNATIVE)(cdCanvas* canvas, void* data) = NULL; + +static void cdcreatecanvasIUP(cdCanvas* canvas, Ihandle *ih_canvas) +{ +#ifndef WIN32 + char str[50] = ""; +#endif + char* data; + + if (IupGetInt(ih_canvas, "CD_GDK")) + data = IupGetAttribute(ih_canvas, "DRAWABLE"); /* new IUP 3 attribute, works for GTK only */ + else + { +#ifdef WIN32 + data = IupGetAttribute(ih_canvas, "HWND"); /* new IUP 3 attribute, works for Windows and GTK */ + if (!data) + data = IupGetAttribute(ih_canvas, "WID"); /* OLD IUP 2 attribute */ + if (!data) + return; +#else + void *dpy = IupGetAttribute(ih_canvas, "XDISPLAY"); /* works for Motif and GTK */ + unsigned long wnd = (unsigned long)IupGetAttribute(ih_canvas, "XWINDOW"); + if (!wnd || !dpy) + return; + data = str; +#ifdef SunOS_OLD + sprintf(str, "%d %lu", (int)dpy, wnd); +#else + sprintf(str, "%p %lu", dpy, wnd); +#endif +#endif + } + + /* Inicializa driver NativeWindow */ + cdcreatecanvasNATIVE(canvas, data); + + IupSetAttribute(ih_canvas, "_CD_CANVAS", (char*)canvas); +} + +static cdContext cdIupContext; + +cdContext* cdContextIup(void) +{ + /* call cdContextNativeWindow every time, because of ContextPlus */ + cdContext* ctx = cdContextNativeWindow(); + + cdcreatecanvasNATIVE = ctx->cxCreateCanvas; + + cdIupContext = *ctx; + cdIupContext.cxCreateCanvas = cdcreatecanvasIUP; + + return &cdIupContext; +} diff --git a/iup/srccd/iupcd.def b/iup/srccd/iupcd.def new file mode 100755 index 0000000..67a21f9 --- /dev/null +++ b/iup/srccd/iupcd.def @@ -0,0 +1,2 @@ +EXPORTS + cdContextIup diff --git a/iup/srccd/iupcd.dep b/iup/srccd/iupcd.dep new file mode 100644 index 0000000..4612393 --- /dev/null +++ b/iup/srccd/iupcd.dep @@ -0,0 +1,3 @@ +$(OBJDIR)/iup_cd.o: iup_cd.c ../include/iup.h ../include/iupkey.h \ + ../include/iupdef.h ../../cd/include/cd.h ../../cd/include/cd_private.h \ + ../../cd/include/cdiup.h ../../cd/include/cdnative.h diff --git a/iup/srccd/make_uname b/iup/srccd/make_uname new file mode 100755 index 0000000..cc4b881 --- /dev/null +++ b/iup/srccd/make_uname @@ -0,0 +1,3 @@ +#This builds all the libraries of the folder for 1 uname + +tecmake $1 $2 $3 $4 $5 $6 $7 diff --git a/iup/srccd/make_uname.bat b/iup/srccd/make_uname.bat new file mode 100755 index 0000000..f0a0722 --- /dev/null +++ b/iup/srccd/make_uname.bat @@ -0,0 +1,4 @@ +@echo off +REM This builds all the libraries of the folder for 1 uname + +call tecmake %1 %2 %3 %4 %5 %6 |