add LuaEngineAddon

This commit is contained in:
Syping 2020-05-14 14:09:07 +02:00
parent 8091a092ab
commit bf3d74fb21
12 changed files with 105 additions and 48 deletions

View File

@ -4,7 +4,7 @@
!define COMP_NAME "Syping"
!define WEB_SITE "https://luaengine.syping.de/"
!define VERSION "0.1.0.0"
!define COPYRIGHT "Copyright © 2018-2019 Syping"
!define COPYRIGHT "Copyright © 2018-2020 Syping"
!define DESCRIPTION "LuaEngine Runtime and Compiler"
!define INSTALLER_NAME "luaengine_setup.exe"
!define MAIN_APP_RUNTIME "luaengine.exe"
@ -108,25 +108,24 @@ File "luaenginec.exe"
File "LuaEngineGui.dll"
File "LuaEngineIO.dll"
File "LuaEngineOS.dll"
File "/usr/lib/gcc/x86_64-w64-mingw32/8.3-win32/libgcc_s_seh-1.dll"
File "/usr/lib/gcc/x86_64-w64-mingw32/8.3-win32/libstdc++-6.dll"
File "/opt/windev/libjpeg-turbo-latest_qt64d/bin/libjpeg-62.dll"
File "/opt/windev/qt64d-latest/bin/Qt5Core.dll"
File "/opt/windev/qt64d-latest/bin/Qt5Gui.dll"
File "/opt/windev/qt64d-latest/bin/Qt5Svg.dll"
File "/opt/windev/qt64d-latest/bin/Qt5Widgets.dll"
File "/opt/llvm-mingw/x86_64-w64-mingw32/bin/libc++.dll"
File "/opt/llvm-mingw/x86_64-w64-mingw32/bin/libunwind.dll"
File "/usr/local/lib/x86_64-w64-mingw32/qt5/bin/Qt5Core.dll"
File "/usr/local/lib/x86_64-w64-mingw32/qt5/bin/Qt5Gui.dll"
File "/usr/local/lib/x86_64-w64-mingw32/qt5/bin/Qt5Svg.dll"
File "/usr/local/lib/x86_64-w64-mingw32/qt5/bin/Qt5Widgets.dll"
SetOutPath "$INSTDIR\imageformats"
File "/opt/windev/qt64d-latest/plugins/imageformats/qgif.dll"
File "/opt/windev/qt64d-latest/plugins/imageformats/qicns.dll"
File "/opt/windev/qt64d-latest/plugins/imageformats/qico.dll"
File "/opt/windev/qt64d-latest/plugins/imageformats/qjpeg.dll"
File "/opt/windev/qt64d-latest/plugins/imageformats/qsvg.dll"
File "/opt/windev/qt64d-latest/plugins/imageformats/qtga.dll"
File "/opt/windev/qt64d-latest/plugins/imageformats/qtiff.dll"
File "/opt/windev/qt64d-latest/plugins/imageformats/qwbmp.dll"
File "/opt/windev/qt64d-latest/plugins/imageformats/qwebp.dll"
File "/usr/local/lib/x86_64-w64-mingw32/qt5/plugins/imageformats/qgif.dll"
File "/usr/local/lib/x86_64-w64-mingw32/qt5/plugins/imageformats/qicns.dll"
File "/usr/local/lib/x86_64-w64-mingw32/qt5/plugins/imageformats/qico.dll"
File "/usr/local/lib/x86_64-w64-mingw32/qt5/plugins/imageformats/qjpeg.dll"
File "/usr/local/lib/x86_64-w64-mingw32/qt5/plugins/imageformats/qsvg.dll"
File "/usr/local/lib/x86_64-w64-mingw32/qt5/plugins/imageformats/qtga.dll"
File "/usr/local/lib/x86_64-w64-mingw32/qt5/plugins/imageformats/qtiff.dll"
File "/usr/local/lib/x86_64-w64-mingw32/qt5/plugins/imageformats/qwbmp.dll"
File "/usr/local/lib/x86_64-w64-mingw32/qt5/plugins/imageformats/qwebp.dll"
SetOutPath "$INSTDIR\platforms"
File "/opt/windev/qt64d-latest/plugins/platforms/qwindows.dll"
File "/usr/local/lib/x86_64-w64-mingw32/qt5/plugins/platforms/qwindows.dll"
SetOutPath "$INSTDIR\scripts"
File "scripts/luaenginec.lea"
File "scripts/luaenginert.lea"
@ -134,9 +133,9 @@ SetOutPath "$INSTDIR\sstubs"
File "sstubs/windows.json"
File "windows.le"
SetOutPath "$INSTDIR\styles"
File "/opt/windev/qt64d-latest/plugins/styles/qcleanlooksstyle.dll"
File "/opt/windev/qt64d-latest/plugins/styles/qplastiquestyle.dll"
File "/opt/windev/qt64d-latest/plugins/styles/qwindowsvistastyle.dll"
File "/usr/local/lib/x86_64-w64-mingw32/qt5/plugins/styles/qcleanlooksstyle.dll"
File "/usr/local/lib/x86_64-w64-mingw32/qt5/plugins/styles/qplastiquestyle.dll"
File "/usr/local/lib/x86_64-w64-mingw32/qt5/plugins/styles/qwindowsvistastyle.dll"
SectionEnd
######################################################################
@ -195,9 +194,8 @@ Delete "$INSTDIR\luaenginec.exe"
Delete "$INSTDIR\LuaEngineGui.dll"
Delete "$INSTDIR\LuaEngineIO.dll"
Delete "$INSTDIR\LuaEngineOS.dll"
Delete "$INSTDIR\libgcc_s_seh-1.dll"
Delete "$INSTDIR\libstdc++-6.dll"
Delete "$INSTDIR\libjpeg-62.dll"
Delete "$INSTDIR\libc++.dll"
Delete "$INSTDIR\libunwind.dll"
Delete "$INSTDIR\Qt5Core.dll"
Delete "$INSTDIR\Qt5Gui.dll"
Delete "$INSTDIR\Qt5Svg.dll"

