New file |
| | |
| | | #if USE_UNI_LUA |
| | | using LuaAPI = UniLua.Lua; |
| | | using RealStatePtr = UniLua.ILuaState; |
| | | using LuaCSFunction = UniLua.CSharpFunctionDelegate; |
| | | #else |
| | | using LuaAPI = XLua.LuaDLL.Lua; |
| | | using RealStatePtr = System.IntPtr; |
| | | using LuaCSFunction = XLua.LuaDLL.lua_CSFunction; |
| | | #endif |
| | | |
| | | using XLua; |
| | | using System.Collections.Generic; |
| | | |
| | | |
| | | namespace XLua.CSObjectWrap |
| | | { |
| | | using Utils = XLua.Utils; |
| | | public class LuaWindowUtilityWrap |
| | | { |
| | | public static void __Register(RealStatePtr L) |
| | | { |
| | | ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); |
| | | System.Type type = typeof(LuaWindowUtility); |
| | | Utils.BeginObjectRegister(type, L, translator, 0, 0, 0, 0); |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | Utils.EndObjectRegister(type, L, translator, null, null, |
| | | null, null, null); |
| | | |
| | | Utils.BeginClassRegister(type, L, __CreateInstance, 8, 0, 0); |
| | | Utils.RegisterFunc(L, Utils.CLS_IDX, "Open", _m_Open_xlua_st_); |
| | | Utils.RegisterFunc(L, Utils.CLS_IDX, "OpenWithoutAnimation", _m_OpenWithoutAnimation_xlua_st_); |
| | | Utils.RegisterFunc(L, Utils.CLS_IDX, "Get", _m_Get_xlua_st_); |
| | | Utils.RegisterFunc(L, Utils.CLS_IDX, "Close", _m_Close_xlua_st_); |
| | | Utils.RegisterFunc(L, Utils.CLS_IDX, "CloseAll", _m_CloseAll_xlua_st_); |
| | | Utils.RegisterFunc(L, Utils.CLS_IDX, "DestroyWin", _m_DestroyWin_xlua_st_); |
| | | Utils.RegisterFunc(L, Utils.CLS_IDX, "CheckOpen", _m_CheckOpen_xlua_st_); |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | Utils.EndClassRegister(type, L, translator); |
| | | } |
| | | |
| | | [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] |
| | | static int __CreateInstance(RealStatePtr L) |
| | | { |
| | | |
| | | try { |
| | | ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); |
| | | if(LuaAPI.lua_gettop(L) == 1) |
| | | { |
| | | |
| | | LuaWindowUtility gen_ret = new LuaWindowUtility(); |
| | | translator.Push(L, gen_ret); |
| | | |
| | | return 1; |
| | | } |
| | | |
| | | } |
| | | catch(System.Exception gen_e) { |
| | | return LuaAPI.luaL_error(L, "c# exception:" + gen_e); |
| | | } |
| | | return LuaAPI.luaL_error(L, "invalid arguments to LuaWindowUtility constructor!"); |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] |
| | | static int _m_Open_xlua_st_(RealStatePtr L) |
| | | { |
| | | try { |
| | | |
| | | ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); |
| | | |
| | | |
| | | |
| | | int gen_param_count = LuaAPI.lua_gettop(L); |
| | | |
| | | if(gen_param_count == 3&& (LuaAPI.lua_isnil(L, 1) || LuaAPI.lua_type(L, 1) == LuaTypes.LUA_TSTRING)&& LuaTypes.LUA_TBOOLEAN == LuaAPI.lua_type(L, 2)&& LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 3)) |
| | | { |
| | | string __name = LuaAPI.lua_tostring(L, 1); |
| | | bool __forceSync = LuaAPI.lua_toboolean(L, 2); |
| | | int __functionalOrder = LuaAPI.xlua_tointeger(L, 3); |
| | | |
| | | Snxxz.UI.Window gen_ret = LuaWindowUtility.Open( __name, __forceSync, __functionalOrder ); |
| | | translator.Push(L, gen_ret); |
| | | |
| | | |
| | | |
| | | return 1; |
| | | } |
| | | if(gen_param_count == 2&& (LuaAPI.lua_isnil(L, 1) || LuaAPI.lua_type(L, 1) == LuaTypes.LUA_TSTRING)&& LuaTypes.LUA_TBOOLEAN == LuaAPI.lua_type(L, 2)) |
| | | { |
| | | string __name = LuaAPI.lua_tostring(L, 1); |
| | | bool __forceSync = LuaAPI.lua_toboolean(L, 2); |
| | | |
| | | Snxxz.UI.Window gen_ret = LuaWindowUtility.Open( __name, __forceSync ); |
| | | translator.Push(L, gen_ret); |
| | | |
| | | |
| | | |
| | | return 1; |
| | | } |
| | | if(gen_param_count == 1&& (LuaAPI.lua_isnil(L, 1) || LuaAPI.lua_type(L, 1) == LuaTypes.LUA_TSTRING)) |
| | | { |
| | | string __name = LuaAPI.lua_tostring(L, 1); |
| | | |
| | | Snxxz.UI.Window gen_ret = LuaWindowUtility.Open( __name ); |
| | | translator.Push(L, gen_ret); |
| | | |
| | | |
| | | |
| | | return 1; |
| | | } |
| | | |
| | | } catch(System.Exception gen_e) { |
| | | return LuaAPI.luaL_error(L, "c# exception:" + gen_e); |
| | | } |
| | | |
| | | return LuaAPI.luaL_error(L, "invalid arguments to LuaWindowUtility.Open!"); |
| | | |
| | | } |
| | | |
| | | [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] |
| | | static int _m_OpenWithoutAnimation_xlua_st_(RealStatePtr L) |
| | | { |
| | | try { |
| | | |
| | | ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); |
| | | |
| | | |
| | | |
| | | |
| | | { |
| | | string __name = LuaAPI.lua_tostring(L, 1); |
| | | |
| | | Snxxz.UI.Window gen_ret = LuaWindowUtility.OpenWithoutAnimation( __name ); |
| | | translator.Push(L, gen_ret); |
| | | |
| | | |
| | | |
| | | return 1; |
| | | } |
| | | |
| | | } catch(System.Exception gen_e) { |
| | | return LuaAPI.luaL_error(L, "c# exception:" + gen_e); |
| | | } |
| | | |
| | | } |
| | | |
| | | [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] |
| | | static int _m_Get_xlua_st_(RealStatePtr L) |
| | | { |
| | | try { |
| | | |
| | | ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); |
| | | |
| | | |
| | | |
| | | |
| | | { |
| | | string __name = LuaAPI.lua_tostring(L, 1); |
| | | |
| | | Snxxz.UI.Window gen_ret = LuaWindowUtility.Get( __name ); |
| | | translator.Push(L, gen_ret); |
| | | |
| | | |
| | | |
| | | return 1; |
| | | } |
| | | |
| | | } catch(System.Exception gen_e) { |
| | | return LuaAPI.luaL_error(L, "c# exception:" + gen_e); |
| | | } |
| | | |
| | | } |
| | | |
| | | [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] |
| | | static int _m_Close_xlua_st_(RealStatePtr L) |
| | | { |
| | | try { |
| | | |
| | | ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); |
| | | |
| | | |
| | | |
| | | |
| | | { |
| | | string __name = LuaAPI.lua_tostring(L, 1); |
| | | |
| | | Snxxz.UI.Window gen_ret = LuaWindowUtility.Close( __name ); |
| | | translator.Push(L, gen_ret); |
| | | |
| | | |
| | | |
| | | return 1; |
| | | } |
| | | |
| | | } catch(System.Exception gen_e) { |
| | | return LuaAPI.luaL_error(L, "c# exception:" + gen_e); |
| | | } |
| | | |
| | | } |
| | | |
| | | [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] |
| | | static int _m_CloseAll_xlua_st_(RealStatePtr L) |
| | | { |
| | | try { |
| | | |
| | | |
| | | |
| | | |
| | | { |
| | | |
| | | LuaWindowUtility.CloseAll( ); |
| | | |
| | | |
| | | |
| | | return 0; |
| | | } |
| | | |
| | | } catch(System.Exception gen_e) { |
| | | return LuaAPI.luaL_error(L, "c# exception:" + gen_e); |
| | | } |
| | | |
| | | } |
| | | |
| | | [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] |
| | | static int _m_DestroyWin_xlua_st_(RealStatePtr L) |
| | | { |
| | | try { |
| | | |
| | | |
| | | |
| | | |
| | | { |
| | | string __name = LuaAPI.lua_tostring(L, 1); |
| | | |
| | | LuaWindowUtility.DestroyWin( __name ); |
| | | |
| | | |
| | | |
| | | return 0; |
| | | } |
| | | |
| | | } catch(System.Exception gen_e) { |
| | | return LuaAPI.luaL_error(L, "c# exception:" + gen_e); |
| | | } |
| | | |
| | | } |
| | | |
| | | [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] |
| | | static int _m_CheckOpen_xlua_st_(RealStatePtr L) |
| | | { |
| | | try { |
| | | |
| | | |
| | | |
| | | |
| | | { |
| | | string __name = LuaAPI.lua_tostring(L, 1); |
| | | |
| | | bool gen_ret = LuaWindowUtility.CheckOpen( __name ); |
| | | LuaAPI.lua_pushboolean(L, gen_ret); |
| | | |
| | | |
| | | |
| | | return 1; |
| | | } |
| | | |
| | | } catch(System.Exception gen_e) { |
| | | return LuaAPI.luaL_error(L, "c# exception:" + gen_e); |
| | | } |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | } |
| | | } |