mirror of
https://gitlab.com/Syping/luaengineapp.git
synced 2025-09-10 10:46:28 +02:00
change structure
This commit is contained in:
parent
da69c259be
commit
df496eae97
73 changed files with 170 additions and 169 deletions
420
src/luaenginecore/luaengine/LuaEngine.cpp
Normal file
420
src/luaenginecore/luaengine/LuaEngine.cpp
Normal file
|
@ -0,0 +1,420 @@
|
|||
/*****************************************************************************
|
||||
* luaEngine Lua Engine for Qt
|
||||
* Copyright (C) 2018-2019 Syping
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*****************************************************************************/
|
||||
|
||||
#define LUA_LIB
|
||||
#include "LuaEngine.h"
|
||||
#include <QTextStream>
|
||||
#include <QMetaMethod>
|
||||
#include <QtGlobal>
|
||||
#include <QDebug>
|
||||
|
||||
LuaEngine::LuaEngine(QObject *parent, bool loadBaseLibraries) : QObject(parent)
|
||||
{
|
||||
L = luaL_newstate();
|
||||
if (loadBaseLibraries)
|
||||
luaL_openlibs(L);
|
||||
pushPointer("__LuaEngine", (void*)this);
|
||||
pushVariant("DeleteInstant", 0);
|
||||
pushVariant("DeleteLater", 1);
|
||||
pushFunction("delete", luaObjectDelete_p);
|
||||
pushFunction("getParent", luaObjectParent_p);
|
||||
pushFunction("connect", luaTriggerConnect_p);
|
||||
pushFunction("disconnect", luaTriggerDisconnect_p);
|
||||
pushFunction("luaEngineVersion", luaEngineVersion_p);
|
||||
pushFunction("luaEnginePlatform", luaEnginePlatform_p);
|
||||
}
|
||||
|
||||
LuaEngine::~LuaEngine()
|
||||
{
|
||||
lua_close(L);
|
||||
}
|
||||
|
||||
lua_State* LuaEngine::luaState()
|
||||
{
|
||||
return L;
|
||||
}
|
||||
|
||||
void LuaEngine::loadBaseLibraries()
|
||||
{
|
||||
luaL_openlibs(L);
|
||||
}
|
||||
|
||||
int LuaEngine::luaEngineVersion_p(lua_State *L_p)
|
||||
{
|
||||
pushVariant(L_p, "0.1");
|
||||
return 1;
|
||||
}
|
||||
|
||||
int LuaEngine::luaEnginePlatform_p(lua_State *L_p)
|
||||
{
|
||||
#ifdef Q_OS_ANDROID
|
||||
pushVariant(L_p, "Android");
|
||||
#elif defined(Q_OS_LINUX)
|
||||
pushVariant(L_p, "Linux");
|
||||
#elif defined(Q_OS_FREEBSD)
|
||||
pushVariant(L_p, "FreeBSD");
|
||||
#elif defined(Q_OS_OPENBSD)
|
||||
pushVariant(L_p, "OpenBSD");
|
||||
#elif defined(Q_OS_MACOS)
|
||||
pushVariant(L_p, "macOS");
|
||||
#elif defined(Q_OS_DARWIN)
|
||||
pushVariant(L_p, "Darwin");
|
||||
#elif defined(Q_OS_UNIX)
|
||||
pushVariant(L_p, "Unix");
|
||||
#elif defined(Q_OS_WIN)
|
||||
pushVariant(L_p, "Windows");
|
||||
#else
|
||||
pushVariant(L_p, "Unknown");
|
||||
#endif
|
||||
return 1;
|
||||
}
|
||||
|
||||
bool LuaEngine::executeLuaScript(const QByteArray &data)
|
||||
{
|
||||
int result = luaL_loadbuffer(L, data.data(), data.size(), "script");
|
||||
if (result == 0)
|
||||
return (lua_pcall(L, 0, LUA_MULTRET, 0) == 0) ? true : false;
|
||||
return false;
|
||||
}
|
||||
|
||||
bool LuaEngine::executeLuaScript(QIODevice *device, bool closeDevice)
|
||||
{
|
||||
QByteArray data;
|
||||
if (!device->isOpen()) {
|
||||
if (device->open(QIODevice::ReadOnly)) {
|
||||
data = device->readAll();
|
||||
if (closeDevice)
|
||||
device->close();
|
||||
return executeLuaScript(data);
|
||||
}
|
||||
}
|
||||
else {
|
||||
data = device->readAll();
|
||||
if (closeDevice)
|
||||
device->close();
|
||||
return executeLuaScript(data);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
bool LuaEngine::executeLuaFunction(const char *name, bool requireReturn)
|
||||
{
|
||||
return executeLuaFunction(L, name, requireReturn);
|
||||
}
|
||||
|
||||
bool LuaEngine::executeLuaFunction(lua_State *L_p, const char *name, bool requireReturn)
|
||||
{
|
||||
int returnCount = (requireReturn) ? LUA_MULTRET : 0;
|
||||
lua_getglobal(L_p, name);
|
||||
return (lua_pcall(L_p, 0, returnCount, 0) == 0) ? true : false;
|
||||
}
|
||||
|
||||
bool LuaEngine::executeLuaFunction(const char *name, const QVariant &argument, bool requireReturn)
|
||||
{
|
||||
return executeLuaFunction(L, name, argument, requireReturn);
|
||||
}
|
||||
|
||||
bool LuaEngine::executeLuaFunction(lua_State *L_p, const char *name, const QVariant &argument, bool requireReturn)
|
||||
{
|
||||
int returnCount = (requireReturn) ? LUA_MULTRET : 0;
|
||||
lua_getglobal(L_p, name);
|
||||
pushVariant(L_p, argument);
|
||||
return (lua_pcall(L_p, 1, returnCount, 0) == 0) ? true : false;
|
||||
}
|
||||
|
||||
bool LuaEngine::executeLuaFunction(const char *name, const QVariantList &args, bool requireReturn)
|
||||
{
|
||||
return executeLuaFunction(L, name, args, requireReturn);
|
||||
}
|
||||
|
||||
bool LuaEngine::executeLuaFunction(lua_State *L_p, const char *name, const QVariantList &args, bool requireReturn)
|
||||
{
|
||||
int returnCount = (requireReturn) ? LUA_MULTRET : 0;
|
||||
lua_getglobal(L_p, name);
|
||||
for (const QVariant &argument : args) {
|
||||
pushVariant(L_p, argument);
|
||||
}
|
||||
return (lua_pcall(L_p, args.count(), returnCount, 0) == 0) ? true : false;
|
||||
}
|
||||
|
||||
void LuaEngine::pushFunction(const char *name, lua_CFunction function)
|
||||
{
|
||||
pushFunction(L, name, function);
|
||||
}
|
||||
|
||||
void LuaEngine::pushFunction(lua_State *L_p, const char *name, lua_CFunction function)
|
||||
{
|
||||
lua_pushcfunction(L_p, function);
|
||||
lua_setglobal(L_p, name);
|
||||
}
|
||||
|
||||
void LuaEngine::pushPointer(const char *name, void *pointer)
|
||||
{
|
||||
pushPointer(L, name, pointer);
|
||||
}
|
||||
|
||||
void LuaEngine::pushPointer(lua_State *L_p, const char *name, void *pointer)
|
||||
{
|
||||
pushPointer(L_p, pointer);
|
||||
lua_setglobal(L_p, name);
|
||||
}
|
||||
|
||||
void LuaEngine::pushPointer(void *pointer)
|
||||
{
|
||||
pushPointer(L, pointer);
|
||||
}
|
||||
|
||||
void LuaEngine::pushPointer(lua_State *L_p, void *pointer)
|
||||
{
|
||||
lua_pushlightuserdata(L_p, pointer);
|
||||
}
|
||||
|
||||
void LuaEngine::pushVariant(const char *name, const QVariant &variant)
|
||||
{
|
||||
pushVariant(L, name, variant);
|
||||
}
|
||||
|
||||
void LuaEngine::pushVariant(lua_State *L_p, const char *name, const QVariant &variant)
|
||||
{
|
||||
pushVariant(L_p, variant);
|
||||
lua_setglobal(L_p, name);
|
||||
}
|
||||
|
||||
void LuaEngine::pushVariant(const QVariant &variant)
|
||||
{
|
||||
pushVariant(L, variant);
|
||||
}
|
||||
|
||||
void LuaEngine::pushVariant(lua_State *L_p, const QVariant &variant)
|
||||
{
|
||||
if (variant.type() == QVariant::Bool) {
|
||||
lua_pushboolean(L_p, variant.toBool());
|
||||
}
|
||||
else if (variant.type() == QVariant::Int) {
|
||||
lua_pushinteger(L_p, variant.toInt());
|
||||
}
|
||||
else if (variant.type() == QVariant::Double) {
|
||||
lua_pushnumber(L_p, variant.toDouble());
|
||||
}
|
||||
else if (variant.type() == QVariant::String) {
|
||||
lua_pushstring(L_p, variant.toString().toUtf8().data());
|
||||
}
|
||||
else if (variant.type() == QVariant::StringList) {
|
||||
QStringList stringList = variant.toStringList();
|
||||
lua_createtable(L_p, 0, stringList.count());
|
||||
int currentId = 1;
|
||||
for (const QString &string : stringList) {
|
||||
lua_pushnumber(L_p, currentId);
|
||||
lua_pushstring(L_p, string.toUtf8().data());
|
||||
lua_settable(L_p, -3);
|
||||
currentId++;
|
||||
}
|
||||
}
|
||||
else if ((QMetaType::Type)variant.type() == QMetaType::Void || (QMetaType::Type)variant.type() == QMetaType::VoidStar) {
|
||||
lua_pushlightuserdata(L_p, variant.value<void*>());
|
||||
}
|
||||
else {
|
||||
lua_pushnil(L_p);
|
||||
}
|
||||
}
|
||||
|
||||
QVariant LuaEngine::getVariant(const char *name)
|
||||
{
|
||||
lua_getglobal(L, name);
|
||||
return returnVariant();
|
||||
}
|
||||
|
||||
QVariant LuaEngine::getVariant(lua_State *L_p, const char *name)
|
||||
{
|
||||
lua_getglobal(L_p, name);
|
||||
return returnVariant(L_p);
|
||||
}
|
||||
|
||||
QVariant LuaEngine::getVariant(int index)
|
||||
{
|
||||
return getVariant(L, index);
|
||||
}
|
||||
|
||||
QVariant LuaEngine::getVariant(lua_State *L_p, int index)
|
||||
{
|
||||
if (lua_isboolean(L_p, index)) {
|
||||
return QVariant::fromValue((bool)lua_toboolean(L_p, index));
|
||||
}
|
||||
else if (lua_isinteger(L_p, index)) {
|
||||
return QVariant::fromValue(lua_tointeger(L_p, index));
|
||||
}
|
||||
else if (lua_isnumber(L_p, index)) {
|
||||
return QVariant::fromValue(lua_tonumber(L_p, index));
|
||||
}
|
||||
else if (lua_isstring(L_p, index)) {
|
||||
return QVariant::fromValue(QString(lua_tostring(L_p, index)));
|
||||
}
|
||||
else if (lua_isuserdata(L_p, index)) {
|
||||
return QVariant::fromValue(lua_touserdata(L_p, index));
|
||||
}
|
||||
else if (lua_isnoneornil(L_p, index)) {
|
||||
return QVariant();
|
||||
}
|
||||
QTextStream(stderr) << "Warning: Didn't catch lua_isnoneornil before empty QVariant got returned" << endl;
|
||||
return QVariant();
|
||||
}
|
||||
|
||||
void* LuaEngine::returnPointer()
|
||||
{
|
||||
return returnPointer(L);
|
||||
}
|
||||
|
||||
void* LuaEngine::returnPointer(lua_State *L_p)
|
||||
{
|
||||
return getPointer(L_p, -1);
|
||||
}
|
||||
|
||||
void* LuaEngine::getPointer(const char *name)
|
||||
{
|
||||
lua_getglobal(L, name);
|
||||
return returnPointer();
|
||||
}
|
||||
|
||||
void* LuaEngine::getPointer(lua_State *L_p, const char *name)
|
||||
{
|
||||
lua_getglobal(L_p, name);
|
||||
return returnPointer(L_p);
|
||||
}
|
||||
|
||||
void* LuaEngine::getPointer(int index)
|
||||
{
|
||||
return getPointer(L, index);
|
||||
}
|
||||
|
||||
void* LuaEngine::getPointer(lua_State *L_p, int index)
|
||||
{
|
||||
return lua_touserdata(L_p, index);
|
||||
}
|
||||
|
||||
QVariant LuaEngine::returnVariant()
|
||||
{
|
||||
return returnVariant(L);
|
||||
}
|
||||
|
||||
QVariant LuaEngine::returnVariant(lua_State *L_p)
|
||||
{
|
||||
return getVariant(L_p, -1);
|
||||
}
|
||||
|
||||
QVariantList LuaEngine::getArguments(lua_State *L_p)
|
||||
{
|
||||
QVariantList arguments;
|
||||
int argumentCount = getArgumentCount(L_p);
|
||||
for (int i = 1; i < (argumentCount + 1); i++) {
|
||||
arguments << getVariant(L_p, i);
|
||||
}
|
||||
return arguments;
|
||||
}
|
||||
|
||||
int LuaEngine::getArgumentCount(lua_State *L_p)
|
||||
{
|
||||
return lua_gettop(L_p);
|
||||
}
|
||||
|
||||
int LuaEngine::luaObjectDelete_p(lua_State *L_p)
|
||||
{
|
||||
if (getArgumentCount(L_p) >= 1) {
|
||||
void *pointer = getPointer(L_p, 1);
|
||||
if (pointer != NULL) {
|
||||
switch (getVariant(L_p, 2).toInt())
|
||||
{
|
||||
case 1:
|
||||
((QObject*)pointer)->deleteLater();
|
||||
break;
|
||||
default:
|
||||
delete ((QObject*)pointer);
|
||||
}
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
int LuaEngine::luaObjectParent_p(lua_State *L_p)
|
||||
{
|
||||
if (getArgumentCount(L_p) >= 1) {
|
||||
void *pointer = getPointer(L_p, 1);
|
||||
if (pointer != NULL) {
|
||||
pushPointer(L_p, ((QObject*)pointer)->parent());
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
int LuaEngine::luaTriggerConnect_p(lua_State *L_p)
|
||||
{
|
||||
if (getArgumentCount(L_p) >= 3) {
|
||||
void *pointer = getPointer(L_p, 1);
|
||||
if (pointer != NULL) {
|
||||
QObject *object = (QObject*)pointer;
|
||||
QString signalString = getVariant(L_p, 2).toString();
|
||||
int signalIndex = object->metaObject()->indexOfSignal(signalString.toUtf8().data());
|
||||
if (signalIndex != -1) {
|
||||
LuaEngine *engine = (LuaEngine*)getPointer(L_p, "__LuaEngine");
|
||||
int slotIndex = engine->metaObject()->indexOfSlot("luaTriggerSlot_p()");
|
||||
if (slotIndex != -1) {
|
||||
QMetaMethod signal = object->metaObject()->method(signalIndex);
|
||||
QMetaMethod slot = engine->metaObject()->method(slotIndex);
|
||||
QString funcStorage;
|
||||
QTextStream(&funcStorage) << "__ConnectFunc_" << object << "_" << signal.name();
|
||||
pushVariant(L_p, funcStorage.toUtf8().data(), getVariant(L_p, 3).toString());
|
||||
QObject::connect(object, signal, engine, slot);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
int LuaEngine::luaTriggerDisconnect_p(lua_State *L_p)
|
||||
{
|
||||
if (getArgumentCount(L_p) >= 2) {
|
||||
void *pointer = getPointer(L_p, 1);
|
||||
if (pointer != NULL) {
|
||||
QObject *object = (QObject*)pointer;
|
||||
QString signalString = getVariant(L_p, 2).toString();
|
||||
int signalIndex = object->metaObject()->indexOfSignal(signalString.toUtf8().data());
|
||||
if (signalIndex != -1) {
|
||||
LuaEngine *engine = (LuaEngine*)getPointer(L_p, "__LuaEngine");
|
||||
int slotIndex = engine->metaObject()->indexOfSlot("luaTriggerSlot_p()");
|
||||
if (slotIndex != -1) {
|
||||
QMetaMethod signal = object->metaObject()->method(signalIndex);
|
||||
QMetaMethod slot = engine->metaObject()->method(slotIndex);
|
||||
QString funcStorage;
|
||||
QTextStream(&funcStorage) << "__ConnectFunc_" << object << "_" << signal.name();
|
||||
pushVariant(L_p, funcStorage.toUtf8().data(), QVariant());
|
||||
QObject::disconnect(object, signal, engine, slot);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
void LuaEngine::luaTriggerSlot_p()
|
||||
{
|
||||
QMetaMethod signal = sender()->metaObject()->method(senderSignalIndex());
|
||||
QString funcStorage;
|
||||
QTextStream(&funcStorage) << "__ConnectFunc_" << sender() << "_" << signal.name();
|
||||
QString luaConnectFunc = getVariant(funcStorage.toUtf8().data()).toString();
|
||||
executeLuaFunction(luaConnectFunc.toUtf8().data(), QVariant::fromValue((void*)sender()));
|
||||
}
|
88
src/luaenginecore/luaengine/LuaEngine.h
Normal file
88
src/luaenginecore/luaengine/LuaEngine.h
Normal file
|
@ -0,0 +1,88 @@
|
|||
/*****************************************************************************
|
||||
* luaEngine Lua Engine for Qt
|
||||
* Copyright (C) 2018-2019 Syping
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*****************************************************************************/
|
||||
|
||||
#ifndef LUAENGINE_H
|
||||
#define LUAENGINE_H
|
||||
|
||||
#include "LuaEngine_global.h"
|
||||
#include <QVariantList>
|
||||
#include <QByteArray>
|
||||
#include <QIODevice>
|
||||
#include <QVariant>
|
||||
#include <QString>
|
||||
#include <QObject>
|
||||
extern "C" {
|
||||
#include "../lua/lua.h"
|
||||
#include "../lua/lualib.h"
|
||||
#include "../lua/lauxlib.h"
|
||||
}
|
||||
|
||||
class LUAENGINESHARED_EXPORT LuaEngine : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
LuaEngine(QObject *parent = nullptr, bool loadBaseLibraries = true);
|
||||
~LuaEngine();
|
||||
lua_State* luaState();
|
||||
void loadBaseLibraries();
|
||||
bool executeLuaScript(const QByteArray &data);
|
||||
bool executeLuaScript(QIODevice *device, bool closeDevice = true);
|
||||
bool executeLuaFunction(const char *name, bool requireReturn = false);
|
||||
static bool executeLuaFunction(lua_State *L_p, const char *name, bool requireReturn = false);
|
||||
bool executeLuaFunction(const char *name, const QVariant &argument, bool requireReturn = false);
|
||||
static bool executeLuaFunction(lua_State *L_p, const char *name, const QVariant &argument, bool requireReturn = false);
|
||||
bool executeLuaFunction(const char *name, const QVariantList &args, bool requireReturn = false);
|
||||
static bool executeLuaFunction(lua_State *L_p, const char *name, const QVariantList &args, bool requireReturn = false);
|
||||
void pushFunction(const char *name, lua_CFunction function);
|
||||
static void pushFunction(lua_State *L_p, const char *name, lua_CFunction function);
|
||||
void pushPointer(const char *name, void *pointer);
|
||||
static void pushPointer(lua_State *L_p, const char *name, void *pointer);
|
||||
void pushPointer(void *pointer);
|
||||
static void pushPointer(lua_State *L_p, void *pointer);
|
||||
void pushVariant(const char *name, const QVariant &variant);
|
||||
static void pushVariant(lua_State *L_p, const char *name, const QVariant &variant);
|
||||
void pushVariant(const QVariant &variant);
|
||||
static void pushVariant(lua_State *L_p, const QVariant &variant);
|
||||
QVariant getVariant(const char *name);
|
||||
static QVariant getVariant(lua_State *L_p, const char *name);
|
||||
QVariant getVariant(int index);
|
||||
static QVariant getVariant(lua_State *L_p, int index);
|
||||
void* returnPointer();
|
||||
static void* returnPointer(lua_State *L_p);
|
||||
void* getPointer(const char* name);
|
||||
static void* getPointer(lua_State *L_p, const char* name);
|
||||
void* getPointer(int index);
|
||||
static void* getPointer(lua_State *L_p, int index);
|
||||
QVariant returnVariant();
|
||||
static QVariant returnVariant(lua_State *L_p);
|
||||
static QVariantList getArguments(lua_State *L_p);
|
||||
static int getArgumentCount(lua_State *L_p);
|
||||
|
||||
private:
|
||||
lua_State *L;
|
||||
static int luaEngineVersion_p(lua_State *L_p);
|
||||
static int luaEnginePlatform_p(lua_State *L_p);
|
||||
static int luaObjectDelete_p(lua_State *L_p);
|
||||
static int luaObjectParent_p(lua_State *L_p);
|
||||
static int luaTriggerConnect_p(lua_State *L_p);
|
||||
static int luaTriggerDisconnect_p(lua_State *L_p);
|
||||
|
||||
private slots:
|
||||
void luaTriggerSlot_p();
|
||||
};
|
||||
|
||||
#endif // LUAENGINE_H
|
33
src/luaenginecore/luaengine/LuaEngine_global.h
Normal file
33
src/luaenginecore/luaengine/LuaEngine_global.h
Normal file
|
@ -0,0 +1,33 @@
|
|||
/*****************************************************************************
|
||||
* luaEngine Lua Engine for Qt
|
||||
* Copyright (C) 2018-2019 Syping
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*****************************************************************************/
|
||||
|
||||
#ifndef LUAENGINE_GLOBAL_H
|
||||
#define LUAENGINE_GLOBAL_H
|
||||
|
||||
#include <QtCore/qglobal.h>
|
||||
|
||||
#ifndef LUAENGINE_STATIC
|
||||
#ifdef LUAENGINE_LIBRARY
|
||||
#define LUAENGINESHARED_EXPORT Q_DECL_EXPORT
|
||||
#else
|
||||
#define LUAENGINESHARED_EXPORT Q_DECL_IMPORT
|
||||
#endif
|
||||
#else
|
||||
#define LUAENGINESHARED_EXPORT
|
||||
#endif
|
||||
|
||||
#endif // LUAENGINE_GLOBAL_H
|
29
src/luaenginecore/luaengine/LuaEngine_macro.h
Normal file
29
src/luaenginecore/luaengine/LuaEngine_macro.h
Normal file
|
@ -0,0 +1,29 @@
|
|||
/*****************************************************************************
|
||||
* luaEngine Lua Engine for Qt
|
||||
* Copyright (C) 2019 Syping
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*****************************************************************************/
|
||||
|
||||
#ifndef LUAENGINE_MACRO_H
|
||||
#define LUAENGINE_MACRO_H
|
||||
|
||||
#define getArguments LuaEngine::getArguments
|
||||
#define getArgumentCount LuaEngine::getArgumentCount
|
||||
#define getPointer LuaEngine::getPointer
|
||||
#define getVariant LuaEngine::getVariant
|
||||
#define pushFunction LuaEngine::pushFunction
|
||||
#define pushPointer LuaEngine::pushPointer
|
||||
#define pushVariant LuaEngine::pushVariant
|
||||
|
||||
#endif // LUAENGINE_MACRO_H
|
Loading…
Add table
Add a link
Reference in a new issue