270 lines
9.9 KiB
C#
270 lines
9.9 KiB
C#
#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 BFBFTouchSelectableWrap
|
|
{
|
|
public static void __Register(RealStatePtr L)
|
|
{
|
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
System.Type type = typeof(BF.BFTouchSelectable);
|
|
Utils.BeginObjectRegister(type, L, translator, 0, 0, 7, 5);
|
|
|
|
|
|
|
|
Utils.RegisterFunc(L, Utils.GETTER_IDX, "OnEvent", _g_get_OnEvent);
|
|
Utils.RegisterFunc(L, Utils.GETTER_IDX, "OnSelectGesture", _g_get_OnSelectGesture);
|
|
Utils.RegisterFunc(L, Utils.GETTER_IDX, "IsSelected", _g_get_IsSelected);
|
|
Utils.RegisterFunc(L, Utils.GETTER_IDX, "IsLongSelected", _g_get_IsLongSelected);
|
|
Utils.RegisterFunc(L, Utils.GETTER_IDX, "allowMutiFingers", _g_get_allowMutiFingers);
|
|
Utils.RegisterFunc(L, Utils.GETTER_IDX, "allowOutOfRange", _g_get_allowOutOfRange);
|
|
Utils.RegisterFunc(L, Utils.GETTER_IDX, "longHitTime", _g_get_longHitTime);
|
|
|
|
Utils.RegisterFunc(L, Utils.SETTER_IDX, "OnEvent", _s_set_OnEvent);
|
|
Utils.RegisterFunc(L, Utils.SETTER_IDX, "OnSelectGesture", _s_set_OnSelectGesture);
|
|
Utils.RegisterFunc(L, Utils.SETTER_IDX, "allowMutiFingers", _s_set_allowMutiFingers);
|
|
Utils.RegisterFunc(L, Utils.SETTER_IDX, "allowOutOfRange", _s_set_allowOutOfRange);
|
|
Utils.RegisterFunc(L, Utils.SETTER_IDX, "longHitTime", _s_set_longHitTime);
|
|
|
|
|
|
Utils.EndObjectRegister(type, L, translator, null, null,
|
|
null, null, null);
|
|
|
|
Utils.BeginClassRegister(type, L, __CreateInstance, 1, 0, 0);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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)
|
|
{
|
|
|
|
var gen_ret = new BF.BFTouchSelectable();
|
|
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 BF.BFTouchSelectable constructor!");
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
|
static int _g_get_OnEvent(RealStatePtr L)
|
|
{
|
|
try {
|
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
|
|
BF.BFTouchSelectable gen_to_be_invoked = (BF.BFTouchSelectable)translator.FastGetCSObj(L, 1);
|
|
translator.Push(L, gen_to_be_invoked.OnEvent);
|
|
} catch(System.Exception gen_e) {
|
|
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
|
}
|
|
return 1;
|
|
}
|
|
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
|
static int _g_get_OnSelectGesture(RealStatePtr L)
|
|
{
|
|
try {
|
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
|
|
BF.BFTouchSelectable gen_to_be_invoked = (BF.BFTouchSelectable)translator.FastGetCSObj(L, 1);
|
|
translator.Push(L, gen_to_be_invoked.OnSelectGesture);
|
|
} catch(System.Exception gen_e) {
|
|
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
|
}
|
|
return 1;
|
|
}
|
|
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
|
static int _g_get_IsSelected(RealStatePtr L)
|
|
{
|
|
try {
|
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
|
|
BF.BFTouchSelectable gen_to_be_invoked = (BF.BFTouchSelectable)translator.FastGetCSObj(L, 1);
|
|
LuaAPI.lua_pushboolean(L, gen_to_be_invoked.IsSelected);
|
|
} catch(System.Exception gen_e) {
|
|
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
|
}
|
|
return 1;
|
|
}
|
|
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
|
static int _g_get_IsLongSelected(RealStatePtr L)
|
|
{
|
|
try {
|
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
|
|
BF.BFTouchSelectable gen_to_be_invoked = (BF.BFTouchSelectable)translator.FastGetCSObj(L, 1);
|
|
LuaAPI.lua_pushboolean(L, gen_to_be_invoked.IsLongSelected);
|
|
} catch(System.Exception gen_e) {
|
|
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
|
}
|
|
return 1;
|
|
}
|
|
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
|
static int _g_get_allowMutiFingers(RealStatePtr L)
|
|
{
|
|
try {
|
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
|
|
BF.BFTouchSelectable gen_to_be_invoked = (BF.BFTouchSelectable)translator.FastGetCSObj(L, 1);
|
|
LuaAPI.lua_pushboolean(L, gen_to_be_invoked.allowMutiFingers);
|
|
} catch(System.Exception gen_e) {
|
|
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
|
}
|
|
return 1;
|
|
}
|
|
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
|
static int _g_get_allowOutOfRange(RealStatePtr L)
|
|
{
|
|
try {
|
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
|
|
BF.BFTouchSelectable gen_to_be_invoked = (BF.BFTouchSelectable)translator.FastGetCSObj(L, 1);
|
|
LuaAPI.lua_pushboolean(L, gen_to_be_invoked.allowOutOfRange);
|
|
} catch(System.Exception gen_e) {
|
|
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
|
}
|
|
return 1;
|
|
}
|
|
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
|
static int _g_get_longHitTime(RealStatePtr L)
|
|
{
|
|
try {
|
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
|
|
BF.BFTouchSelectable gen_to_be_invoked = (BF.BFTouchSelectable)translator.FastGetCSObj(L, 1);
|
|
LuaAPI.lua_pushnumber(L, gen_to_be_invoked.longHitTime);
|
|
} catch(System.Exception gen_e) {
|
|
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
|
}
|
|
return 1;
|
|
}
|
|
|
|
|
|
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
|
static int _s_set_OnEvent(RealStatePtr L)
|
|
{
|
|
try {
|
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
|
|
BF.BFTouchSelectable gen_to_be_invoked = (BF.BFTouchSelectable)translator.FastGetCSObj(L, 1);
|
|
gen_to_be_invoked.OnEvent = (BF.BFEvent<BF.SelectEventType, BF.BFFinger>)translator.GetObject(L, 2, typeof(BF.BFEvent<BF.SelectEventType, BF.BFFinger>));
|
|
|
|
} catch(System.Exception gen_e) {
|
|
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
|
}
|
|
return 0;
|
|
}
|
|
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
|
static int _s_set_OnSelectGesture(RealStatePtr L)
|
|
{
|
|
try {
|
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
|
|
BF.BFTouchSelectable gen_to_be_invoked = (BF.BFTouchSelectable)translator.FastGetCSObj(L, 1);
|
|
gen_to_be_invoked.OnSelectGesture = (BF.BFEvent<System.Collections.Generic.List<BF.BFFinger>>)translator.GetObject(L, 2, typeof(BF.BFEvent<System.Collections.Generic.List<BF.BFFinger>>));
|
|
|
|
} catch(System.Exception gen_e) {
|
|
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
|
}
|
|
return 0;
|
|
}
|
|
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
|
static int _s_set_allowMutiFingers(RealStatePtr L)
|
|
{
|
|
try {
|
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
|
|
BF.BFTouchSelectable gen_to_be_invoked = (BF.BFTouchSelectable)translator.FastGetCSObj(L, 1);
|
|
gen_to_be_invoked.allowMutiFingers = LuaAPI.lua_toboolean(L, 2);
|
|
|
|
} catch(System.Exception gen_e) {
|
|
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
|
}
|
|
return 0;
|
|
}
|
|
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
|
static int _s_set_allowOutOfRange(RealStatePtr L)
|
|
{
|
|
try {
|
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
|
|
BF.BFTouchSelectable gen_to_be_invoked = (BF.BFTouchSelectable)translator.FastGetCSObj(L, 1);
|
|
gen_to_be_invoked.allowOutOfRange = LuaAPI.lua_toboolean(L, 2);
|
|
|
|
} catch(System.Exception gen_e) {
|
|
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
|
}
|
|
return 0;
|
|
}
|
|
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
|
static int _s_set_longHitTime(RealStatePtr L)
|
|
{
|
|
try {
|
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
|
|
BF.BFTouchSelectable gen_to_be_invoked = (BF.BFTouchSelectable)translator.FastGetCSObj(L, 1);
|
|
gen_to_be_invoked.longHitTime = (float)LuaAPI.lua_tonumber(L, 2);
|
|
|
|
} catch(System.Exception gen_e) {
|
|
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
|
}
|
|
return 0;
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
}
|