|
|
@@ -5857,191 +5857,6 @@ static int Polycore_delete_String(lua_State *L) {
|
|
|
return 0;
|
|
|
}
|
|
|
|
|
|
-static int Polycore_SDLCore(lua_State *L) {
|
|
|
- luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
|
|
|
- PolycodeViewBase * view = (PolycodeViewBase *)lua_topointer(L, 1);
|
|
|
- luaL_checktype(L, 2, LUA_TNUMBER);
|
|
|
- int xRes = lua_tointeger(L, 2);
|
|
|
- luaL_checktype(L, 3, LUA_TNUMBER);
|
|
|
- int yRes = lua_tointeger(L, 3);
|
|
|
- luaL_checktype(L, 4, LUA_TBOOLEAN);
|
|
|
- bool fullScreen = lua_toboolean(L, 4);
|
|
|
- luaL_checktype(L, 5, LUA_TNUMBER);
|
|
|
- int aaLevel = lua_tointeger(L, 5);
|
|
|
- luaL_checktype(L, 6, LUA_TNUMBER);
|
|
|
- int frameRate = lua_tointeger(L, 6);
|
|
|
- SDLCore *inst = new SDLCore(view, xRes, yRes, fullScreen, aaLevel, frameRate);
|
|
|
- lua_pushlightuserdata(L, (void*)inst);
|
|
|
- return 1;
|
|
|
-}
|
|
|
-
|
|
|
-static int Polycore_SDLCore_enableMouse(lua_State *L) {
|
|
|
- luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
|
|
|
- SDLCore *inst = (SDLCore*)lua_topointer(L, 1);
|
|
|
- luaL_checktype(L, 2, LUA_TBOOLEAN);
|
|
|
- bool newval = lua_toboolean(L, 2);
|
|
|
- inst->enableMouse(newval);
|
|
|
- return 0;
|
|
|
-}
|
|
|
-
|
|
|
-static int Polycore_SDLCore_getTicks(lua_State *L) {
|
|
|
- luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
|
|
|
- SDLCore *inst = (SDLCore*)lua_topointer(L, 1);
|
|
|
- lua_pushinteger(L, inst->getTicks());
|
|
|
- return 1;
|
|
|
-}
|
|
|
-
|
|
|
-static int Polycore_SDLCore_Update(lua_State *L) {
|
|
|
- luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
|
|
|
- SDLCore *inst = (SDLCore*)lua_topointer(L, 1);
|
|
|
- lua_pushboolean(L, inst->Update());
|
|
|
- return 1;
|
|
|
-}
|
|
|
-
|
|
|
-static int Polycore_SDLCore_setVideoMode(lua_State *L) {
|
|
|
- luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
|
|
|
- SDLCore *inst = (SDLCore*)lua_topointer(L, 1);
|
|
|
- luaL_checktype(L, 2, LUA_TNUMBER);
|
|
|
- int xRes = lua_tointeger(L, 2);
|
|
|
- luaL_checktype(L, 3, LUA_TNUMBER);
|
|
|
- int yRes = lua_tointeger(L, 3);
|
|
|
- luaL_checktype(L, 4, LUA_TBOOLEAN);
|
|
|
- bool fullScreen = lua_toboolean(L, 4);
|
|
|
- luaL_checktype(L, 5, LUA_TNUMBER);
|
|
|
- int aaLevel = lua_tointeger(L, 5);
|
|
|
- inst->setVideoMode(xRes, yRes, fullScreen, aaLevel);
|
|
|
- return 0;
|
|
|
-}
|
|
|
-
|
|
|
-static int Polycore_SDLCore_createThread(lua_State *L) {
|
|
|
- luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
|
|
|
- SDLCore *inst = (SDLCore*)lua_topointer(L, 1);
|
|
|
- luaL_checktype(L, 2, LUA_TLIGHTUSERDATA);
|
|
|
- Threaded * target = (Threaded *)lua_topointer(L, 2);
|
|
|
- inst->createThread(target);
|
|
|
- return 0;
|
|
|
-}
|
|
|
-
|
|
|
-static int Polycore_SDLCore_setCursor(lua_State *L) {
|
|
|
- luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
|
|
|
- SDLCore *inst = (SDLCore*)lua_topointer(L, 1);
|
|
|
- luaL_checktype(L, 2, LUA_TNUMBER);
|
|
|
- int cursorType = lua_tointeger(L, 2);
|
|
|
- inst->setCursor(cursorType);
|
|
|
- return 0;
|
|
|
-}
|
|
|
-
|
|
|
-static int Polycore_SDLCore_lockMutex(lua_State *L) {
|
|
|
- luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
|
|
|
- SDLCore *inst = (SDLCore*)lua_topointer(L, 1);
|
|
|
- luaL_checktype(L, 2, LUA_TLIGHTUSERDATA);
|
|
|
- CoreMutex * mutex = (CoreMutex *)lua_topointer(L, 2);
|
|
|
- inst->lockMutex(mutex);
|
|
|
- return 0;
|
|
|
-}
|
|
|
-
|
|
|
-static int Polycore_SDLCore_unlockMutex(lua_State *L) {
|
|
|
- luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
|
|
|
- SDLCore *inst = (SDLCore*)lua_topointer(L, 1);
|
|
|
- luaL_checktype(L, 2, LUA_TLIGHTUSERDATA);
|
|
|
- CoreMutex * mutex = (CoreMutex *)lua_topointer(L, 2);
|
|
|
- inst->unlockMutex(mutex);
|
|
|
- return 0;
|
|
|
-}
|
|
|
-
|
|
|
-static int Polycore_SDLCore_createMutex(lua_State *L) {
|
|
|
- luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
|
|
|
- SDLCore *inst = (SDLCore*)lua_topointer(L, 1);
|
|
|
- void *ptrRetVal = (void*)inst->createMutex();
|
|
|
- if(ptrRetVal == NULL) {
|
|
|
- lua_pushnil(L);
|
|
|
- } else {
|
|
|
- lua_pushlightuserdata(L, ptrRetVal);
|
|
|
- }
|
|
|
- return 1;
|
|
|
-}
|
|
|
-
|
|
|
-static int Polycore_SDLCore_copyStringToClipboard(lua_State *L) {
|
|
|
- luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
|
|
|
- SDLCore *inst = (SDLCore*)lua_topointer(L, 1);
|
|
|
- luaL_checktype(L, 2, LUA_TSTRING);
|
|
|
- String str = String(lua_tostring(L, 2));
|
|
|
- inst->copyStringToClipboard(str);
|
|
|
- return 0;
|
|
|
-}
|
|
|
-
|
|
|
-static int Polycore_SDLCore_getClipboardString(lua_State *L) {
|
|
|
- luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
|
|
|
- SDLCore *inst = (SDLCore*)lua_topointer(L, 1);
|
|
|
- lua_pushstring(L, inst->getClipboardString().c_str());
|
|
|
- return 1;
|
|
|
-}
|
|
|
-
|
|
|
-static int Polycore_SDLCore_createFolder(lua_State *L) {
|
|
|
- luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
|
|
|
- SDLCore *inst = (SDLCore*)lua_topointer(L, 1);
|
|
|
- luaL_checktype(L, 2, LUA_TSTRING);
|
|
|
- String folderPath = String(lua_tostring(L, 2));
|
|
|
- inst->createFolder(folderPath);
|
|
|
- return 0;
|
|
|
-}
|
|
|
-
|
|
|
-static int Polycore_SDLCore_copyDiskItem(lua_State *L) {
|
|
|
- luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
|
|
|
- SDLCore *inst = (SDLCore*)lua_topointer(L, 1);
|
|
|
- luaL_checktype(L, 2, LUA_TSTRING);
|
|
|
- String itemPath = String(lua_tostring(L, 2));
|
|
|
- luaL_checktype(L, 3, LUA_TSTRING);
|
|
|
- String destItemPath = String(lua_tostring(L, 3));
|
|
|
- inst->copyDiskItem(itemPath, destItemPath);
|
|
|
- return 0;
|
|
|
-}
|
|
|
-
|
|
|
-static int Polycore_SDLCore_moveDiskItem(lua_State *L) {
|
|
|
- luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
|
|
|
- SDLCore *inst = (SDLCore*)lua_topointer(L, 1);
|
|
|
- luaL_checktype(L, 2, LUA_TSTRING);
|
|
|
- String itemPath = String(lua_tostring(L, 2));
|
|
|
- luaL_checktype(L, 3, LUA_TSTRING);
|
|
|
- String destItemPath = String(lua_tostring(L, 3));
|
|
|
- inst->moveDiskItem(itemPath, destItemPath);
|
|
|
- return 0;
|
|
|
-}
|
|
|
-
|
|
|
-static int Polycore_SDLCore_removeDiskItem(lua_State *L) {
|
|
|
- luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
|
|
|
- SDLCore *inst = (SDLCore*)lua_topointer(L, 1);
|
|
|
- luaL_checktype(L, 2, LUA_TSTRING);
|
|
|
- String itemPath = String(lua_tostring(L, 2));
|
|
|
- inst->removeDiskItem(itemPath);
|
|
|
- return 0;
|
|
|
-}
|
|
|
-
|
|
|
-static int Polycore_SDLCore_openFolderPicker(lua_State *L) {
|
|
|
- luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
|
|
|
- SDLCore *inst = (SDLCore*)lua_topointer(L, 1);
|
|
|
- lua_pushstring(L, inst->openFolderPicker().c_str());
|
|
|
- return 1;
|
|
|
-}
|
|
|
-
|
|
|
-static int Polycore_SDLCore_resizeTo(lua_State *L) {
|
|
|
- luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
|
|
|
- SDLCore *inst = (SDLCore*)lua_topointer(L, 1);
|
|
|
- luaL_checktype(L, 2, LUA_TNUMBER);
|
|
|
- int xRes = lua_tointeger(L, 2);
|
|
|
- luaL_checktype(L, 3, LUA_TNUMBER);
|
|
|
- int yRes = lua_tointeger(L, 3);
|
|
|
- inst->resizeTo(xRes, yRes);
|
|
|
- return 0;
|
|
|
-}
|
|
|
-
|
|
|
-static int Polycore_delete_SDLCore(lua_State *L) {
|
|
|
- luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
|
|
|
- SDLCore *inst = (SDLCore*)lua_topointer(L, 1);
|
|
|
- delete inst;
|
|
|
- return 0;
|
|
|
-}
|
|
|
-
|
|
|
static int Polycore_PolycodeModule(lua_State *L) {
|
|
|
PolycodeModule *inst = new PolycodeModule();
|
|
|
lua_pushlightuserdata(L, (void*)inst);
|