View File

@ -5,7 +5,7 @@ stages:
LuaEngine Windows:
stage: runtime
image: syping/qt5-shared-mingw-openssl:5.12.8
image: syping/qt5-shared-llvm-mingw:5.12.8
variables:
QT_SELECT: "qt5-x86_64-w64-mingw32"
script:
@ -63,7 +63,7 @@ LuaEngine Debian armhf:
LuaEngine PE Windows:
stage: portable
image: syping/qt5-static-mingw-openssl:5.12.8
image: syping/qt5-static-llvm-mingw:5.12.8
variables:
QT_SELECT: "qt5-x86_64-w64-mingw32"
script:
@ -79,7 +79,7 @@ LuaEngine PE Windows:
LuaEngine Setup:
stage: deploy
image: syping/qt5-shared-mingw-openssl:5.12.8
image: syping/qt5-shared-llvm-mingw:5.12.8
script:
- apt-get update -qq
- apt-get install nsis -qq

View File

@ -53,6 +53,6 @@ win32 {
RC_ICONS = ../../res/lua.ico
QMAKE_TARGET_COMPANY = "Syping"
QMAKE_TARGET_DESCRIPTION = "LuaEngine Runtime"
QMAKE_TARGET_COPYRIGHT = "Copyright (c) 2019 Syping"
QMAKE_TARGET_COPYRIGHT = "Copyright (c) 2019-2020 Syping"
QMAKE_TARGET_PRODUCT = "luaengine"
}

View File

@ -51,6 +51,6 @@ win32 {
RC_ICONS = ../../res/lua.ico
QMAKE_TARGET_COMPANY = "Syping"
QMAKE_TARGET_DESCRIPTION = "LuaEngine Compiler"
QMAKE_TARGET_COPYRIGHT = "Copyright (c) 2019 Syping"
QMAKE_TARGET_COPYRIGHT = "Copyright (c) 2019-2020 Syping"
QMAKE_TARGET_PRODUCT = "luaenginec"
}

View File

@ -0,0 +1,70 @@
/*****************************************************************************
* luaEngine Lua Engine for Qt
* Copyright (C) 2018-2020 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 LUAENGINEADDON_H
#define LUAENGINEADDON_H
#include "LuaEngine_global.h"
#include "LuaEngine.h"
class LUAENGINESHARED_EXPORT LuaEngineAddon : public QObject
{
Q_OBJECT
public:
static void pushFunction(lua_State *L_p, const char *name, lua_CFunction function) {
LuaEngine::pushFunction(L_p, name, function);
}
static void pushPointer(lua_State *L_p, const char *name, void *pointer) {
LuaEngine::pushPointer(L_p, name, pointer);
}
static void pushPointer(lua_State *L_p, void *pointer) {
LuaEngine::pushPointer(L_p, pointer);
}
static void pushVariant(lua_State *L_p, const char *name, const QVariant &variant) {
LuaEngine::pushVariant(L_p, name, variant);
}
static void pushVariant(lua_State *L_p, const QVariant &variant) {
LuaEngine::pushVariant(L_p, variant);
}
static QVariant getVariant(lua_State *L_p, const char *name) {
return LuaEngine::getVariant(L_p, name);
}
static QVariant getVariant(lua_State *L_p, int index) {
return LuaEngine::getVariant(L_p, index);
}
static void* returnPointer(lua_State *L_p) {
return LuaEngine::returnPointer(L_p);
}
static void* getPointer(lua_State *L_p, const char* name) {
return LuaEngine::getPointer(L_p, name);
}
static void* getPointer(lua_State *L_p, int index) {
return LuaEngine::getPointer(L_p, index);
}
static QVariant returnVariant(lua_State *L_p) {
return LuaEngine::returnVariant(L_p);
}
static QVariantList getArguments(lua_State *L_p) {
return LuaEngine::getArguments(L_p);
}
static int getArgumentCount(lua_State *L_p) {
return LuaEngine::getArgumentCount(L_p);
}
};
#endif // LUAENGINEADDON_H

View File

@ -43,6 +43,7 @@ HEADERS += \
luaengine/LuaEngine.h \
luaengine/LuaEngine_global.h \
luaengine/LuaEngine_macro.h \
luaengine/LuaEngineAddon.h \
luaengine/LuaEngineRegistry.h
SOURCES += \
@ -116,6 +117,6 @@ win32 {
RC_LANG = 0x0
QMAKE_TARGET_COMPANY = "Syping"
QMAKE_TARGET_DESCRIPTION = "LuaEngine Library"
QMAKE_TARGET_COPYRIGHT = "Copyright (c) 2018-2019 Syping"
QMAKE_TARGET_COPYRIGHT = "Copyright (c) 2018-2020 Syping"
QMAKE_TARGET_PRODUCT = "LuaEngine"
}

View File

@ -55,6 +55,6 @@ win32 {
RC_LANG = 0x0
QMAKE_TARGET_COMPANY = "Syping"
QMAKE_TARGET_DESCRIPTION = "LuaEngine Gui Library"
QMAKE_TARGET_COPYRIGHT = "Copyright (c) 2018-2019 Syping"
QMAKE_TARGET_COPYRIGHT = "Copyright (c) 2018-2020 Syping"
QMAKE_TARGET_PRODUCT = "LuaEngineGui"
}

View File

@ -32,12 +32,6 @@
#include "unistd.h"
#endif
LuaEngineIO::LuaEngineIO(QObject *parent, bool loadBaseLibraries) : LuaEngine(parent, loadBaseLibraries)
{
L = luaState();
pushClass(L);
}
void LuaEngineIO::pushClass(lua_State *L_p)
{
// Directory

View File

@ -19,17 +19,17 @@
#define LUAENGINEIO_H
#include "LuaEngineIO_global.h"
#include "LuaEngineAddon.h"
#include "LuaEngine.h"
#include <QJsonValueRef>
#include <QJsonValue>
#include <QString>
#include <QObject>
class LUAENGINEIOSHARED_EXPORT LuaEngineIO : public LuaEngine
class LUAENGINEIOSHARED_EXPORT LuaEngineIO : public LuaEngineAddon
{
Q_OBJECT
public:
LuaEngineIO(QObject *parent = nullptr, bool loadBaseLibraries = true);
static void pushClass(lua_State *L_p);
static void pushClass(LuaEngine *luaEngine);
static int checkDirectoryExists(lua_State *L_p);

View File

@ -55,6 +55,6 @@ win32 {
RC_LANG = 0x0
QMAKE_TARGET_COMPANY = "Syping"
QMAKE_TARGET_DESCRIPTION = "LuaEngine I/O Library"
QMAKE_TARGET_COPYRIGHT = "Copyright (c) 2019 Syping"
QMAKE_TARGET_COPYRIGHT = "Copyright (c) 2019-2020 Syping"
QMAKE_TARGET_PRODUCT = "LuaEngineIO"
}

View File

@ -21,12 +21,6 @@
#include <QString>
#include <QObject>
LuaEngineOS::LuaEngineOS(QObject *parent, bool loadBaseLibraries) : LuaEngine(parent, loadBaseLibraries)
{
L = luaState();
pushClass(L);
}
void LuaEngineOS::pushClass(lua_State *L_p)
{
// Process

View File

@ -19,15 +19,15 @@
#define LUAENGINEOS_H
#include "LuaEngineOS_global.h"
#include "LuaEngineAddon.h"
#include "LuaEngine.h"
#include <QString>
#include <QObject>
class LUAENGINEOSSHARED_EXPORT LuaEngineOS : public LuaEngine
class LUAENGINEOSSHARED_EXPORT LuaEngineOS : public LuaEngineAddon
{
Q_OBJECT
public:
LuaEngineOS(QObject *parent = nullptr, bool loadBaseLibraries = true);
static void pushClass(lua_State *L_p);
static void pushClass(LuaEngine *luaEngine);
static int executeProcess(lua_State *L_p);