From 7baa004d4455a02826aee2aa460ea99030b294da Mon Sep 17 00:00:00 2001 From: scuri Date: Fri, 23 Apr 2010 14:27:10 +0000 Subject: Fixed: missed implementation for CD_DEBUG, CD_PICTURE and CD_DBUFFERRGB in Lua. --- src/lua5/cdlua5ctx.c | 63 ++++++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 61 insertions(+), 2 deletions(-) (limited to 'src/lua5') diff --git a/src/lua5/cdlua5ctx.c b/src/lua5/cdlua5ctx.c index 4d97f3b..b4c899b 100644 --- a/src/lua5/cdlua5ctx.c +++ b/src/lua5/cdlua5ctx.c @@ -1,5 +1,5 @@ /***************************************************************************\ -* $Id: cdlua5ctx.c,v 1.2 2009/12/02 20:31:02 scuri Exp $ +* $Id: cdlua5ctx.c,v 1.3 2010/04/23 14:27:10 scuri Exp $ * * \***************************************************************************/ @@ -25,7 +25,9 @@ #include "cdps.h" #include "cdsvg.h" #include "cddbuf.h" -#include "cdgdiplus.h" +#include "cddebug.h" +#include "cdpicture.h" + #include #include @@ -320,6 +322,24 @@ static cdluaContext cdluadbufctx = 0 }; +/***************************************************************************\ +* CD_DBUFFERRGB. * +\***************************************************************************/ +static void *cddbufrgb_checkdata(lua_State * L, int param) +{ + return cdlua_checkcanvas(L, param); +} + +static cdluaContext cdluadbufrgbctx = +{ + 0, + "DBUFFERRGB", + cdContextDBufferRGB, + cddbufrgb_checkdata, + NULL, + 0 +}; + /***************************************************************************\ * CD_IMAGE. * \***************************************************************************/ @@ -619,6 +639,42 @@ static int emf_sizecb(cdCanvas *canvas, int w, int h, double mm_w, double mm_h) return luaL_checkint(L,-1); } +/***************************************************************************\ +* CD_PICTURE. * +\***************************************************************************/ +static void *cdpicture_checkdata(lua_State *L,int param) +{ + return (void *)luaL_checkstring(L,param); +} + +static cdluaContext cdluapicturectx = +{ + 0, + "PICTURE", + cdContextPicture, + cdpicture_checkdata, + NULL, + 0 +}; + +/***************************************************************************\ +* CD_DEBUG. * +\***************************************************************************/ +static void *cddebug_checkdata(lua_State *L,int param) +{ + return (void *)luaL_checkstring(L,param); +} + +static cdluaContext cdluadebugctx = +{ + 0, + "DEBUG", + cdContextDebug, + cddebug_checkdata, + NULL, + 0 +}; + /***************************************************************************\ * CD_METAFILE. * \***************************************************************************/ @@ -811,6 +867,8 @@ void cdlua_initdrivers(lua_State * L, cdluaLuaState* cdL) cdlua_addcontext(L, cdL, &cdluadgnctx); cdlua_addcontext(L, cdL, &cdluacgmctx); cdlua_addcontext(L, cdL, &cdluamfctx); + cdlua_addcontext(L, cdL, &cdluadebugctx); + cdlua_addcontext(L, cdL, &cdluapicturectx); cdlua_addcontext(L, cdL, &cdluapsctx); cdlua_addcontext(L, cdL, &cdluasvgctx); cdlua_addcontext(L, cdL, &cdluaclipboardctx); @@ -819,4 +877,5 @@ void cdlua_initdrivers(lua_State * L, cdluaLuaState* cdL) cdlua_addcontext(L, cdL, &cdluawmfctx); cdlua_addcontext(L, cdL, &cdluaemfctx); cdlua_addcontext(L, cdL, &cdluadbufctx); + cdlua_addcontext(L, cdL, &cdluadbufrgbctx); } -- cgit v1.2.3