feat: 将协议注释添加到代码中;初步支持内置函数的自动补充(WIP);调整 AngelScript 的字符串全局函数的命名空间为 string 而非空;
This commit is contained in:
parent
63b4583ccd
commit
4f4db8b5f8
|
@ -88,7 +88,7 @@ QEditor *QCodeCompletionEngine::editor() const { return pEdit; }
|
||||||
*/
|
*/
|
||||||
void QCodeCompletionEngine::setEditor(QEditor *e) {
|
void QCodeCompletionEngine::setEditor(QEditor *e) {
|
||||||
if (pEdit) {
|
if (pEdit) {
|
||||||
pEdit->removeAction(pForcedTrigger, "&Edit");
|
pEdit->removeAction(pForcedTrigger, tr("&Edit"));
|
||||||
// pEdit->removeEventFilter(this);
|
// pEdit->removeEventFilter(this);
|
||||||
|
|
||||||
disconnect(pEdit, SIGNAL(textEdited(QKeyEvent *)), this,
|
disconnect(pEdit, SIGNAL(textEdited(QKeyEvent *)), this,
|
||||||
|
@ -99,10 +99,9 @@ void QCodeCompletionEngine::setEditor(QEditor *e) {
|
||||||
|
|
||||||
if (pEdit) {
|
if (pEdit) {
|
||||||
// pEdit->installEventFilter(this);
|
// pEdit->installEventFilter(this);
|
||||||
pEdit->addAction(pForcedTrigger, "&Edit");
|
pEdit->addAction(pForcedTrigger, tr("&Edit"));
|
||||||
|
connect(pEdit, &QEditor::textEdited, this,
|
||||||
connect(pEdit, SIGNAL(textEdited(QKeyEvent *)), this,
|
&QCodeCompletionEngine::textEdited);
|
||||||
SLOT(textEdited(QKeyEvent *)));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -50,7 +50,7 @@ public:
|
||||||
QAction *triggerAction() const;
|
QAction *triggerAction() const;
|
||||||
|
|
||||||
QEditor *editor() const;
|
QEditor *editor() const;
|
||||||
void setEditor(QEditor *e);
|
virtual void setEditor(QEditor *e);
|
||||||
|
|
||||||
QStringList triggers() const;
|
QStringList triggers() const;
|
||||||
|
|
||||||
|
|
|
@ -303,15 +303,12 @@ set(CODEEDIT_WIDGET
|
||||||
src/qcodeeditwidget/qformatconfig.ui)
|
src/qcodeeditwidget/qformatconfig.ui)
|
||||||
|
|
||||||
set(CODE_MODEL
|
set(CODE_MODEL
|
||||||
src/codemodel/qcm-config.h
|
|
||||||
src/codemodel/qcodemodel.cpp
|
src/codemodel/qcodemodel.cpp
|
||||||
src/codemodel/qcodemodel.h
|
src/codemodel/qcodemodel.h
|
||||||
src/codemodel/qcodenode.cpp
|
src/codemodel/qcodenode.cpp
|
||||||
src/codemodel/qcodenode.h
|
src/codemodel/qcodenode.h
|
||||||
src/codemodel/qcodeproxymodel.cpp
|
src/codemodel/qcodeproxymodel.cpp
|
||||||
src/codemodel/qcodeproxymodel.h
|
src/codemodel/qcodeproxymodel.h
|
||||||
src/codemodel/qcodeserializer.cpp
|
|
||||||
src/codemodel/qcodeserializer.h
|
|
||||||
src/codemodel/qcodeview.cpp
|
src/codemodel/qcodeview.cpp
|
||||||
src/codemodel/qcodeview.h
|
src/codemodel/qcodeview.h
|
||||||
src/codemodel/qsourcecodewatcher.cpp
|
src/codemodel/qsourcecodewatcher.cpp
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -1,3 +1,20 @@
|
||||||
|
/*==============================================================================
|
||||||
|
** Copyright (C) 2024-2027 WingSummer
|
||||||
|
**
|
||||||
|
** This program is free software: you can redistribute it and/or modify it under
|
||||||
|
** the terms of the GNU Affero General Public License as published by the Free
|
||||||
|
** Software Foundation, version 3.
|
||||||
|
**
|
||||||
|
** This program is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
** ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
||||||
|
** FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
|
||||||
|
** details.
|
||||||
|
**
|
||||||
|
** You should have received a copy of the GNU Affero General Public License
|
||||||
|
** along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
** =============================================================================
|
||||||
|
*/
|
||||||
|
|
||||||
#include "angelobjstring.h"
|
#include "angelobjstring.h"
|
||||||
#include "AngelScript/sdk/add_on/datetime/datetime.h"
|
#include "AngelScript/sdk/add_on/datetime/datetime.h"
|
||||||
#include "AngelScript/sdk/add_on/scriptarray/scriptarray.h"
|
#include "AngelScript/sdk/add_on/scriptarray/scriptarray.h"
|
||||||
|
|
|
@ -1,3 +1,20 @@
|
||||||
|
/*==============================================================================
|
||||||
|
** Copyright (C) 2024-2027 WingSummer
|
||||||
|
**
|
||||||
|
** This program is free software: you can redistribute it and/or modify it under
|
||||||
|
** the terms of the GNU Affero General Public License as published by the Free
|
||||||
|
** Software Foundation, version 3.
|
||||||
|
**
|
||||||
|
** This program is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
** ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
||||||
|
** FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
|
||||||
|
** details.
|
||||||
|
**
|
||||||
|
** You should have received a copy of the GNU Affero General Public License
|
||||||
|
** along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
** =============================================================================
|
||||||
|
*/
|
||||||
|
|
||||||
#ifndef ANGELOBJSTRING_H
|
#ifndef ANGELOBJSTRING_H
|
||||||
#define ANGELOBJSTRING_H
|
#define ANGELOBJSTRING_H
|
||||||
|
|
||||||
|
|
|
@ -1,3 +1,20 @@
|
||||||
|
/*==============================================================================
|
||||||
|
** Copyright (C) 2024-2027 WingSummer
|
||||||
|
**
|
||||||
|
** This program is free software: you can redistribute it and/or modify it under
|
||||||
|
** the terms of the GNU Affero General Public License as published by the Free
|
||||||
|
** Software Foundation, version 3.
|
||||||
|
**
|
||||||
|
** This program is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
** ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
||||||
|
** FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
|
||||||
|
** details.
|
||||||
|
**
|
||||||
|
** You should have received a copy of the GNU Affero General Public License
|
||||||
|
** along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
** =============================================================================
|
||||||
|
*/
|
||||||
|
|
||||||
#ifndef ANGELSCRIPTHELPER_H
|
#ifndef ANGELSCRIPTHELPER_H
|
||||||
#define ANGELSCRIPTHELPER_H
|
#define ANGELSCRIPTHELPER_H
|
||||||
|
|
||||||
|
|
|
@ -1,3 +1,20 @@
|
||||||
|
/*==============================================================================
|
||||||
|
** Copyright (C) 2024-2027 WingSummer
|
||||||
|
**
|
||||||
|
** This program is free software: you can redistribute it and/or modify it under
|
||||||
|
** the terms of the GNU Affero General Public License as published by the Free
|
||||||
|
** Software Foundation, version 3.
|
||||||
|
**
|
||||||
|
** This program is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
** ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
||||||
|
** FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
|
||||||
|
** details.
|
||||||
|
**
|
||||||
|
** You should have received a copy of the GNU Affero General Public License
|
||||||
|
** along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
** =============================================================================
|
||||||
|
*/
|
||||||
|
|
||||||
#include "appmanager.h"
|
#include "appmanager.h"
|
||||||
|
|
||||||
#include <QFont>
|
#include <QFont>
|
||||||
|
|
|
@ -1,3 +1,20 @@
|
||||||
|
/*==============================================================================
|
||||||
|
** Copyright (C) 2024-2027 WingSummer
|
||||||
|
**
|
||||||
|
** This program is free software: you can redistribute it and/or modify it under
|
||||||
|
** the terms of the GNU Affero General Public License as published by the Free
|
||||||
|
** Software Foundation, version 3.
|
||||||
|
**
|
||||||
|
** This program is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
** ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
||||||
|
** FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
|
||||||
|
** details.
|
||||||
|
**
|
||||||
|
** You should have received a copy of the GNU Affero General Public License
|
||||||
|
** along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
** =============================================================================
|
||||||
|
*/
|
||||||
|
|
||||||
#ifndef APPMANAGER_H
|
#ifndef APPMANAGER_H
|
||||||
#define APPMANAGER_H
|
#define APPMANAGER_H
|
||||||
|
|
||||||
|
|
|
@ -1,3 +1,20 @@
|
||||||
|
/*==============================================================================
|
||||||
|
** Copyright (C) 2024-2027 WingSummer
|
||||||
|
**
|
||||||
|
** This program is free software: you can redistribute it and/or modify it under
|
||||||
|
** the terms of the GNU Affero General Public License as published by the Free
|
||||||
|
** Software Foundation, version 3.
|
||||||
|
**
|
||||||
|
** This program is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
** ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
||||||
|
** FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
|
||||||
|
** details.
|
||||||
|
**
|
||||||
|
** You should have received a copy of the GNU Affero General Public License
|
||||||
|
** along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
** =============================================================================
|
||||||
|
*/
|
||||||
|
|
||||||
#include "asbuilder.h"
|
#include "asbuilder.h"
|
||||||
|
|
||||||
#include <QDir>
|
#include <QDir>
|
||||||
|
|
|
@ -1,3 +1,20 @@
|
||||||
|
/*==============================================================================
|
||||||
|
** Copyright (C) 2024-2027 WingSummer
|
||||||
|
**
|
||||||
|
** This program is free software: you can redistribute it and/or modify it under
|
||||||
|
** the terms of the GNU Affero General Public License as published by the Free
|
||||||
|
** Software Foundation, version 3.
|
||||||
|
**
|
||||||
|
** This program is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
** ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
||||||
|
** FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
|
||||||
|
** details.
|
||||||
|
**
|
||||||
|
** You should have received a copy of the GNU Affero General Public License
|
||||||
|
** along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
** =============================================================================
|
||||||
|
*/
|
||||||
|
|
||||||
#ifndef ASBUILDER_H
|
#ifndef ASBUILDER_H
|
||||||
#define ASBUILDER_H
|
#define ASBUILDER_H
|
||||||
|
|
||||||
|
|
|
@ -1,3 +1,20 @@
|
||||||
|
/*==============================================================================
|
||||||
|
** Copyright (C) 2024-2027 WingSummer
|
||||||
|
**
|
||||||
|
** This program is free software: you can redistribute it and/or modify it under
|
||||||
|
** the terms of the GNU Affero General Public License as published by the Free
|
||||||
|
** Software Foundation, version 3.
|
||||||
|
**
|
||||||
|
** This program is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
** ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
||||||
|
** FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
|
||||||
|
** details.
|
||||||
|
**
|
||||||
|
** You should have received a copy of the GNU Affero General Public License
|
||||||
|
** along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
** =============================================================================
|
||||||
|
*/
|
||||||
|
|
||||||
#include "ascompletion.h"
|
#include "ascompletion.h"
|
||||||
|
|
||||||
#include "qasparser.h"
|
#include "qasparser.h"
|
||||||
|
@ -5,8 +22,6 @@
|
||||||
#include "qdocumentcursor.h"
|
#include "qdocumentcursor.h"
|
||||||
#include "qdocumentline.h"
|
#include "qdocumentline.h"
|
||||||
|
|
||||||
// #include "plugin.h"
|
|
||||||
|
|
||||||
#include <QDir>
|
#include <QDir>
|
||||||
#include <QLibraryInfo>
|
#include <QLibraryInfo>
|
||||||
#include <QQueue>
|
#include <QQueue>
|
||||||
|
@ -15,21 +30,28 @@
|
||||||
#include <QTimer>
|
#include <QTimer>
|
||||||
#include <QtDebug>
|
#include <QtDebug>
|
||||||
|
|
||||||
|
#include "control/qcodecompletionwidget.h"
|
||||||
|
|
||||||
|
const auto DOT_TRIGGER = QStringLiteral(".");
|
||||||
|
const auto SEMI_COLON_TRIGGER = QStringLiteral("::");
|
||||||
|
const auto LEFT_PARE_TRIGGER = QStringLiteral("(");
|
||||||
|
|
||||||
AsCompletion::AsCompletion(asIScriptEngine *engine, QObject *p)
|
AsCompletion::AsCompletion(asIScriptEngine *engine, QObject *p)
|
||||||
: QCodeCompletionEngine(p), _engine(engine) {
|
: QCodeCompletionEngine(p), parser(engine), _engine(engine),
|
||||||
|
pPopup(new QCodeCompletionWidget()) {
|
||||||
Q_ASSERT(engine);
|
Q_ASSERT(engine);
|
||||||
|
|
||||||
addTrigger(".");
|
addTrigger(DOT_TRIGGER);
|
||||||
addTrigger("::");
|
addTrigger(SEMI_COLON_TRIGGER);
|
||||||
|
|
||||||
// unleash the power of call tips
|
// unleash the power of call tips
|
||||||
addTrigger("(");
|
addTrigger(LEFT_PARE_TRIGGER);
|
||||||
}
|
}
|
||||||
|
|
||||||
AsCompletion::~AsCompletion() {}
|
AsCompletion::~AsCompletion() {}
|
||||||
|
|
||||||
QCodeCompletionEngine *AsCompletion::clone() {
|
QCodeCompletionEngine *AsCompletion::clone() {
|
||||||
AsCompletion *e = new AsCompletion(_engine);
|
AsCompletion *e = new AsCompletion(_engine, pPopup->editor());
|
||||||
|
|
||||||
for (auto &t : triggers())
|
for (auto &t : triggers())
|
||||||
e->addTrigger(t);
|
e->addTrigger(t);
|
||||||
|
@ -51,15 +73,78 @@ QStringList AsCompletion::extensions() const {
|
||||||
}
|
}
|
||||||
|
|
||||||
void AsCompletion::complete(const QDocumentCursor &c, const QString &trigger) {
|
void AsCompletion::complete(const QDocumentCursor &c, const QString &trigger) {
|
||||||
auto codes = c.document()->text(true, false);
|
// TODO
|
||||||
QAsParser parser(_engine);
|
// auto codes = c.document()->text(true, false);
|
||||||
parser.parse(codes, this->editor()->fileName());
|
// parser.parse(codes, this->editor()->fileName());
|
||||||
|
|
||||||
QList<QCodeNode *> nodes = parser.codeNodes();
|
// QList<QCodeNode *> nodes = parser.codeNodes();
|
||||||
|
auto txt = c.line().text().left(c.columnNumber());
|
||||||
|
auto code = txt.toUtf8();
|
||||||
|
|
||||||
|
auto p = code.data();
|
||||||
|
auto len = code.length();
|
||||||
|
auto end = p + len;
|
||||||
|
|
||||||
|
struct Token {
|
||||||
|
asETokenClass type;
|
||||||
|
QByteArray content;
|
||||||
|
};
|
||||||
|
|
||||||
|
QVector<Token> tokens;
|
||||||
|
for (; p < end;) {
|
||||||
|
asUINT tokenLen = 0;
|
||||||
|
auto tt = _engine->ParseToken(p, len, &tokenLen);
|
||||||
|
Token token;
|
||||||
|
token.type = tt;
|
||||||
|
token.content = QByteArray(p, tokenLen);
|
||||||
|
tokens << token;
|
||||||
|
p += tokenLen;
|
||||||
|
}
|
||||||
|
|
||||||
|
QByteArray fn;
|
||||||
|
QList<QCodeNode *> nodes;
|
||||||
|
|
||||||
|
auto r =
|
||||||
|
std::find_if(tokens.rbegin(), tokens.rend(), [](const Token &token) {
|
||||||
|
return token.type == asTC_IDENTIFIER || token.type == asTC_VALUE;
|
||||||
|
});
|
||||||
|
if (r == tokens.rend()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
auto &_headerNodes = parser.headerNodes();
|
||||||
|
fn = r->content;
|
||||||
|
if (trigger == SEMI_COLON_TRIGGER) {
|
||||||
|
for (auto &n : _headerNodes) {
|
||||||
|
auto name = n->qualifiedName();
|
||||||
|
if (name == fn) {
|
||||||
|
nodes << n;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else if (trigger == LEFT_PARE_TRIGGER) {
|
||||||
|
if (r != tokens.rend()) {
|
||||||
|
auto pr = std::next(r);
|
||||||
|
if (pr->content == SEMI_COLON_TRIGGER) {
|
||||||
|
if (pr != tokens.rend()) {
|
||||||
|
auto prr = std::next(pr);
|
||||||
|
auto ns = prr->content;
|
||||||
|
if (prr->type == asTC_IDENTIFIER) {
|
||||||
|
for (auto &n : _headerNodes) {
|
||||||
|
auto name = n->qualifiedName();
|
||||||
|
if (name == ns) {
|
||||||
|
nodes << n;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// TODO
|
// TODO
|
||||||
QByteArray fn;
|
// QList<QCodeNode *> temp; // internal CodeNodes
|
||||||
QList<QCodeNode *> temp; // internal CodeNodes
|
|
||||||
int filter = QCodeCompletionWidget::FilterFlag::KeepAll;
|
int filter = QCodeCompletionWidget::FilterFlag::KeepAll;
|
||||||
|
|
||||||
if (nodes.count()) {
|
if (nodes.count()) {
|
||||||
|
@ -69,7 +154,7 @@ void AsCompletion::complete(const QDocumentCursor &c, const QString &trigger) {
|
||||||
// qDebug("fn %s", fn.constData());
|
// qDebug("fn %s", fn.constData());
|
||||||
|
|
||||||
for (auto &n : nodes) {
|
for (auto &n : nodes) {
|
||||||
for (auto &f : n->children) {
|
for (auto &f : n->children()) {
|
||||||
if (f->type() != QCodeNode::Function ||
|
if (f->type() != QCodeNode::Function ||
|
||||||
f->role(QCodeNode::Name) != fn)
|
f->role(QCodeNode::Name) != fn)
|
||||||
continue;
|
continue;
|
||||||
|
@ -104,7 +189,7 @@ void AsCompletion::complete(const QDocumentCursor &c, const QString &trigger) {
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
pPopup->setTemporaryNodes(temp);
|
// pPopup->setTemporaryNodes(temp);
|
||||||
pPopup->setFilter(QCodeCompletionWidget::Filter(filter));
|
pPopup->setFilter(QCodeCompletionWidget::Filter(filter));
|
||||||
pPopup->setCompletions(nodes);
|
pPopup->setCompletions(nodes);
|
||||||
|
|
||||||
|
@ -116,7 +201,12 @@ void AsCompletion::complete(const QDocumentCursor &c, const QString &trigger) {
|
||||||
pPopup->popup();
|
pPopup->popup();
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
qDeleteAll(temp);
|
// qDeleteAll(temp);
|
||||||
qDebug("completion failed");
|
qDebug("completion failed");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void AsCompletion::setEditor(QEditor *e) {
|
||||||
|
QCodeCompletionEngine::setEditor(e);
|
||||||
|
pPopup->setEditor(e);
|
||||||
|
}
|
||||||
|
|
|
@ -1,13 +1,27 @@
|
||||||
|
/*==============================================================================
|
||||||
|
** Copyright (C) 2024-2027 WingSummer
|
||||||
|
**
|
||||||
|
** This program is free software: you can redistribute it and/or modify it under
|
||||||
|
** the terms of the GNU Affero General Public License as published by the Free
|
||||||
|
** Software Foundation, version 3.
|
||||||
|
**
|
||||||
|
** This program is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
** ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
||||||
|
** FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
|
||||||
|
** details.
|
||||||
|
**
|
||||||
|
** You should have received a copy of the GNU Affero General Public License
|
||||||
|
** along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
** =============================================================================
|
||||||
|
*/
|
||||||
|
|
||||||
#ifndef _AS_COMPLETION_H_
|
#ifndef _AS_COMPLETION_H_
|
||||||
#define _AS_COMPLETION_H_
|
#define _AS_COMPLETION_H_
|
||||||
|
|
||||||
#include "angelscript.h"
|
#include "class/qasparser.h"
|
||||||
#include "control/qcodecompletionwidget.h"
|
|
||||||
#include "qcodecompletionengine.h"
|
#include "qcodecompletionengine.h"
|
||||||
|
|
||||||
#include <QHash>
|
class QCodeCompletionWidget;
|
||||||
|
|
||||||
class QByteArray;
|
|
||||||
|
|
||||||
class AsCompletion : public QCodeCompletionEngine {
|
class AsCompletion : public QCodeCompletionEngine {
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
@ -21,11 +35,14 @@ public:
|
||||||
virtual QString language() const override;
|
virtual QString language() const override;
|
||||||
virtual QStringList extensions() const override;
|
virtual QStringList extensions() const override;
|
||||||
|
|
||||||
|
virtual void setEditor(QEditor *e) override;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual void complete(const QDocumentCursor &c,
|
virtual void complete(const QDocumentCursor &c,
|
||||||
const QString &trigger) override;
|
const QString &trigger) override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
QAsParser parser;
|
||||||
asIScriptEngine *_engine;
|
asIScriptEngine *_engine;
|
||||||
QCodeCompletionWidget *pPopup;
|
QCodeCompletionWidget *pPopup;
|
||||||
QPointer<QCodeModel> pModel;
|
QPointer<QCodeModel> pModel;
|
||||||
|
|
|
@ -1,3 +1,20 @@
|
||||||
|
/*==============================================================================
|
||||||
|
** Copyright (C) 2024-2027 WingSummer
|
||||||
|
**
|
||||||
|
** This program is free software: you can redistribute it and/or modify it under
|
||||||
|
** the terms of the GNU Affero General Public License as published by the Free
|
||||||
|
** Software Foundation, version 3.
|
||||||
|
**
|
||||||
|
** This program is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
** ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
||||||
|
** FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
|
||||||
|
** details.
|
||||||
|
**
|
||||||
|
** You should have received a copy of the GNU Affero General Public License
|
||||||
|
** along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
** =============================================================================
|
||||||
|
*/
|
||||||
|
|
||||||
#include "ascontextmgr.h"
|
#include "ascontextmgr.h"
|
||||||
|
|
||||||
asContextMgr::asContextMgr() : CContextMgr() {}
|
asContextMgr::asContextMgr() : CContextMgr() {}
|
||||||
|
|
|
@ -1,3 +1,20 @@
|
||||||
|
/*==============================================================================
|
||||||
|
** Copyright (C) 2024-2027 WingSummer
|
||||||
|
**
|
||||||
|
** This program is free software: you can redistribute it and/or modify it under
|
||||||
|
** the terms of the GNU Affero General Public License as published by the Free
|
||||||
|
** Software Foundation, version 3.
|
||||||
|
**
|
||||||
|
** This program is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
** ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
||||||
|
** FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
|
||||||
|
** details.
|
||||||
|
**
|
||||||
|
** You should have received a copy of the GNU Affero General Public License
|
||||||
|
** along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
** =============================================================================
|
||||||
|
*/
|
||||||
|
|
||||||
#ifndef ASCONTEXTMGR_H
|
#ifndef ASCONTEXTMGR_H
|
||||||
#define ASCONTEXTMGR_H
|
#define ASCONTEXTMGR_H
|
||||||
|
|
||||||
|
|
|
@ -1,3 +1,20 @@
|
||||||
|
/*==============================================================================
|
||||||
|
** Copyright (C) 2024-2027 WingSummer
|
||||||
|
**
|
||||||
|
** This program is free software: you can redistribute it and/or modify it under
|
||||||
|
** the terms of the GNU Affero General Public License as published by the Free
|
||||||
|
** Software Foundation, version 3.
|
||||||
|
**
|
||||||
|
** This program is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
** ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
||||||
|
** FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
|
||||||
|
** details.
|
||||||
|
**
|
||||||
|
** You should have received a copy of the GNU Affero General Public License
|
||||||
|
** along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
** =============================================================================
|
||||||
|
*/
|
||||||
|
|
||||||
#include "asdebugger.h"
|
#include "asdebugger.h"
|
||||||
|
|
||||||
#include <QApplication>
|
#include <QApplication>
|
||||||
|
|
|
@ -1,3 +1,20 @@
|
||||||
|
/*==============================================================================
|
||||||
|
** Copyright (C) 2024-2027 WingSummer
|
||||||
|
**
|
||||||
|
** This program is free software: you can redistribute it and/or modify it under
|
||||||
|
** the terms of the GNU Affero General Public License as published by the Free
|
||||||
|
** Software Foundation, version 3.
|
||||||
|
**
|
||||||
|
** This program is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
** ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
||||||
|
** FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
|
||||||
|
** details.
|
||||||
|
**
|
||||||
|
** You should have received a copy of the GNU Affero General Public License
|
||||||
|
** along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
** =============================================================================
|
||||||
|
*/
|
||||||
|
|
||||||
#ifndef ASDEBUGGER_H
|
#ifndef ASDEBUGGER_H
|
||||||
#define ASDEBUGGER_H
|
#define ASDEBUGGER_H
|
||||||
|
|
||||||
|
|
|
@ -1,3 +1,20 @@
|
||||||
|
/*==============================================================================
|
||||||
|
** Copyright (C) 2024-2027 WingSummer
|
||||||
|
**
|
||||||
|
** This program is free software: you can redistribute it and/or modify it under
|
||||||
|
** the terms of the GNU Affero General Public License as published by the Free
|
||||||
|
** Software Foundation, version 3.
|
||||||
|
**
|
||||||
|
** This program is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
** ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
||||||
|
** FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
|
||||||
|
** details.
|
||||||
|
**
|
||||||
|
** You should have received a copy of the GNU Affero General Public License
|
||||||
|
** along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
** =============================================================================
|
||||||
|
*/
|
||||||
|
|
||||||
#ifndef FOCUSOUTEVENTFILTER_H
|
#ifndef FOCUSOUTEVENTFILTER_H
|
||||||
#define FOCUSOUTEVENTFILTER_H
|
#define FOCUSOUTEVENTFILTER_H
|
||||||
|
|
||||||
|
|
|
@ -1,3 +1,20 @@
|
||||||
|
/*==============================================================================
|
||||||
|
** Copyright (C) 2024-2027 WingSummer
|
||||||
|
**
|
||||||
|
** This program is free software: you can redistribute it and/or modify it under
|
||||||
|
** the terms of the GNU Affero General Public License as published by the Free
|
||||||
|
** Software Foundation, version 3.
|
||||||
|
**
|
||||||
|
** This program is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
** ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
||||||
|
** FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
|
||||||
|
** details.
|
||||||
|
**
|
||||||
|
** You should have received a copy of the GNU Affero General Public License
|
||||||
|
** along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
** =============================================================================
|
||||||
|
*/
|
||||||
|
|
||||||
#include "framelesshelper.h"
|
#include "framelesshelper.h"
|
||||||
|
|
||||||
#include "widgetframe/windowbutton.h"
|
#include "widgetframe/windowbutton.h"
|
||||||
|
|
|
@ -1,3 +1,20 @@
|
||||||
|
/*==============================================================================
|
||||||
|
** Copyright (C) 2024-2027 WingSummer
|
||||||
|
**
|
||||||
|
** This program is free software: you can redistribute it and/or modify it under
|
||||||
|
** the terms of the GNU Affero General Public License as published by the Free
|
||||||
|
** Software Foundation, version 3.
|
||||||
|
**
|
||||||
|
** This program is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
** ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
||||||
|
** FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
|
||||||
|
** details.
|
||||||
|
**
|
||||||
|
** You should have received a copy of the GNU Affero General Public License
|
||||||
|
** along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
** =============================================================================
|
||||||
|
*/
|
||||||
|
|
||||||
#ifndef FRAMELESSHELPER_H
|
#ifndef FRAMELESSHELPER_H
|
||||||
#define FRAMELESSHELPER_H
|
#define FRAMELESSHELPER_H
|
||||||
|
|
||||||
|
|
|
@ -1,3 +1,20 @@
|
||||||
|
/*==============================================================================
|
||||||
|
** Copyright (C) 2024-2027 WingSummer
|
||||||
|
**
|
||||||
|
** This program is free software: you can redistribute it and/or modify it under
|
||||||
|
** the terms of the GNU Affero General Public License as published by the Free
|
||||||
|
** Software Foundation, version 3.
|
||||||
|
**
|
||||||
|
** This program is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
** ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
||||||
|
** FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
|
||||||
|
** details.
|
||||||
|
**
|
||||||
|
** You should have received a copy of the GNU Affero General Public License
|
||||||
|
** along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
** =============================================================================
|
||||||
|
*/
|
||||||
|
|
||||||
#include "languagemanager.h"
|
#include "languagemanager.h"
|
||||||
|
|
||||||
#include "wingmessagebox.h"
|
#include "wingmessagebox.h"
|
||||||
|
|
|
@ -1,3 +1,20 @@
|
||||||
|
/*==============================================================================
|
||||||
|
** Copyright (C) 2024-2027 WingSummer
|
||||||
|
**
|
||||||
|
** This program is free software: you can redistribute it and/or modify it under
|
||||||
|
** the terms of the GNU Affero General Public License as published by the Free
|
||||||
|
** Software Foundation, version 3.
|
||||||
|
**
|
||||||
|
** This program is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
** ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
||||||
|
** FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
|
||||||
|
** details.
|
||||||
|
**
|
||||||
|
** You should have received a copy of the GNU Affero General Public License
|
||||||
|
** along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
** =============================================================================
|
||||||
|
*/
|
||||||
|
|
||||||
#ifndef LANGUAGEMANAGER_H
|
#ifndef LANGUAGEMANAGER_H
|
||||||
#define LANGUAGEMANAGER_H
|
#define LANGUAGEMANAGER_H
|
||||||
|
|
||||||
|
|
|
@ -1,3 +1,20 @@
|
||||||
|
/*==============================================================================
|
||||||
|
** Copyright (C) 2024-2027 WingSummer
|
||||||
|
**
|
||||||
|
** This program is free software: you can redistribute it and/or modify it under
|
||||||
|
** the terms of the GNU Affero General Public License as published by the Free
|
||||||
|
** Software Foundation, version 3.
|
||||||
|
**
|
||||||
|
** This program is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
** ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
||||||
|
** FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
|
||||||
|
** details.
|
||||||
|
**
|
||||||
|
** You should have received a copy of the GNU Affero General Public License
|
||||||
|
** along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
** =============================================================================
|
||||||
|
*/
|
||||||
|
|
||||||
#include "logger.h"
|
#include "logger.h"
|
||||||
#include <QApplication>
|
#include <QApplication>
|
||||||
#include <QDateTime>
|
#include <QDateTime>
|
||||||
|
|
|
@ -1,3 +1,20 @@
|
||||||
|
/*==============================================================================
|
||||||
|
** Copyright (C) 2024-2027 WingSummer
|
||||||
|
**
|
||||||
|
** This program is free software: you can redistribute it and/or modify it under
|
||||||
|
** the terms of the GNU Affero General Public License as published by the Free
|
||||||
|
** Software Foundation, version 3.
|
||||||
|
**
|
||||||
|
** This program is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
** ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
||||||
|
** FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
|
||||||
|
** details.
|
||||||
|
**
|
||||||
|
** You should have received a copy of the GNU Affero General Public License
|
||||||
|
** along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
** =============================================================================
|
||||||
|
*/
|
||||||
|
|
||||||
#ifndef LOGGER_H
|
#ifndef LOGGER_H
|
||||||
#define LOGGER_H
|
#define LOGGER_H
|
||||||
|
|
||||||
|
|
|
@ -1,3 +1,20 @@
|
||||||
|
/*==============================================================================
|
||||||
|
** Copyright (C) 2024-2027 WingSummer
|
||||||
|
**
|
||||||
|
** This program is free software: you can redistribute it and/or modify it under
|
||||||
|
** the terms of the GNU Affero General Public License as published by the Free
|
||||||
|
** Software Foundation, version 3.
|
||||||
|
**
|
||||||
|
** This program is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
** ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
||||||
|
** FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
|
||||||
|
** details.
|
||||||
|
**
|
||||||
|
** You should have received a copy of the GNU Affero General Public License
|
||||||
|
** along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
** =============================================================================
|
||||||
|
*/
|
||||||
|
|
||||||
#include "qasparser.h"
|
#include "qasparser.h"
|
||||||
|
|
||||||
#include "AngelScript/sdk/angelscript/source/as_builder.h"
|
#include "AngelScript/sdk/angelscript/source/as_builder.h"
|
||||||
|
@ -8,52 +25,24 @@
|
||||||
#include <QDebug>
|
#include <QDebug>
|
||||||
|
|
||||||
QAsParser::QAsParser(asIScriptEngine *engine) : asBuilder(), _engine(engine) {
|
QAsParser::QAsParser(asIScriptEngine *engine) : asBuilder(), _engine(engine) {
|
||||||
constexpr const char *_HEADER_ =
|
addEnumCompletion(engine);
|
||||||
"namespace reader { bool copy(bool hex = false); }";
|
addGlobalFunctionCompletion(engine);
|
||||||
constexpr size_t _HEADER_LEN_ = std::char_traits<char>::length(_HEADER_);
|
|
||||||
|
|
||||||
// module->AddScriptSection("header", _HEADER_, _HEADER_LEN_, 0);
|
|
||||||
|
|
||||||
ClearAll();
|
|
||||||
|
|
||||||
if (StartNewModule(_engine, "_HEADER_PARSER_") != 0) {
|
|
||||||
Q_ASSERT(false);
|
|
||||||
}
|
|
||||||
|
|
||||||
auto mod = dynamic_cast<asCModule *>(GetModule());
|
|
||||||
auto en = dynamic_cast<asCScriptEngine *>(engine);
|
|
||||||
Q_ASSERT(en && mod);
|
|
||||||
asCParser parser(new asCBuilder(en, mod));
|
|
||||||
|
|
||||||
m_code.reset(new asCScriptCode);
|
|
||||||
m_code->SetCode("_HEADER_", _HEADER_, true);
|
|
||||||
|
|
||||||
parser.ParseScript(m_code.get());
|
|
||||||
|
|
||||||
auto pnodes = parser.GetScriptNode();
|
|
||||||
|
|
||||||
QList<QCodeNode *> qnodes;
|
|
||||||
|
|
||||||
auto node = new QCodeNode;
|
|
||||||
processNode(nullptr, pnodes, node);
|
|
||||||
|
|
||||||
do {
|
|
||||||
auto p = qnodes.first();
|
|
||||||
} while (false);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
QAsParser::~QAsParser() {}
|
QAsParser::~QAsParser() {
|
||||||
|
qDeleteAll(_headerNodes);
|
||||||
|
_headerNodes.clear();
|
||||||
|
}
|
||||||
|
|
||||||
void QAsParser::processNode(asCScriptCode *code, asCScriptNode *raw,
|
void QAsParser::processNode(asCScriptCode *code, asCScriptNode *raw,
|
||||||
QCodeNode *node) {
|
QCodeNode *node) {
|
||||||
Q_ASSERT(raw && node);
|
Q_ASSERT(raw && node);
|
||||||
|
|
||||||
node->model = nullptr;
|
|
||||||
int row = -1;
|
int row = -1;
|
||||||
if (code) {
|
if (code) {
|
||||||
code->ConvertPosToRowCol(raw->tokenPos, &row, nullptr);
|
code->ConvertPosToRowCol(raw->tokenPos, &row, nullptr);
|
||||||
}
|
}
|
||||||
node->line = row;
|
node->setLine(row);
|
||||||
|
|
||||||
QByteArray ns; // namespace
|
QByteArray ns; // namespace
|
||||||
|
|
||||||
|
@ -92,10 +81,104 @@ void QAsParser::processNode(asCScriptCode *code, asCScriptNode *raw,
|
||||||
auto cnode = new QCodeNode;
|
auto cnode = new QCodeNode;
|
||||||
// cnode->parent = node;
|
// cnode->parent = node;
|
||||||
processNode(code, p, cnode);
|
processNode(code, p, cnode);
|
||||||
node->children.append(cnode);
|
node->children().append(cnode);
|
||||||
p = p->next;
|
p = p->next;
|
||||||
}
|
}
|
||||||
node->children.append(node);
|
node->children().append(node);
|
||||||
|
}
|
||||||
|
|
||||||
|
QByteArray QAsParser::getFnParamDeclString(asIScriptFunction *fn,
|
||||||
|
bool includeNamespace,
|
||||||
|
bool includeParamNames) {
|
||||||
|
auto fun = dynamic_cast<asCScriptFunction *>(fn);
|
||||||
|
if (fun == nullptr) {
|
||||||
|
return {};
|
||||||
|
}
|
||||||
|
|
||||||
|
asCString str;
|
||||||
|
|
||||||
|
auto ¶meterTypes = fun->parameterTypes;
|
||||||
|
auto ¶meterNames = fun->parameterNames;
|
||||||
|
auto &nameSpace = fun->nameSpace;
|
||||||
|
auto &inOutFlags = fun->inOutFlags;
|
||||||
|
auto &defaultArgs = fun->defaultArgs;
|
||||||
|
|
||||||
|
if (parameterTypes.GetLength() > 0) {
|
||||||
|
asUINT n;
|
||||||
|
for (n = 0; n < parameterTypes.GetLength() - 1; n++) {
|
||||||
|
str += parameterTypes[n].Format(nameSpace, includeNamespace);
|
||||||
|
if (parameterTypes[n].IsReference() && inOutFlags.GetLength() > n) {
|
||||||
|
if (inOutFlags[n] == asTM_INREF)
|
||||||
|
str += "in";
|
||||||
|
else if (inOutFlags[n] == asTM_OUTREF)
|
||||||
|
str += "out";
|
||||||
|
else if (inOutFlags[n] == asTM_INOUTREF)
|
||||||
|
str += "inout";
|
||||||
|
}
|
||||||
|
|
||||||
|
if (includeParamNames && n < parameterNames.GetLength() &&
|
||||||
|
parameterNames[n].GetLength() != 0) {
|
||||||
|
str += " ";
|
||||||
|
str += parameterNames[n];
|
||||||
|
}
|
||||||
|
|
||||||
|
if (defaultArgs.GetLength() > n && defaultArgs[n]) {
|
||||||
|
asCString tmp;
|
||||||
|
tmp.Format(" = %s", defaultArgs[n]->AddressOf());
|
||||||
|
str += tmp;
|
||||||
|
}
|
||||||
|
|
||||||
|
str += ", ";
|
||||||
|
}
|
||||||
|
|
||||||
|
// Add the last parameter
|
||||||
|
str += parameterTypes[n].Format(nameSpace, includeNamespace);
|
||||||
|
if (parameterTypes[n].IsReference() && inOutFlags.GetLength() > n) {
|
||||||
|
if (inOutFlags[n] == asTM_INREF)
|
||||||
|
str += "in";
|
||||||
|
else if (inOutFlags[n] == asTM_OUTREF)
|
||||||
|
str += "out";
|
||||||
|
else if (inOutFlags[n] == asTM_INOUTREF)
|
||||||
|
str += "inout";
|
||||||
|
}
|
||||||
|
|
||||||
|
if (includeParamNames && n < parameterNames.GetLength() &&
|
||||||
|
parameterNames[n].GetLength() != 0) {
|
||||||
|
str += " ";
|
||||||
|
str += parameterNames[n];
|
||||||
|
}
|
||||||
|
|
||||||
|
if (defaultArgs.GetLength() > n && defaultArgs[n]) {
|
||||||
|
asCString tmp;
|
||||||
|
tmp.Format(" = %s", defaultArgs[n]->AddressOf());
|
||||||
|
str += tmp;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return QByteArray(str.AddressOf(), str.GetLength());
|
||||||
|
}
|
||||||
|
|
||||||
|
QByteArray QAsParser::getFnRetTypeString(asIScriptFunction *fn,
|
||||||
|
bool includeNamespace) {
|
||||||
|
auto fun = dynamic_cast<asCScriptFunction *>(fn);
|
||||||
|
if (fun == nullptr) {
|
||||||
|
return {};
|
||||||
|
}
|
||||||
|
|
||||||
|
auto &returnType = fun->returnType;
|
||||||
|
auto &objectType = fun->objectType;
|
||||||
|
auto &name = fun->name;
|
||||||
|
auto &nameSpace = fun->nameSpace;
|
||||||
|
|
||||||
|
if (!(returnType.GetTokenType() == ttVoid && objectType &&
|
||||||
|
(name == objectType->name ||
|
||||||
|
(name.GetLength() > 0 && name[0] == '~') || name == "$beh0" ||
|
||||||
|
name == "$beh2"))) {
|
||||||
|
auto str = returnType.Format(nameSpace, includeNamespace);
|
||||||
|
return QByteArray(str.AddressOf(), str.GetLength());
|
||||||
|
}
|
||||||
|
|
||||||
|
return {};
|
||||||
}
|
}
|
||||||
|
|
||||||
bool QAsParser::parse(const QString &filename) {
|
bool QAsParser::parse(const QString &filename) {
|
||||||
|
@ -145,3 +228,153 @@ bool QAsParser::parse(const QString &filename) {
|
||||||
bool QAsParser::parse(const QString &code, const QString §ion) {
|
bool QAsParser::parse(const QString &code, const QString §ion) {
|
||||||
return ProcessScriptSection(code.toUtf8(), code.length(), section, 0);
|
return ProcessScriptSection(code.toUtf8(), code.length(), section, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const QList<QCodeNode *> &QAsParser::headerNodes() const {
|
||||||
|
return _headerNodes;
|
||||||
|
}
|
||||||
|
|
||||||
|
void QAsParser::addGlobalFunctionCompletion(asIScriptEngine *engine) {
|
||||||
|
Q_ASSERT(engine);
|
||||||
|
|
||||||
|
struct FnInfo {
|
||||||
|
QByteArray retType;
|
||||||
|
QByteArray fnName;
|
||||||
|
QByteArray params;
|
||||||
|
bool isConst = false;
|
||||||
|
};
|
||||||
|
|
||||||
|
QHash<QByteArray, QList<FnInfo>> _maps;
|
||||||
|
|
||||||
|
for (asUINT i = 0; i < engine->GetGlobalFunctionCount(); ++i) {
|
||||||
|
auto fn = engine->GetGlobalFunctionByIndex(i);
|
||||||
|
|
||||||
|
FnInfo fnInfo;
|
||||||
|
auto ns = fn->GetNamespace();
|
||||||
|
fnInfo.retType = getFnRetTypeString(fn, true);
|
||||||
|
fnInfo.fnName = fn->GetName();
|
||||||
|
fnInfo.params = getFnParamDeclString(fn, false, true);
|
||||||
|
fnInfo.isConst = fn->IsReadOnly();
|
||||||
|
|
||||||
|
_maps[ns] << fnInfo;
|
||||||
|
}
|
||||||
|
|
||||||
|
for (auto p = _maps.keyValueBegin(); p != _maps.keyValueEnd(); p++) {
|
||||||
|
auto node = new QCodeNode;
|
||||||
|
_headerNodes << node;
|
||||||
|
if (p->first.isEmpty()) {
|
||||||
|
node->setNodeType(QCodeNode::Group);
|
||||||
|
} else {
|
||||||
|
node->setNodeType(QCodeNode::Namespace);
|
||||||
|
}
|
||||||
|
node->setRole(QCodeNode::Name, p->first);
|
||||||
|
|
||||||
|
auto pnodes = &node->children();
|
||||||
|
auto nodeParent = node;
|
||||||
|
|
||||||
|
for (auto &fn : p->second) {
|
||||||
|
auto node = new QCodeNode;
|
||||||
|
node->setNodeType(QCodeNode::Function);
|
||||||
|
node->setRole(QCodeNode::Return, fn.retType);
|
||||||
|
node->setRole(QCodeNode::Name, fn.fnName);
|
||||||
|
node->setRole(QCodeNode::Arguments, fn.params);
|
||||||
|
QByteArray qualifiers;
|
||||||
|
if (fn.isConst) {
|
||||||
|
qualifiers.setNum(QCodeNode::QUALIFIER_CONST);
|
||||||
|
}
|
||||||
|
node->setRole(QCodeNode::Qualifiers, qualifiers);
|
||||||
|
node->setParent(nodeParent);
|
||||||
|
pnodes->append(node);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void QAsParser::addEnumCompletion(asIScriptEngine *engine) {
|
||||||
|
Q_ASSERT(engine);
|
||||||
|
|
||||||
|
struct EnumInfo {
|
||||||
|
QByteArray name;
|
||||||
|
QList<QPair<QByteArray, int>> enums;
|
||||||
|
};
|
||||||
|
|
||||||
|
QHash<QByteArray, QList<EnumInfo>> _maps;
|
||||||
|
|
||||||
|
for (asUINT i = 0; i < engine->GetEnumCount(); ++i) {
|
||||||
|
auto etype = engine->GetEnumByIndex(i);
|
||||||
|
etype->AddRef();
|
||||||
|
|
||||||
|
EnumInfo einfo;
|
||||||
|
auto ns = etype->GetNamespace();
|
||||||
|
einfo.name = etype->GetName();
|
||||||
|
|
||||||
|
for (asUINT i = 0; i < etype->GetEnumValueCount(); ++i) {
|
||||||
|
int v;
|
||||||
|
auto e = etype->GetEnumValueByIndex(i, &v);
|
||||||
|
einfo.enums.append(qMakePair(QByteArray(e), v));
|
||||||
|
}
|
||||||
|
|
||||||
|
etype->Release();
|
||||||
|
|
||||||
|
_maps[ns] << einfo;
|
||||||
|
}
|
||||||
|
|
||||||
|
for (auto p = _maps.keyValueBegin(); p != _maps.keyValueEnd(); p++) {
|
||||||
|
auto node = new QCodeNode;
|
||||||
|
_headerNodes << node;
|
||||||
|
if (p->first.isEmpty()) {
|
||||||
|
node->setNodeType(QCodeNode::Group);
|
||||||
|
} else {
|
||||||
|
node->setNodeType(QCodeNode::Namespace);
|
||||||
|
}
|
||||||
|
node->setRole(QCodeNode::Name, p->first);
|
||||||
|
|
||||||
|
auto pnodes = &node->children();
|
||||||
|
auto nodeParent = node;
|
||||||
|
for (auto &fn : p->second) {
|
||||||
|
auto node = new QCodeNode;
|
||||||
|
node->setNodeType(QCodeNode::Enum);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void QAsParser::addClassCompletion(asIScriptEngine *engine) {
|
||||||
|
Q_ASSERT(engine);
|
||||||
|
|
||||||
|
struct ClassInfo {
|
||||||
|
QByteArray name;
|
||||||
|
//
|
||||||
|
};
|
||||||
|
|
||||||
|
QHash<QByteArray, QList<ClassInfo>> _maps;
|
||||||
|
|
||||||
|
for (asUINT i = 0; i < engine->GetObjectTypeCount(); ++i) {
|
||||||
|
auto obj = engine->GetObjectTypeByIndex(i);
|
||||||
|
obj->AddRef();
|
||||||
|
|
||||||
|
ClassInfo cls;
|
||||||
|
cls.name = obj->GetNamespace();
|
||||||
|
auto ns = obj->GetNamespace();
|
||||||
|
|
||||||
|
for (asUINT i = 0; i < obj->GetBehaviourCount(); ++i) {
|
||||||
|
asEBehaviours bv;
|
||||||
|
auto b = obj->GetBehaviourByIndex(i, &bv);
|
||||||
|
switch (bv) {
|
||||||
|
case asBEHAVE_CONSTRUCT:
|
||||||
|
case asBEHAVE_DESTRUCT:
|
||||||
|
// only these are supported
|
||||||
|
|
||||||
|
default:
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
for (asUINT i = 0; i < obj->GetMethodCount(); ++i) {
|
||||||
|
auto m = obj->GetMethodByIndex(i);
|
||||||
|
}
|
||||||
|
|
||||||
|
obj->Release();
|
||||||
|
|
||||||
|
_maps[ns] << cls;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
QList<QCodeNode *> QAsParser::codeNodes() const { return _nodes; }
|
||||||
|
|
|
@ -1,3 +1,20 @@
|
||||||
|
/*==============================================================================
|
||||||
|
** Copyright (C) 2024-2027 WingSummer
|
||||||
|
**
|
||||||
|
** This program is free software: you can redistribute it and/or modify it under
|
||||||
|
** the terms of the GNU Affero General Public License as published by the Free
|
||||||
|
** Software Foundation, version 3.
|
||||||
|
**
|
||||||
|
** This program is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
** ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
||||||
|
** FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
|
||||||
|
** details.
|
||||||
|
**
|
||||||
|
** You should have received a copy of the GNU Affero General Public License
|
||||||
|
** along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
** =============================================================================
|
||||||
|
*/
|
||||||
|
|
||||||
#ifndef _QAS_PARSER_H_
|
#ifndef _QAS_PARSER_H_
|
||||||
#define _QAS_PARSER_H_
|
#define _QAS_PARSER_H_
|
||||||
|
|
||||||
|
@ -17,20 +34,30 @@ public:
|
||||||
private:
|
private:
|
||||||
void processNode(asCScriptCode *code, asCScriptNode *raw, QCodeNode *node);
|
void processNode(asCScriptCode *code, asCScriptNode *raw, QCodeNode *node);
|
||||||
|
|
||||||
|
QByteArray getFnParamDeclString(asIScriptFunction *fn,
|
||||||
|
bool includeNamespace,
|
||||||
|
bool includeParamNames);
|
||||||
|
|
||||||
|
QByteArray getFnRetTypeString(asIScriptFunction *fn, bool includeNamespace);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
bool parse(const QString &filename);
|
bool parse(const QString &filename);
|
||||||
bool parse(const QString &code, const QString §ion);
|
bool parse(const QString &code, const QString §ion);
|
||||||
|
|
||||||
QList<QCodeNode *> codeNodes() const;
|
QList<QCodeNode *> codeNodes() const;
|
||||||
|
|
||||||
|
const QList<QCodeNode *> &headerNodes() const;
|
||||||
|
|
||||||
|
private:
|
||||||
|
void addGlobalFunctionCompletion(asIScriptEngine *engine);
|
||||||
|
void addEnumCompletion(asIScriptEngine *engine);
|
||||||
|
void addClassCompletion(asIScriptEngine *engine);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
asIScriptEngine *_engine;
|
asIScriptEngine *_engine;
|
||||||
QScopedPointer<asCScriptCode> m_code;
|
QScopedPointer<asCScriptCode> m_code;
|
||||||
|
QList<QCodeNode *> _headerNodes;
|
||||||
QList<QCodeNode *> _nodes;
|
QList<QCodeNode *> _nodes;
|
||||||
};
|
};
|
||||||
|
|
||||||
// I don't know why it doesn't pass the compiler under Windows when
|
|
||||||
// these codes are in the qasparser.cpp
|
|
||||||
inline QList<QCodeNode *> QAsParser::codeNodes() const { return _nodes; }
|
|
||||||
|
|
||||||
#endif // !_QCPP_PARSER_H_
|
#endif // !_QCPP_PARSER_H_
|
||||||
|
|
|
@ -1,3 +1,20 @@
|
||||||
|
/*==============================================================================
|
||||||
|
** Copyright (C) 2024-2027 WingSummer
|
||||||
|
**
|
||||||
|
** This program is free software: you can redistribute it and/or modify it under
|
||||||
|
** the terms of the GNU Affero General Public License as published by the Free
|
||||||
|
** Software Foundation, version 3.
|
||||||
|
**
|
||||||
|
** This program is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
** ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
||||||
|
** FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
|
||||||
|
** details.
|
||||||
|
**
|
||||||
|
** You should have received a copy of the GNU Affero General Public License
|
||||||
|
** along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
** =============================================================================
|
||||||
|
*/
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
**
|
**
|
||||||
** Copyright (C) 2006-2009 fullmetalcoder <fullmetalcoder@hotmail.fr>
|
** Copyright (C) 2006-2009 fullmetalcoder <fullmetalcoder@hotmail.fr>
|
||||||
|
|
|
@ -1,3 +1,20 @@
|
||||||
|
/*==============================================================================
|
||||||
|
** Copyright (C) 2024-2027 WingSummer
|
||||||
|
**
|
||||||
|
** This program is free software: you can redistribute it and/or modify it under
|
||||||
|
** the terms of the GNU Affero General Public License as published by the Free
|
||||||
|
** Software Foundation, version 3.
|
||||||
|
**
|
||||||
|
** This program is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
** ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
||||||
|
** FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
|
||||||
|
** details.
|
||||||
|
**
|
||||||
|
** You should have received a copy of the GNU Affero General Public License
|
||||||
|
** along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
** =============================================================================
|
||||||
|
*/
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
**
|
**
|
||||||
** Copyright (C) 2006-2009 fullmetalcoder <fullmetalcoder@hotmail.fr>
|
** Copyright (C) 2006-2009 fullmetalcoder <fullmetalcoder@hotmail.fr>
|
||||||
|
|
|
@ -1,3 +1,20 @@
|
||||||
|
/*==============================================================================
|
||||||
|
** Copyright (C) 2024-2027 WingSummer
|
||||||
|
**
|
||||||
|
** This program is free software: you can redistribute it and/or modify it under
|
||||||
|
** the terms of the GNU Affero General Public License as published by the Free
|
||||||
|
** Software Foundation, version 3.
|
||||||
|
**
|
||||||
|
** This program is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
** ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
||||||
|
** FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
|
||||||
|
** details.
|
||||||
|
**
|
||||||
|
** You should have received a copy of the GNU Affero General Public License
|
||||||
|
** along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
** =============================================================================
|
||||||
|
*/
|
||||||
|
|
||||||
#include "qkeysequences.h"
|
#include "qkeysequences.h"
|
||||||
|
|
||||||
QKeySequences::QKeySequences() {
|
QKeySequences::QKeySequences() {
|
||||||
|
|
|
@ -1,3 +1,20 @@
|
||||||
|
/*==============================================================================
|
||||||
|
** Copyright (C) 2024-2027 WingSummer
|
||||||
|
**
|
||||||
|
** This program is free software: you can redistribute it and/or modify it under
|
||||||
|
** the terms of the GNU Affero General Public License as published by the Free
|
||||||
|
** Software Foundation, version 3.
|
||||||
|
**
|
||||||
|
** This program is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
** ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
||||||
|
** FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
|
||||||
|
** details.
|
||||||
|
**
|
||||||
|
** You should have received a copy of the GNU Affero General Public License
|
||||||
|
** along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
** =============================================================================
|
||||||
|
*/
|
||||||
|
|
||||||
#ifndef QKEYSEQUENCES_H
|
#ifndef QKEYSEQUENCES_H
|
||||||
#define QKEYSEQUENCES_H
|
#define QKEYSEQUENCES_H
|
||||||
|
|
||||||
|
|
|
@ -1,3 +1,20 @@
|
||||||
|
/*==============================================================================
|
||||||
|
** Copyright (C) 2024-2027 WingSummer
|
||||||
|
**
|
||||||
|
** This program is free software: you can redistribute it and/or modify it under
|
||||||
|
** the terms of the GNU Affero General Public License as published by the Free
|
||||||
|
** Software Foundation, version 3.
|
||||||
|
**
|
||||||
|
** This program is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
** ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
||||||
|
** FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
|
||||||
|
** details.
|
||||||
|
**
|
||||||
|
** You should have received a copy of the GNU Affero General Public License
|
||||||
|
** along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
** =============================================================================
|
||||||
|
*/
|
||||||
|
|
||||||
#include "recentfilemanager.h"
|
#include "recentfilemanager.h"
|
||||||
#include "control/toast.h"
|
#include "control/toast.h"
|
||||||
#include "utilities.h"
|
#include "utilities.h"
|
||||||
|
|
|
@ -1,3 +1,20 @@
|
||||||
|
/*==============================================================================
|
||||||
|
** Copyright (C) 2024-2027 WingSummer
|
||||||
|
**
|
||||||
|
** This program is free software: you can redistribute it and/or modify it under
|
||||||
|
** the terms of the GNU Affero General Public License as published by the Free
|
||||||
|
** Software Foundation, version 3.
|
||||||
|
**
|
||||||
|
** This program is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
** ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
||||||
|
** FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
|
||||||
|
** details.
|
||||||
|
**
|
||||||
|
** You should have received a copy of the GNU Affero General Public License
|
||||||
|
** along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
** =============================================================================
|
||||||
|
*/
|
||||||
|
|
||||||
#ifndef RECENTFILEMANAGER_H
|
#ifndef RECENTFILEMANAGER_H
|
||||||
#define RECENTFILEMANAGER_H
|
#define RECENTFILEMANAGER_H
|
||||||
|
|
||||||
|
|
|
@ -1,3 +1,20 @@
|
||||||
|
/*==============================================================================
|
||||||
|
** Copyright (C) 2024-2027 WingSummer
|
||||||
|
**
|
||||||
|
** This program is free software: you can redistribute it and/or modify it under
|
||||||
|
** the terms of the GNU Affero General Public License as published by the Free
|
||||||
|
** Software Foundation, version 3.
|
||||||
|
**
|
||||||
|
** This program is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
** ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
||||||
|
** FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
|
||||||
|
** details.
|
||||||
|
**
|
||||||
|
** You should have received a copy of the GNU Affero General Public License
|
||||||
|
** along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
** =============================================================================
|
||||||
|
*/
|
||||||
|
|
||||||
#include "scriptconsolemachine.h"
|
#include "scriptconsolemachine.h"
|
||||||
|
|
||||||
#include "AngelScript/sdk/add_on/scripthelper/scripthelper.h"
|
#include "AngelScript/sdk/add_on/scripthelper/scripthelper.h"
|
||||||
|
|
|
@ -1,3 +1,20 @@
|
||||||
|
/*==============================================================================
|
||||||
|
** Copyright (C) 2024-2027 WingSummer
|
||||||
|
**
|
||||||
|
** This program is free software: you can redistribute it and/or modify it under
|
||||||
|
** the terms of the GNU Affero General Public License as published by the Free
|
||||||
|
** Software Foundation, version 3.
|
||||||
|
**
|
||||||
|
** This program is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
** ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
||||||
|
** FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
|
||||||
|
** details.
|
||||||
|
**
|
||||||
|
** You should have received a copy of the GNU Affero General Public License
|
||||||
|
** along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
** =============================================================================
|
||||||
|
*/
|
||||||
|
|
||||||
#ifndef SCRIPTCONSOLEMACHINE_H
|
#ifndef SCRIPTCONSOLEMACHINE_H
|
||||||
#define SCRIPTCONSOLEMACHINE_H
|
#define SCRIPTCONSOLEMACHINE_H
|
||||||
|
|
||||||
|
|
|
@ -1,3 +1,20 @@
|
||||||
|
/*==============================================================================
|
||||||
|
** Copyright (C) 2024-2027 WingSummer
|
||||||
|
**
|
||||||
|
** This program is free software: you can redistribute it and/or modify it under
|
||||||
|
** the terms of the GNU Affero General Public License as published by the Free
|
||||||
|
** Software Foundation, version 3.
|
||||||
|
**
|
||||||
|
** This program is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
** ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
||||||
|
** FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
|
||||||
|
** details.
|
||||||
|
**
|
||||||
|
** You should have received a copy of the GNU Affero General Public License
|
||||||
|
** along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
** =============================================================================
|
||||||
|
*/
|
||||||
|
|
||||||
#include "scripteditortheme.h"
|
#include "scripteditortheme.h"
|
||||||
|
|
||||||
#include <QFile>
|
#include <QFile>
|
||||||
|
|
|
@ -1,3 +1,20 @@
|
||||||
|
/*==============================================================================
|
||||||
|
** Copyright (C) 2024-2027 WingSummer
|
||||||
|
**
|
||||||
|
** This program is free software: you can redistribute it and/or modify it under
|
||||||
|
** the terms of the GNU Affero General Public License as published by the Free
|
||||||
|
** Software Foundation, version 3.
|
||||||
|
**
|
||||||
|
** This program is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
** ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
||||||
|
** FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
|
||||||
|
** details.
|
||||||
|
**
|
||||||
|
** You should have received a copy of the GNU Affero General Public License
|
||||||
|
** along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
** =============================================================================
|
||||||
|
*/
|
||||||
|
|
||||||
#ifndef SCRIPTEDITORTHEME_H
|
#ifndef SCRIPTEDITORTHEME_H
|
||||||
#define SCRIPTEDITORTHEME_H
|
#define SCRIPTEDITORTHEME_H
|
||||||
|
|
||||||
|
|
|
@ -1,3 +1,20 @@
|
||||||
|
/*==============================================================================
|
||||||
|
** Copyright (C) 2024-2027 WingSummer
|
||||||
|
**
|
||||||
|
** This program is free software: you can redistribute it and/or modify it under
|
||||||
|
** the terms of the GNU Affero General Public License as published by the Free
|
||||||
|
** Software Foundation, version 3.
|
||||||
|
**
|
||||||
|
** This program is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
** ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
||||||
|
** FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
|
||||||
|
** details.
|
||||||
|
**
|
||||||
|
** You should have received a copy of the GNU Affero General Public License
|
||||||
|
** along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
** =============================================================================
|
||||||
|
*/
|
||||||
|
|
||||||
#include "scriptmachine.h"
|
#include "scriptmachine.h"
|
||||||
|
|
||||||
#include "AngelScript/sdk/add_on/datetime/datetime.h"
|
#include "AngelScript/sdk/add_on/datetime/datetime.h"
|
||||||
|
|
|
@ -1,3 +1,20 @@
|
||||||
|
/*==============================================================================
|
||||||
|
** Copyright (C) 2024-2027 WingSummer
|
||||||
|
**
|
||||||
|
** This program is free software: you can redistribute it and/or modify it under
|
||||||
|
** the terms of the GNU Affero General Public License as published by the Free
|
||||||
|
** Software Foundation, version 3.
|
||||||
|
**
|
||||||
|
** This program is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
** ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
||||||
|
** FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
|
||||||
|
** details.
|
||||||
|
**
|
||||||
|
** You should have received a copy of the GNU Affero General Public License
|
||||||
|
** along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
** =============================================================================
|
||||||
|
*/
|
||||||
|
|
||||||
#ifndef SCRIPTMACHINE_H
|
#ifndef SCRIPTMACHINE_H
|
||||||
#define SCRIPTMACHINE_H
|
#define SCRIPTMACHINE_H
|
||||||
|
|
||||||
|
|
|
@ -1,3 +1,20 @@
|
||||||
|
/*==============================================================================
|
||||||
|
** Copyright (C) 2024-2027 WingSummer
|
||||||
|
**
|
||||||
|
** This program is free software: you can redistribute it and/or modify it under
|
||||||
|
** the terms of the GNU Affero General Public License as published by the Free
|
||||||
|
** Software Foundation, version 3.
|
||||||
|
**
|
||||||
|
** This program is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
** ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
||||||
|
** FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
|
||||||
|
** details.
|
||||||
|
**
|
||||||
|
** You should have received a copy of the GNU Affero General Public License
|
||||||
|
** along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
** =============================================================================
|
||||||
|
*/
|
||||||
|
|
||||||
#include "scriptmanager.h"
|
#include "scriptmanager.h"
|
||||||
|
|
||||||
#include "dbghelper.h"
|
#include "dbghelper.h"
|
||||||
|
|
|
@ -1,3 +1,20 @@
|
||||||
|
/*==============================================================================
|
||||||
|
** Copyright (C) 2024-2027 WingSummer
|
||||||
|
**
|
||||||
|
** This program is free software: you can redistribute it and/or modify it under
|
||||||
|
** the terms of the GNU Affero General Public License as published by the Free
|
||||||
|
** Software Foundation, version 3.
|
||||||
|
**
|
||||||
|
** This program is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
** ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
||||||
|
** FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
|
||||||
|
** details.
|
||||||
|
**
|
||||||
|
** You should have received a copy of the GNU Affero General Public License
|
||||||
|
** along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
** =============================================================================
|
||||||
|
*/
|
||||||
|
|
||||||
#ifndef SCRIPTMANAGER_H
|
#ifndef SCRIPTMANAGER_H
|
||||||
#define SCRIPTMANAGER_H
|
#define SCRIPTMANAGER_H
|
||||||
|
|
||||||
|
|
|
@ -1,3 +1,20 @@
|
||||||
|
/*==============================================================================
|
||||||
|
** Copyright (C) 2024-2027 WingSummer
|
||||||
|
**
|
||||||
|
** This program is free software: you can redistribute it and/or modify it under
|
||||||
|
** the terms of the GNU Affero General Public License as published by the Free
|
||||||
|
** Software Foundation, version 3.
|
||||||
|
**
|
||||||
|
** This program is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
** ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
||||||
|
** FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
|
||||||
|
** details.
|
||||||
|
**
|
||||||
|
** You should have received a copy of the GNU Affero General Public License
|
||||||
|
** along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
** =============================================================================
|
||||||
|
*/
|
||||||
|
|
||||||
#include "settingmanager.h"
|
#include "settingmanager.h"
|
||||||
|
|
||||||
#include "class/logger.h"
|
#include "class/logger.h"
|
||||||
|
|
|
@ -1,3 +1,20 @@
|
||||||
|
/*==============================================================================
|
||||||
|
** Copyright (C) 2024-2027 WingSummer
|
||||||
|
**
|
||||||
|
** This program is free software: you can redistribute it and/or modify it under
|
||||||
|
** the terms of the GNU Affero General Public License as published by the Free
|
||||||
|
** Software Foundation, version 3.
|
||||||
|
**
|
||||||
|
** This program is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
** ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
||||||
|
** FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
|
||||||
|
** details.
|
||||||
|
**
|
||||||
|
** You should have received a copy of the GNU Affero General Public License
|
||||||
|
** along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
** =============================================================================
|
||||||
|
*/
|
||||||
|
|
||||||
#ifndef SETTINGMANAGER_H
|
#ifndef SETTINGMANAGER_H
|
||||||
#define SETTINGMANAGER_H
|
#define SETTINGMANAGER_H
|
||||||
|
|
||||||
|
|
|
@ -1,3 +1,20 @@
|
||||||
|
/*==============================================================================
|
||||||
|
** Copyright (C) 2024-2027 WingSummer
|
||||||
|
**
|
||||||
|
** This program is free software: you can redistribute it and/or modify it under
|
||||||
|
** the terms of the GNU Affero General Public License as published by the Free
|
||||||
|
** Software Foundation, version 3.
|
||||||
|
**
|
||||||
|
** This program is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
** ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
||||||
|
** FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
|
||||||
|
** details.
|
||||||
|
**
|
||||||
|
** You should have received a copy of the GNU Affero General Public License
|
||||||
|
** along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
** =============================================================================
|
||||||
|
*/
|
||||||
|
|
||||||
#include "skinmanager.h"
|
#include "skinmanager.h"
|
||||||
|
|
||||||
#include "dbghelper.h"
|
#include "dbghelper.h"
|
||||||
|
|
|
@ -1,3 +1,20 @@
|
||||||
|
/*==============================================================================
|
||||||
|
** Copyright (C) 2024-2027 WingSummer
|
||||||
|
**
|
||||||
|
** This program is free software: you can redistribute it and/or modify it under
|
||||||
|
** the terms of the GNU Affero General Public License as published by the Free
|
||||||
|
** Software Foundation, version 3.
|
||||||
|
**
|
||||||
|
** This program is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
** ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
||||||
|
** FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
|
||||||
|
** details.
|
||||||
|
**
|
||||||
|
** You should have received a copy of the GNU Affero General Public License
|
||||||
|
** along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
** =============================================================================
|
||||||
|
*/
|
||||||
|
|
||||||
#ifndef SKINMANAGER_H
|
#ifndef SKINMANAGER_H
|
||||||
#define SKINMANAGER_H
|
#define SKINMANAGER_H
|
||||||
|
|
||||||
|
|
|
@ -1,3 +1,20 @@
|
||||||
|
/*==============================================================================
|
||||||
|
** Copyright (C) 2024-2027 WingSummer
|
||||||
|
**
|
||||||
|
** This program is free software: you can redistribute it and/or modify it under
|
||||||
|
** the terms of the GNU Affero General Public License as published by the Free
|
||||||
|
** Software Foundation, version 3.
|
||||||
|
**
|
||||||
|
** This program is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
** ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
||||||
|
** FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
|
||||||
|
** details.
|
||||||
|
**
|
||||||
|
** You should have received a copy of the GNU Affero General Public License
|
||||||
|
** along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
** =============================================================================
|
||||||
|
*/
|
||||||
|
|
||||||
#include "wingangelapi.h"
|
#include "wingangelapi.h"
|
||||||
|
|
||||||
#include "AngelScript/sdk/angelscript/include/angelscript.h"
|
#include "AngelScript/sdk/angelscript/include/angelscript.h"
|
||||||
|
@ -28,13 +45,7 @@ WingAngelAPI::WingAngelAPI() {
|
||||||
_fnbuffer.reserve(signalCount);
|
_fnbuffer.reserve(signalCount);
|
||||||
}
|
}
|
||||||
|
|
||||||
WingAngelAPI::~WingAngelAPI() {
|
WingAngelAPI::~WingAngelAPI() { _fnbuffer.clear(); }
|
||||||
for (auto &p : _fnbuffer) {
|
|
||||||
auto f = reinterpret_cast<std::function<void(void *)> *>(p);
|
|
||||||
delete f;
|
|
||||||
}
|
|
||||||
_fnbuffer.clear();
|
|
||||||
}
|
|
||||||
|
|
||||||
int WingAngelAPI::sdkVersion() const { return WingHex::SDKVERSION; }
|
int WingAngelAPI::sdkVersion() const { return WingHex::SDKVERSION; }
|
||||||
|
|
||||||
|
|
|
@ -1,10 +1,29 @@
|
||||||
|
/*==============================================================================
|
||||||
|
** Copyright (C) 2024-2027 WingSummer
|
||||||
|
**
|
||||||
|
** This program is free software: you can redistribute it and/or modify it under
|
||||||
|
** the terms of the GNU Affero General Public License as published by the Free
|
||||||
|
** Software Foundation, version 3.
|
||||||
|
**
|
||||||
|
** This program is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
** ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
||||||
|
** FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
|
||||||
|
** details.
|
||||||
|
**
|
||||||
|
** You should have received a copy of the GNU Affero General Public License
|
||||||
|
** along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
** =============================================================================
|
||||||
|
*/
|
||||||
|
|
||||||
#ifndef WINGANGELAPI_H
|
#ifndef WINGANGELAPI_H
|
||||||
#define WINGANGELAPI_H
|
#define WINGANGELAPI_H
|
||||||
|
|
||||||
#include "AngelScript/sdk/add_on/scriptarray/scriptarray.h"
|
#include "AngelScript/sdk/add_on/scriptarray/scriptarray.h"
|
||||||
#include "plugin/iwingplugin.h"
|
#include "plugin/iwingplugin.h"
|
||||||
|
|
||||||
|
#include <any>
|
||||||
#include <functional>
|
#include <functional>
|
||||||
|
#include <vector>
|
||||||
|
|
||||||
class asIScriptEngine;
|
class asIScriptEngine;
|
||||||
|
|
||||||
|
@ -45,11 +64,11 @@ private:
|
||||||
template <class T>
|
template <class T>
|
||||||
void registerAPI(asIScriptEngine *engine, const std::function<T> &fn,
|
void registerAPI(asIScriptEngine *engine, const std::function<T> &fn,
|
||||||
const char *sig) {
|
const char *sig) {
|
||||||
auto *f = new std::function<T>(fn);
|
_fnbuffer.push_back(fn);
|
||||||
auto r = engine->RegisterGlobalFunction(
|
auto r = engine->RegisterGlobalFunction(
|
||||||
sig, asMETHOD(std::function<T>, operator()),
|
sig, asMETHOD(std::function<T>, operator()),
|
||||||
asCALL_THISCALL_ASGLOBAL, f);
|
asCALL_THISCALL_ASGLOBAL,
|
||||||
_fnbuffer << f;
|
std::any_cast<std::function<T>>(&_fnbuffer.back()));
|
||||||
Q_ASSERT(r >= 0);
|
Q_ASSERT(r >= 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -118,7 +137,7 @@ private:
|
||||||
const CScriptArray &headerNames);
|
const CScriptArray &headerNames);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QVector<void *> _fnbuffer;
|
std::vector<std::any> _fnbuffer;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // WINGANGELAPI_H
|
#endif // WINGANGELAPI_H
|
||||||
|
|
|
@ -1,3 +1,20 @@
|
||||||
|
/*==============================================================================
|
||||||
|
** Copyright (C) 2024-2027 WingSummer
|
||||||
|
**
|
||||||
|
** This program is free software: you can redistribute it and/or modify it under
|
||||||
|
** the terms of the GNU Affero General Public License as published by the Free
|
||||||
|
** Software Foundation, version 3.
|
||||||
|
**
|
||||||
|
** This program is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
** ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
||||||
|
** FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
|
||||||
|
** details.
|
||||||
|
**
|
||||||
|
** You should have received a copy of the GNU Affero General Public License
|
||||||
|
** along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
** =============================================================================
|
||||||
|
*/
|
||||||
|
|
||||||
#include "wingfiledialog.h"
|
#include "wingfiledialog.h"
|
||||||
#include "../dialog/framelessdialogbase.h"
|
#include "../dialog/framelessdialogbase.h"
|
||||||
#include "settingmanager.h"
|
#include "settingmanager.h"
|
||||||
|
|
|
@ -1,3 +1,20 @@
|
||||||
|
/*==============================================================================
|
||||||
|
** Copyright (C) 2024-2027 WingSummer
|
||||||
|
**
|
||||||
|
** This program is free software: you can redistribute it and/or modify it under
|
||||||
|
** the terms of the GNU Affero General Public License as published by the Free
|
||||||
|
** Software Foundation, version 3.
|
||||||
|
**
|
||||||
|
** This program is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
** ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
||||||
|
** FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
|
||||||
|
** details.
|
||||||
|
**
|
||||||
|
** You should have received a copy of the GNU Affero General Public License
|
||||||
|
** along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
** =============================================================================
|
||||||
|
*/
|
||||||
|
|
||||||
#ifndef WINGFILEDIALOG_H
|
#ifndef WINGFILEDIALOG_H
|
||||||
#define WINGFILEDIALOG_H
|
#define WINGFILEDIALOG_H
|
||||||
|
|
||||||
|
|
|
@ -1,3 +1,20 @@
|
||||||
|
/*==============================================================================
|
||||||
|
** Copyright (C) 2024-2027 WingSummer
|
||||||
|
**
|
||||||
|
** This program is free software: you can redistribute it and/or modify it under
|
||||||
|
** the terms of the GNU Affero General Public License as published by the Free
|
||||||
|
** Software Foundation, version 3.
|
||||||
|
**
|
||||||
|
** This program is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
** ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
||||||
|
** FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
|
||||||
|
** details.
|
||||||
|
**
|
||||||
|
** You should have received a copy of the GNU Affero General Public License
|
||||||
|
** along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
** =============================================================================
|
||||||
|
*/
|
||||||
|
|
||||||
#include "winginputdialog.h"
|
#include "winginputdialog.h"
|
||||||
#include "../dialog/framelessdialogbase.h"
|
#include "../dialog/framelessdialogbase.h"
|
||||||
|
|
||||||
|
|
|
@ -1,3 +1,20 @@
|
||||||
|
/*==============================================================================
|
||||||
|
** Copyright (C) 2024-2027 WingSummer
|
||||||
|
**
|
||||||
|
** This program is free software: you can redistribute it and/or modify it under
|
||||||
|
** the terms of the GNU Affero General Public License as published by the Free
|
||||||
|
** Software Foundation, version 3.
|
||||||
|
**
|
||||||
|
** This program is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
** ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
||||||
|
** FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
|
||||||
|
** details.
|
||||||
|
**
|
||||||
|
** You should have received a copy of the GNU Affero General Public License
|
||||||
|
** along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
** =============================================================================
|
||||||
|
*/
|
||||||
|
|
||||||
#ifndef WINGINPUTDIALOG_H
|
#ifndef WINGINPUTDIALOG_H
|
||||||
#define WINGINPUTDIALOG_H
|
#define WINGINPUTDIALOG_H
|
||||||
|
|
||||||
|
|
|
@ -1,3 +1,20 @@
|
||||||
|
/*==============================================================================
|
||||||
|
** Copyright (C) 2024-2027 WingSummer
|
||||||
|
**
|
||||||
|
** This program is free software: you can redistribute it and/or modify it under
|
||||||
|
** the terms of the GNU Affero General Public License as published by the Free
|
||||||
|
** Software Foundation, version 3.
|
||||||
|
**
|
||||||
|
** This program is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
** ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
||||||
|
** FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
|
||||||
|
** details.
|
||||||
|
**
|
||||||
|
** You should have received a copy of the GNU Affero General Public License
|
||||||
|
** along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
** =============================================================================
|
||||||
|
*/
|
||||||
|
|
||||||
#include "wingmessagebox.h"
|
#include "wingmessagebox.h"
|
||||||
#include "class/eventfilter.h"
|
#include "class/eventfilter.h"
|
||||||
#include "dialog/framelessdialogbase.h"
|
#include "dialog/framelessdialogbase.h"
|
||||||
|
|
|
@ -1,3 +1,20 @@
|
||||||
|
/*==============================================================================
|
||||||
|
** Copyright (C) 2024-2027 WingSummer
|
||||||
|
**
|
||||||
|
** This program is free software: you can redistribute it and/or modify it under
|
||||||
|
** the terms of the GNU Affero General Public License as published by the Free
|
||||||
|
** Software Foundation, version 3.
|
||||||
|
**
|
||||||
|
** This program is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
** ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
||||||
|
** FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
|
||||||
|
** details.
|
||||||
|
**
|
||||||
|
** You should have received a copy of the GNU Affero General Public License
|
||||||
|
** along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
** =============================================================================
|
||||||
|
*/
|
||||||
|
|
||||||
#ifndef WINGMESSAGEBOX_H
|
#ifndef WINGMESSAGEBOX_H
|
||||||
#define WINGMESSAGEBOX_H
|
#define WINGMESSAGEBOX_H
|
||||||
|
|
||||||
|
|
|
@ -1,3 +1,20 @@
|
||||||
|
/*==============================================================================
|
||||||
|
** Copyright (C) 2024-2027 WingSummer
|
||||||
|
**
|
||||||
|
** This program is free software: you can redistribute it and/or modify it under
|
||||||
|
** the terms of the GNU Affero General Public License as published by the Free
|
||||||
|
** Software Foundation, version 3.
|
||||||
|
**
|
||||||
|
** This program is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
** ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
||||||
|
** FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
|
||||||
|
** details.
|
||||||
|
**
|
||||||
|
** You should have received a copy of the GNU Affero General Public License
|
||||||
|
** along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
** =============================================================================
|
||||||
|
*/
|
||||||
|
|
||||||
#include "wingprogressdialog.h"
|
#include "wingprogressdialog.h"
|
||||||
|
|
||||||
WingProgressDialog::WingProgressDialog(const QString &labelText,
|
WingProgressDialog::WingProgressDialog(const QString &labelText,
|
||||||
|
|
|
@ -1,3 +1,20 @@
|
||||||
|
/*==============================================================================
|
||||||
|
** Copyright (C) 2024-2027 WingSummer
|
||||||
|
**
|
||||||
|
** This program is free software: you can redistribute it and/or modify it under
|
||||||
|
** the terms of the GNU Affero General Public License as published by the Free
|
||||||
|
** Software Foundation, version 3.
|
||||||
|
**
|
||||||
|
** This program is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
** ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
||||||
|
** FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
|
||||||
|
** details.
|
||||||
|
**
|
||||||
|
** You should have received a copy of the GNU Affero General Public License
|
||||||
|
** along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
** =============================================================================
|
||||||
|
*/
|
||||||
|
|
||||||
#ifndef WINGPROGRESSDIALOG_H
|
#ifndef WINGPROGRESSDIALOG_H
|
||||||
#define WINGPROGRESSDIALOG_H
|
#define WINGPROGRESSDIALOG_H
|
||||||
|
|
||||||
|
|
|
@ -1,3 +1,20 @@
|
||||||
|
/*==============================================================================
|
||||||
|
** Copyright (C) 2024-2027 WingSummer
|
||||||
|
**
|
||||||
|
** This program is free software: you can redistribute it and/or modify it under
|
||||||
|
** the terms of the GNU Affero General Public License as published by the Free
|
||||||
|
** Software Foundation, version 3.
|
||||||
|
**
|
||||||
|
** This program is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
** ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
||||||
|
** FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
|
||||||
|
** details.
|
||||||
|
**
|
||||||
|
** You should have received a copy of the GNU Affero General Public License
|
||||||
|
** along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
** =============================================================================
|
||||||
|
*/
|
||||||
|
|
||||||
#include "workspacemanager.h"
|
#include "workspacemanager.h"
|
||||||
#include <QDir>
|
#include <QDir>
|
||||||
#include <QFile>
|
#include <QFile>
|
||||||
|
|
|
@ -1,3 +1,20 @@
|
||||||
|
/*==============================================================================
|
||||||
|
** Copyright (C) 2024-2027 WingSummer
|
||||||
|
**
|
||||||
|
** This program is free software: you can redistribute it and/or modify it under
|
||||||
|
** the terms of the GNU Affero General Public License as published by the Free
|
||||||
|
** Software Foundation, version 3.
|
||||||
|
**
|
||||||
|
** This program is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
** ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
||||||
|
** FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
|
||||||
|
** details.
|
||||||
|
**
|
||||||
|
** You should have received a copy of the GNU Affero General Public License
|
||||||
|
** along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
** =============================================================================
|
||||||
|
*/
|
||||||
|
|
||||||
#ifndef WORKSPACEMANAGER_H
|
#ifndef WORKSPACEMANAGER_H
|
||||||
#define WORKSPACEMANAGER_H
|
#define WORKSPACEMANAGER_H
|
||||||
|
|
||||||
|
|
|
@ -1,33 +0,0 @@
|
||||||
/****************************************************************************
|
|
||||||
**
|
|
||||||
** Copyright (C) 2006-2009 fullmetalcoder <fullmetalcoder@hotmail.fr>
|
|
||||||
**
|
|
||||||
** This file is part of the Edyuk project <http://edyuk.org>
|
|
||||||
**
|
|
||||||
** This file may be used under the terms of the GNU General Public License
|
|
||||||
** version 3 as published by the Free Software Foundation and appearing in the
|
|
||||||
** file GPL.txt included in the packaging of this file.
|
|
||||||
**
|
|
||||||
** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
|
|
||||||
** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
|
||||||
**
|
|
||||||
****************************************************************************/
|
|
||||||
|
|
||||||
#ifndef _QCM_CONFIG_H_
|
|
||||||
#define _QCM_CONFIG_H_
|
|
||||||
|
|
||||||
#include <qglobal.h>
|
|
||||||
|
|
||||||
#ifndef QCM_EXPORT
|
|
||||||
#define QCM_EXPORT
|
|
||||||
#endif
|
|
||||||
|
|
||||||
class QByteArray;
|
|
||||||
|
|
||||||
template <typename T>
|
|
||||||
class QList;
|
|
||||||
|
|
||||||
typedef QByteArray QToken;
|
|
||||||
typedef QList<QToken> QTokenList;
|
|
||||||
|
|
||||||
#endif // _QCM_CONFIG_H_
|
|
|
@ -34,7 +34,7 @@ void QCodeModel::q_cache(QCodeNode *n, QByteArray cxt = QByteArray()) {
|
||||||
// qDebug("Caching %s [0x%x] in 0x%x", cxt.constData(), n, this);
|
// qDebug("Caching %s [0x%x] in 0x%x", cxt.constData(), n, this);
|
||||||
}
|
}
|
||||||
|
|
||||||
for (auto &child : n->children) {
|
for (auto &child : n->children()) {
|
||||||
q_cache(child, cxt);
|
q_cache(child, cxt);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -46,7 +46,7 @@ void QCodeModel::q_uncache(QCodeNode *n, QByteArray cxt = QByteArray()) {
|
||||||
// qDebug("De-Caching %s", cxt.constData());
|
// qDebug("De-Caching %s", cxt.constData());
|
||||||
}
|
}
|
||||||
|
|
||||||
for (auto &child : n->children) {
|
for (auto &child : n->children()) {
|
||||||
q_uncache(child, cxt);
|
q_uncache(child, cxt);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -92,7 +92,7 @@ void QCodeModel::beginRemoveRows(const QModelIndex idx, int beg, int end) {
|
||||||
|
|
||||||
Q_EXTRACT_INDEX(idx, parent)
|
Q_EXTRACT_INDEX(idx, parent)
|
||||||
|
|
||||||
const QList<QCodeNode *> &l = parent ? parent->children : m_topLevel;
|
const QList<QCodeNode *> &l = parent ? parent->children() : m_topLevel;
|
||||||
|
|
||||||
QByteArray cxt;
|
QByteArray cxt;
|
||||||
|
|
||||||
|
@ -113,7 +113,7 @@ void QCodeModel::endInsertRows() {
|
||||||
CacheOp op = m_cache_ops.pop();
|
CacheOp op = m_cache_ops.pop();
|
||||||
|
|
||||||
const QList<QCodeNode *> &l =
|
const QList<QCodeNode *> &l =
|
||||||
op.parent ? op.parent->children : m_topLevel;
|
op.parent ? op.parent->children() : m_topLevel;
|
||||||
|
|
||||||
QByteArray cxt;
|
QByteArray cxt;
|
||||||
|
|
||||||
|
@ -152,9 +152,9 @@ void QCodeModel::appendTopLevelNode(QCodeNode *n) {
|
||||||
|
|
||||||
while (nodes.count()) {
|
while (nodes.count()) {
|
||||||
n = nodes.pop();
|
n = nodes.pop();
|
||||||
n->model = this;
|
n->setModel(this);
|
||||||
|
|
||||||
foreach (QCodeNode *c, n->children)
|
foreach (QCodeNode *c, n->children())
|
||||||
nodes.push(c);
|
nodes.push(c);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -179,9 +179,9 @@ void QCodeModel::removeTopLevelNode(QCodeNode *n) {
|
||||||
|
|
||||||
while (nodes.count()) {
|
while (nodes.count()) {
|
||||||
n = nodes.pop();
|
n = nodes.pop();
|
||||||
n->model = nullptr;
|
n->setModel(nullptr);
|
||||||
|
|
||||||
for (auto &c : n->children) {
|
for (auto &c : n->children()) {
|
||||||
nodes.push(c);
|
nodes.push(c);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -260,7 +260,7 @@ QList<QCodeNode *> QCodeModel::findRootNodes(const QByteArray &name) {
|
||||||
QList<QCodeNode *> l;
|
QList<QCodeNode *> l;
|
||||||
|
|
||||||
for (auto &g : m_topLevel) {
|
for (auto &g : m_topLevel) {
|
||||||
for (auto &r : g->children) {
|
for (auto &r : g->children()) {
|
||||||
if (r->role(QCodeNode::Name) == name)
|
if (r->role(QCodeNode::Name) == name)
|
||||||
l << r;
|
l << r;
|
||||||
}
|
}
|
||||||
|
@ -296,10 +296,6 @@ bool QCodeModel::isCachable(QCodeNode *n, QByteArray &cxt) const {
|
||||||
cxt += qn;
|
cxt += qn;
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
} else if (t == QCodeNode::Language) {
|
|
||||||
|
|
||||||
cxt += n->role(QCodeNode::Name); // + "/";
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
|
@ -321,7 +317,7 @@ int QCodeModel::rowCount(const QModelIndex &parent) const {
|
||||||
|
|
||||||
Q_EXTRACT_INDEX(parent, item)
|
Q_EXTRACT_INDEX(parent, item)
|
||||||
|
|
||||||
return item ? item->children.count() : 0;
|
return item ? item->children().count() : 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
|
@ -371,8 +367,8 @@ QCodeNode *QCodeModel::node(const QModelIndex &idx) const {
|
||||||
\brief Please read Qt docs on Model/View framework for more informations
|
\brief Please read Qt docs on Model/View framework for more informations
|
||||||
*/
|
*/
|
||||||
QModelIndex QCodeModel::index(QCodeNode *n) const {
|
QModelIndex QCodeModel::index(QCodeNode *n) const {
|
||||||
return n ? createIndex(n->parent ? n->parent->children.indexOf(n)
|
return n ? createIndex(n->parent() ? n->parent()->children().indexOf(n)
|
||||||
: m_topLevel.indexOf(n),
|
: m_topLevel.indexOf(n),
|
||||||
0, n)
|
0, n)
|
||||||
: QModelIndex();
|
: QModelIndex();
|
||||||
}
|
}
|
||||||
|
@ -392,8 +388,8 @@ QModelIndex QCodeModel::index(int row, int column,
|
||||||
|
|
||||||
if (!parent.isValid() && (row < m_topLevel.count())) {
|
if (!parent.isValid() && (row < m_topLevel.count())) {
|
||||||
abs = m_topLevel.at(row);
|
abs = m_topLevel.at(row);
|
||||||
} else if (item && (row < item->children.count())) {
|
} else if (item && (row < item->children().count())) {
|
||||||
abs = item->children.at(row);
|
abs = item->children().at(row);
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef _TRACE_MODEL_
|
#ifdef _TRACE_MODEL_
|
||||||
|
@ -420,7 +416,7 @@ QModelIndex QCodeModel::parent(const QModelIndex &index) const {
|
||||||
Q_EXTRACT_INDEX(index, child)
|
Q_EXTRACT_INDEX(index, child)
|
||||||
|
|
||||||
if (child)
|
if (child)
|
||||||
parent = child->parent;
|
parent = child->parent();
|
||||||
|
|
||||||
#ifdef _TRACE_MODEL_
|
#ifdef _TRACE_MODEL_
|
||||||
|
|
||||||
|
@ -435,8 +431,9 @@ QModelIndex QCodeModel::parent(const QModelIndex &index) const {
|
||||||
if (!parent)
|
if (!parent)
|
||||||
return QModelIndex();
|
return QModelIndex();
|
||||||
|
|
||||||
const int row = parent->parent ? parent->parent->children.indexOf(parent)
|
const int row = parent->parent()
|
||||||
: m_topLevel.indexOf(parent);
|
? parent->parent()->children().indexOf(parent)
|
||||||
|
: m_topLevel.indexOf(parent);
|
||||||
|
|
||||||
return createIndex(row, 0, parent);
|
return createIndex(row, 0, parent);
|
||||||
}
|
}
|
||||||
|
|
|
@ -16,18 +16,16 @@
|
||||||
#ifndef _QCODE_MODEL_H_
|
#ifndef _QCODE_MODEL_H_
|
||||||
#define _QCODE_MODEL_H_
|
#define _QCODE_MODEL_H_
|
||||||
|
|
||||||
#include "qcm-config.h"
|
|
||||||
|
|
||||||
#include <QAbstractItemModel>
|
#include <QAbstractItemModel>
|
||||||
#include <QHash>
|
#include <QHash>
|
||||||
#include <QStack>
|
#include <QStack>
|
||||||
|
|
||||||
struct QCodeNode;
|
class QCodeNode;
|
||||||
|
|
||||||
class QCM_EXPORT QCodeModel : public QAbstractItemModel {
|
class QCodeModel : public QAbstractItemModel {
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
friend struct QCodeNode;
|
friend class QCodeNode;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
enum ExtraRoles { TypeRole = Qt::UserRole, VisibilityRole };
|
enum ExtraRoles { TypeRole = Qt::UserRole, VisibilityRole };
|
||||||
|
|
|
@ -90,86 +90,15 @@ static QIcon icon(int cacheIndex) {
|
||||||
return q_icon_cache.value(cacheIndex);
|
return q_icon_cache.value(cacheIndex);
|
||||||
}
|
}
|
||||||
|
|
||||||
QByteArray section(const QByteArray &b, char c, int beg, int end = -1) {
|
QCodeNode::QCodeNode() : line(-1), _parent(0), _model(0) {}
|
||||||
QList<QByteArray> l = b.split(c);
|
|
||||||
|
|
||||||
// qDebug("split %s into %i parts...", b.constData(), l.length());
|
|
||||||
// qDebug("parts %i to %i", beg, end);
|
|
||||||
|
|
||||||
if (beg < 0)
|
|
||||||
beg = l.length() + beg;
|
|
||||||
|
|
||||||
if (end < 0)
|
|
||||||
end = l.length() + end;
|
|
||||||
|
|
||||||
int start = qMin(beg, end), stop = qMax(beg, end);
|
|
||||||
|
|
||||||
// qDebug("parts %i to %i", start, stop);
|
|
||||||
|
|
||||||
if ((start >= l.length()) || (stop < 0))
|
|
||||||
return QByteArray();
|
|
||||||
|
|
||||||
QByteArray sec = l.at(start);
|
|
||||||
|
|
||||||
while (++start <= stop)
|
|
||||||
sec.prepend(c).prepend(l.at(start));
|
|
||||||
|
|
||||||
return sec;
|
|
||||||
}
|
|
||||||
|
|
||||||
void setSection(QByteArray &b, char c, int beg, int end = -1,
|
|
||||||
const QByteArray &r = QByteArray()) {
|
|
||||||
QList<QByteArray> l = b.split(c);
|
|
||||||
|
|
||||||
if (beg < 0)
|
|
||||||
beg = l.length() + beg;
|
|
||||||
|
|
||||||
if (end < 0)
|
|
||||||
end = l.length() + end;
|
|
||||||
|
|
||||||
int offset = 0, length = 0;
|
|
||||||
int start = qMin(beg, end), stop = qMax(beg, end);
|
|
||||||
|
|
||||||
if ((start >= l.length()) || (stop < 0))
|
|
||||||
return;
|
|
||||||
|
|
||||||
for (int i = 0; i < start; ++i)
|
|
||||||
offset += l.at(i).length() + 1;
|
|
||||||
|
|
||||||
for (int i = start; i <= stop; ++i)
|
|
||||||
length += l.at(i).length() + 1;
|
|
||||||
|
|
||||||
--length;
|
|
||||||
|
|
||||||
/*
|
|
||||||
qDebug("set section [%i, %i]=>[%i, %i] of \"%s\" to \"%s\"",
|
|
||||||
beg, end,
|
|
||||||
offset, offset + length,
|
|
||||||
b.constData(),
|
|
||||||
r.constData());
|
|
||||||
*/
|
|
||||||
|
|
||||||
b.replace(offset, length, r);
|
|
||||||
}
|
|
||||||
|
|
||||||
void QCodeNode::operator delete(void *p) {
|
|
||||||
QCodeNode *n = static_cast<QCodeNode *>(p);
|
|
||||||
|
|
||||||
if (!n)
|
|
||||||
return;
|
|
||||||
else
|
|
||||||
::operator delete(p);
|
|
||||||
}
|
|
||||||
|
|
||||||
QCodeNode::QCodeNode() : line(-1), parent(0), model(0) {}
|
|
||||||
|
|
||||||
QCodeNode::~QCodeNode() {
|
QCodeNode::~QCodeNode() {
|
||||||
detach();
|
QCodeNode::detach();
|
||||||
|
|
||||||
model = nullptr;
|
_model = nullptr;
|
||||||
parent = nullptr;
|
_parent = nullptr;
|
||||||
|
|
||||||
clear();
|
QCodeNode::clear();
|
||||||
|
|
||||||
QSourceCodeWatcher *w = QSourceCodeWatcher::watcher(this, nullptr);
|
QSourceCodeWatcher *w = QSourceCodeWatcher::watcher(this, nullptr);
|
||||||
|
|
||||||
|
@ -180,10 +109,10 @@ QCodeNode::~QCodeNode() {
|
||||||
void QCodeNode::attach(QCodeNode *p) {
|
void QCodeNode::attach(QCodeNode *p) {
|
||||||
detach();
|
detach();
|
||||||
|
|
||||||
if (!p || p->children.contains(this))
|
if (!p || p->_children.contains(this))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
bool modelChange = model != p->model;
|
bool modelChange = _model != p->_model;
|
||||||
|
|
||||||
if (modelChange) {
|
if (modelChange) {
|
||||||
QStack<QCodeNode *> tree;
|
QStack<QCodeNode *> tree;
|
||||||
|
@ -193,44 +122,44 @@ void QCodeNode::attach(QCodeNode *p) {
|
||||||
while (tree.length()) {
|
while (tree.length()) {
|
||||||
QCodeNode *n = tree.pop();
|
QCodeNode *n = tree.pop();
|
||||||
|
|
||||||
n->model = p->model;
|
n->_model = p->_model;
|
||||||
|
|
||||||
foreach (QCodeNode *c, n->children)
|
foreach (QCodeNode *c, n->_children)
|
||||||
tree.push(c);
|
tree.push(c);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
int row = p->children.length();
|
int row = p->_children.length();
|
||||||
|
|
||||||
if (model)
|
if (_model)
|
||||||
model->beginInsertRows(model->index(p), row, row);
|
_model->beginInsertRows(_model->index(p), row, row);
|
||||||
|
|
||||||
parent = p;
|
_parent = p;
|
||||||
p->children.insert(row, this);
|
p->_children.insert(row, this);
|
||||||
|
|
||||||
if (model)
|
if (_model)
|
||||||
model->endInsertRows();
|
_model->endInsertRows();
|
||||||
}
|
}
|
||||||
|
|
||||||
void QCodeNode::detach() {
|
void QCodeNode::detach() {
|
||||||
if (!parent)
|
if (!_parent)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
int row = parent->children.indexOf(this);
|
int row = _parent->_children.indexOf(this);
|
||||||
|
|
||||||
if (row < 0)
|
if (row < 0)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (model)
|
if (_model)
|
||||||
model->beginRemoveRows(model->index(parent), row, row);
|
_model->beginRemoveRows(_model->index(_parent), row, row);
|
||||||
|
|
||||||
parent->children.removeAt(row);
|
_parent->_children.removeAt(row);
|
||||||
parent = 0;
|
_parent = 0;
|
||||||
|
|
||||||
if (model)
|
if (_model)
|
||||||
model->endRemoveRows();
|
_model->endRemoveRows();
|
||||||
|
|
||||||
if (model) {
|
if (_model) {
|
||||||
QStack<QCodeNode *> tree;
|
QStack<QCodeNode *> tree;
|
||||||
|
|
||||||
tree.push(this);
|
tree.push(this);
|
||||||
|
@ -238,16 +167,28 @@ void QCodeNode::detach() {
|
||||||
while (tree.length()) {
|
while (tree.length()) {
|
||||||
QCodeNode *n = tree.pop();
|
QCodeNode *n = tree.pop();
|
||||||
|
|
||||||
n->model = 0;
|
n->_model = 0;
|
||||||
|
|
||||||
foreach (QCodeNode *c, n->children)
|
foreach (QCodeNode *c, n->_children)
|
||||||
tree.push(c);
|
tree.push(c);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QCodeModel *QCodeNode::model() const { return _model; }
|
||||||
|
|
||||||
|
void QCodeNode::setModel(QCodeModel *newModel) { _model = newModel; }
|
||||||
|
|
||||||
|
QCodeNode *QCodeNode::parent() const { return _parent; }
|
||||||
|
|
||||||
|
void QCodeNode::setParent(QCodeNode *newParent) { _parent = newParent; }
|
||||||
|
|
||||||
|
int QCodeNode::getLine() const { return line; }
|
||||||
|
|
||||||
|
void QCodeNode::setLine(int newLine) { line = newLine; }
|
||||||
|
|
||||||
void QCodeNode::clear() {
|
void QCodeNode::clear() {
|
||||||
QList<QCodeNode *> c = children;
|
QList<QCodeNode *> c = _children;
|
||||||
|
|
||||||
removeAll();
|
removeAll();
|
||||||
|
|
||||||
|
@ -255,66 +196,61 @@ void QCodeNode::clear() {
|
||||||
}
|
}
|
||||||
|
|
||||||
void QCodeNode::removeAll() {
|
void QCodeNode::removeAll() {
|
||||||
if (children.isEmpty())
|
if (_children.isEmpty())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (model)
|
if (_model)
|
||||||
model->beginRemoveRows(model->index(this), 0, children.length() - 1);
|
_model->beginRemoveRows(_model->index(this), 0, _children.length() - 1);
|
||||||
|
|
||||||
foreach (QCodeNode *n, children) {
|
foreach (QCodeNode *n, _children) {
|
||||||
n->model = 0;
|
n->_model = nullptr;
|
||||||
n->parent = 0;
|
n->_parent = nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
children.clear();
|
_children.clear();
|
||||||
|
|
||||||
if (model)
|
if (_model)
|
||||||
model->endRemoveRows();
|
_model->endRemoveRows();
|
||||||
}
|
}
|
||||||
|
|
||||||
int QCodeNode::type() const {
|
int QCodeNode::type() const {
|
||||||
return roles.length() ? role(NodeType).at(0) : 0;
|
return roles.value(NodeType, QByteArray(1, 0)).at(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
QByteArray QCodeNode::context() const {
|
QByteArray QCodeNode::context() const {
|
||||||
int t = type();
|
int t = type();
|
||||||
|
|
||||||
if ((t == Group) || (t == Language) || (t == Namespace))
|
if ((t == Group) || (t == Namespace))
|
||||||
return QByteArray();
|
return QByteArray();
|
||||||
|
|
||||||
const QCodeNode *p = this;
|
const QCodeNode *p = this;
|
||||||
|
|
||||||
while (p->parent) {
|
while (p->_parent) {
|
||||||
int t = p->parent->type();
|
int t = p->_parent->type();
|
||||||
|
|
||||||
if ((t == Group) || (t == Language) || (t == Namespace))
|
if ((t == Group) || (t == Namespace))
|
||||||
break;
|
break;
|
||||||
|
|
||||||
p = p->parent;
|
p = p->_parent;
|
||||||
}
|
}
|
||||||
|
|
||||||
return p ? p->role(Context) : role(Context);
|
return p ? p->role(Context) : role(Context);
|
||||||
}
|
}
|
||||||
|
|
||||||
QByteArray QCodeNode::qualifiedName(bool language) const {
|
QByteArray QCodeNode::qualifiedName(bool ext) const {
|
||||||
int t = type();
|
int t = type();
|
||||||
|
|
||||||
if (t == Group)
|
if (t == Group)
|
||||||
return QByteArray();
|
return QByteArray();
|
||||||
else if (t == Language)
|
|
||||||
return language ? role(Name) : QByteArray();
|
|
||||||
|
|
||||||
QByteArray cxt = parent ? parent->qualifiedName(language) : QByteArray();
|
QByteArray cxt;
|
||||||
|
if (ext) {
|
||||||
if (cxt.length()) {
|
if (_parent && _parent->type() == Namespace) {
|
||||||
// if ( parent->type() == Language )
|
cxt += _parent->role(Name);
|
||||||
// cxt += "/";
|
}
|
||||||
// else
|
|
||||||
cxt += "::";
|
cxt += "::";
|
||||||
}
|
}
|
||||||
|
|
||||||
// cxt += role(Name);
|
|
||||||
|
|
||||||
cxt += role(Name);
|
cxt += role(Name);
|
||||||
|
|
||||||
if (t == Function) {
|
if (t == Function) {
|
||||||
|
@ -537,15 +473,10 @@ QVariant QCodeNode::data(int r) const {
|
||||||
return QVariant();
|
return QVariant();
|
||||||
}
|
}
|
||||||
|
|
||||||
void QCodeNode::setData(int role, const QVariant &v) {
|
QByteArray QCodeNode::role(RoleIndex r) const { return roles.value(r); }
|
||||||
Q_UNUSED(v)
|
|
||||||
Q_UNUSED(role)
|
|
||||||
}
|
|
||||||
|
|
||||||
QByteArray QCodeNode::role(RoleIndex r) const {
|
void QCodeNode::setRole(RoleIndex r, const QByteArray &b) { roles[r] = b; }
|
||||||
return section(roles, '@', (int)r, (int)r);
|
|
||||||
}
|
|
||||||
|
|
||||||
void QCodeNode::setRole(RoleIndex r, const QByteArray &b) {
|
void QCodeNode::setNodeType(DefaultNodeTypes t) {
|
||||||
setSection(roles, '@', (int)r, (int)r, b);
|
setRole(NodeType, QByteArray(1, t));
|
||||||
}
|
}
|
||||||
|
|
|
@ -16,15 +16,15 @@
|
||||||
#ifndef _QCODE_NODE_H_
|
#ifndef _QCODE_NODE_H_
|
||||||
#define _QCODE_NODE_H_
|
#define _QCODE_NODE_H_
|
||||||
|
|
||||||
#include "qcm-config.h"
|
|
||||||
|
|
||||||
#include <QByteArray>
|
#include <QByteArray>
|
||||||
#include <QList>
|
#include <QList>
|
||||||
|
#include <QMap>
|
||||||
#include <QVariant>
|
#include <QVariant>
|
||||||
|
|
||||||
class QCodeModel;
|
class QCodeModel;
|
||||||
|
|
||||||
struct QCM_EXPORT QCodeNode {
|
class QCodeNode {
|
||||||
|
public:
|
||||||
enum RoleIndex {
|
enum RoleIndex {
|
||||||
NodeType = 0,
|
NodeType = 0,
|
||||||
Name = 1,
|
Name = 1,
|
||||||
|
@ -55,9 +55,8 @@ struct QCM_EXPORT QCodeNode {
|
||||||
Context = -1
|
Context = -1
|
||||||
};
|
};
|
||||||
|
|
||||||
enum DefaultNodeTypes {
|
enum DefaultNodeTypes : char {
|
||||||
Group = 'g',
|
Group = 'g',
|
||||||
Language = 'l',
|
|
||||||
|
|
||||||
Class = 'c',
|
Class = 'c',
|
||||||
// Struct = 's',
|
// Struct = 's',
|
||||||
|
@ -113,29 +112,40 @@ public:
|
||||||
QCodeNode();
|
QCodeNode();
|
||||||
virtual ~QCodeNode();
|
virtual ~QCodeNode();
|
||||||
|
|
||||||
void operator delete(void *p);
|
int type() const;
|
||||||
|
QByteArray context() const;
|
||||||
|
QByteArray qualifiedName(bool ext = false) const;
|
||||||
|
|
||||||
virtual int type() const;
|
QVariant data(int role) const;
|
||||||
virtual QByteArray context() const;
|
|
||||||
virtual QByteArray qualifiedName(bool language = true) const;
|
|
||||||
|
|
||||||
virtual QVariant data(int role) const;
|
|
||||||
virtual void setData(int role, const QVariant &v);
|
|
||||||
|
|
||||||
QByteArray role(RoleIndex r) const;
|
QByteArray role(RoleIndex r) const;
|
||||||
void setRole(RoleIndex r, const QByteArray &b);
|
void setRole(RoleIndex r, const QByteArray &b);
|
||||||
|
|
||||||
virtual void clear();
|
QList<QCodeNode *> &children() { return _children; }
|
||||||
virtual void removeAll();
|
|
||||||
|
|
||||||
virtual void attach(QCodeNode *p);
|
void setNodeType(DefaultNodeTypes t);
|
||||||
virtual void detach();
|
|
||||||
|
|
||||||
int line;
|
void clear();
|
||||||
QByteArray roles;
|
void removeAll();
|
||||||
QCodeNode *parent;
|
|
||||||
QCodeModel *model;
|
void attach(QCodeNode *p);
|
||||||
QList<QCodeNode *> children;
|
void detach();
|
||||||
|
|
||||||
|
QCodeModel *model() const;
|
||||||
|
void setModel(QCodeModel *newModel);
|
||||||
|
|
||||||
|
QCodeNode *parent() const;
|
||||||
|
void setParent(QCodeNode *newParent);
|
||||||
|
|
||||||
|
int getLine() const;
|
||||||
|
void setLine(int newLine);
|
||||||
|
|
||||||
|
private:
|
||||||
|
int line = -1;
|
||||||
|
QMap<RoleIndex, QByteArray> roles;
|
||||||
|
QCodeNode *_parent = nullptr;
|
||||||
|
QCodeModel *_model = nullptr;
|
||||||
|
QList<QCodeNode *> _children;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // !_QCODE_NODE_H_
|
#endif // !_QCODE_NODE_H_
|
||||||
|
|
|
@ -24,8 +24,7 @@
|
||||||
#include "qcodenode.h"
|
#include "qcodenode.h"
|
||||||
|
|
||||||
static QList<int> priority = QList<int>()
|
static QList<int> priority = QList<int>()
|
||||||
<< QCodeNode::Group << QCodeNode::Language
|
<< QCodeNode::Group << QCodeNode::Namespace
|
||||||
<< QCodeNode::Namespace
|
|
||||||
<< QCodeNode::Class
|
<< QCodeNode::Class
|
||||||
// << QCodeNode::Struct << QCodeNode::Union
|
// << QCodeNode::Struct << QCodeNode::Union
|
||||||
<< QCodeNode::Enum << QCodeNode::Typedef
|
<< QCodeNode::Enum << QCodeNode::Typedef
|
||||||
|
|
|
@ -16,8 +16,6 @@
|
||||||
#ifndef _QCODE_PROXY_MODEL_H_
|
#ifndef _QCODE_PROXY_MODEL_H_
|
||||||
#define _QCODE_PROXY_MODEL_H_
|
#define _QCODE_PROXY_MODEL_H_
|
||||||
|
|
||||||
#include "qcm-config.h"
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\file qcodeproxymodel.h
|
\file qcodeproxymodel.h
|
||||||
\brief Definition of the QCodeProxyModel class.
|
\brief Definition of the QCodeProxyModel class.
|
||||||
|
@ -25,7 +23,7 @@
|
||||||
|
|
||||||
#include <QSortFilterProxyModel>
|
#include <QSortFilterProxyModel>
|
||||||
|
|
||||||
class QCM_EXPORT QCodeProxyModel : public QSortFilterProxyModel {
|
class QCodeProxyModel : public QSortFilterProxyModel {
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
|
@ -1,195 +0,0 @@
|
||||||
/****************************************************************************
|
|
||||||
**
|
|
||||||
** Copyright (C) 2006-2009 fullmetalcoder <fullmetalcoder@hotmail.fr>
|
|
||||||
**
|
|
||||||
** This file is part of the Edyuk project <http://edyuk.org>
|
|
||||||
**
|
|
||||||
** This file may be used under the terms of the GNU General Public License
|
|
||||||
** version 3 as published by the Free Software Foundation and appearing in the
|
|
||||||
** file GPL.txt included in the packaging of this file.
|
|
||||||
**
|
|
||||||
** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
|
|
||||||
** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
|
||||||
**
|
|
||||||
****************************************************************************/
|
|
||||||
|
|
||||||
#include "qcodeserializer.h"
|
|
||||||
|
|
||||||
/*!
|
|
||||||
\file qcodeserializer.cpp
|
|
||||||
\brief Implementation of the QCodeSerializer class.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "qcodemodel.h"
|
|
||||||
#include "qcodenode.h"
|
|
||||||
|
|
||||||
#include <QFile>
|
|
||||||
#include <QFileInfo>
|
|
||||||
#include <QIODevice>
|
|
||||||
#include <QRegularExpression>
|
|
||||||
#include <QTextStream>
|
|
||||||
|
|
||||||
/*
|
|
||||||
File format :
|
|
||||||
* header : '{' MIME type (text/x-tag) ',' version ',' source '}'
|
|
||||||
* each line represents on node as a at ('@') separated list of roles
|
|
||||||
* each space at the begining of the line represents a parenting level
|
|
||||||
|
|
||||||
*/
|
|
||||||
|
|
||||||
#define Q_VERSION(maj, min, patch) ((maj << 8) | (min << 8) | patch)
|
|
||||||
|
|
||||||
static int _version = Q_VERSION(2, 0, 0);
|
|
||||||
static int _version_min = Q_VERSION(2, 0, 0), _version_max = Q_VERSION(2, 0, 0);
|
|
||||||
static QString header_pattern("{text/x-tag,%1,%2}");
|
|
||||||
static QRegularExpression
|
|
||||||
header_matcher("^\\{text/x-tag,([0-9a-fA-F]+),([^}]+)\\}\n$");
|
|
||||||
|
|
||||||
/*!
|
|
||||||
\class QCodeSerializer
|
|
||||||
\brief Serializer/deserializer for code trees
|
|
||||||
*/
|
|
||||||
|
|
||||||
QCodeSerializer::QCodeSerializer() : m_model(0) {}
|
|
||||||
|
|
||||||
QCodeSerializer::~QCodeSerializer() {}
|
|
||||||
|
|
||||||
QCodeModel *QCodeSerializer::targetModel() const { return m_model; }
|
|
||||||
|
|
||||||
void QCodeSerializer::setTargetModel(QCodeModel *m) { m_model = m; }
|
|
||||||
|
|
||||||
void QCodeSerializer::serialize(QCodeNode *n, QTextStream &out, int indent) {
|
|
||||||
if (!n)
|
|
||||||
return;
|
|
||||||
|
|
||||||
if (indent > 0)
|
|
||||||
out << QByteArray(indent, ' ');
|
|
||||||
else
|
|
||||||
out << header_pattern.arg(QString::number(_version))
|
|
||||||
.arg(QString::fromLocal8Bit(n->role(QCodeNode::Context)))
|
|
||||||
<< Qt::endl;
|
|
||||||
|
|
||||||
out << n->roles << "\n";
|
|
||||||
|
|
||||||
foreach (QCodeNode *c, n->children)
|
|
||||||
serialize(c, out, indent + 1);
|
|
||||||
}
|
|
||||||
|
|
||||||
void QCodeSerializer::deserialize(const QString &file, bool *ok,
|
|
||||||
QString *source, const QDateTime &t) {
|
|
||||||
QFile f(file);
|
|
||||||
|
|
||||||
if (f.open(QFile::Text | QFile::ReadOnly))
|
|
||||||
deserialize(&f, ok, source, t);
|
|
||||||
}
|
|
||||||
|
|
||||||
void QCodeSerializer::deserialize(QIODevice *device, bool *ok, QString *source,
|
|
||||||
const QDateTime &t) {
|
|
||||||
if (!device)
|
|
||||||
return;
|
|
||||||
|
|
||||||
QByteArray line;
|
|
||||||
int indent = 0, spaces;
|
|
||||||
QCodeNode *n, *previous = 0, *parent = 0;
|
|
||||||
|
|
||||||
line = device->readLine();
|
|
||||||
|
|
||||||
auto match = header_matcher.match(line);
|
|
||||||
|
|
||||||
if (!match.hasMatch()) {
|
|
||||||
qWarning("Header mismatch : %s", line.constData());
|
|
||||||
|
|
||||||
if (ok)
|
|
||||||
*ok = false;
|
|
||||||
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
int version = match.captured(1).toInt(0, 0);
|
|
||||||
|
|
||||||
if ((version < _version_min) || (version > _version_max)) {
|
|
||||||
qWarning("Version mismatch : %i !E [%i, %i]", version, _version_min,
|
|
||||||
_version_max);
|
|
||||||
|
|
||||||
if (ok)
|
|
||||||
*ok = false;
|
|
||||||
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (source)
|
|
||||||
*source = match.captured(2);
|
|
||||||
|
|
||||||
if (t.isValid() && ok) {
|
|
||||||
// check time stamps if someone pay attention to success/failure
|
|
||||||
QFileInfo info(*source);
|
|
||||||
|
|
||||||
if (info.lastModified() > t) {
|
|
||||||
// source modified after tag file... must reload...
|
|
||||||
|
|
||||||
*ok = false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
while (!device->atEnd()) {
|
|
||||||
spaces = 0;
|
|
||||||
char c;
|
|
||||||
bool ok = device->getChar(&c);
|
|
||||||
|
|
||||||
while (ok && isspace(c) && (c != '\n')) {
|
|
||||||
++spaces;
|
|
||||||
ok = device->getChar(&c);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!ok || c == '\n')
|
|
||||||
continue;
|
|
||||||
|
|
||||||
if (spaces > indent) {
|
|
||||||
// down one level
|
|
||||||
parent = previous;
|
|
||||||
|
|
||||||
// if ( parent )
|
|
||||||
// qDebug("down a level : parent = %s",
|
|
||||||
// parent->role(QCodeNode::Name).constData());
|
|
||||||
} else if (spaces < indent) {
|
|
||||||
|
|
||||||
// up one (or more) level
|
|
||||||
for (int i = 0; (i < (indent - spaces)) && parent && parent->parent;
|
|
||||||
++i)
|
|
||||||
parent = parent ? parent->parent : 0;
|
|
||||||
|
|
||||||
// if ( parent )
|
|
||||||
// qDebug("up one level : parent = %s",
|
|
||||||
// parent->role(QCodeNode::Name).constData());
|
|
||||||
} else {
|
|
||||||
// qDebug("adding child %s", line.constData());
|
|
||||||
}
|
|
||||||
|
|
||||||
n = new QCodeNode;
|
|
||||||
|
|
||||||
while (ok && c != '\n') {
|
|
||||||
n->roles += c;
|
|
||||||
ok = device->getChar(&c);
|
|
||||||
}
|
|
||||||
|
|
||||||
// n->roles = device->readLine();
|
|
||||||
// n->roles.prepend(c);
|
|
||||||
|
|
||||||
n->roles.squeeze();
|
|
||||||
|
|
||||||
if (parent)
|
|
||||||
n->attach(parent);
|
|
||||||
|
|
||||||
indent = spaces;
|
|
||||||
previous = n;
|
|
||||||
}
|
|
||||||
|
|
||||||
while (parent && parent->parent)
|
|
||||||
parent = parent->parent;
|
|
||||||
|
|
||||||
if (parent && m_model)
|
|
||||||
m_model->appendTopLevelNode(parent);
|
|
||||||
|
|
||||||
if (ok)
|
|
||||||
*ok = true;
|
|
||||||
}
|
|
|
@ -1,55 +0,0 @@
|
||||||
/****************************************************************************
|
|
||||||
**
|
|
||||||
** Copyright (C) 2006-2009 fullmetalcoder <fullmetalcoder@hotmail.fr>
|
|
||||||
**
|
|
||||||
** This file is part of the Edyuk project <http://edyuk.org>
|
|
||||||
**
|
|
||||||
** This file may be used under the terms of the GNU General Public License
|
|
||||||
** version 3 as published by the Free Software Foundation and appearing in the
|
|
||||||
** file GPL.txt included in the packaging of this file.
|
|
||||||
**
|
|
||||||
** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
|
|
||||||
** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
|
||||||
**
|
|
||||||
****************************************************************************/
|
|
||||||
|
|
||||||
#ifndef _QCODE_SERIALIZER_H_
|
|
||||||
#define _QCODE_SERIALIZER_H_
|
|
||||||
|
|
||||||
#include "qcm-config.h"
|
|
||||||
|
|
||||||
/*!
|
|
||||||
\file qcodeserializer.h
|
|
||||||
\brief Definition of the QCodeSerializer class.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include <QDateTime>
|
|
||||||
#include <QThread>
|
|
||||||
|
|
||||||
struct QCodeNode;
|
|
||||||
class QCodeModel;
|
|
||||||
|
|
||||||
class QIODevice;
|
|
||||||
class QTextStream;
|
|
||||||
|
|
||||||
class QCM_EXPORT QCodeSerializer {
|
|
||||||
public:
|
|
||||||
QCodeSerializer();
|
|
||||||
virtual ~QCodeSerializer();
|
|
||||||
|
|
||||||
QCodeModel *targetModel() const;
|
|
||||||
void setTargetModel(QCodeModel *m);
|
|
||||||
|
|
||||||
void serialize(QCodeNode *n, QTextStream &out, int indent = 0);
|
|
||||||
|
|
||||||
void deserialize(const QString &file, bool *ok = 0, QString *source = 0,
|
|
||||||
const QDateTime &t = QDateTime());
|
|
||||||
|
|
||||||
void deserialize(QIODevice *device, bool *ok = 0, QString *source = 0,
|
|
||||||
const QDateTime &t = QDateTime());
|
|
||||||
|
|
||||||
private:
|
|
||||||
QCodeModel *m_model;
|
|
||||||
};
|
|
||||||
|
|
||||||
#endif // !_QCODE_SERIALIZER_H_
|
|
|
@ -47,7 +47,7 @@ QCodeView::QCodeView(QCodeModel *m, QWidget *p) : QTreeView(p), m_model(0) {
|
||||||
connect(this, SIGNAL(activated(QModelIndex)), this,
|
connect(this, SIGNAL(activated(QModelIndex)), this,
|
||||||
SLOT(indexActivated(QModelIndex)));
|
SLOT(indexActivated(QModelIndex)));
|
||||||
|
|
||||||
setModel(m);
|
QCodeView::setModel(m);
|
||||||
}
|
}
|
||||||
|
|
||||||
QCodeView::~QCodeView() {}
|
QCodeView::~QCodeView() {}
|
||||||
|
@ -114,9 +114,10 @@ void QCodeView::indexActivated(const QModelIndex &idx) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else if (n->line != -1) {
|
} else if (n->getLine() != -1) {
|
||||||
emit actionRequested("open", QStringList() << cxt << "-l"
|
emit actionRequested("open", QStringList()
|
||||||
<< QString::number(n->line));
|
<< cxt << "-l"
|
||||||
|
<< QString::number(n->getLine()));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -132,20 +133,21 @@ void QCodeView::indexActivated(const QModelIndex &idx) {
|
||||||
ptp = qn;
|
ptp = qn;
|
||||||
rxp = QRegularExpression::escape(qn);
|
rxp = QRegularExpression::escape(qn);
|
||||||
|
|
||||||
rxp.replace(
|
static QRegularExpression rxp_r(
|
||||||
QRegularExpression("\\s*(::|\\\\[()\\[\\]{}|*$+.?^]|[,&<>])\\s*"),
|
"\\s*(::|\\\\[()\\[\\]{}|*$+.?^]|[,&<>])\\s*");
|
||||||
"\\s*\\1\\s*");
|
rxp.replace(rxp_r, "\\s*\\1\\s*");
|
||||||
rxp.replace(" ", "\\s+");
|
rxp.replace(" ", "\\s+");
|
||||||
|
|
||||||
i = rxp.indexOf("(");
|
i = rxp.indexOf("(");
|
||||||
|
|
||||||
QString tmp = rxp.mid(i);
|
QString tmp = rxp.mid(i);
|
||||||
tmp.replace(
|
static QRegularExpression tmp_r(
|
||||||
QRegularExpression("(\\\\s[+*])[\\w_]+\\\\s\\*(,|\\\\\\)\\\\s\\*$)"),
|
"(\\\\s[+*])[\\w_]+\\\\s\\*(,|\\\\\\)\\\\s\\*$)");
|
||||||
"\\1[\\w_]*\\s*\\2");
|
tmp.replace(tmp_r, QStringLiteral("\\1[\\w_]*\\s*\\2"));
|
||||||
rxp = rxp.left(i) + tmp;
|
rxp = rxp.left(i) + tmp;
|
||||||
|
|
||||||
ptp.replace(QRegularExpression(" (::|[()<>]) "), "\\1");
|
static QRegularExpression ptp_r(" (::|[()<>]) ");
|
||||||
|
ptp.replace(ptp_r, QStringLiteral("\\1"));
|
||||||
i = ptp.indexOf("(");
|
i = ptp.indexOf("(");
|
||||||
|
|
||||||
if (i != -1)
|
if (i != -1)
|
||||||
|
|
|
@ -16,8 +16,6 @@
|
||||||
#ifndef _QCODE_VIEW_H_
|
#ifndef _QCODE_VIEW_H_
|
||||||
#define _QCODE_VIEW_H_
|
#define _QCODE_VIEW_H_
|
||||||
|
|
||||||
#include "qcm-config.h"
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\file qcodeview.h
|
\file qcodeview.h
|
||||||
\brief Definition of the QCodeView class.
|
\brief Definition of the QCodeView class.
|
||||||
|
@ -27,7 +25,7 @@
|
||||||
|
|
||||||
class QCodeModel;
|
class QCodeModel;
|
||||||
|
|
||||||
class QCM_EXPORT QCodeView : public QTreeView {
|
class QCodeView : public QTreeView {
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
|
@ -32,7 +32,7 @@ QSourceCodeWatcher *QSourceCodeWatcher::watcher(QCodeNode *t, QCodeParser *c) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return c ? new QSourceCodeWatcher(t, c, t->model) : 0;
|
return c ? new QSourceCodeWatcher(t, c, t->model()) : 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
QSourceCodeWatcher::QSourceCodeWatcher(QCodeNode *n, QCodeParser *c, QObject *p)
|
QSourceCodeWatcher::QSourceCodeWatcher(QCodeNode *n, QCodeParser *c, QObject *p)
|
||||||
|
|
|
@ -16,8 +16,6 @@
|
||||||
#ifndef _QSOURCE_CODE_WATCHER_H_
|
#ifndef _QSOURCE_CODE_WATCHER_H_
|
||||||
#define _QSOURCE_CODE_WATCHER_H_
|
#define _QSOURCE_CODE_WATCHER_H_
|
||||||
|
|
||||||
#include "qcm-config.h"
|
|
||||||
|
|
||||||
#include <QFileSystemWatcher>
|
#include <QFileSystemWatcher>
|
||||||
#include <QHash>
|
#include <QHash>
|
||||||
#include <QTimer>
|
#include <QTimer>
|
||||||
|
@ -25,7 +23,7 @@
|
||||||
struct QCodeNode;
|
struct QCodeNode;
|
||||||
class QCodeParser;
|
class QCodeParser;
|
||||||
|
|
||||||
class QCM_EXPORT QSourceCodeWatcher : public QFileSystemWatcher {
|
class QSourceCodeWatcher : public QFileSystemWatcher {
|
||||||
friend struct QCodeNode;
|
friend struct QCodeNode;
|
||||||
|
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
|
@ -1,3 +1,20 @@
|
||||||
|
/*==============================================================================
|
||||||
|
** Copyright (C) 2024-2027 WingSummer
|
||||||
|
**
|
||||||
|
** This program is free software: you can redistribute it and/or modify it under
|
||||||
|
** the terms of the GNU Affero General Public License as published by the Free
|
||||||
|
** Software Foundation, version 3.
|
||||||
|
**
|
||||||
|
** This program is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
** ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
||||||
|
** FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
|
||||||
|
** details.
|
||||||
|
**
|
||||||
|
** You should have received a copy of the GNU Affero General Public License
|
||||||
|
** along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
** =============================================================================
|
||||||
|
*/
|
||||||
|
|
||||||
#include "editorview.h"
|
#include "editorview.h"
|
||||||
|
|
||||||
#include "QHexView/document/buffer/qfilebuffer.h"
|
#include "QHexView/document/buffer/qfilebuffer.h"
|
||||||
|
|
|
@ -1,3 +1,20 @@
|
||||||
|
/*==============================================================================
|
||||||
|
** Copyright (C) 2024-2027 WingSummer
|
||||||
|
**
|
||||||
|
** This program is free software: you can redistribute it and/or modify it under
|
||||||
|
** the terms of the GNU Affero General Public License as published by the Free
|
||||||
|
** Software Foundation, version 3.
|
||||||
|
**
|
||||||
|
** This program is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
** ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
||||||
|
** FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
|
||||||
|
** details.
|
||||||
|
**
|
||||||
|
** You should have received a copy of the GNU Affero General Public License
|
||||||
|
** along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
** =============================================================================
|
||||||
|
*/
|
||||||
|
|
||||||
#ifndef EDITORVIEW_H
|
#ifndef EDITORVIEW_H
|
||||||
#define EDITORVIEW_H
|
#define EDITORVIEW_H
|
||||||
|
|
||||||
|
|
|
@ -1,3 +1,20 @@
|
||||||
|
/*==============================================================================
|
||||||
|
** Copyright (C) 2024-2027 WingSummer
|
||||||
|
**
|
||||||
|
** This program is free software: you can redistribute it and/or modify it under
|
||||||
|
** the terms of the GNU Affero General Public License as published by the Free
|
||||||
|
** Software Foundation, version 3.
|
||||||
|
**
|
||||||
|
** This program is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
** ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
||||||
|
** FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
|
||||||
|
** details.
|
||||||
|
**
|
||||||
|
** You should have received a copy of the GNU Affero General Public License
|
||||||
|
** along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
** =============================================================================
|
||||||
|
*/
|
||||||
|
|
||||||
#include "gotowidget.h"
|
#include "gotowidget.h"
|
||||||
#include "ui_gotowidget.h"
|
#include "ui_gotowidget.h"
|
||||||
|
|
||||||
|
|
|
@ -1,3 +1,20 @@
|
||||||
|
/*==============================================================================
|
||||||
|
** Copyright (C) 2024-2027 WingSummer
|
||||||
|
**
|
||||||
|
** This program is free software: you can redistribute it and/or modify it under
|
||||||
|
** the terms of the GNU Affero General Public License as published by the Free
|
||||||
|
** Software Foundation, version 3.
|
||||||
|
**
|
||||||
|
** This program is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
** ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
||||||
|
** FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
|
||||||
|
** details.
|
||||||
|
**
|
||||||
|
** You should have received a copy of the GNU Affero General Public License
|
||||||
|
** along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
** =============================================================================
|
||||||
|
*/
|
||||||
|
|
||||||
#ifndef GOTOWIDGET_H
|
#ifndef GOTOWIDGET_H
|
||||||
#define GOTOWIDGET_H
|
#define GOTOWIDGET_H
|
||||||
|
|
||||||
|
|
|
@ -1,3 +1,20 @@
|
||||||
|
/*==============================================================================
|
||||||
|
** Copyright (C) 2024-2027 WingSummer
|
||||||
|
**
|
||||||
|
** This program is free software: you can redistribute it and/or modify it under
|
||||||
|
** the terms of the GNU Affero General Public License as published by the Free
|
||||||
|
** Software Foundation, version 3.
|
||||||
|
**
|
||||||
|
** This program is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
** ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
||||||
|
** FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
|
||||||
|
** details.
|
||||||
|
**
|
||||||
|
** You should have received a copy of the GNU Affero General Public License
|
||||||
|
** along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
** =============================================================================
|
||||||
|
*/
|
||||||
|
|
||||||
#include "huecolorpickerslider.h"
|
#include "huecolorpickerslider.h"
|
||||||
#include "dialog/colorpickerdialog.h"
|
#include "dialog/colorpickerdialog.h"
|
||||||
|
|
||||||
|
|
|
@ -1,3 +1,20 @@
|
||||||
|
/*==============================================================================
|
||||||
|
** Copyright (C) 2024-2027 WingSummer
|
||||||
|
**
|
||||||
|
** This program is free software: you can redistribute it and/or modify it under
|
||||||
|
** the terms of the GNU Affero General Public License as published by the Free
|
||||||
|
** Software Foundation, version 3.
|
||||||
|
**
|
||||||
|
** This program is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
** ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
||||||
|
** FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
|
||||||
|
** details.
|
||||||
|
**
|
||||||
|
** You should have received a copy of the GNU Affero General Public License
|
||||||
|
** along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
** =============================================================================
|
||||||
|
*/
|
||||||
|
|
||||||
#ifndef HUECOLORPICKERSLIDER_H
|
#ifndef HUECOLORPICKERSLIDER_H
|
||||||
#define HUECOLORPICKERSLIDER_H
|
#define HUECOLORPICKERSLIDER_H
|
||||||
|
|
||||||
|
|
|
@ -14,8 +14,7 @@
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#include "qcodecompletionwidget.h"
|
#include "qcodecompletionwidget.h"
|
||||||
|
#include "qcodecompletionwidget_p.h"
|
||||||
#include "control/qcodecompletionwidget_p.h"
|
|
||||||
|
|
||||||
#include "qdocument.h"
|
#include "qdocument.h"
|
||||||
#include "qdocumentcursor.h"
|
#include "qdocumentcursor.h"
|
||||||
|
@ -25,6 +24,8 @@
|
||||||
#include "codemodel/qcodemodel.h"
|
#include "codemodel/qcodemodel.h"
|
||||||
#include "codemodel/qcodenode.h"
|
#include "codemodel/qcodenode.h"
|
||||||
|
|
||||||
|
#include "class/ascompletion.h"
|
||||||
|
|
||||||
#include <QApplication>
|
#include <QApplication>
|
||||||
#include <QFocusEvent>
|
#include <QFocusEvent>
|
||||||
#include <QKeyEvent>
|
#include <QKeyEvent>
|
||||||
|
@ -118,9 +119,10 @@ QEditor *QCodeCompletionWidget::editor() const {
|
||||||
}
|
}
|
||||||
|
|
||||||
void QCodeCompletionWidget::setEditor(QEditor *e) {
|
void QCodeCompletionWidget::setEditor(QEditor *e) {
|
||||||
pEditor = dynamic_cast<QObject *>(e);
|
pEditor = e;
|
||||||
|
if (e) {
|
||||||
setParent(e->viewport());
|
setParent(e->viewport());
|
||||||
|
}
|
||||||
// QObject::setParent(pEditor);
|
// QObject::setParent(pEditor);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -212,7 +214,8 @@ void QCodeCompletionWidget::complete(const QModelIndex &index) {
|
||||||
txt.remove(pb + 1, pe - pb - 1);
|
txt.remove(pb + 1, pe - pb - 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
txt.remove(QRegularExpression("(\\bconst\\s*)?(=\\s*0)?$"));
|
static QRegularExpression re("(\\bconst\\s*)?(=\\s*0)?$");
|
||||||
|
txt.remove(re);
|
||||||
|
|
||||||
if (prefix.length() && txt.startsWith(prefix))
|
if (prefix.length() && txt.startsWith(prefix))
|
||||||
txt.remove(0, prefix.length());
|
txt.remove(0, prefix.length());
|
||||||
|
@ -406,14 +409,14 @@ void QCodeCompletionModel::forceUpdate() const {
|
||||||
m_visibles.clear();
|
m_visibles.clear();
|
||||||
|
|
||||||
foreach (QCodeNode *n, m_nodes) {
|
foreach (QCodeNode *n, m_nodes) {
|
||||||
foreach (QCodeNode *c, n->children) {
|
foreach (QCodeNode *c, n->children()) {
|
||||||
if (match(c, m_filter, m_prefix)) {
|
if (match(c, m_filter, m_prefix)) {
|
||||||
m_visibles << c;
|
m_visibles << c;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (c->type() == QCodeNode::Enum) {
|
if (c->type() == QCodeNode::Enum) {
|
||||||
if (match(c, m_filter))
|
if (match(c, m_filter))
|
||||||
for (QCodeNode *ev : c->children)
|
for (QCodeNode *ev : c->children())
|
||||||
if (match(ev, m_filter, m_prefix))
|
if (match(ev, m_filter, m_prefix))
|
||||||
m_visibles << ev;
|
m_visibles << ev;
|
||||||
}
|
}
|
||||||
|
@ -423,7 +426,7 @@ void QCodeCompletionModel::forceUpdate() const {
|
||||||
// qDebug("model updated");
|
// qDebug("model updated");
|
||||||
|
|
||||||
bUpdate = false;
|
bUpdate = false;
|
||||||
emit changed();
|
emit const_cast<QCodeCompletionModel *>(this)->changed();
|
||||||
}
|
}
|
||||||
|
|
||||||
QList<QCodeNode *> QCodeCompletionModel::focusNodes() const { return m_nodes; }
|
QList<QCodeNode *> QCodeCompletionModel::focusNodes() const { return m_nodes; }
|
||||||
|
@ -454,7 +457,7 @@ QVariant QCodeCompletionModel::data(const QModelIndex &index, int role) const {
|
||||||
int type = n->type();
|
int type = n->type();
|
||||||
|
|
||||||
if ((role == Qt::DisplayRole) && (type == QCodeNode::Enumerator))
|
if ((role == Qt::DisplayRole) && (type == QCodeNode::Enumerator))
|
||||||
return n->parent->data(role).toString() +
|
return n->parent()->data(role).toString() +
|
||||||
"::" + n->data(role).toString();
|
"::" + n->data(role).toString();
|
||||||
|
|
||||||
if (role == Qt::UserRole)
|
if (role == Qt::UserRole)
|
||||||
|
@ -481,7 +484,7 @@ int QCodeCompletionModel::rowCount(const QModelIndex &parent) const {
|
||||||
bool QCodeCompletionModel::match(QCodeNode *n,
|
bool QCodeCompletionModel::match(QCodeNode *n,
|
||||||
QCodeCompletionWidget::Filter filter,
|
QCodeCompletionWidget::Filter filter,
|
||||||
const QByteArray &prefix) {
|
const QByteArray &prefix) {
|
||||||
QByteArray bcxt = n->parent->qualifiedName(),
|
QByteArray bcxt = n->parent()->qualifiedName(),
|
||||||
bnn = n->role(QCodeNode::Name);
|
bnn = n->role(QCodeNode::Name);
|
||||||
|
|
||||||
if (!n || (prefix.length() && (!bnn.startsWith(prefix)))) {
|
if (!n || (prefix.length() && (!bnn.startsWith(prefix)))) {
|
||||||
|
@ -537,7 +540,7 @@ bool QCodeCompletionModel::match(QCodeNode *n,
|
||||||
((qualifiers & QCodeNode::QUALIFIER_CONST) &&
|
((qualifiers & QCodeNode::QUALIFIER_CONST) &&
|
||||||
!(filter & QCodeCompletionWidget::KeepConst)) ||
|
!(filter & QCodeCompletionWidget::KeepConst)) ||
|
||||||
((filter & QCodeCompletionWidget::IsStatic) &&
|
((filter & QCodeCompletionWidget::IsStatic) &&
|
||||||
(n->parent->type() != QCodeNode::Namespace)) ||
|
(n->parent()->type() != QCodeNode::Namespace)) ||
|
||||||
(!(qualifiers & QCodeNode::QUALIFIER_CONST) &&
|
(!(qualifiers & QCodeNode::QUALIFIER_CONST) &&
|
||||||
(filter & QCodeCompletionWidget::IsConst)) ||
|
(filter & QCodeCompletionWidget::IsConst)) ||
|
||||||
(!qstrcmp(name, ctxt + cxt_off) &&
|
(!qstrcmp(name, ctxt + cxt_off) &&
|
||||||
|
|
|
@ -21,14 +21,14 @@
|
||||||
#include <QAbstractListModel>
|
#include <QAbstractListModel>
|
||||||
#include <QPointer>
|
#include <QPointer>
|
||||||
|
|
||||||
struct QCodeNode;
|
class QCodeNode;
|
||||||
class QCodeModel;
|
class QCodeModel;
|
||||||
|
|
||||||
class QCodeCompletionModel : public QAbstractListModel {
|
class QCodeCompletionModel : public QAbstractListModel {
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
QCodeCompletionModel(QObject *p = 0);
|
QCodeCompletionModel(QObject *p = nullptr);
|
||||||
|
|
||||||
void clear();
|
void clear();
|
||||||
void update();
|
void update();
|
||||||
|
@ -53,7 +53,7 @@ public:
|
||||||
int rowCount(const QModelIndex &parent = QModelIndex()) const;
|
int rowCount(const QModelIndex &parent = QModelIndex()) const;
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
void changed() const;
|
void changed();
|
||||||
|
|
||||||
void prefixChanged(const QString &newPrefix);
|
void prefixChanged(const QString &newPrefix);
|
||||||
void filterChanged(QCodeCompletionWidget::Filter f);
|
void filterChanged(QCodeCompletionWidget::Filter f);
|
||||||
|
|
|
@ -1,3 +1,20 @@
|
||||||
|
/*==============================================================================
|
||||||
|
** Copyright (C) 2024-2027 WingSummer
|
||||||
|
**
|
||||||
|
** This program is free software: you can redistribute it and/or modify it under
|
||||||
|
** the terms of the GNU Affero General Public License as published by the Free
|
||||||
|
** Software Foundation, version 3.
|
||||||
|
**
|
||||||
|
** This program is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
** ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
||||||
|
** FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
|
||||||
|
** details.
|
||||||
|
**
|
||||||
|
** You should have received a copy of the GNU Affero General Public License
|
||||||
|
** along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
** =============================================================================
|
||||||
|
*/
|
||||||
|
|
||||||
#include <QPaintEvent>
|
#include <QPaintEvent>
|
||||||
#include <QPainter>
|
#include <QPainter>
|
||||||
#include <QPainterPath>
|
#include <QPainterPath>
|
||||||
|
|
|
@ -1,3 +1,20 @@
|
||||||
|
/*==============================================================================
|
||||||
|
** Copyright (C) 2024-2027 WingSummer
|
||||||
|
**
|
||||||
|
** This program is free software: you can redistribute it and/or modify it under
|
||||||
|
** the terms of the GNU Affero General Public License as published by the Free
|
||||||
|
** Software Foundation, version 3.
|
||||||
|
**
|
||||||
|
** This program is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
** ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
||||||
|
** FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
|
||||||
|
** details.
|
||||||
|
**
|
||||||
|
** You should have received a copy of the GNU Affero General Public License
|
||||||
|
** along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
** =============================================================================
|
||||||
|
*/
|
||||||
|
|
||||||
#ifndef QCOLORPICKERSLIDER_H
|
#ifndef QCOLORPICKERSLIDER_H
|
||||||
#define QCOLORPICKERSLIDER_H
|
#define QCOLORPICKERSLIDER_H
|
||||||
|
|
||||||
|
|
|
@ -1,3 +1,20 @@
|
||||||
|
/*==============================================================================
|
||||||
|
** Copyright (C) 2024-2027 WingSummer
|
||||||
|
**
|
||||||
|
** This program is free software: you can redistribute it and/or modify it under
|
||||||
|
** the terms of the GNU Affero General Public License as published by the Free
|
||||||
|
** Software Foundation, version 3.
|
||||||
|
**
|
||||||
|
** This program is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
** ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
||||||
|
** FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
|
||||||
|
** details.
|
||||||
|
**
|
||||||
|
** You should have received a copy of the GNU Affero General Public License
|
||||||
|
** along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
** =============================================================================
|
||||||
|
*/
|
||||||
|
|
||||||
#include "qlistviewext.h"
|
#include "qlistviewext.h"
|
||||||
|
|
||||||
#include <QScrollBar>
|
#include <QScrollBar>
|
||||||
|
|
|
@ -1,3 +1,20 @@
|
||||||
|
/*==============================================================================
|
||||||
|
** Copyright (C) 2024-2027 WingSummer
|
||||||
|
**
|
||||||
|
** This program is free software: you can redistribute it and/or modify it under
|
||||||
|
** the terms of the GNU Affero General Public License as published by the Free
|
||||||
|
** Software Foundation, version 3.
|
||||||
|
**
|
||||||
|
** This program is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
** ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
||||||
|
** FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
|
||||||
|
** details.
|
||||||
|
**
|
||||||
|
** You should have received a copy of the GNU Affero General Public License
|
||||||
|
** along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
** =============================================================================
|
||||||
|
*/
|
||||||
|
|
||||||
#ifndef QLISTVIEWEXT_H
|
#ifndef QLISTVIEWEXT_H
|
||||||
#define QLISTVIEWEXT_H
|
#define QLISTVIEWEXT_H
|
||||||
|
|
||||||
|
|
|
@ -1,3 +1,20 @@
|
||||||
|
/*==============================================================================
|
||||||
|
** Copyright (C) 2024-2027 WingSummer
|
||||||
|
**
|
||||||
|
** This program is free software: you can redistribute it and/or modify it under
|
||||||
|
** the terms of the GNU Affero General Public License as published by the Free
|
||||||
|
** Software Foundation, version 3.
|
||||||
|
**
|
||||||
|
** This program is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
** ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
||||||
|
** FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
|
||||||
|
** details.
|
||||||
|
**
|
||||||
|
** You should have received a copy of the GNU Affero General Public License
|
||||||
|
** along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
** =============================================================================
|
||||||
|
*/
|
||||||
|
|
||||||
#include "qtableviewext.h"
|
#include "qtableviewext.h"
|
||||||
|
|
||||||
#include <QScrollBar>
|
#include <QScrollBar>
|
||||||
|
|
|
@ -1,3 +1,20 @@
|
||||||
|
/*==============================================================================
|
||||||
|
** Copyright (C) 2024-2027 WingSummer
|
||||||
|
**
|
||||||
|
** This program is free software: you can redistribute it and/or modify it under
|
||||||
|
** the terms of the GNU Affero General Public License as published by the Free
|
||||||
|
** Software Foundation, version 3.
|
||||||
|
**
|
||||||
|
** This program is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
** ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
||||||
|
** FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
|
||||||
|
** details.
|
||||||
|
**
|
||||||
|
** You should have received a copy of the GNU Affero General Public License
|
||||||
|
** along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
** =============================================================================
|
||||||
|
*/
|
||||||
|
|
||||||
#ifndef QTABLEVIEWEXT_H
|
#ifndef QTABLEVIEWEXT_H
|
||||||
#define QTABLEVIEWEXT_H
|
#define QTABLEVIEWEXT_H
|
||||||
|
|
||||||
|
|
|
@ -1,3 +1,20 @@
|
||||||
|
/*==============================================================================
|
||||||
|
** Copyright (C) 2024-2027 WingSummer
|
||||||
|
**
|
||||||
|
** This program is free software: you can redistribute it and/or modify it under
|
||||||
|
** the terms of the GNU Affero General Public License as published by the Free
|
||||||
|
** Software Foundation, version 3.
|
||||||
|
**
|
||||||
|
** This program is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
** ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
||||||
|
** FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
|
||||||
|
** details.
|
||||||
|
**
|
||||||
|
** You should have received a copy of the GNU Affero General Public License
|
||||||
|
** along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
** =============================================================================
|
||||||
|
*/
|
||||||
|
|
||||||
#include "scripteditor.h"
|
#include "scripteditor.h"
|
||||||
#include "qeditor.h"
|
#include "qeditor.h"
|
||||||
|
|
||||||
|
|
|
@ -1,3 +1,20 @@
|
||||||
|
/*==============================================================================
|
||||||
|
** Copyright (C) 2024-2027 WingSummer
|
||||||
|
**
|
||||||
|
** This program is free software: you can redistribute it and/or modify it under
|
||||||
|
** the terms of the GNU Affero General Public License as published by the Free
|
||||||
|
** Software Foundation, version 3.
|
||||||
|
**
|
||||||
|
** This program is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
** ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
||||||
|
** FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
|
||||||
|
** details.
|
||||||
|
**
|
||||||
|
** You should have received a copy of the GNU Affero General Public License
|
||||||
|
** along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
** =============================================================================
|
||||||
|
*/
|
||||||
|
|
||||||
#ifndef SCRIPTEDITOR_H
|
#ifndef SCRIPTEDITOR_H
|
||||||
#define SCRIPTEDITOR_H
|
#define SCRIPTEDITOR_H
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,21 @@
|
||||||
#include "scriptingconsole.h"
|
/*==============================================================================
|
||||||
|
** Copyright (C) 2024-2027 WingSummer
|
||||||
|
**
|
||||||
|
** This program is free software: you can redistribute it and/or modify it under
|
||||||
|
** the terms of the GNU Affero General Public License as published by the Free
|
||||||
|
** Software Foundation, version 3.
|
||||||
|
**
|
||||||
|
** This program is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
** ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
||||||
|
** FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
|
||||||
|
** details.
|
||||||
|
**
|
||||||
|
** You should have received a copy of the GNU Affero General Public License
|
||||||
|
** along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
** =============================================================================
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include "scriptingconsole.h"
|
||||||
#include "class/scriptconsolemachine.h"
|
#include "class/scriptconsolemachine.h"
|
||||||
|
|
||||||
#include <QApplication>
|
#include <QApplication>
|
||||||
|
|
|
@ -1,3 +1,20 @@
|
||||||
|
/*==============================================================================
|
||||||
|
** Copyright (C) 2024-2027 WingSummer
|
||||||
|
**
|
||||||
|
** This program is free software: you can redistribute it and/or modify it under
|
||||||
|
** the terms of the GNU Affero General Public License as published by the Free
|
||||||
|
** Software Foundation, version 3.
|
||||||
|
**
|
||||||
|
** This program is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
** ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
||||||
|
** FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
|
||||||
|
** details.
|
||||||
|
**
|
||||||
|
** You should have received a copy of the GNU Affero General Public License
|
||||||
|
** along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
** =============================================================================
|
||||||
|
*/
|
||||||
|
|
||||||
#ifndef ScriptingConsole_H
|
#ifndef ScriptingConsole_H
|
||||||
#define ScriptingConsole_H
|
#define ScriptingConsole_H
|
||||||
|
|
||||||
|
|
|
@ -1,3 +1,20 @@
|
||||||
|
/*==============================================================================
|
||||||
|
** Copyright (C) 2024-2027 WingSummer
|
||||||
|
**
|
||||||
|
** This program is free software: you can redistribute it and/or modify it under
|
||||||
|
** the terms of the GNU Affero General Public License as published by the Free
|
||||||
|
** Software Foundation, version 3.
|
||||||
|
**
|
||||||
|
** This program is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
** ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
||||||
|
** FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
|
||||||
|
** details.
|
||||||
|
**
|
||||||
|
** You should have received a copy of the GNU Affero General Public License
|
||||||
|
** along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
** =============================================================================
|
||||||
|
*/
|
||||||
|
|
||||||
#include "toast.h"
|
#include "toast.h"
|
||||||
|
|
||||||
#include <QColor>
|
#include <QColor>
|
||||||
|
|
|
@ -1,3 +1,20 @@
|
||||||
|
/*==============================================================================
|
||||||
|
** Copyright (C) 2024-2027 WingSummer
|
||||||
|
**
|
||||||
|
** This program is free software: you can redistribute it and/or modify it under
|
||||||
|
** the terms of the GNU Affero General Public License as published by the Free
|
||||||
|
** Software Foundation, version 3.
|
||||||
|
**
|
||||||
|
** This program is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
** ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
||||||
|
** FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
|
||||||
|
** details.
|
||||||
|
**
|
||||||
|
** You should have received a copy of the GNU Affero General Public License
|
||||||
|
** along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
** =============================================================================
|
||||||
|
*/
|
||||||
|
|
||||||
#ifndef TOAST_H
|
#ifndef TOAST_H
|
||||||
#define TOAST_H
|
#define TOAST_H
|
||||||
|
|
||||||
|
|
|
@ -1,3 +1,20 @@
|
||||||
|
/*==============================================================================
|
||||||
|
** Copyright (C) 2024-2027 WingSummer
|
||||||
|
**
|
||||||
|
** This program is free software: you can redistribute it and/or modify it under
|
||||||
|
** the terms of the GNU Affero General Public License as published by the Free
|
||||||
|
** Software Foundation, version 3.
|
||||||
|
**
|
||||||
|
** This program is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
** ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
||||||
|
** FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
|
||||||
|
** details.
|
||||||
|
**
|
||||||
|
** You should have received a copy of the GNU Affero General Public License
|
||||||
|
** along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
** =============================================================================
|
||||||
|
*/
|
||||||
|
|
||||||
#ifndef DBGHELPER_H
|
#ifndef DBGHELPER_H
|
||||||
#define DBGHELPER_H
|
#define DBGHELPER_H
|
||||||
|
|
||||||
|
|
|
@ -1,3 +1,20 @@
|
||||||
|
/*==============================================================================
|
||||||
|
** Copyright (C) 2024-2027 WingSummer
|
||||||
|
**
|
||||||
|
** This program is free software: you can redistribute it and/or modify it under
|
||||||
|
** the terms of the GNU Affero General Public License as published by the Free
|
||||||
|
** Software Foundation, version 3.
|
||||||
|
**
|
||||||
|
** This program is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
** ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
||||||
|
** FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
|
||||||
|
** details.
|
||||||
|
**
|
||||||
|
** You should have received a copy of the GNU Affero General Public License
|
||||||
|
** along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
** =============================================================================
|
||||||
|
*/
|
||||||
|
|
||||||
#include "aboutsoftwaredialog.h"
|
#include "aboutsoftwaredialog.h"
|
||||||
#include "ui_aboutsoftwaredialog.h"
|
#include "ui_aboutsoftwaredialog.h"
|
||||||
|
|
||||||
|
|
|
@ -1,3 +1,20 @@
|
||||||
|
/*==============================================================================
|
||||||
|
** Copyright (C) 2024-2027 WingSummer
|
||||||
|
**
|
||||||
|
** This program is free software: you can redistribute it and/or modify it under
|
||||||
|
** the terms of the GNU Affero General Public License as published by the Free
|
||||||
|
** Software Foundation, version 3.
|
||||||
|
**
|
||||||
|
** This program is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
** ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
||||||
|
** FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
|
||||||
|
** details.
|
||||||
|
**
|
||||||
|
** You should have received a copy of the GNU Affero General Public License
|
||||||
|
** along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
** =============================================================================
|
||||||
|
*/
|
||||||
|
|
||||||
#ifndef ABOUTSOFTWAREDIALOG_H
|
#ifndef ABOUTSOFTWAREDIALOG_H
|
||||||
#define ABOUTSOFTWAREDIALOG_H
|
#define ABOUTSOFTWAREDIALOG_H
|
||||||
|
|
||||||
|
|
|
@ -1,3 +1,20 @@
|
||||||
|
/*==============================================================================
|
||||||
|
** Copyright (C) 2024-2027 WingSummer
|
||||||
|
**
|
||||||
|
** This program is free software: you can redistribute it and/or modify it under
|
||||||
|
** the terms of the GNU Affero General Public License as published by the Free
|
||||||
|
** Software Foundation, version 3.
|
||||||
|
**
|
||||||
|
** This program is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
** ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
||||||
|
** FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
|
||||||
|
** details.
|
||||||
|
**
|
||||||
|
** You should have received a copy of the GNU Affero General Public License
|
||||||
|
** along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
** =============================================================================
|
||||||
|
*/
|
||||||
|
|
||||||
#include "checksumdialog.h"
|
#include "checksumdialog.h"
|
||||||
#include "utilities.h"
|
#include "utilities.h"
|
||||||
|
|
||||||
|
|
|
@ -1,3 +1,20 @@
|
||||||
|
/*==============================================================================
|
||||||
|
** Copyright (C) 2024-2027 WingSummer
|
||||||
|
**
|
||||||
|
** This program is free software: you can redistribute it and/or modify it under
|
||||||
|
** the terms of the GNU Affero General Public License as published by the Free
|
||||||
|
** Software Foundation, version 3.
|
||||||
|
**
|
||||||
|
** This program is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
** ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
||||||
|
** FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
|
||||||
|
** details.
|
||||||
|
**
|
||||||
|
** You should have received a copy of the GNU Affero General Public License
|
||||||
|
** along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
** =============================================================================
|
||||||
|
*/
|
||||||
|
|
||||||
#ifndef CHECKSUMDIALOG_H
|
#ifndef CHECKSUMDIALOG_H
|
||||||
#define CHECKSUMDIALOG_H
|
#define CHECKSUMDIALOG_H
|
||||||
|
|
||||||
|
|
|
@ -1,3 +1,20 @@
|
||||||
|
/*==============================================================================
|
||||||
|
** Copyright (C) 2024-2027 WingSummer
|
||||||
|
**
|
||||||
|
** This program is free software: you can redistribute it and/or modify it under
|
||||||
|
** the terms of the GNU Affero General Public License as published by the Free
|
||||||
|
** Software Foundation, version 3.
|
||||||
|
**
|
||||||
|
** This program is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
** ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
||||||
|
** FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
|
||||||
|
** details.
|
||||||
|
**
|
||||||
|
** You should have received a copy of the GNU Affero General Public License
|
||||||
|
** along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
** =============================================================================
|
||||||
|
*/
|
||||||
|
|
||||||
#include "colorpickerdialog.h"
|
#include "colorpickerdialog.h"
|
||||||
#include "ui_colorpickerdialog.h"
|
#include "ui_colorpickerdialog.h"
|
||||||
|
|
||||||
|
|
|
@ -1,3 +1,20 @@
|
||||||
|
/*==============================================================================
|
||||||
|
** Copyright (C) 2024-2027 WingSummer
|
||||||
|
**
|
||||||
|
** This program is free software: you can redistribute it and/or modify it under
|
||||||
|
** the terms of the GNU Affero General Public License as published by the Free
|
||||||
|
** Software Foundation, version 3.
|
||||||
|
**
|
||||||
|
** This program is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
** ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
||||||
|
** FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
|
||||||
|
** details.
|
||||||
|
**
|
||||||
|
** You should have received a copy of the GNU Affero General Public License
|
||||||
|
** along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
** =============================================================================
|
||||||
|
*/
|
||||||
|
|
||||||
#ifndef COLORPICKERDIALOG_H
|
#ifndef COLORPICKERDIALOG_H
|
||||||
#define COLORPICKERDIALOG_H
|
#define COLORPICKERDIALOG_H
|
||||||
|
|
||||||
|
|
|
@ -1,3 +1,20 @@
|
||||||
|
/*==============================================================================
|
||||||
|
** Copyright (C) 2024-2027 WingSummer
|
||||||
|
**
|
||||||
|
** This program is free software: you can redistribute it and/or modify it under
|
||||||
|
** the terms of the GNU Affero General Public License as published by the Free
|
||||||
|
** Software Foundation, version 3.
|
||||||
|
**
|
||||||
|
** This program is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
** ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
||||||
|
** FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
|
||||||
|
** details.
|
||||||
|
**
|
||||||
|
** You should have received a copy of the GNU Affero General Public License
|
||||||
|
** along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
** =============================================================================
|
||||||
|
*/
|
||||||
|
|
||||||
#include "driverselectordialog.h"
|
#include "driverselectordialog.h"
|
||||||
#include "utilities.h"
|
#include "utilities.h"
|
||||||
|
|
||||||
|
|
|
@ -1,3 +1,20 @@
|
||||||
|
/*==============================================================================
|
||||||
|
** Copyright (C) 2024-2027 WingSummer
|
||||||
|
**
|
||||||
|
** This program is free software: you can redistribute it and/or modify it under
|
||||||
|
** the terms of the GNU Affero General Public License as published by the Free
|
||||||
|
** Software Foundation, version 3.
|
||||||
|
**
|
||||||
|
** This program is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
** ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
||||||
|
** FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
|
||||||
|
** details.
|
||||||
|
**
|
||||||
|
** You should have received a copy of the GNU Affero General Public License
|
||||||
|
** along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
** =============================================================================
|
||||||
|
*/
|
||||||
|
|
||||||
#ifndef DRIVERSELECTORDIALOG_H
|
#ifndef DRIVERSELECTORDIALOG_H
|
||||||
#define DRIVERSELECTORDIALOG_H
|
#define DRIVERSELECTORDIALOG_H
|
||||||
|
|
||||||
|
|
|
@ -1,3 +1,20 @@
|
||||||
|
/*==============================================================================
|
||||||
|
** Copyright (C) 2024-2027 WingSummer
|
||||||
|
**
|
||||||
|
** This program is free software: you can redistribute it and/or modify it under
|
||||||
|
** the terms of the GNU Affero General Public License as published by the Free
|
||||||
|
** Software Foundation, version 3.
|
||||||
|
**
|
||||||
|
** This program is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
** ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
||||||
|
** FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
|
||||||
|
** details.
|
||||||
|
**
|
||||||
|
** You should have received a copy of the GNU Affero General Public License
|
||||||
|
** along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
** =============================================================================
|
||||||
|
*/
|
||||||
|
|
||||||
#include "encodingdialog.h"
|
#include "encodingdialog.h"
|
||||||
|
|
||||||
#include "../utilities.h"
|
#include "../utilities.h"
|
||||||
|
|
|
@ -1,3 +1,20 @@
|
||||||
|
/*==============================================================================
|
||||||
|
** Copyright (C) 2024-2027 WingSummer
|
||||||
|
**
|
||||||
|
** This program is free software: you can redistribute it and/or modify it under
|
||||||
|
** the terms of the GNU Affero General Public License as published by the Free
|
||||||
|
** Software Foundation, version 3.
|
||||||
|
**
|
||||||
|
** This program is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
** ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
||||||
|
** FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
|
||||||
|
** details.
|
||||||
|
**
|
||||||
|
** You should have received a copy of the GNU Affero General Public License
|
||||||
|
** along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
** =============================================================================
|
||||||
|
*/
|
||||||
|
|
||||||
#ifndef ENCODINGDIALOG_H
|
#ifndef ENCODINGDIALOG_H
|
||||||
#define ENCODINGDIALOG_H
|
#define ENCODINGDIALOG_H
|
||||||
|
|
||||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue