Просмотр исходного кода

Rebuild Lua API without SDLCore.

Cameron Hart 14 лет назад
Родитель
Сommit
09ca9d340e

+ 0 - 1
Bindings/Contents/LUA/API/Polycode.lua

@@ -51,7 +51,6 @@ require "Polycode/ScreenLine"
 require "Polycode/ScreenSoundListener"
 require "Polycode/ScreenSound"
 require "Polycode/String"
-require "Polycode/SDLCore"
 require "Polycode/PolycodeModule"
 require "Polycode/PolycodeViewBase"
 require "Polycode/Core"

+ 0 - 116
Bindings/Contents/LUA/API/Polycode/SDLCore.lua

@@ -1,116 +0,0 @@
-require "Polycode/Core"
-
-class "SDLCore" (Core)
-
-
-
-
-
-
-
-function SDLCore:SDLCore(...)
-	if type(arg[1]) == "table" and count(arg) == 1 then
-		if ""..arg[1]:class() == "Core" then
-			self.__ptr = arg[1].__ptr
-			return
-		end
-	end
-	for k,v in pairs(arg) do
-		if type(v) == "table" then
-			if v.__ptr ~= nil then
-				arg[k] = v.__ptr
-			end
-		end
-	end
-	if self.__ptr == nil and arg[1] ~= "__skip_ptr__" then
-		self.__ptr = Polycore.SDLCore(unpack(arg))
-		Polycore.__ptr_lookup[self.__ptr] = self
-	end
-end
-
-function SDLCore:enableMouse(newval)
-	local retVal = Polycore.SDLCore_enableMouse(self.__ptr, newval)
-end
-
-function SDLCore:getTicks()
-	local retVal =  Polycore.SDLCore_getTicks(self.__ptr)
-	return retVal
-end
-
-function SDLCore:Update()
-	local retVal =  Polycore.SDLCore_Update(self.__ptr)
-	return retVal
-end
-
-function SDLCore:setVideoMode(xRes, yRes, fullScreen, aaLevel)
-	local retVal = Polycore.SDLCore_setVideoMode(self.__ptr, xRes, yRes, fullScreen, aaLevel)
-end
-
-function SDLCore:createThread(target)
-	local retVal = Polycore.SDLCore_createThread(self.__ptr, target.__ptr)
-end
-
-function SDLCore:setCursor(cursorType)
-	local retVal = Polycore.SDLCore_setCursor(self.__ptr, cursorType)
-end
-
-function SDLCore:lockMutex(mutex)
-	local retVal = Polycore.SDLCore_lockMutex(self.__ptr, mutex.__ptr)
-end
-
-function SDLCore:unlockMutex(mutex)
-	local retVal = Polycore.SDLCore_unlockMutex(self.__ptr, mutex.__ptr)
-end
-
-function SDLCore:createMutex()
-	local retVal =  Polycore.SDLCore_createMutex(self.__ptr)
-	if retVal == nil then return nil end
-	if Polycore.__ptr_lookup[retVal] ~= nil then
-		return Polycore.__ptr_lookup[retVal]
-	else
-		Polycore.__ptr_lookup[retVal] = CoreMutex("__skip_ptr__")
-		Polycore.__ptr_lookup[retVal].__ptr = retVal
-		return Polycore.__ptr_lookup[retVal]
-	end
-end
-
-function SDLCore:copyStringToClipboard(str)
-	local retVal = Polycore.SDLCore_copyStringToClipboard(self.__ptr, str)
-end
-
-function SDLCore:getClipboardString()
-	local retVal =  Polycore.SDLCore_getClipboardString(self.__ptr)
-	return retVal
-end
-
-function SDLCore:createFolder(folderPath)
-	local retVal = Polycore.SDLCore_createFolder(self.__ptr, folderPath)
-end
-
-function SDLCore:copyDiskItem(itemPath, destItemPath)
-	local retVal = Polycore.SDLCore_copyDiskItem(self.__ptr, itemPath, destItemPath)
-end
-
-function SDLCore:moveDiskItem(itemPath, destItemPath)
-	local retVal = Polycore.SDLCore_moveDiskItem(self.__ptr, itemPath, destItemPath)
-end
-
-function SDLCore:removeDiskItem(itemPath)
-	local retVal = Polycore.SDLCore_removeDiskItem(self.__ptr, itemPath)
-end
-
-function SDLCore:openFolderPicker()
-	local retVal =  Polycore.SDLCore_openFolderPicker(self.__ptr)
-	return retVal
-end
-
-function SDLCore:resizeTo(xRes, yRes)
-	local retVal = Polycore.SDLCore_resizeTo(self.__ptr, xRes, yRes)
-end
-
-
-
-function SDLCore:__delete()
-	Polycore.__ptr_lookup[self.__ptr] = nil
-	Polycore.delete_SDLCore(self.__ptr)
-end

+ 0 - 185
Bindings/Contents/LUA/Include/PolycodeLUAWrappers.h

@@ -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);

+ 0 - 19
Bindings/Contents/LUA/Source/PolycodeLUA.cpp

@@ -623,25 +623,6 @@ int luaopen_Polycode(lua_State *L) {
 		{"String_getDataSizeWithEncoding", Polycore_String_getDataSizeWithEncoding},
 		{"String_setDataWithEncoding", Polycore_String_setDataWithEncoding},
 		{"delete_String", Polycore_delete_String},
-		{"SDLCore", Polycore_SDLCore},
-		{"SDLCore_enableMouse", Polycore_SDLCore_enableMouse},
-		{"SDLCore_getTicks", Polycore_SDLCore_getTicks},
-		{"SDLCore_Update", Polycore_SDLCore_Update},
-		{"SDLCore_setVideoMode", Polycore_SDLCore_setVideoMode},
-		{"SDLCore_createThread", Polycore_SDLCore_createThread},
-		{"SDLCore_setCursor", Polycore_SDLCore_setCursor},
-		{"SDLCore_lockMutex", Polycore_SDLCore_lockMutex},
-		{"SDLCore_unlockMutex", Polycore_SDLCore_unlockMutex},
-		{"SDLCore_createMutex", Polycore_SDLCore_createMutex},
-		{"SDLCore_copyStringToClipboard", Polycore_SDLCore_copyStringToClipboard},
-		{"SDLCore_getClipboardString", Polycore_SDLCore_getClipboardString},
-		{"SDLCore_createFolder", Polycore_SDLCore_createFolder},
-		{"SDLCore_copyDiskItem", Polycore_SDLCore_copyDiskItem},
-		{"SDLCore_moveDiskItem", Polycore_SDLCore_moveDiskItem},
-		{"SDLCore_removeDiskItem", Polycore_SDLCore_removeDiskItem},
-		{"SDLCore_openFolderPicker", Polycore_SDLCore_openFolderPicker},
-		{"SDLCore_resizeTo", Polycore_SDLCore_resizeTo},
-		{"delete_SDLCore", Polycore_delete_SDLCore},
 		{"PolycodeModule", Polycore_PolycodeModule},
 		{"PolycodeModule_getType", Polycore_PolycodeModule_getType},
 		{"delete_PolycodeModule", Polycore_delete_PolycodeModule},