|
|
@ -19,8 +19,9 @@
|
|
|
|
|
|
|
|
|
|
|
|
#include "nel/misc/types_nl.h"
|
|
|
|
#include "nel/misc/types_nl.h"
|
|
|
|
#include "nel/gui/lua_helper.h"
|
|
|
|
#include "nel/gui/lua_helper.h"
|
|
|
|
using namespace NLGUI;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#define IHM_LUA_METATABLE "__ui_metatable"
|
|
|
|
|
|
|
|
#define IHM_LUA_ENVTABLE "__ui_envtable"
|
|
|
|
|
|
|
|
|
|
|
|
namespace NLMISC
|
|
|
|
namespace NLMISC
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -29,6 +30,9 @@ namespace NLMISC
|
|
|
|
class CRGBA;
|
|
|
|
class CRGBA;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
namespace NLGUI
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
class CReflectable;
|
|
|
|
class CReflectable;
|
|
|
|
class CReflectedProperty;
|
|
|
|
class CReflectedProperty;
|
|
|
|
|
|
|
|
|
|
|
@ -57,12 +61,6 @@ public:
|
|
|
|
}
|
|
|
|
}
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// ***************************************************************************
|
|
|
|
|
|
|
|
#define IHM_LUA_METATABLE "__ui_metatable"
|
|
|
|
|
|
|
|
#define IHM_LUA_ENVTABLE "__ui_envtable"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// ***************************************************************************
|
|
|
|
// ***************************************************************************
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* Define Functions to export from C to LUA
|
|
|
|
* Define Functions to export from C to LUA
|
|
|
@ -128,34 +126,26 @@ public:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private:
|
|
|
|
private:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static void registerBasics(CLuaState &ls);
|
|
|
|
static void registerBasics(CLuaState &ls);
|
|
|
|
static void registerIHM(CLuaState &ls);
|
|
|
|
static void registerIHM(CLuaState &ls);
|
|
|
|
static void createLuaEnumTable(CLuaState &ls, const std::string &str);
|
|
|
|
static void createLuaEnumTable(CLuaState &ls, const std::string &str);
|
|
|
|
|
|
|
|
|
|
|
|
/// \name Exported Functions
|
|
|
|
//////////////////////////////////////////// Exported functions //////////////////////////////////////////////////////
|
|
|
|
// @{
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// LUA exported Functions with luabind
|
|
|
|
|
|
|
|
static uint32 getLocalTime();
|
|
|
|
static uint32 getLocalTime();
|
|
|
|
static double getPreciseLocalTime();
|
|
|
|
static double getPreciseLocalTime();
|
|
|
|
|
|
|
|
|
|
|
|
static std::string findReplaceAll(const std::string &str, const std::string &search, const std::string &replace);
|
|
|
|
static std::string findReplaceAll(const std::string &str, const std::string &search, const std::string &replace);
|
|
|
|
static ucstring findReplaceAll(const ucstring &str, const ucstring &search, const ucstring &replace);
|
|
|
|
static ucstring findReplaceAll(const ucstring &str, const ucstring &search, const ucstring &replace);
|
|
|
|
// just for ease of use
|
|
|
|
|
|
|
|
static ucstring findReplaceAll(const ucstring &str, const std::string &search, const std::string &replace);
|
|
|
|
static ucstring findReplaceAll(const ucstring &str, const std::string &search, const std::string &replace);
|
|
|
|
static ucstring findReplaceAll(const ucstring &str, const std::string &search, const ucstring &replace);
|
|
|
|
static ucstring findReplaceAll(const ucstring &str, const std::string &search, const ucstring &replace);
|
|
|
|
static ucstring findReplaceAll(const ucstring &str, const ucstring &search, const std::string &replace);
|
|
|
|
static ucstring findReplaceAll(const ucstring &str, const ucstring &search, const std::string &replace);
|
|
|
|
|
|
|
|
|
|
|
|
// @}
|
|
|
|
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
|
|
|
|
// Function export tools
|
|
|
|
|
|
|
|
// Function to forward lua call to C++ to a 'lua method' exported from a reflected object
|
|
|
|
|
|
|
|
static int luaMethodCall(lua_State *ls);
|
|
|
|
static int luaMethodCall(lua_State *ls);
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
#endif // NL_LUA_IHM_H
|
|
|
|
#endif // NL_LUA_IHM_H
|
|
|
|
|
|
|
|
|
|
|
|