c1_unity/Assets/XLua/Gen/TMPro_KerningTableWrap.cs
2023-04-03 11:04:31 +08:00

266 lines
8.7 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 TMProKerningTableWrap
{
public static void __Register(RealStatePtr L)
{
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
System.Type type = typeof(TMPro.KerningTable);
Utils.BeginObjectRegister(type, L, translator, 0, 4, 1, 1);
Utils.RegisterFunc(L, Utils.METHOD_IDX, "AddKerningPair", _m_AddKerningPair);
Utils.RegisterFunc(L, Utils.METHOD_IDX, "AddGlyphPairAdjustmentRecord", _m_AddGlyphPairAdjustmentRecord);
Utils.RegisterFunc(L, Utils.METHOD_IDX, "RemoveKerningPair", _m_RemoveKerningPair);
Utils.RegisterFunc(L, Utils.METHOD_IDX, "SortKerningPairs", _m_SortKerningPairs);
Utils.RegisterFunc(L, Utils.GETTER_IDX, "kerningPairs", _g_get_kerningPairs);
Utils.RegisterFunc(L, Utils.SETTER_IDX, "kerningPairs", _s_set_kerningPairs);
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 TMPro.KerningTable();
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 TMPro.KerningTable constructor!");
}
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
static int _m_AddKerningPair(RealStatePtr L)
{
try {
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
TMPro.KerningTable gen_to_be_invoked = (TMPro.KerningTable)translator.FastGetCSObj(L, 1);
int gen_param_count = LuaAPI.lua_gettop(L);
if(gen_param_count == 1)
{
gen_to_be_invoked.AddKerningPair( );
return 0;
}
if(gen_param_count == 4&& LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 2)&& LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 3)&& LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 4))
{
uint _first = LuaAPI.xlua_touint(L, 2);
uint _second = LuaAPI.xlua_touint(L, 3);
float _offset = (float)LuaAPI.lua_tonumber(L, 4);
var gen_ret = gen_to_be_invoked.AddKerningPair( _first, _second, _offset );
LuaAPI.xlua_pushinteger(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 TMPro.KerningTable.AddKerningPair!");
}
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
static int _m_AddGlyphPairAdjustmentRecord(RealStatePtr L)
{
try {
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
TMPro.KerningTable gen_to_be_invoked = (TMPro.KerningTable)translator.FastGetCSObj(L, 1);
{
uint _first = LuaAPI.xlua_touint(L, 2);
TMPro.GlyphValueRecord_Legacy _firstAdjustments;translator.Get(L, 3, out _firstAdjustments);
uint _second = LuaAPI.xlua_touint(L, 4);
TMPro.GlyphValueRecord_Legacy _secondAdjustments;translator.Get(L, 5, out _secondAdjustments);
var gen_ret = gen_to_be_invoked.AddGlyphPairAdjustmentRecord( _first, _firstAdjustments, _second, _secondAdjustments );
LuaAPI.xlua_pushinteger(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_RemoveKerningPair(RealStatePtr L)
{
try {
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
TMPro.KerningTable gen_to_be_invoked = (TMPro.KerningTable)translator.FastGetCSObj(L, 1);
int gen_param_count = LuaAPI.lua_gettop(L);
if(gen_param_count == 2&& LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 2))
{
int _index = LuaAPI.xlua_tointeger(L, 2);
gen_to_be_invoked.RemoveKerningPair( _index );
return 0;
}
if(gen_param_count == 3&& LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 2)&& LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 3))
{
int _left = LuaAPI.xlua_tointeger(L, 2);
int _right = LuaAPI.xlua_tointeger(L, 3);
gen_to_be_invoked.RemoveKerningPair( _left, _right );
return 0;
}
} catch(System.Exception gen_e) {
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
}
return LuaAPI.luaL_error(L, "invalid arguments to TMPro.KerningTable.RemoveKerningPair!");
}
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
static int _m_SortKerningPairs(RealStatePtr L)
{
try {
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
TMPro.KerningTable gen_to_be_invoked = (TMPro.KerningTable)translator.FastGetCSObj(L, 1);
{
gen_to_be_invoked.SortKerningPairs( );
return 0;
}
} catch(System.Exception gen_e) {
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
}
}
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
static int _g_get_kerningPairs(RealStatePtr L)
{
try {
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
TMPro.KerningTable gen_to_be_invoked = (TMPro.KerningTable)translator.FastGetCSObj(L, 1);
translator.Push(L, gen_to_be_invoked.kerningPairs);
} catch(System.Exception gen_e) {
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
}
return 1;
}
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
static int _s_set_kerningPairs(RealStatePtr L)
{
try {
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
TMPro.KerningTable gen_to_be_invoked = (TMPro.KerningTable)translator.FastGetCSObj(L, 1);
gen_to_be_invoked.kerningPairs = (System.Collections.Generic.List<TMPro.KerningPair>)translator.GetObject(L, 2, typeof(System.Collections.Generic.List<TMPro.KerningPair>));
} catch(System.Exception gen_e) {
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
}
return 0;
}
}
}