Beispiel #1
0
static int iupluaimglib_open (lua_State *L)
{
  IupImageLibOpen();
  
  iuplua_get_env(L);
  iuplua_register(L, imagelibopen, "ImageLibOpen");
  return 0; /* nothing in stack */
}
Beispiel #2
0
void iuplua_push_name(lua_State *L, const char* name)
{
  /* push iup.name in stack */
  iuplua_get_env(L);
  lua_pushstring(L, name);
  lua_gettable(L, -2);
  lua_remove(L, -2);  /* remove global table from stack */
}
Beispiel #3
0
int iupgllua_open(lua_State * L)
{
  if (iuplua_opencall_internal(L))
    IupGLCanvasOpen();

  iuplua_get_env(L);
  iupglcanvaslua_open(L);
  return 0;
}
Beispiel #4
0
int iupolelua_open(lua_State* L)
{
  if (iuplua_opencall_internal(L))
    IupOleControlOpen();
    
  iuplua_get_env(L);
  iupolecontrollua_open(L);
  return 0;
}
Beispiel #5
0
int iup_plotlua_open(lua_State * L)
{
  if (iuplua_opencall_internal(L))
    IupPlotOpen();

  iuplua_get_env(L);
  iupplotlua_open(L);
  return 0;
}
Beispiel #6
0
int iupweblua_open(lua_State* L)
{
  if (iuplua_opencall_internal(L))
    IupWebBrowserOpen();
    
  iuplua_get_env(L);
  iupwebbrowserlua_open(L);
  return 0;
}
Beispiel #7
0
int iupimlua_open(lua_State *L)
{
  iuplua_get_env(L);
  iuplua_register(L, LoadImage, "LoadImage");
  iuplua_register(L, SaveImage, "SaveImage");
  iuplua_register(L, GetNativeHandleImage, "GetNativeHandleImage");
  iuplua_register(L, GetImageNativeHandle, "GetImageNativeHandle");
  iuplua_register(L, ImageFromImImage, "ImageFromImImage");
  return 0; /* nothing in stack */
}
Beispiel #8
0
int iup_scintillalua_open(lua_State* L)
{
  if (iuplua_opencall_internal(L))
    IupScintillaOpen();
    
  iuplua_get_env(L);
  iupscintillalua_open(L);
  iupscintilladlglua_open(L);
  return 0;
}
Beispiel #9
0
static int GLMakeCurrent(lua_State *L)
{  
   IupGLMakeCurrent(iuplua_checkihandle(L,1));

   iuplua_get_env(L);
   iuplua_regstring(L, IupGetGlobal("GL_VENDOR"), "GL_VENDOR");
   iuplua_regstring(L, IupGetGlobal("GL_RENDERER"), "GL_RENDERER");
   iuplua_regstring(L, IupGetGlobal("GL_VERSION"), "GL_VERSION");

   return 0;
}
static int GLMakeCurrent(lua_State *L)
{  
   IupGLMakeCurrent(iuplua_checkihandle(L,1));

   iuplua_get_env(L);
   iuplua_regstring(L, (const char*)glGetString(GL_VENDOR), "GL_VENDOR");
   iuplua_regstring(L, (const char*)glGetString(GL_RENDERER), "GL_RENDERER");
   iuplua_regstring(L, (const char*)glGetString(GL_VERSION), "GL_VERSION");

   return 0;
}
Beispiel #11
0
int iuplua_opencall_internal(lua_State * L)
{
  int ret = 0;
  const char* s;
  iuplua_get_env(L);
  lua_pushliteral(L,"_IUPOPEN_CALL");
  lua_gettable(L, -2);
  s = lua_tostring(L, -1);
  if (s && strcmp(s, "INTERNAL")==0)
    ret = 1;
  lua_pop(L, 2);  /* remove global table and <global table>._IUPOPEN_CALL from stack */
  return ret;
}
Beispiel #12
0
static void push_tracefunc(lua_State *L)
{
  iuplua_get_env(L);
  lua_pushstring(L, "_TRACEBACK");
  lua_gettable(L, -2);
  lua_remove(L, -2);  /* remove global table from stack */

  if (lua_isnil(L, -1))
  {
    lua_pop(L, 1);
    lua_pushcfunction(L, traceback);  /* push traceback function */
  }
}
Beispiel #13
0
/* iup.TREEREFTABLE[object at pos] = ref */
static void tree_settableref(lua_State *L, int pos, int ref)
{
  iuplua_get_env(L);
  lua_pushstring(L, "TREEREFTABLE");
  lua_gettable(L, -2);
  lua_remove(L, -2); /* remove iup table from stack */

  lua_pushvalue(L, pos);
  if(ref == LUA_NOREF)
    lua_pushnil(L);
  else
    lua_pushinteger(L, ref);
  lua_settable(L, -3);
  lua_pop(L, 1);
}
Beispiel #14
0
int iupcontrolslua_open(lua_State * L)
{
  if (iuplua_opencall_internal(L))
    IupControlsOpen();

  iuplua_get_env(L);

  iupgaugelua_open(L);
  iupmatrixlua_open(L);
  iupmasklua_open(L);
  iupdiallua_open(L);
  iupcolorbrowserlua_open(L);
  iupcellslua_open(L);
  iupcolorbarlua_open(L);
  iupmatrixlistlua_open(L);

  return 0;
}
Beispiel #15
0
void iuplua_register_lib(lua_State *L, const luaL_Reg* funcs)
{
#if LUA_VERSION_NUM < 502
  luaL_register(L, iup_globaltable, funcs);
#else
  iuplua_get_env(L);
  if (lua_istable(L, -1))
    luaL_setfuncs(L, funcs, 0);
  else
  {
    if (!lua_isnil(L, -1))
      luaL_error(L, "name conflict for module \"%s\"", iup_globaltable);

    lua_newtable(L);
    luaL_setfuncs(L, funcs, 0);
    lua_pushvalue(L, -1);
    lua_setglobal(L, iup_globaltable);
  }
#endif
}
Beispiel #16
0
/* ref = iup.TREEREFTABLE[object at pos] */
static int tree_gettableref(lua_State *L, int pos)
{
  iuplua_get_env(L);
  lua_pushstring(L, "TREEREFTABLE");
  lua_gettable(L, -2);
  lua_remove(L, -2); /* remove iup table from stack */

  lua_pushvalue(L, pos);
  lua_gettable(L, -2);
  if (lua_isnil(L, -1))
  {
    lua_pop(L, 1);
    return LUA_NOREF;
  }
  else
  {
    int ref = (int)lua_tointeger(L, -1);
    lua_pop(L, 1);
    return ref;
  }
}
int iupglcontrolslua_open(lua_State * L)
{
  if (iuplua_opencall_internal(L))
    IupGLControlsOpen();

  iuplua_get_env(L);

  iupglcanvasboxlua_open(L);
  iupglsubcanvaslua_open(L);
  iupgllabellua_open(L);
  iupglbuttonlua_open(L);
  iupglexpanderlua_open(L);
  iupglframelua_open(L);
  iupgllinklua_open(L);
  iupglprogressbarlua_open(L);
  iupglseparatorlua_open(L);
  iupglsizeboxlua_open(L);
  iupgltogglelua_open(L);
  iupglvallua_open(L); 
  iupglscrollboxlua_open(L); 

  return 0;
}