From d577d991b97ae2b5ee1af23641bcffc3f83af5b2 Mon Sep 17 00:00:00 2001 From: Pixel Date: Wed, 4 Nov 2009 11:56:41 -0800 Subject: Initial import. Contains the im, cd and iup librairies, and a "working" Makefile for them under linux. --- iup/srclua3/il_getcolor.c | 42 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100755 iup/srclua3/il_getcolor.c (limited to 'iup/srclua3/il_getcolor.c') diff --git a/iup/srclua3/il_getcolor.c b/iup/srclua3/il_getcolor.c new file mode 100755 index 0000000..96ef20d --- /dev/null +++ b/iup/srclua3/il_getcolor.c @@ -0,0 +1,42 @@ +/** \file + * \brief Bindig of iupgc to Lua 3. + * + * See Copyright Notice in "iup.h" + */ + +#include + +#include "iup.h" + +#include +#include + +#include "iuplua.h" +#include "il.h" +#include "il_controls.h" + +static void GetColor(void) +{ + int x = luaL_check_int(1); + int y = luaL_check_int(2); + unsigned char r = (unsigned char)luaL_check_int(3); + unsigned char g = (unsigned char)luaL_check_int(4); + unsigned char b = (unsigned char)luaL_check_int(5); + + if (IupGetColor(x, y, &r, &g, &b )) + { + lua_pushnumber(r); + lua_pushnumber(g); + lua_pushnumber(b); + } + else + { + lua_pushnil(); + } +} + +int gclua_open(void) +{ + iuplua_register("IupGetColor", GetColor); + return 1; +} -- cgit v1.2.3