/
luainterface.h
55 lines (42 loc) · 976 Bytes
/
luainterface.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
#pragma once
extern "C"
{
#include "lua.h"
#include "lualib.h"
#include "lauxlib.h"
}
#include <iostream>
#include <QMetaObject>
#include <QMetaMethod>
#include <QObject>
#include <QMainWindow>
#include <QFile>
#include <QTextStream>
#include <QtUiTools/QUiLoader>
#include <QCoreApplication>
#include "lua/luaqobject.h"
#include "lua-intf/LuaIntf/LuaIntf.h"
#include "cad/lualibrecadbridge.h"
#include "lua/qtbridge.h"
class LuaInterface {
public:
LuaInterface();
~LuaInterface();
void initLua();
bool luaConnect(
QObject* sender,
std::string signalName,
LuaIntf::LuaRef slot
);
bool qtConnect(QObject* sender,
std::string signalName,
QObject* receiver,
std::string slotName);
void cleanInvalidQObject();
static std::shared_ptr<QWidget> loadUiFile(const char* fileName);
void hideUI(bool hidden);
LuaIntf::LuaState luaState();
private:
LuaIntf::LuaState _L;
std::vector<LuaQObject_SPtr> _luaQObjects;
};