diff options
Diffstat (limited to 'cd/src/lua5/cdlua5ctx.c')
-rwxr-xr-x | cd/src/lua5/cdlua5ctx.c | 67 |
1 files changed, 63 insertions, 4 deletions
diff --git a/cd/src/lua5/cdlua5ctx.c b/cd/src/lua5/cdlua5ctx.c index 4d97f3b..71f090d 100755 --- a/cd/src/lua5/cdlua5ctx.c +++ b/cd/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.4 2010/06/11 17:28:56 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 <lua.h> #include <lauxlib.h> @@ -321,6 +323,24 @@ static cdluaContext cdluadbufctx = }; /***************************************************************************\ +* 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. * \***************************************************************************/ static void *cdimage_checkdata(lua_State *L, int param) @@ -377,7 +397,7 @@ static void *cdimagergb_checkdata(lua_State* L, int param) int ret = cdlua_rawchecktype(L, param, "cdBitmap"); if (ret == 0) - luaL_typerror(L, param, "cdBitmap"); /* not a user data and not a metatable */ + luaL_typeerror(L, param, "cdBitmap"); /* not a user data and not a metatable */ if (ret == 1) { @@ -467,7 +487,7 @@ static void *cdimagergb_checkdata(lua_State* L, int param) return data_s; } - luaL_typerror(L, param, "cdBitmap"); /* is a metatable but it is not one of the accepted */ + luaL_typeerror(L, param, "cdBitmap"); /* is a metatable but it is not one of the accepted */ } return data_s; @@ -620,6 +640,42 @@ static int emf_sizecb(cdCanvas *canvas, int w, int h, double mm_w, double mm_h) } /***************************************************************************\ +* 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. * \***************************************************************************/ static void *cdmetafile_checkdata(lua_State *L,int param) @@ -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); } |