Compare commits
19 Commits
c4778fbfa9
...
5a5e727b99
Author | SHA1 | Date |
---|---|---|
|
5a5e727b99 | |
|
cb7923e4f8 | |
|
276787df09 | |
|
598c20ac1a | |
|
7b1a77ae60 | |
|
f49d6fb5e0 | |
|
5be4fc8b19 | |
|
dd1e6ba3ff | |
|
d62ea2237a | |
|
c1faf5c1d0 | |
|
626c8f422d | |
|
a326e27eff | |
|
53c7e8f082 | |
|
84ce5951be | |
|
e60f03e447 | |
|
a03ee053c1 | |
|
5935ca77e8 | |
|
cec1ac6dc6 | |
|
223ce7cd50 |
|
@ -0,0 +1,20 @@
|
|||
# -----------------------------
|
||||
# Options effecting formatting.
|
||||
# -----------------------------
|
||||
with section("format"):
|
||||
|
||||
# How wide to allow formatted cmake files
|
||||
line_width = 80
|
||||
|
||||
# How many spaces to tab for indent
|
||||
tab_size = 4
|
||||
|
||||
# If true, separate flow control names from their parentheses with a space
|
||||
separate_ctrl_name_with_space = False
|
||||
|
||||
# If true, separate function names from parentheses with a space
|
||||
separate_fn_name_with_space = False
|
||||
|
||||
# If a statement is wrapped to more than one line, than dangle the closing
|
||||
# parenthesis on its own line.
|
||||
dangle_parens = False
|
|
@ -0,0 +1,14 @@
|
|||
name: Check CMake Formatting
|
||||
|
||||
on: [push, pull_request]
|
||||
|
||||
jobs:
|
||||
format-check:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v4
|
||||
- name: cmake-format lint
|
||||
uses: neg-c/cmake-format-action@v0.1.1
|
||||
with:
|
||||
inplace: true
|
|
@ -1,3 +1,4 @@
|
|||
name: Conventional commit check
|
||||
on: [pull_request]
|
||||
|
||||
jobs:
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
name: Conventional commit check
|
||||
on: [push]
|
||||
|
||||
jobs:
|
||||
|
|
|
@ -0,0 +1,51 @@
|
|||
name: CMake build check
|
||||
|
||||
on: [push, pull_request]
|
||||
|
||||
env:
|
||||
BUILD_TYPE: Release
|
||||
|
||||
jobs:
|
||||
build-test:
|
||||
runs-on: ${{ matrix.os }}
|
||||
|
||||
strategy:
|
||||
matrix:
|
||||
os: [windows-latest, ubuntu-latest]
|
||||
qt_version: [5.15.2, 6.6.2]
|
||||
arch: [win64_msvc2019_64, gcc_64]
|
||||
exclude:
|
||||
- os: windows-latest
|
||||
arch: gcc_64
|
||||
- os: ubuntu-latest
|
||||
arch: win64_msvc2019_64
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
with:
|
||||
submodules: 'recursive'
|
||||
token: ${{ secrets.CONTRIBUTORS_TOKEN }}
|
||||
- name: Install Qt
|
||||
# Installs the Qt SDK
|
||||
uses: jurplel/install-qt-action@v3
|
||||
with:
|
||||
version: ${{ matrix.qt_version }}
|
||||
host: ${{ matrix.os == 'windows-latest' && 'windows' || 'linux' }}
|
||||
target: 'desktop'
|
||||
arch: ${{ matrix.arch }}
|
||||
cache: true
|
||||
|
||||
- name: Configure CMake
|
||||
# Configure CMake in a 'build' subdirectory. `CMAKE_BUILD_TYPE` is only required if you are using a single-configuration generator such as make.
|
||||
# See https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html?highlight=cmake_build_type
|
||||
run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}}
|
||||
|
||||
- name: Build
|
||||
# Build your program with the given configuration
|
||||
run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}}
|
||||
|
||||
- uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: WingHexExplorer2-${{ matrix.os == 'windows-latest' && 'windows' || 'linux' }}-${{ matrix.qt_version }}-build-cache
|
||||
path: ${{github.workspace}}/build
|
||||
|
|
@ -10,6 +10,3 @@
|
|||
[submodule "3rdparty/SingleApplication"]
|
||||
path = 3rdparty/SingleApplication
|
||||
url = git@github.com:itay-grudev/SingleApplication.git
|
||||
[submodule "3rdparty/QLogger"]
|
||||
path = 3rdparty/QLogger
|
||||
url = git@github.com:Wing-summer/QLogger.git
|
||||
|
|
|
@ -1 +1 @@
|
|||
Subproject commit b13869d71a6da6520710e81a66f3bc942c495604
|
||||
Subproject commit f2034769ce887367e97a5fbaced5b14aa8039fd3
|
|
@ -1,9 +1,9 @@
|
|||
cmake_minimum_required(VERSION 3.5)
|
||||
|
||||
project(
|
||||
QConsoleWidget
|
||||
VERSION 2.14.1
|
||||
LANGUAGES CXX)
|
||||
QConsoleWidget
|
||||
VERSION 2.14.1
|
||||
LANGUAGES CXX)
|
||||
|
||||
set(CMAKE_AUTOUIC ON)
|
||||
set(CMAKE_AUTOMOC ON)
|
||||
|
@ -16,13 +16,13 @@ find_package(QT NAMES Qt6 Qt5 REQUIRED COMPONENTS Widgets)
|
|||
find_package(Qt${QT_VERSION_MAJOR} REQUIRED COMPONENTS Widgets)
|
||||
|
||||
if(MSVC)
|
||||
string(APPEND CMAKE_CXX_FLAGS " /utf-8")
|
||||
string(APPEND CMAKE_C_FLAGS " /utf-8")
|
||||
add_definitions(-D_CRT_SECURE_NO_WARNINGS)
|
||||
string(APPEND CMAKE_CXX_FLAGS " /utf-8")
|
||||
string(APPEND CMAKE_C_FLAGS " /utf-8")
|
||||
add_definitions(-D_CRT_SECURE_NO_WARNINGS)
|
||||
endif()
|
||||
|
||||
add_library(
|
||||
QConsoleWidget STATIC src/QConsoleIODevice.cpp src/QConsoleIODevice.h
|
||||
src/QConsoleWidget.cpp src/QConsoleWidget.h)
|
||||
QConsoleWidget STATIC src/QConsoleIODevice.cpp src/QConsoleIODevice.h
|
||||
src/QConsoleWidget.cpp src/QConsoleWidget.h)
|
||||
|
||||
target_link_libraries(QConsoleWidget PRIVATE Qt${QT_VERSION_MAJOR}::Widgets)
|
||||
|
|
|
@ -5,12 +5,14 @@
|
|||
#include <QApplication>
|
||||
#include <QClipboard>
|
||||
#include <QDebug>
|
||||
#include <QDir>
|
||||
#include <QFile>
|
||||
#include <QKeyEvent>
|
||||
#include <QMenu>
|
||||
#include <QMimeData>
|
||||
#include <QMouseEvent>
|
||||
#include <QScrollBar>
|
||||
#include <QStandardPaths>
|
||||
#include <QStringListModel>
|
||||
#include <QTextBlock>
|
||||
#include <QTextCursor>
|
||||
|
@ -413,6 +415,12 @@ void QConsoleWidget::replaceCommandLine(const QString &str) {
|
|||
setTextCursor(textCursor);
|
||||
}
|
||||
|
||||
QString QConsoleWidget::getHistoryPath() {
|
||||
QDir dir(QStandardPaths::writableLocation(QStandardPaths::AppDataLocation) +
|
||||
QDir::separator() + APP_NAME);
|
||||
return dir.absoluteFilePath(QStringLiteral(".command_history.lst"));
|
||||
}
|
||||
|
||||
void QConsoleWidget::write(const QString &message, const QTextCharFormat &fmt) {
|
||||
QTextCharFormat currfmt = currentCharFormat();
|
||||
QTextCursor tc = textCursor();
|
||||
|
@ -472,13 +480,11 @@ void QConsoleWidget::writeStdErr(const QString &s) {
|
|||
|
||||
/////////////////// QConsoleWidget::History /////////////////////
|
||||
|
||||
#define HISTORY_FILE ".command_history.lst"
|
||||
|
||||
QConsoleWidget::History QConsoleWidget::history_;
|
||||
|
||||
QConsoleWidget::History::History(void)
|
||||
: pos_(0), active_(false), maxsize_(10000) {
|
||||
QFile f(HISTORY_FILE);
|
||||
QFile f(QConsoleWidget::getHistoryPath());
|
||||
if (f.open(QFile::ReadOnly)) {
|
||||
QTextStream is(&f);
|
||||
while (!is.atEnd())
|
||||
|
@ -486,7 +492,7 @@ QConsoleWidget::History::History(void)
|
|||
}
|
||||
}
|
||||
QConsoleWidget::History::~History(void) {
|
||||
QFile f(HISTORY_FILE);
|
||||
QFile f(QConsoleWidget::getHistoryPath());
|
||||
if (f.open(QFile::WriteOnly | QFile::Truncate)) {
|
||||
QTextStream os(&f);
|
||||
int n = strings_.size();
|
||||
|
|
|
@ -80,6 +80,8 @@ protected:
|
|||
// replace the command line
|
||||
void replaceCommandLine(const QString &str);
|
||||
|
||||
static QString getHistoryPath();
|
||||
|
||||
protected slots:
|
||||
|
||||
// insert the completion from completer
|
||||
|
|
|
@ -3,85 +3,84 @@ cmake_minimum_required(VERSION 3.12)
|
|||
project(QHexView LANGUAGES CXX)
|
||||
|
||||
find_package(
|
||||
Qt${QT_VERSION_MAJOR}
|
||||
COMPONENTS Widgets Gui
|
||||
REQUIRED)
|
||||
Qt${QT_VERSION_MAJOR}
|
||||
COMPONENTS Widgets Gui
|
||||
REQUIRED)
|
||||
|
||||
set(CMAKE_INCLUDE_CURRENT_DIR TRUE)
|
||||
|
||||
add_library(
|
||||
QHexView STATIC
|
||||
document/buffer/qfilebuffer.cpp
|
||||
document/buffer/qfilebuffer.h
|
||||
document/buffer/qfileregionbuffer.cpp
|
||||
document/buffer/qfileregionbuffer.h
|
||||
document/buffer/qhexbuffer.cpp
|
||||
document/buffer/qhexbuffer.h
|
||||
document/buffer/qmemorybuffer.cpp
|
||||
document/buffer/qmemorybuffer.h
|
||||
document/buffer/qmemoryrefbuffer.cpp
|
||||
document/buffer/qmemoryrefbuffer.h
|
||||
document/commands/hex/hexcommand.cpp
|
||||
document/commands/hex/hexcommand.h
|
||||
document/commands/hex/insertcommand.cpp
|
||||
document/commands/hex/insertcommand.h
|
||||
document/commands/hex/removecommand.cpp
|
||||
document/commands/hex/removecommand.h
|
||||
document/commands/hex/replacecommand.cpp
|
||||
document/commands/hex/replacecommand.h
|
||||
document/commands/meta/metashowcommand.h
|
||||
document/commands/meta/metaremovecommand.cpp
|
||||
document/commands/meta/metaremovecommand.h
|
||||
document/commands/meta/metaremoveposcommand.cpp
|
||||
document/commands/meta/metaremoveposcommand.h
|
||||
document/commands/meta/metareplacecommand.cpp
|
||||
document/commands/meta/metareplacecommand.h
|
||||
document/commands/meta/metashowcommand.cpp
|
||||
document/commands/meta/metaclearcommand.cpp
|
||||
document/commands/meta/metaclearcommand.h
|
||||
document/commands/meta/metaaddcommand.h
|
||||
document/commands/meta/metaaddcommand.cpp
|
||||
document/commands/meta/metacommand.cpp
|
||||
document/commands/meta/metacommand.h
|
||||
document/commands/bookmark/bookmarkaddcommand.cpp
|
||||
document/commands/bookmark/bookmarkaddcommand.h
|
||||
document/commands/bookmark/bookmarkclearcommand.cpp
|
||||
document/commands/bookmark/bookmarkclearcommand.h
|
||||
document/commands/bookmark/bookmarkcommand.cpp
|
||||
document/commands/bookmark/bookmarkcommand.h
|
||||
document/commands/bookmark/bookmarkremovecommand.cpp
|
||||
document/commands/bookmark/bookmarkremovecommand.h
|
||||
document/commands/bookmark/bookmarkreplacecommand.cpp
|
||||
document/commands/bookmark/bookmarkreplacecommand.h
|
||||
document/commands/baseaddrcommand.cpp
|
||||
document/commands/baseaddrcommand.h
|
||||
document/commands/encodingchangecommand.cpp
|
||||
document/commands/encodingchangecommand.h
|
||||
document/buffer/qwindriverbuffer.h
|
||||
document/buffer/qwindriverbuffer.cpp
|
||||
document/qstoragedevice.h
|
||||
document/qstoragedevice.cpp
|
||||
document/qhexcursor.cpp
|
||||
document/qhexcursor.h
|
||||
document/qhexdocument.cpp
|
||||
document/qhexdocument.h
|
||||
document/qhexmetadata.cpp
|
||||
document/qhexmetadata.h
|
||||
document/qhexrenderer.cpp
|
||||
document/qhexrenderer.h
|
||||
QHexEdit2/chunks.cpp
|
||||
QHexEdit2/chunks.h
|
||||
QHexEdit2/chunks_win.cpp
|
||||
QHexEdit2/chunks_win.h
|
||||
qhexview.h
|
||||
qhexview.cpp
|
||||
)
|
||||
QHexView STATIC
|
||||
document/buffer/qfilebuffer.cpp
|
||||
document/buffer/qfilebuffer.h
|
||||
document/buffer/qfileregionbuffer.cpp
|
||||
document/buffer/qfileregionbuffer.h
|
||||
document/buffer/qhexbuffer.cpp
|
||||
document/buffer/qhexbuffer.h
|
||||
document/buffer/qmemorybuffer.cpp
|
||||
document/buffer/qmemorybuffer.h
|
||||
document/buffer/qmemoryrefbuffer.cpp
|
||||
document/buffer/qmemoryrefbuffer.h
|
||||
document/commands/hex/hexcommand.cpp
|
||||
document/commands/hex/hexcommand.h
|
||||
document/commands/hex/insertcommand.cpp
|
||||
document/commands/hex/insertcommand.h
|
||||
document/commands/hex/removecommand.cpp
|
||||
document/commands/hex/removecommand.h
|
||||
document/commands/hex/replacecommand.cpp
|
||||
document/commands/hex/replacecommand.h
|
||||
document/commands/meta/metashowcommand.h
|
||||
document/commands/meta/metaremovecommand.cpp
|
||||
document/commands/meta/metaremovecommand.h
|
||||
document/commands/meta/metaremoveposcommand.cpp
|
||||
document/commands/meta/metaremoveposcommand.h
|
||||
document/commands/meta/metareplacecommand.cpp
|
||||
document/commands/meta/metareplacecommand.h
|
||||
document/commands/meta/metashowcommand.cpp
|
||||
document/commands/meta/metaclearcommand.cpp
|
||||
document/commands/meta/metaclearcommand.h
|
||||
document/commands/meta/metaaddcommand.h
|
||||
document/commands/meta/metaaddcommand.cpp
|
||||
document/commands/meta/metacommand.cpp
|
||||
document/commands/meta/metacommand.h
|
||||
document/commands/bookmark/bookmarkaddcommand.cpp
|
||||
document/commands/bookmark/bookmarkaddcommand.h
|
||||
document/commands/bookmark/bookmarkclearcommand.cpp
|
||||
document/commands/bookmark/bookmarkclearcommand.h
|
||||
document/commands/bookmark/bookmarkcommand.cpp
|
||||
document/commands/bookmark/bookmarkcommand.h
|
||||
document/commands/bookmark/bookmarkremovecommand.cpp
|
||||
document/commands/bookmark/bookmarkremovecommand.h
|
||||
document/commands/bookmark/bookmarkreplacecommand.cpp
|
||||
document/commands/bookmark/bookmarkreplacecommand.h
|
||||
document/commands/baseaddrcommand.cpp
|
||||
document/commands/baseaddrcommand.h
|
||||
document/commands/encodingchangecommand.cpp
|
||||
document/commands/encodingchangecommand.h
|
||||
document/buffer/qwindriverbuffer.h
|
||||
document/buffer/qwindriverbuffer.cpp
|
||||
document/qstoragedevice.h
|
||||
document/qstoragedevice.cpp
|
||||
document/qhexcursor.cpp
|
||||
document/qhexcursor.h
|
||||
document/qhexdocument.cpp
|
||||
document/qhexdocument.h
|
||||
document/qhexmetadata.cpp
|
||||
document/qhexmetadata.h
|
||||
document/qhexrenderer.cpp
|
||||
document/qhexrenderer.h
|
||||
QHexEdit2/chunks.cpp
|
||||
QHexEdit2/chunks.h
|
||||
QHexEdit2/chunks_win.cpp
|
||||
QHexEdit2/chunks_win.h
|
||||
qhexview.h
|
||||
qhexview.cpp)
|
||||
|
||||
set_target_properties(
|
||||
QHexView
|
||||
PROPERTIES AUTOMOC ON
|
||||
CXX_STANDARD 11
|
||||
CXX_STANDARD_REQUIRED ON)
|
||||
QHexView
|
||||
PROPERTIES AUTOMOC ON
|
||||
CXX_STANDARD 11
|
||||
CXX_STANDARD_REQUIRED ON)
|
||||
|
||||
target_link_libraries(QHexView PRIVATE Qt${QT_VERSION_MAJOR}::Widgets
|
||||
Qt${QT_VERSION_MAJOR}::Gui)
|
||||
|
|
|
@ -23,6 +23,15 @@ void QHexMetadata::ModifyMetadata(QHexMetadataAbsoluteItem newmeta,
|
|||
m_undo->push(new MetaReplaceCommand(this, newmeta, oldmeta));
|
||||
}
|
||||
|
||||
void QHexMetadata::RemoveMetadatas(
|
||||
const QList<QHexMetadataAbsoluteItem> &items) {
|
||||
m_undo->beginMacro("RemoveMetadatas");
|
||||
for (auto &item : items) {
|
||||
RemoveMetadata(item);
|
||||
}
|
||||
m_undo->endMacro();
|
||||
}
|
||||
|
||||
void QHexMetadata::RemoveMetadata(QHexMetadataAbsoluteItem item) {
|
||||
m_undo->push(new MetaRemoveCommand(this, item));
|
||||
}
|
||||
|
|
|
@ -61,6 +61,7 @@ public:
|
|||
|
||||
void ModifyMetadata(QHexMetadataAbsoluteItem newmeta,
|
||||
QHexMetadataAbsoluteItem oldmeta);
|
||||
void RemoveMetadatas(const QList<QHexMetadataAbsoluteItem> &items);
|
||||
void RemoveMetadata(QHexMetadataAbsoluteItem item);
|
||||
void RemoveMetadata(qsizetype offset);
|
||||
void Metadata(qsizetype begin, qsizetype end, const QColor &fgcolor,
|
||||
|
|
|
@ -338,6 +338,10 @@ bool QHexView::atEnd() const {
|
|||
return m_cursor->position().offset() >= m_document->length();
|
||||
}
|
||||
|
||||
void QHexView::gotoMetaData(qsizetype index) {
|
||||
m_cursor->moveTo(m_document->metadata()->getallMetasPtr().at(index).begin);
|
||||
}
|
||||
|
||||
QByteArray QHexView::selectedBytes() const {
|
||||
if (!m_cursor->hasSelection())
|
||||
return QByteArray();
|
||||
|
|
|
@ -103,6 +103,8 @@ public:
|
|||
bool removeSelection();
|
||||
bool atEnd() const;
|
||||
|
||||
void gotoMetaData(qsizetype index);
|
||||
|
||||
QByteArray selectedBytes() const;
|
||||
|
||||
bool cut(bool hex);
|
||||
|
|
|
@ -1,21 +1,21 @@
|
|||
cmake_minimum_required(VERSION 3.26)
|
||||
|
||||
project(
|
||||
QJsonModel
|
||||
VERSION 0.0.2
|
||||
LANGUAGES C CXX
|
||||
# Save this for later: HOMEPAGE_URL <URL>
|
||||
DESCRIPTION
|
||||
"QJsonModel is a json tree model class for Qt6/C++17 based on QAbstractItemModel. MIT License."
|
||||
QJsonModel
|
||||
VERSION 0.0.2
|
||||
LANGUAGES C CXX
|
||||
# Save this for later: HOMEPAGE_URL <URL>
|
||||
DESCRIPTION
|
||||
"QJsonModel is a json tree model class for Qt6/C++17 based on QAbstractItemModel. MIT License."
|
||||
)
|
||||
|
||||
find_package(QT NAMES Qt6 Qt5 REQUIRED COMPONENTS Widgets)
|
||||
find_package(Qt${QT_VERSION_MAJOR} REQUIRED COMPONENTS Widgets)
|
||||
|
||||
if(MSVC)
|
||||
string(APPEND CMAKE_CXX_FLAGS " /utf-8")
|
||||
string(APPEND CMAKE_C_FLAGS " /utf-8")
|
||||
add_definitions(-D_CRT_SECURE_NO_WARNINGS)
|
||||
string(APPEND CMAKE_CXX_FLAGS " /utf-8")
|
||||
string(APPEND CMAKE_C_FLAGS " /utf-8")
|
||||
add_definitions(-D_CRT_SECURE_NO_WARNINGS)
|
||||
endif()
|
||||
|
||||
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/include)
|
||||
|
|
|
@ -1 +0,0 @@
|
|||
Subproject commit 7796cd87d93e03f2386c11b8a3829989d00c0808
|
|
@ -1 +1 @@
|
|||
Subproject commit 318776e428741cd17087a13a2ddf6c83a05e24e0
|
||||
Subproject commit b3e7421d4a55ce85124db2e2ae712040cc758f0a
|
|
@ -11,10 +11,9 @@ find_package(QT NAMES Qt6 Qt5 REQUIRED COMPONENTS Widgets Gui PrintSupport Xml)
|
|||
find_package(Qt${QT_VERSION_MAJOR} REQUIRED COMPONENTS Widgets Gui PrintSupport
|
||||
Xml)
|
||||
|
||||
add_definitions(-DQNFA_BUILD -D_QCODE_EDIT_BUILD_ -D_QCODE_EDIT_EMBED_)
|
||||
add_definitions(-DQNFA_BUILD)
|
||||
|
||||
set(DOCUMENT_SRC
|
||||
lib/document/qdocumentsearch.h
|
||||
lib/document/qdocumentline_p.h
|
||||
lib/document/qdocumentbuffer.h
|
||||
lib/document/qdocumentcommand.h
|
||||
|
@ -25,43 +24,25 @@ set(DOCUMENT_SRC
|
|||
lib/document/qdocument.h
|
||||
lib/document/qdocumentbuffer.cpp
|
||||
lib/document/qdocumentline.cpp
|
||||
lib/document/qdocumentsearch.cpp
|
||||
lib/document/qdocumentcursor.cpp
|
||||
lib/document/qdocumentcommand.cpp
|
||||
lib/document/qdocument.cpp)
|
||||
|
||||
set(WIDGETS_SRC
|
||||
lib/widgets/qgotolinedialog.h
|
||||
lib/widgets/qlinechangepanel.h
|
||||
lib/widgets/qfoldpanel.h
|
||||
lib/widgets/qlinenumberpanel.h
|
||||
lib/widgets/qstatuspanel.h
|
||||
lib/widgets/qcalltip.h
|
||||
lib/widgets/qsimplecolorpicker.h
|
||||
lib/widgets/qlinemarkpanel.h
|
||||
lib/widgets/qgotolinepanel.h
|
||||
lib/widgets/qgotolinedialog.cpp
|
||||
lib/widgets/qformatconfig.h
|
||||
lib/widgets/gotoline.ui
|
||||
lib/widgets/qeditconfig.h
|
||||
lib/widgets/qsimplecolorpicker.cpp
|
||||
lib/widgets/qsearchreplacepanel.h
|
||||
lib/widgets/qlinechangepanel.cpp
|
||||
lib/widgets/formatconfig.ui
|
||||
lib/widgets/qpanel.h
|
||||
lib/widgets/qgotolinepanel.cpp
|
||||
lib/widgets/gotolinedialog.ui
|
||||
lib/widgets/qstatuspanel.cpp
|
||||
lib/widgets/qlinemarkpanel.cpp
|
||||
lib/widgets/qlinenumberpanel.cpp
|
||||
lib/widgets/qcalltip.cpp
|
||||
lib/widgets/qpanel.cpp
|
||||
lib/widgets/qcalltip.h
|
||||
lib/widgets/qfoldpanel.cpp
|
||||
lib/widgets/editconfig.ui
|
||||
lib/widgets/qsearchreplacepanel.cpp
|
||||
lib/widgets/qformatconfig.cpp
|
||||
lib/widgets/qeditconfig.cpp
|
||||
lib/widgets/searchreplace.ui)
|
||||
lib/widgets/qfoldpanel.h
|
||||
lib/widgets/qlinechangepanel.cpp
|
||||
lib/widgets/qlinechangepanel.h
|
||||
lib/widgets/qlinemarkpanel.cpp
|
||||
lib/widgets/qlinemarkpanel.h
|
||||
lib/widgets/qlinenumberpanel.cpp
|
||||
lib/widgets/qlinenumberpanel.h
|
||||
lib/widgets/qpanel.cpp
|
||||
lib/widgets/qpanel.h
|
||||
lib/widgets/qsimplecolorpicker.cpp
|
||||
lib/widgets/qsimplecolorpicker.h)
|
||||
|
||||
set(QNFA_SRC
|
||||
lib/qnfa/light_vector.h lib/qnfa/qnfadefinition.h lib/qnfa/qnfa.h
|
||||
|
@ -111,15 +92,18 @@ set(SOURCE_FILES
|
|||
add_library(QCodeEditor2 STATIC ${SOURCE_FILES} ${DOCUMENT_SRC} ${WIDGETS_SRC}
|
||||
${QNFA_SRC} ${SNIPPET_SRC})
|
||||
|
||||
target_compile_definitions(QCodeEditor2 PUBLIC _QCODE_EDIT_BUILD_
|
||||
_QCODE_EDIT_EMBED_)
|
||||
|
||||
target_include_directories(
|
||||
QCodeEditor2
|
||||
PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/lib"
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/lib/document"
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/lib/widgets"
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/lib/qnfa"
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/lib/snippets")
|
||||
QCodeEditor2
|
||||
PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/lib"
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/lib/document"
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/lib/widgets"
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/lib/qnfa"
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/lib/snippets")
|
||||
|
||||
target_link_libraries(
|
||||
QCodeEditor2
|
||||
PRIVATE Qt${QT_VERSION_MAJOR}::Widgets Qt${QT_VERSION_MAJOR}::Gui
|
||||
Qt${QT_VERSION_MAJOR}::Xml Qt${QT_VERSION_MAJOR}::PrintSupport)
|
||||
QCodeEditor2
|
||||
PRIVATE Qt${QT_VERSION_MAJOR}::Widgets Qt${QT_VERSION_MAJOR}::Gui
|
||||
Qt${QT_VERSION_MAJOR}::Xml Qt${QT_VERSION_MAJOR}::PrintSupport)
|
||||
|
|
|
@ -5446,7 +5446,9 @@ void QDocumentPrivate::clearMatches(int groupId) {
|
|||
|
||||
MatchList &matches = *mit;
|
||||
|
||||
foreach (const Match &m, matches) { m.h->removeOverlay(m.range); }
|
||||
for (const Match &m : matches) {
|
||||
m.h->removeOverlay(m.range);
|
||||
}
|
||||
|
||||
matches.index = matches.count();
|
||||
}
|
||||
|
|
|
@ -171,7 +171,7 @@ void QCodeCompletionEngine::textEdited(QKeyEvent *k) {
|
|||
|
||||
// qDebug("text : %s", qPrintable(txt));
|
||||
|
||||
foreach (QString trig, m_triggers) {
|
||||
for (auto &trig : m_triggers) {
|
||||
if (txt.endsWith(trig)) {
|
||||
cur = editor()->cursor();
|
||||
cur.movePosition(trig.size(), QDocumentCursor::PreviousCharacter);
|
||||
|
@ -225,7 +225,7 @@ bool QCodeCompletionEngine::eventFilter(QObject *o, QEvent *e) {
|
|||
|
||||
// qDebug("text : %s", qPrintable(txt));
|
||||
|
||||
foreach (QString trig, m_triggers) {
|
||||
for (auto &trig : m_triggers) {
|
||||
if (txt.endsWith(trig)) {
|
||||
editor()->write(s);
|
||||
|
||||
|
|
|
@ -32,7 +32,6 @@
|
|||
|
||||
#include "QMetaMethod"
|
||||
#include "qcodeedit.h"
|
||||
#include "qgotolinedialog.h"
|
||||
#include "qlinemarksinfocenter.h"
|
||||
#include "qpanellayout.h"
|
||||
|
||||
|
@ -55,6 +54,7 @@
|
|||
#include <QPointer>
|
||||
#include <QPrintDialog>
|
||||
#include <QPrinter>
|
||||
#include <QRegularExpression>
|
||||
#include <QScrollBar>
|
||||
#include <QStyle>
|
||||
#include <QTextStream>
|
||||
|
@ -76,7 +76,7 @@
|
|||
#endif
|
||||
|
||||
#ifdef Q_GL_EDITOR
|
||||
#include <QGLWidget>
|
||||
#include <QtOpenGLWidgets/QOpenGLWidget>
|
||||
#endif
|
||||
|
||||
#define QCE_ACTION(name, action) \
|
||||
|
@ -216,7 +216,7 @@ QString QEditor::defaultInputBindingId() {
|
|||
void QEditor::registerInputBinding(QEditorInputBindingInterface *b) {
|
||||
m_registeredBindings[b->id()] = b;
|
||||
|
||||
foreach (QEditor *e, m_editors)
|
||||
for (QEditor *e : m_editors)
|
||||
e->updateBindingsMenu();
|
||||
}
|
||||
|
||||
|
@ -226,7 +226,7 @@ void QEditor::registerInputBinding(QEditorInputBindingInterface *b) {
|
|||
void QEditor::unregisterInputBinding(QEditorInputBindingInterface *b) {
|
||||
m_registeredBindings.remove(b->id());
|
||||
|
||||
foreach (QEditor *e, m_editors)
|
||||
for (QEditor *e : m_editors)
|
||||
e->updateBindingsMenu();
|
||||
}
|
||||
|
||||
|
@ -294,7 +294,7 @@ int QEditor::defaultFlags() { return m_defaultFlags; }
|
|||
void QEditor::setDefaultFlags(int flags) {
|
||||
m_defaultFlags = flags & Accessible;
|
||||
|
||||
foreach (QEditor *e, m_editors) {
|
||||
for (QEditor *e : m_editors) {
|
||||
bool ontoWrap = (m_defaultFlags & LineWrap) && !(e->m_state & LineWrap);
|
||||
bool outOfWrap =
|
||||
!(m_defaultFlags & LineWrap) && (e->m_state & LineWrap);
|
||||
|
@ -331,7 +331,7 @@ QString QEditor::defaultCodecName() { return m_defaultCodecName; }
|
|||
affected by the change of the default codecName.
|
||||
*/
|
||||
void QEditor::setDefaultCodec(const QString &name, int update) {
|
||||
foreach (QEditor *e, m_editors) {
|
||||
for (QEditor *e : m_editors) {
|
||||
if (e->codecName() == m_defaultCodecName) {
|
||||
if (update & UpdateOld)
|
||||
e->setCodec(name);
|
||||
|
@ -432,9 +432,6 @@ QEditor::~QEditor() {
|
|||
if (m_completionEngine)
|
||||
delete m_completionEngine;
|
||||
|
||||
if (m_doc)
|
||||
delete m_doc;
|
||||
|
||||
if (m_editors.isEmpty()) {
|
||||
delete watcher();
|
||||
} else {
|
||||
|
@ -447,7 +444,7 @@ QEditor::~QEditor() {
|
|||
*/
|
||||
void QEditor::init(bool actions) {
|
||||
#ifdef Q_GL_EDITOR
|
||||
setViewport(new QGLWidget);
|
||||
setViewport(new QOpenGLWidget);
|
||||
#endif
|
||||
|
||||
viewport()->setCursor(Qt::IBeamCursor);
|
||||
|
@ -472,6 +469,7 @@ void QEditor::init(bool actions) {
|
|||
SLOT(markChanged(QString, QDocumentLineHandle *, int, bool)));
|
||||
|
||||
m_doc = new QDocument(this);
|
||||
_docfont = m_doc->font();
|
||||
|
||||
connect(m_doc, SIGNAL(formatsChange(int, int)), this,
|
||||
SLOT(repaintContent(int, int)));
|
||||
|
@ -514,7 +512,7 @@ void QEditor::init(bool actions) {
|
|||
|
||||
QAction *a, *sep;
|
||||
|
||||
a = new QAction(QIcon(":/undo.png"), tr("&Undo"), this);
|
||||
a = new QAction(QIcon(":/qeditor/undo.png"), tr("&Undo"), this);
|
||||
a->setObjectName("undo");
|
||||
Q_SHORTCUT(a, "Ctrl+Z", "Edit");
|
||||
a->setEnabled(false);
|
||||
|
@ -523,7 +521,7 @@ void QEditor::init(bool actions) {
|
|||
|
||||
addAction(a, "&Edit", "Edit");
|
||||
|
||||
a = new QAction(QIcon(":/redo.png"), tr("&Redo"), this);
|
||||
a = new QAction(QIcon(":/qeditor/redo.png"), tr("&Redo"), this);
|
||||
a->setObjectName("redo");
|
||||
Q_SHORTCUT(a, "Ctrl+Y", "Edit");
|
||||
a->setEnabled(false);
|
||||
|
@ -536,7 +534,7 @@ void QEditor::init(bool actions) {
|
|||
sep->setSeparator(true);
|
||||
addAction(sep, "&Edit", "Edit");
|
||||
|
||||
a = new QAction(QIcon(":/cut.png"), tr("Cu&t"), this);
|
||||
a = new QAction(QIcon(":/qeditor/cut.png"), tr("Cu&t"), this);
|
||||
a->setObjectName("cut");
|
||||
Q_SHORTCUT(a, "Ctrl+X", "Edit");
|
||||
a->setEnabled(false);
|
||||
|
@ -545,7 +543,7 @@ void QEditor::init(bool actions) {
|
|||
|
||||
addAction(a, "&Edit", "Edit");
|
||||
|
||||
a = new QAction(QIcon(":/copy.png"), tr("&Copy"), this);
|
||||
a = new QAction(QIcon(":/qeditor/copy.png"), tr("&Copy"), this);
|
||||
a->setObjectName("copy");
|
||||
Q_SHORTCUT(a, "Ctrl+C", "Edit");
|
||||
a->setEnabled(false);
|
||||
|
@ -554,7 +552,7 @@ void QEditor::init(bool actions) {
|
|||
|
||||
addAction(a, "&Edit", "Edit");
|
||||
|
||||
a = new QAction(QIcon(":/paste.png"), tr("&Paste"), this);
|
||||
a = new QAction(QIcon(":/qeditor/paste.png"), tr("&Paste"), this);
|
||||
a->setObjectName("paste");
|
||||
// aPaste->setEnabled(QApplication::clipboard()->text().count());
|
||||
Q_SHORTCUT(a, "Ctrl+V", "Edit");
|
||||
|
@ -569,14 +567,14 @@ void QEditor::init(bool actions) {
|
|||
sep->setSeparator(true);
|
||||
addAction(sep, "&Edit", "Edit");
|
||||
|
||||
a = new QAction(QIcon(":/indent.png"), tr("&Indent"), this);
|
||||
a = new QAction(tr("&Indent"), this);
|
||||
a->setObjectName("indent");
|
||||
Q_SHORTCUT(a, "Ctrl+I", "Edit");
|
||||
connect(a, SIGNAL(triggered()), this, SLOT(indentSelection()));
|
||||
|
||||
addAction(a, "&Edit", "Edit");
|
||||
|
||||
a = new QAction(QIcon(":/unindent.png"), tr("&Unindent"), this);
|
||||
a = new QAction(tr("&Unindent"), this);
|
||||
a->setObjectName("unindent");
|
||||
Q_SHORTCUT(a, "Ctrl+Shift+I", "Edit");
|
||||
connect(a, SIGNAL(triggered()), this, SLOT(unindentSelection()));
|
||||
|
@ -587,14 +585,14 @@ void QEditor::init(bool actions) {
|
|||
sep->setSeparator(true);
|
||||
addAction(sep, "&Edit", "");
|
||||
|
||||
a = new QAction(QIcon(":/comment.png"), tr("Co&mment"), this);
|
||||
a = new QAction(tr("Co&mment"), this);
|
||||
a->setObjectName("comment");
|
||||
Q_SHORTCUT(a, "Ctrl+D", "Edit");
|
||||
connect(a, SIGNAL(triggered()), this, SLOT(commentSelection()));
|
||||
|
||||
addAction(a, "&Edit", "Edit");
|
||||
|
||||
a = new QAction(QIcon(":/uncomment.png"), tr("Unc&omment"), this);
|
||||
a = new QAction(tr("Unc&omment"), this);
|
||||
a->setObjectName("uncomment");
|
||||
Q_SHORTCUT(a, "Ctrl+Shift+D", "Edit");
|
||||
connect(a, SIGNAL(triggered()), this, SLOT(uncommentSelection()));
|
||||
|
@ -616,21 +614,21 @@ void QEditor::init(bool actions) {
|
|||
sep->setSeparator(true);
|
||||
addAction(sep, QString());
|
||||
|
||||
a = new QAction(QIcon(":/find.png"), tr("&Find"), this);
|
||||
a = new QAction(QIcon(":/qeditor/find.png"), tr("&Find"), this);
|
||||
a->setObjectName("find");
|
||||
Q_SHORTCUT(a, "Ctrl+F", "Search");
|
||||
connect(a, SIGNAL(triggered()), this, SLOT(find()));
|
||||
|
||||
addAction(a, "&Search", "Search");
|
||||
|
||||
a = new QAction(QIcon(":/next.png"), tr("Fin&d next"), pMenu);
|
||||
a = new QAction(tr("Fin&d next"), pMenu);
|
||||
a->setObjectName("findNext");
|
||||
Q_SHORTCUT(a, "F3", "Search");
|
||||
connect(a, SIGNAL(triggered()), this, SLOT(findNext()));
|
||||
|
||||
addAction(a, "&Search", "Search");
|
||||
|
||||
a = new QAction(QIcon(":/replace.png"), tr("&Replace"), this);
|
||||
a = new QAction(QIcon(":/qeditor/replace.png"), tr("&Replace"), this);
|
||||
a->setObjectName("replace");
|
||||
Q_SHORTCUT(a, "Ctrl+R", "Search");
|
||||
connect(a, SIGNAL(triggered()), this, SLOT(replace()));
|
||||
|
@ -641,7 +639,7 @@ void QEditor::init(bool actions) {
|
|||
sep->setSeparator(true);
|
||||
addAction(sep, "&Search", "Search");
|
||||
|
||||
a = new QAction(QIcon(":/goto.png"), tr("&Goto line..."), this);
|
||||
a = new QAction(QIcon(":/qeditor/goto.png"), tr("&Goto line..."), this);
|
||||
a->setObjectName("goto");
|
||||
Q_SHORTCUT(a, "Ctrl+G", "Search");
|
||||
connect(a, SIGNAL(triggered()), this, SLOT(gotoLine()));
|
||||
|
@ -703,7 +701,7 @@ void QEditor::init(bool actions) {
|
|||
|
||||
QList<QAction *> lle = m_lineEndingsActions->actions();
|
||||
|
||||
foreach (QAction *a, lle) {
|
||||
for (QAction *a : lle) {
|
||||
a->setCheckable(true);
|
||||
m_lineEndingsMenu->addAction(a);
|
||||
}
|
||||
|
@ -823,9 +821,9 @@ void QEditor::setText(const QString &s) {
|
|||
|
||||
\see fileName()
|
||||
*/
|
||||
void QEditor::save() {
|
||||
bool QEditor::save() {
|
||||
if (!m_doc)
|
||||
return;
|
||||
return false;
|
||||
|
||||
QString oldFileName = fileName();
|
||||
|
||||
|
@ -833,7 +831,7 @@ void QEditor::save() {
|
|||
QString fn = QFileDialog::getSaveFileName();
|
||||
|
||||
if (fn.isEmpty())
|
||||
return;
|
||||
return false;
|
||||
|
||||
setFileName(fn);
|
||||
} else if (isInConflict()) {
|
||||
|
@ -851,12 +849,12 @@ void QEditor::save() {
|
|||
} else if (ret == QMessageBox::Reset) {
|
||||
load(fileName());
|
||||
m_saveState = Undefined;
|
||||
return;
|
||||
return false;
|
||||
} else if (ret == QMessageBox::Discard) {
|
||||
m_saveState = Undefined;
|
||||
return;
|
||||
return false;
|
||||
} else {
|
||||
return;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -872,7 +870,7 @@ void QEditor::save() {
|
|||
m_saveState = Undefined;
|
||||
reconnectWatcher();
|
||||
|
||||
return;
|
||||
return false;
|
||||
}
|
||||
|
||||
// QTextStream s(&f);
|
||||
|
@ -893,6 +891,7 @@ void QEditor::save() {
|
|||
QTimer::singleShot(100, this, SLOT(reconnectWatcher()));
|
||||
|
||||
update();
|
||||
return true;
|
||||
}
|
||||
|
||||
/*!
|
||||
|
@ -901,7 +900,7 @@ void QEditor::save() {
|
|||
\note This method renames the editor, stop monitoring the old
|
||||
file and monitor the new one
|
||||
*/
|
||||
void QEditor::save(const QString &fn) {
|
||||
bool QEditor::save(const QString &fn) {
|
||||
if (fileName().size()) {
|
||||
watcher()->removeWatch(fileName(), this);
|
||||
}
|
||||
|
@ -912,7 +911,7 @@ void QEditor::save(const QString &fn) {
|
|||
m_saveState = Undefined;
|
||||
reconnectWatcher();
|
||||
|
||||
return;
|
||||
return false;
|
||||
}
|
||||
|
||||
QString txt =
|
||||
|
@ -930,6 +929,7 @@ void QEditor::save(const QString &fn) {
|
|||
m_saveState = Saved;
|
||||
|
||||
QTimer::singleShot(100, this, SLOT(reconnectWatcher()));
|
||||
return true;
|
||||
}
|
||||
|
||||
/*!
|
||||
|
@ -1091,9 +1091,7 @@ void QEditor::gotoLine() {
|
|||
|
||||
m->sendPanelCommand("Goto", "show");
|
||||
} else {
|
||||
QGotoLineDialog dlg(this);
|
||||
|
||||
dlg.exec(this);
|
||||
qDebug("Unmanaged QEditor");
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1223,7 +1221,7 @@ void QEditor::removeAction(QAction *a, const QString &menu,
|
|||
|
||||
If the file cannot be loaded, previous content is cleared.
|
||||
*/
|
||||
void QEditor::load(const QString &file) {
|
||||
bool QEditor::load(const QString &file) {
|
||||
QFile f(file);
|
||||
|
||||
// gotta handle line endings ourselves if we want to detect current line
|
||||
|
@ -1231,7 +1229,7 @@ void QEditor::load(const QString &file) {
|
|||
// if ( !f.open(QFile::Text | QFile::ReadOnly) )
|
||||
if (!f.open(QFile::ReadOnly)) {
|
||||
setText(QString());
|
||||
return;
|
||||
return false;
|
||||
}
|
||||
|
||||
const int size = f.size();
|
||||
|
@ -1311,6 +1309,7 @@ void QEditor::load(const QString &file) {
|
|||
setFileName(file);
|
||||
|
||||
emit loaded(this, file);
|
||||
return true;
|
||||
}
|
||||
|
||||
/*!
|
||||
|
@ -1382,7 +1381,7 @@ void QEditor::addInputBinding(QEditorInputBindingInterface *b) {
|
|||
|
||||
QList<QAction *> actions = m_bindingsActions->actions();
|
||||
|
||||
foreach (QAction *a, actions) {
|
||||
for (QAction *a : actions) {
|
||||
if (a->data().toString() != id)
|
||||
a->setChecked(true);
|
||||
}
|
||||
|
@ -1405,7 +1404,7 @@ void QEditor::removeInputBinding(QEditorInputBindingInterface *b) {
|
|||
|
||||
QList<QAction *> actions = m_bindingsActions->actions();
|
||||
|
||||
foreach (QAction *a, actions) {
|
||||
for (QAction *a : actions) {
|
||||
if (a->data().toString() != id)
|
||||
a->setChecked(false);
|
||||
}
|
||||
|
@ -1431,7 +1430,7 @@ void QEditor::setInputBinding(QEditorInputBindingInterface *b) {
|
|||
|
||||
QList<QAction *> actions = m_bindingsActions->actions();
|
||||
|
||||
foreach (QAction *a, actions) {
|
||||
for (QAction *a : actions) {
|
||||
if (a)
|
||||
a->setChecked(a->data().toString() != id);
|
||||
}
|
||||
|
@ -1449,7 +1448,7 @@ void QEditor::updateBindingsMenu() {
|
|||
|
||||
aDefaultBinding->setChecked(m_bindings.contains(m_defaultBinding));
|
||||
|
||||
foreach (QAction *a, actions) {
|
||||
for (QAction *a : actions) {
|
||||
int idx = bindings.indexOf(a->data().toString());
|
||||
|
||||
if (idx == -1) {
|
||||
|
@ -1459,7 +1458,7 @@ void QEditor::updateBindingsMenu() {
|
|||
} else {
|
||||
bindings.removeAt(idx);
|
||||
|
||||
foreach (QEditorInputBindingInterface *b, m_bindings)
|
||||
for (QEditorInputBindingInterface *b : m_bindings)
|
||||
if (a->data().toString() == b->id())
|
||||
a->setChecked(true);
|
||||
}
|
||||
|
@ -1467,7 +1466,7 @@ void QEditor::updateBindingsMenu() {
|
|||
|
||||
bindings.removeAll("default");
|
||||
|
||||
foreach (QString s, bindings) {
|
||||
for (auto &s : bindings) {
|
||||
QEditorInputBindingInterface *b = m_registeredBindings.value(s);
|
||||
|
||||
if (!b)
|
||||
|
@ -1786,7 +1785,7 @@ QCodeCompletionEngine *QEditor::completionEngine() const {
|
|||
*/
|
||||
void QEditor::setCompletionEngine(QCodeCompletionEngine *e) {
|
||||
if (m_completionEngine) {
|
||||
m_completionEngine->setEditor(0);
|
||||
m_completionEngine->setEditor(nullptr);
|
||||
m_completionEngine->deleteLater();
|
||||
}
|
||||
|
||||
|
@ -1797,6 +1796,20 @@ void QEditor::setCompletionEngine(QCodeCompletionEngine *e) {
|
|||
}
|
||||
}
|
||||
|
||||
void QEditor::setScaleRate(qreal rate) {
|
||||
_scaleRate = rate;
|
||||
if (!m_doc)
|
||||
return;
|
||||
|
||||
auto f = _docfont;
|
||||
f.setPointSizeF(f.pointSizeF() * _scaleRate);
|
||||
m_doc->setFont(f);
|
||||
emit zoomed();
|
||||
update();
|
||||
}
|
||||
|
||||
qreal QEditor::scaleRate() const { return _scaleRate; }
|
||||
|
||||
/*!
|
||||
\return the language definition set to this editor, if any
|
||||
*/
|
||||
|
@ -2023,7 +2036,7 @@ void QEditor::indentSelection() {
|
|||
if (!protectedCursor(m_cursor))
|
||||
insert(m_cursor, txt);
|
||||
|
||||
foreach (const QDocumentCursor &m, m_mirrors)
|
||||
for (const QDocumentCursor &m : m_mirrors)
|
||||
if (!protectedCursor(m))
|
||||
insert(m, txt);
|
||||
|
||||
|
@ -2063,7 +2076,7 @@ void QEditor::unindentSelection() {
|
|||
if (!protectedCursor(m_cursor))
|
||||
unindent(m_cursor);
|
||||
|
||||
foreach (const QDocumentCursor &m, m_mirrors)
|
||||
for (const QDocumentCursor &m : m_mirrors)
|
||||
unindent(m);
|
||||
|
||||
m_doc->endMacro();
|
||||
|
@ -2102,7 +2115,7 @@ void QEditor::commentSelection() {
|
|||
if (!protectedCursor(m_cursor))
|
||||
insert(m_cursor, txt);
|
||||
|
||||
foreach (const QDocumentCursor &m, m_mirrors)
|
||||
for (const QDocumentCursor &m : m_mirrors)
|
||||
if (!protectedCursor(m))
|
||||
insert(m, txt);
|
||||
|
||||
|
@ -2148,7 +2161,7 @@ void QEditor::uncommentSelection() {
|
|||
if (!protectedCursor(m_cursor))
|
||||
removeFromStart(m_cursor, txt);
|
||||
|
||||
foreach (const QDocumentCursor &m, m_mirrors)
|
||||
for (const QDocumentCursor &m : m_mirrors)
|
||||
if (!protectedCursor(m))
|
||||
removeFromStart(m, txt);
|
||||
|
||||
|
@ -2246,7 +2259,7 @@ void QEditor::paintEvent(QPaintEvent *e) {
|
|||
}
|
||||
|
||||
// cursor mirrors :D
|
||||
foreach (const QDocumentCursor &m, m_mirrors) {
|
||||
for (const QDocumentCursor &m : m_mirrors) {
|
||||
if (ctx.blinkingCursor)
|
||||
ctx.extra << m.handle();
|
||||
|
||||
|
@ -2272,7 +2285,7 @@ void QEditor::paintEvent(QPaintEvent *e) {
|
|||
p.drawConvexPolygon(ph.cursor.documentRegion());
|
||||
|
||||
p.setPen(Qt::yellow);
|
||||
foreach (const QDocumentCursor &m, ph.mirrors) {
|
||||
for (const QDocumentCursor &m : ph.mirrors) {
|
||||
if (m.isValid())
|
||||
p.drawConvexPolygon(m.documentRegion());
|
||||
}
|
||||
|
@ -2312,7 +2325,7 @@ void QEditor::timerEvent(QTimerEvent *e) {
|
|||
static int max(const QList<QDocumentCursor> &l) {
|
||||
int ln = 0;
|
||||
|
||||
foreach (const QDocumentCursor &c, l)
|
||||
for (const QDocumentCursor &c : l)
|
||||
if (c.lineNumber() > ln)
|
||||
ln = c.lineNumber();
|
||||
|
||||
|
@ -2323,7 +2336,7 @@ static int min(const QList<QDocumentCursor> &l) {
|
|||
// beware the sign bit...
|
||||
int ln = 0x7fffffff;
|
||||
|
||||
foreach (const QDocumentCursor &c, l)
|
||||
for (const QDocumentCursor &c : l)
|
||||
if ((c.lineNumber() < ln) || (ln < 0))
|
||||
ln = c.lineNumber();
|
||||
|
||||
|
@ -2358,7 +2371,7 @@ bool QEditor::protectedCursor(const QDocumentCursor &c) const {
|
|||
\internal
|
||||
*/
|
||||
void QEditor::keyPressEvent(QKeyEvent *e) {
|
||||
foreach (QEditorInputBindingInterface *b, m_bindings)
|
||||
for (QEditorInputBindingInterface *b : m_bindings)
|
||||
if (b->keyPressEvent(e, this))
|
||||
return;
|
||||
|
||||
|
@ -2481,7 +2494,7 @@ void QEditor::keyPressEvent(QKeyEvent *e) {
|
|||
bool pke = isProcessingKeyEvent(e, &offset);
|
||||
bool prot = protectedCursor(m_cursor);
|
||||
|
||||
foreach (const QDocumentCursor &c, m_mirrors)
|
||||
for (const QDocumentCursor &c : m_mirrors)
|
||||
prot |= protectedCursor(c);
|
||||
|
||||
if (!pke || prot) {
|
||||
|
@ -2558,7 +2571,7 @@ void QEditor::keyPressEvent(QKeyEvent *e) {
|
|||
break;
|
||||
}
|
||||
|
||||
foreach (QEditorInputBindingInterface *b, m_bindings)
|
||||
for (QEditorInputBindingInterface *b : m_bindings)
|
||||
b->postKeyPressEvent(e, this);
|
||||
}
|
||||
|
||||
|
@ -2566,7 +2579,7 @@ void QEditor::keyPressEvent(QKeyEvent *e) {
|
|||
\internal
|
||||
*/
|
||||
void QEditor::inputMethodEvent(QInputMethodEvent *e) {
|
||||
foreach (QEditorInputBindingInterface *b, m_bindings)
|
||||
for (QEditorInputBindingInterface *b : m_bindings)
|
||||
if (b->inputMethodEvent(e, this))
|
||||
return;
|
||||
|
||||
|
@ -2585,7 +2598,7 @@ void QEditor::inputMethodEvent(QInputMethodEvent *e) {
|
|||
|
||||
m_cursor.endEditBlock();
|
||||
|
||||
foreach (QEditorInputBindingInterface *b, m_bindings)
|
||||
for (QEditorInputBindingInterface *b : m_bindings)
|
||||
b->postInputMethodEvent(e, this);
|
||||
}
|
||||
|
||||
|
@ -2593,7 +2606,7 @@ void QEditor::inputMethodEvent(QInputMethodEvent *e) {
|
|||
\internal
|
||||
*/
|
||||
void QEditor::mouseMoveEvent(QMouseEvent *e) {
|
||||
foreach (QEditorInputBindingInterface *b, m_bindings)
|
||||
for (QEditorInputBindingInterface *b : m_bindings)
|
||||
if (b->mouseMoveEvent(e, this))
|
||||
return;
|
||||
|
||||
|
@ -2680,7 +2693,7 @@ void QEditor::mouseMoveEvent(QMouseEvent *e) {
|
|||
break;
|
||||
}
|
||||
|
||||
foreach (QEditorInputBindingInterface *b, m_bindings)
|
||||
for (QEditorInputBindingInterface *b : m_bindings)
|
||||
b->postMouseMoveEvent(e, this);
|
||||
}
|
||||
|
||||
|
@ -2688,7 +2701,7 @@ void QEditor::mouseMoveEvent(QMouseEvent *e) {
|
|||
\internal
|
||||
*/
|
||||
void QEditor::mousePressEvent(QMouseEvent *e) {
|
||||
foreach (QEditorInputBindingInterface *b, m_bindings)
|
||||
for (QEditorInputBindingInterface *b : m_bindings)
|
||||
if (b->mousePressEvent(e, this))
|
||||
return;
|
||||
|
||||
|
@ -2857,7 +2870,7 @@ void QEditor::mouseReleaseEvent(QMouseEvent *e) {
|
|||
|
||||
selectionChange();
|
||||
|
||||
foreach (QEditorInputBindingInterface *b, m_bindings)
|
||||
for (QEditorInputBindingInterface *b : m_bindings)
|
||||
b->postMouseReleaseEvent(e, this);
|
||||
}
|
||||
|
||||
|
@ -2865,7 +2878,7 @@ void QEditor::mouseReleaseEvent(QMouseEvent *e) {
|
|||
\internal
|
||||
*/
|
||||
void QEditor::mouseDoubleClickEvent(QMouseEvent *e) {
|
||||
foreach (QEditorInputBindingInterface *b, m_bindings)
|
||||
for (QEditorInputBindingInterface *b : m_bindings)
|
||||
if (b->mouseDoubleClickEvent(e, this))
|
||||
return;
|
||||
|
||||
|
@ -3073,12 +3086,8 @@ void QEditor::showEvent(QShowEvent *e) {
|
|||
*/
|
||||
void QEditor::wheelEvent(QWheelEvent *e) {
|
||||
if (e->modifiers() & Qt::ControlModifier) {
|
||||
const int delta = e->angleDelta().y();
|
||||
|
||||
if (delta > 0)
|
||||
zoom(-1);
|
||||
else if (delta < 0)
|
||||
zoom(1);
|
||||
auto dela = e->angleDelta().y() / 1200.0 / 2;
|
||||
setScaleRate(scaleRate() + dela);
|
||||
|
||||
// viewport()->update();
|
||||
|
||||
|
@ -3250,7 +3259,7 @@ void QEditor::setFileName(const QString &f) {
|
|||
if (fileName().size())
|
||||
watcher()->addWatch(fileName(), this);
|
||||
|
||||
setTitle(name().size() ? name() : "untitled");
|
||||
setTitle(name().size() ? name() : tr("untitled"));
|
||||
}
|
||||
|
||||
/*!
|
||||
|
@ -3865,25 +3874,6 @@ void QEditor::write(const QString &s) {
|
|||
selectionChange();
|
||||
}
|
||||
|
||||
/*!
|
||||
\brief Zoom
|
||||
\param n relative zoom factor
|
||||
|
||||
Zooming is achieved by changing the point size of the font as follow :
|
||||
|
||||
fontPointSize += \a n
|
||||
*/
|
||||
void QEditor::zoom(int n) {
|
||||
if (!m_doc)
|
||||
return;
|
||||
|
||||
QFont f = m_doc->font();
|
||||
f.setPointSize(qMax(1, f.pointSize() + n));
|
||||
m_doc->setFont(f);
|
||||
emit zoomed();
|
||||
update();
|
||||
}
|
||||
|
||||
/*!
|
||||
\brief Obtain the value of panel margins
|
||||
\param l left margin
|
||||
|
|
|
@ -241,8 +241,8 @@ public slots:
|
|||
|
||||
void setLineWrapping(bool on);
|
||||
|
||||
virtual void save();
|
||||
void save(const QString &filename);
|
||||
virtual bool save();
|
||||
bool save(const QString &filename);
|
||||
|
||||
virtual void print();
|
||||
|
||||
|
@ -255,7 +255,7 @@ public slots:
|
|||
void removeAction(QAction *a, const QString &menu,
|
||||
const QString &toolbar = QString());
|
||||
|
||||
void load(const QString &file);
|
||||
bool load(const QString &file);
|
||||
void setText(const QString &s);
|
||||
|
||||
void setCodec(const QString &name);
|
||||
|
@ -272,7 +272,9 @@ public slots:
|
|||
|
||||
void setCompletionEngine(QCodeCompletionEngine *e);
|
||||
|
||||
void zoom(int n);
|
||||
void setScaleRate(qreal rate);
|
||||
|
||||
qreal scaleRate() const;
|
||||
|
||||
void setPanelMargins(int l, int t, int r, int b);
|
||||
void getPanelMargins(int *l, int *t, int *r, int *b) const;
|
||||
|
@ -454,6 +456,9 @@ protected:
|
|||
QPoint m_clickPoint, m_dragPoint;
|
||||
QBasicTimer m_blink, m_scroll, m_click, m_drag;
|
||||
|
||||
QFont _docfont;
|
||||
qreal _scaleRate = 1.0;
|
||||
|
||||
static QReliableFileWatch *watcher();
|
||||
|
||||
static int m_defaultFlags;
|
||||
|
|
|
@ -72,13 +72,16 @@ QLineMarksInfoCenter::~QLineMarksInfoCenter() {}
|
|||
/*!
|
||||
\return the list of line marks set on a given file
|
||||
*/
|
||||
QLineMarkList QLineMarksInfoCenter::marks(const QString &file) {
|
||||
QLineMarkList QLineMarksInfoCenter::marks(const QString &file, int filterID) {
|
||||
QLineMarkList l;
|
||||
bool check = !file.isEmpty();
|
||||
|
||||
foreach (QLineMarkHandle m, m_lineMarks) {
|
||||
if (!check || (m.file == file))
|
||||
l << QLineMark(file, m.line->line() + 1, m.mark);
|
||||
for (auto &m : m_lineMarks) {
|
||||
if (!check || (m.file == file)) {
|
||||
if (filterID < 0 || (filterID >= 0 && m.mark == filterID)) {
|
||||
l << QLineMark(file, m.line->line() + 1, m.mark);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return l;
|
||||
|
@ -88,14 +91,16 @@ QLineMarkList QLineMarksInfoCenter::marks(const QString &file) {
|
|||
\brief Remove all line marks on all files
|
||||
*/
|
||||
void QLineMarksInfoCenter::clear() {
|
||||
foreach (QLineMarkHandle m, m_lineMarks) { removeLineMark(m); }
|
||||
for (auto &m : m_lineMarks) {
|
||||
removeLineMark(m);
|
||||
}
|
||||
}
|
||||
|
||||
/*!
|
||||
\brief Remove all line marks on a given file
|
||||
*/
|
||||
void QLineMarksInfoCenter::removeMarks(const QString &file) {
|
||||
foreach (QLineMarkHandle m, m_lineMarks)
|
||||
for (auto &m : m_lineMarks)
|
||||
if (m.file == file)
|
||||
removeLineMark(m);
|
||||
}
|
||||
|
@ -140,7 +145,7 @@ void QLineMarksInfoCenter::toggleLineMark(const QLineMark &mark) {
|
|||
if (!l.isValid())
|
||||
return;
|
||||
|
||||
e->setCursor(QDocumentCursor(e->document(), mark.line - 1));
|
||||
// e->setCursor(QDocumentCursor(e->document(), mark.line - 1));
|
||||
l.toggleMark(mark.mark);
|
||||
}
|
||||
|
||||
|
@ -481,15 +486,9 @@ QString QLineMarksInfoCenter::priority(const QStringList &marks) {
|
|||
*/
|
||||
QList<QStringList> QLineMarksInfoCenter::marksLayout(const QString &context) {
|
||||
QList<QStringList> l;
|
||||
|
||||
foreach (QString id, availableMarkTypes(context)) { l << QStringList(id); }
|
||||
|
||||
/*
|
||||
foreach ( QLineMarkType t, availableMarks(context) )
|
||||
{
|
||||
|
||||
for (auto &id : availableMarkTypes(context)) {
|
||||
l << QStringList(id);
|
||||
}
|
||||
*/
|
||||
|
||||
return l;
|
||||
}
|
||||
|
|
|
@ -124,7 +124,7 @@ public:
|
|||
static QLineMarksInfoCenter *instance();
|
||||
static void destroy();
|
||||
|
||||
QLineMarkList marks(const QString &file = QString());
|
||||
QLineMarkList marks(const QString &file = QString(), int filterID = -1);
|
||||
|
||||
QString markTypeId(int id);
|
||||
int markTypeId(const QString &id);
|
||||
|
|
|
@ -1,147 +0,0 @@
|
|||
<ui version="4.0" >
|
||||
<class>GotoDialog</class>
|
||||
<widget class="QDialog" name="GotoDialog" >
|
||||
<property name="geometry" >
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>210</width>
|
||||
<height>103</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="sizePolicy" >
|
||||
<sizepolicy vsizetype="Fixed" hsizetype="Fixed" >
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="windowTitle" >
|
||||
<string>Goto line ...</string>
|
||||
</property>
|
||||
<layout class="QGridLayout" >
|
||||
<item row="0" column="0" colspan="2" >
|
||||
<widget class="QLabel" name="label" >
|
||||
<property name="sizePolicy" >
|
||||
<sizepolicy vsizetype="Fixed" hsizetype="Fixed" >
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text" >
|
||||
<string>Select the line you want to go to :</string>
|
||||
</property>
|
||||
<property name="buddy" >
|
||||
<cstring>spinLine</cstring>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0" >
|
||||
<widget class="QSlider" name="slideLine" >
|
||||
<property name="minimum" >
|
||||
<number>1</number>
|
||||
</property>
|
||||
<property name="orientation" >
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1" >
|
||||
<widget class="QSpinBox" name="spinLine" >
|
||||
<property name="sizePolicy" >
|
||||
<sizepolicy vsizetype="Fixed" hsizetype="Minimum" >
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="prefix" >
|
||||
<string>line </string>
|
||||
</property>
|
||||
<property name="minimum" >
|
||||
<number>1</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="0" colspan="2" >
|
||||
<widget class="QDialogButtonBox" name="buttonBox" >
|
||||
<property name="standardButtons" >
|
||||
<set>QDialogButtonBox::Cancel|QDialogButtonBox::NoButton|QDialogButtonBox::Ok</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<tabstops>
|
||||
<tabstop>spinLine</tabstop>
|
||||
<tabstop>slideLine</tabstop>
|
||||
<tabstop>buttonBox</tabstop>
|
||||
</tabstops>
|
||||
<resources>
|
||||
<include location="../../../../src/lib/images/Edyuk.qrc" />
|
||||
</resources>
|
||||
<connections>
|
||||
<connection>
|
||||
<sender>buttonBox</sender>
|
||||
<signal>accepted()</signal>
|
||||
<receiver>GotoDialog</receiver>
|
||||
<slot>accept()</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel" >
|
||||
<x>67</x>
|
||||
<y>165</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel" >
|
||||
<x>205</x>
|
||||
<y>64</y>
|
||||
</hint>
|
||||
</hints>
|
||||
</connection>
|
||||
<connection>
|
||||
<sender>buttonBox</sender>
|
||||
<signal>rejected()</signal>
|
||||
<receiver>GotoDialog</receiver>
|
||||
<slot>reject()</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel" >
|
||||
<x>44</x>
|
||||
<y>164</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel" >
|
||||
<x>30</x>
|
||||
<y>67</y>
|
||||
</hint>
|
||||
</hints>
|
||||
</connection>
|
||||
<connection>
|
||||
<sender>slideLine</sender>
|
||||
<signal>sliderMoved(int)</signal>
|
||||
<receiver>spinLine</receiver>
|
||||
<slot>setValue(int)</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel" >
|
||||
<x>35</x>
|
||||
<y>99</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel" >
|
||||
<x>299</x>
|
||||
<y>100</y>
|
||||
</hint>
|
||||
</hints>
|
||||
</connection>
|
||||
<connection>
|
||||
<sender>spinLine</sender>
|
||||
<signal>valueChanged(int)</signal>
|
||||
<receiver>slideLine</receiver>
|
||||
<slot>setValue(int)</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel" >
|
||||
<x>299</x>
|
||||
<y>112</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel" >
|
||||
<x>82</x>
|
||||
<y>99</y>
|
||||
</hint>
|
||||
</hints>
|
||||
</connection>
|
||||
</connections>
|
||||
</ui>
|
|
@ -1,558 +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 "qeditconfig.h"
|
||||
|
||||
/*!
|
||||
\file qeditconfig.cpp
|
||||
\brief Implementation of the QEditConfig class.
|
||||
|
||||
\see QEditConfig
|
||||
*/
|
||||
|
||||
#include "qdocument.h"
|
||||
#include "qdocument_p.h"
|
||||
#include "qeditor.h"
|
||||
|
||||
#include <QDebug>
|
||||
|
||||
/*!
|
||||
\ingroup dialogs
|
||||
@{
|
||||
|
||||
\class QEditConfig
|
||||
\brief A minimalistic, easy to embed, settings widget.
|
||||
|
||||
*/
|
||||
|
||||
QEditConfig::QEditConfig(QWidget *w) : QWidget(w), m_direct(false) {
|
||||
setupUi(this);
|
||||
|
||||
cbEncoding->clear();
|
||||
cbEncoding->addItems(QCE::getEncodings());
|
||||
|
||||
restore();
|
||||
}
|
||||
|
||||
/*!
|
||||
\brief run-time translation entry point
|
||||
*/
|
||||
void QEditConfig::retranslate() { retranslateUi(this); }
|
||||
|
||||
/*!
|
||||
\brief
|
||||
*/
|
||||
bool QEditConfig::hasUnsavedChanges() const {
|
||||
if (m_direct)
|
||||
return false;
|
||||
|
||||
QFont font = cbFont->currentFont();
|
||||
// font.setPointSize(spnFontSize->value());
|
||||
|
||||
const QFont &docFont = QDocument::font();
|
||||
|
||||
if (font.family() != docFont.family() ||
|
||||
spnFontSize->value() != docFont.pointSize()) {
|
||||
// qDebug("font!");
|
||||
return true;
|
||||
}
|
||||
|
||||
if (spnTabWidth->value() != QDocument::tabStop()) {
|
||||
// qDebug("tab stop!");
|
||||
return true;
|
||||
}
|
||||
|
||||
QDocument::LineEnding le = QDocument::defaultLineEnding();
|
||||
|
||||
if (chkDetectLE->isChecked()) {
|
||||
if (le != QDocument::Conservative) {
|
||||
// qDebug("conservative line endings! : %i", le);
|
||||
return true;
|
||||
}
|
||||
} else {
|
||||
if (le != QDocument::LineEnding(cbLineEndings->currentIndex() + 1)) {
|
||||
// qDebug("line endings!");
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
QDocument::WhiteSpaceMode ws = QDocument::ShowNone;
|
||||
|
||||
if (chkShowLeadingWhitespace->isChecked())
|
||||
ws |= QDocument::ShowLeading;
|
||||
|
||||
if (chkShowTrailingWhitespace->isChecked())
|
||||
ws |= QDocument::ShowTrailing;
|
||||
|
||||
if (chkShowTabsInText->isChecked())
|
||||
ws |= QDocument::ShowTabs;
|
||||
|
||||
if (ws != QDocument::showSpaces()) {
|
||||
// qDebug("spaces!");
|
||||
return true;
|
||||
}
|
||||
|
||||
auto c = QEditor::defaultCodecName();
|
||||
|
||||
if (cbEncoding->currentText() == "System") {
|
||||
if (c != "System") {
|
||||
// qDebug("system codec!");
|
||||
return true;
|
||||
}
|
||||
} else {
|
||||
if (c != cbEncoding->currentText().toLatin1()) {
|
||||
// qDebug("codec!");
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
int flags = QEditor::defaultFlags();
|
||||
|
||||
if (chkReplaceTabs->isChecked())
|
||||
flags |= QEditor::ReplaceTabs;
|
||||
else
|
||||
flags &= ~QEditor::ReplaceTabs;
|
||||
|
||||
if (chkAutoRemoveTrailingWhitespace->isChecked())
|
||||
flags |= QEditor::RemoveTrailing;
|
||||
else
|
||||
flags &= ~QEditor::RemoveTrailing;
|
||||
|
||||
if (chkPreserveTrailingIndent->isChecked())
|
||||
flags |= QEditor::PreserveTrailingIndent;
|
||||
else
|
||||
flags &= ~QEditor::PreserveTrailingIndent;
|
||||
|
||||
if (flags != QEditor::defaultFlags()) {
|
||||
// qDebug("flags!");
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/*!
|
||||
\return whether user changes are immediately applied
|
||||
*/
|
||||
bool QEditConfig::applyImmediately() const { return m_direct; }
|
||||
|
||||
/*!
|
||||
\brief Set whether user changes are immediately applied
|
||||
*/
|
||||
void QEditConfig::setApplyImmediately(bool y) { m_direct = y; }
|
||||
|
||||
/*!
|
||||
\brief Apply changes
|
||||
*/
|
||||
void QEditConfig::apply() {
|
||||
QFont font = cbFont->currentFont();
|
||||
font.setPointSize(spnFontSize->value());
|
||||
|
||||
QDocument::setFont(font);
|
||||
QDocument::setTabStop(spnTabWidth->value());
|
||||
|
||||
if (chkDetectLE->isChecked())
|
||||
QDocument::setDefaultLineEnding(QDocument::Conservative);
|
||||
else
|
||||
QDocument::setDefaultLineEnding(
|
||||
QDocument::LineEnding(cbLineEndings->currentIndex() + 1));
|
||||
|
||||
QDocument::WhiteSpaceMode ws = QDocument::ShowNone;
|
||||
|
||||
if (chkShowLeadingWhitespace->isChecked())
|
||||
ws |= QDocument::ShowLeading;
|
||||
|
||||
if (chkShowTrailingWhitespace->isChecked())
|
||||
ws |= QDocument::ShowTrailing;
|
||||
|
||||
if (chkShowTabsInText->isChecked())
|
||||
ws |= QDocument::ShowTabs;
|
||||
|
||||
QDocument::setShowSpaces(ws);
|
||||
|
||||
QEditor::setDefaultCodec(cbEncoding->currentText().toUtf8(),
|
||||
QEditor::UpdateAll);
|
||||
|
||||
int flags = QEditor::defaultFlags();
|
||||
|
||||
if (chkReplaceTabs->isChecked())
|
||||
flags |= QEditor::ReplaceTabs;
|
||||
else
|
||||
flags &= ~QEditor::ReplaceTabs;
|
||||
|
||||
if (chkAutoRemoveTrailingWhitespace->isChecked())
|
||||
flags |= QEditor::RemoveTrailing;
|
||||
else
|
||||
flags &= ~QEditor::RemoveTrailing;
|
||||
|
||||
if (chkPreserveTrailingIndent->isChecked())
|
||||
flags |= QEditor::PreserveTrailingIndent;
|
||||
else
|
||||
flags &= ~QEditor::PreserveTrailingIndent;
|
||||
|
||||
QEditor::setDefaultFlags(flags);
|
||||
}
|
||||
|
||||
/*!
|
||||
\brief Reset the subcontrols to reflect the current settings
|
||||
|
||||
The name can be a bit misleading at first, it has been chosen
|
||||
because it directly maps to the effect a "cancel" button would
|
||||
have on the widget
|
||||
*/
|
||||
void QEditConfig::cancel() {
|
||||
// reload the current config
|
||||
|
||||
bool oldDir = m_direct;
|
||||
|
||||
m_direct = false;
|
||||
|
||||
cbFont->setFont(QDocument::font());
|
||||
spnFontSize->setValue(QDocument::font().pointSize());
|
||||
|
||||
spnTabWidth->setValue(QDocument::tabStop());
|
||||
|
||||
QDocument::WhiteSpaceMode ws = QDocument::showSpaces();
|
||||
chkShowTabsInText->setChecked(ws & QDocument::ShowTabs);
|
||||
chkShowLeadingWhitespace->setChecked(ws & QDocument::ShowLeading);
|
||||
chkShowTrailingWhitespace->setChecked(ws & QDocument::ShowTrailing);
|
||||
|
||||
QDocument::LineEnding le = QDocument::defaultLineEnding();
|
||||
chkDetectLE->setChecked(le == QDocument::Conservative);
|
||||
cbLineEndings->setCurrentIndex(le ? le - 1 : 0);
|
||||
|
||||
int flags = QEditor::defaultFlags();
|
||||
chkReplaceTabs->setChecked(flags & QEditor::ReplaceTabs);
|
||||
chkAutoRemoveTrailingWhitespace->setChecked(flags &
|
||||
QEditor::RemoveTrailing);
|
||||
chkPreserveTrailingIndent->setChecked(flags &
|
||||
QEditor::PreserveTrailingIndent);
|
||||
|
||||
auto c = QEditor::defaultCodecName();
|
||||
cbEncoding->setCurrentIndex(qMax(cbEncoding->findText(c), 0));
|
||||
|
||||
m_direct = oldDir;
|
||||
}
|
||||
|
||||
/*!
|
||||
\brief Restore default values for all subcontrols
|
||||
|
||||
\note The widgets are changed but these changes are NOT applied.
|
||||
*/
|
||||
void QEditConfig::restore() {
|
||||
// restore default configuration
|
||||
|
||||
bool oldDir = m_direct;
|
||||
|
||||
m_direct = false;
|
||||
|
||||
QFont font("Monospace", 10);
|
||||
font.setStyleHint(QFont::Courier);
|
||||
|
||||
cbFont->setFont(font);
|
||||
spnFontSize->setValue(10);
|
||||
|
||||
spnTabWidth->setValue(4);
|
||||
|
||||
chkShowTabsInText->setChecked(true);
|
||||
chkShowLeadingWhitespace->setChecked(true);
|
||||
chkShowTrailingWhitespace->setChecked(true);
|
||||
|
||||
chkDetectLE->setChecked(true);
|
||||
cbLineEndings->setCurrentIndex(0);
|
||||
|
||||
chkReplaceTabs->setChecked(false);
|
||||
chkAutoRemoveTrailingWhitespace->setChecked(false);
|
||||
chkPreserveTrailingIndent->setChecked(true);
|
||||
|
||||
cbEncoding->setCurrentIndex(0);
|
||||
|
||||
m_direct = oldDir;
|
||||
}
|
||||
|
||||
/*!
|
||||
\brief Fills a settings map from the state of the subcontrols
|
||||
*/
|
||||
QMap<QString, QVariant> QEditConfig::dumpKeys() const {
|
||||
QMap<QString, QVariant> m;
|
||||
|
||||
QFont font = cbFont->currentFont();
|
||||
font.setPointSize(spnFontSize->value());
|
||||
|
||||
m.insert("font", font);
|
||||
m.insert("tab_width", spnTabWidth->value());
|
||||
|
||||
m.insert("show_leading_whitespace", chkShowLeadingWhitespace->isChecked());
|
||||
m.insert("show_trailing_whitespace",
|
||||
chkShowTrailingWhitespace->isChecked());
|
||||
m.insert("show_tabs_in_text", chkShowTabsInText->isChecked());
|
||||
|
||||
m.insert("replace_tabs", chkReplaceTabs->isChecked());
|
||||
m.insert("remove_trailing", chkAutoRemoveTrailingWhitespace->isChecked());
|
||||
m.insert("preserve_trailing_indent",
|
||||
chkPreserveTrailingIndent->isChecked());
|
||||
|
||||
m.insert("encoding", cbEncoding->currentText());
|
||||
|
||||
if (chkDetectLE->isChecked())
|
||||
m.insert("line_endings", (int)QDocument::Conservative);
|
||||
else
|
||||
m.insert("line_endings", cbLineEndings->currentIndex() + 1);
|
||||
|
||||
return m;
|
||||
}
|
||||
|
||||
/*!
|
||||
\brief Fills the widget subcontrols from a settings map
|
||||
|
||||
\param keys a key/value map that can be obtained from QSettings
|
||||
*/
|
||||
void QEditConfig::loadKeys(const QMap<QString, QVariant> &keys) {
|
||||
// qDebug("loading %i keys", keys.count());
|
||||
|
||||
// load
|
||||
QMap<QString, QVariant>::const_iterator it = keys.constBegin();
|
||||
|
||||
while (it != keys.constEnd()) {
|
||||
if (it.key() == "font") {
|
||||
QFont f = qvariant_cast<QFont>(*it);
|
||||
|
||||
cbFont->setCurrentFont(f);
|
||||
spnFontSize->setValue(f.pointSize());
|
||||
|
||||
if (m_direct)
|
||||
QDocument::setFont(f);
|
||||
|
||||
lblSampleText->setFont(f);
|
||||
|
||||
} else if (it.key() == "tab_width") {
|
||||
spnTabWidth->setValue(it->toInt());
|
||||
|
||||
if (m_direct)
|
||||
on_spnTabWidth_valueChanged(it->toInt());
|
||||
} else if (it.key() == "replace_tabs") {
|
||||
chkReplaceTabs->setChecked(it->toBool());
|
||||
if (m_direct)
|
||||
on_chkReplaceTabs_toggled(it->toBool());
|
||||
} else if (it.key() == "remove_trailing") {
|
||||
chkAutoRemoveTrailingWhitespace->setChecked(it->toBool());
|
||||
if (m_direct)
|
||||
on_chkAutoRemoveTrailingWhitespace_toggled(it->toBool());
|
||||
} else if (it.key() == "preserve_trailing_indent") {
|
||||
chkPreserveTrailingIndent->setChecked(it->toBool());
|
||||
if (m_direct)
|
||||
on_chkPreserveTrailingIndent_toggled(it->toBool());
|
||||
} else if (it.key() == "show_tabs_in_text") {
|
||||
chkShowTabsInText->setChecked(it->toBool());
|
||||
if (m_direct)
|
||||
on_chkShowTabsInText_toggled(it->toBool());
|
||||
} else if (it.key() == "show_leading_whitespace") {
|
||||
chkShowLeadingWhitespace->setChecked(it->toBool());
|
||||
if (m_direct)
|
||||
on_chkShowLeadingWhitespace_toggled(it->toBool());
|
||||
} else if (it.key() == "show_trailing_whitespace") {
|
||||
chkShowTrailingWhitespace->setChecked(it->toBool());
|
||||
if (m_direct)
|
||||
on_chkShowTrailingWhitespace_toggled(it->toBool());
|
||||
} else if (it.key() == "encoding") {
|
||||
cbEncoding->setCurrentIndex(cbEncoding->findText(it->toString()));
|
||||
if (m_direct)
|
||||
on_cbEncoding_currentIndexChanged(it->toString());
|
||||
} else if (it.key() == "line_endings") {
|
||||
int le = it->toInt();
|
||||
|
||||
if (le) {
|
||||
chkDetectLE->setChecked(false);
|
||||
cbLineEndings->setCurrentIndex(le - 1);
|
||||
} else {
|
||||
cbLineEndings->setCurrentIndex(0);
|
||||
chkDetectLE->setChecked(true);
|
||||
}
|
||||
} else {
|
||||
/*
|
||||
qWarning("QEditConfig::loadKeys() fed with unsupported settings key
|
||||
: \"%s\" ", qPrintable(it.key())
|
||||
);
|
||||
*/
|
||||
}
|
||||
|
||||
++it;
|
||||
}
|
||||
}
|
||||
|
||||
/*!
|
||||
\brief Slot used to apply font size settings
|
||||
*/
|
||||
void QEditConfig::on_spnFontSize_valueChanged(int size) {
|
||||
QFont font = cbFont->currentFont();
|
||||
font.setPointSize(size);
|
||||
|
||||
lblSampleText->setFont(font);
|
||||
|
||||
if (m_direct) {
|
||||
QDocument::setFont(font);
|
||||
emit keyChanged("font", font);
|
||||
}
|
||||
}
|
||||
|
||||
/*!
|
||||
\brief Slot used to apply font family settings
|
||||
*/
|
||||
void QEditConfig::on_cbFont_currentFontChanged(QFont font) {
|
||||
font.setPointSize(spnFontSize->value());
|
||||
lblSampleText->setFont(font);
|
||||
|
||||
if (m_direct) {
|
||||
QDocument::setFont(font);
|
||||
emit keyChanged("font", font);
|
||||
}
|
||||
}
|
||||
|
||||
/*!
|
||||
\brief Slot used to apply tab width settings
|
||||
*/
|
||||
void QEditConfig::on_spnTabWidth_valueChanged(int n) {
|
||||
if (m_direct) {
|
||||
QDocument::setTabStop(n);
|
||||
emit keyChanged("tab_width", n);
|
||||
}
|
||||
}
|
||||
|
||||
/*!
|
||||
\brief Slot used to apply tabs replacement settings
|
||||
*/
|
||||
void QEditConfig::on_chkReplaceTabs_toggled(bool y) {
|
||||
if (m_direct) {
|
||||
// FIXME
|
||||
foreach (QEditor *e, QEditor::m_editors) {
|
||||
e->setFlag(QEditor::ReplaceTabs, y);
|
||||
}
|
||||
emit keyChanged("replace_tabs", y);
|
||||
}
|
||||
}
|
||||
|
||||
/*!
|
||||
\brief Slot used to apply tabs display settings
|
||||
*/
|
||||
void QEditConfig::on_chkShowTabsInText_toggled(bool y) {
|
||||
if (m_direct) {
|
||||
if (y)
|
||||
QDocument::setShowSpaces(QDocument::showSpaces() |
|
||||
QDocument::ShowTabs);
|
||||
else
|
||||
QDocument::setShowSpaces(QDocument::showSpaces() &
|
||||
~QDocument::ShowTabs);
|
||||
|
||||
emit keyChanged("show_tabs_in_text", y);
|
||||
}
|
||||
}
|
||||
|
||||
/*!
|
||||
\brief Slot used to apply trailing whitespace display settings
|
||||
*/
|
||||
void QEditConfig::on_chkShowLeadingWhitespace_toggled(bool y) {
|
||||
if (m_direct) {
|
||||
if (y)
|
||||
QDocument::setShowSpaces(QDocument::showSpaces() |
|
||||
QDocument::ShowLeading);
|
||||
else
|
||||
QDocument::setShowSpaces(QDocument::showSpaces() &
|
||||
~QDocument::ShowLeading);
|
||||
|
||||
emit keyChanged("show_leading_whitespace", y);
|
||||
}
|
||||
}
|
||||
|
||||
/*!
|
||||
\brief Slot used to apply leading whitespace display settings
|
||||
*/
|
||||
void QEditConfig::on_chkShowTrailingWhitespace_toggled(bool y) {
|
||||
if (m_direct) {
|
||||
if (y)
|
||||
QDocument::setShowSpaces(QDocument::showSpaces() |
|
||||
QDocument::ShowTrailing);
|
||||
else
|
||||
QDocument::setShowSpaces(QDocument::showSpaces() &
|
||||
~QDocument::ShowTrailing);
|
||||
|
||||
emit keyChanged("show_trailing_whitespace", y);
|
||||
}
|
||||
}
|
||||
|
||||
/*!
|
||||
\brief Slot used to apply encodings settings
|
||||
*/
|
||||
void QEditConfig::on_cbEncoding_currentIndexChanged(const QString &name) {
|
||||
if (m_direct) {
|
||||
QEditor::setDefaultCodec(name.toLatin1(), QEditor::UpdateAll);
|
||||
emit keyChanged("encoding", name);
|
||||
}
|
||||
}
|
||||
|
||||
/*!
|
||||
\brief Slot used to apply line endings settings
|
||||
*/
|
||||
void QEditConfig::on_cbLineEndings_currentIndexChanged(int idx) {
|
||||
QDocument::LineEnding le = QDocument::LineEnding(idx + 1);
|
||||
|
||||
if (m_direct) {
|
||||
QDocument::setDefaultLineEnding(le);
|
||||
emit keyChanged("line_endings", (int)le);
|
||||
}
|
||||
}
|
||||
|
||||
/*!
|
||||
\brief Slot used to apply line endings auto detectionl settings
|
||||
*/
|
||||
void QEditConfig::on_chkDetectLE_toggled(bool y) {
|
||||
QDocument::LineEnding le = QDocument::Conservative;
|
||||
|
||||
if (!y) {
|
||||
le = QDocument::LineEnding(cbLineEndings->currentIndex() + 1);
|
||||
}
|
||||
|
||||
if (m_direct) {
|
||||
QDocument::setDefaultLineEnding(le);
|
||||
emit keyChanged("line_endings", (int)le);
|
||||
}
|
||||
}
|
||||
|
||||
/*!
|
||||
\brief Slot used to apply trailing space removal settings
|
||||
*/
|
||||
void QEditConfig::on_chkAutoRemoveTrailingWhitespace_toggled(bool y) {
|
||||
if (m_direct) {
|
||||
// FIXME
|
||||
foreach (QEditor *e, QEditor::m_editors) {
|
||||
e->setFlag(QEditor::RemoveTrailing, y);
|
||||
}
|
||||
emit keyChanged("remove_trailing", y);
|
||||
}
|
||||
}
|
||||
|
||||
/*!
|
||||
\brief Slot used to indent preservation settings
|
||||
*/
|
||||
void QEditConfig::on_chkPreserveTrailingIndent_toggled(bool y) {
|
||||
if (m_direct) {
|
||||
// FIXME
|
||||
foreach (QEditor *e, QEditor::m_editors) {
|
||||
e->setFlag(QEditor::PreserveTrailingIndent, y);
|
||||
}
|
||||
emit keyChanged("preserve_trailing_indent", y);
|
||||
}
|
||||
}
|
||||
|
||||
/*! @} */
|
|
@ -1,80 +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 _QEDIT_CONFIG_H_
|
||||
#define _QEDIT_CONFIG_H_
|
||||
|
||||
#include "../qce-config.h"
|
||||
|
||||
/*!
|
||||
\file qeditconfig.h
|
||||
\brief Definition of the QEditConfig widget
|
||||
|
||||
\see QEditConfig
|
||||
*/
|
||||
|
||||
#include "ui_editconfig.h"
|
||||
|
||||
#include <QWidget>
|
||||
|
||||
class QCE_EXPORT QEditConfig : public QWidget, private Ui::EditorConfig {
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
QEditConfig(QWidget *w = 0);
|
||||
|
||||
bool hasUnsavedChanges() const;
|
||||
|
||||
bool applyImmediately() const;
|
||||
|
||||
QMap<QString, QVariant> dumpKeys() const;
|
||||
|
||||
public slots:
|
||||
void retranslate();
|
||||
|
||||
void apply();
|
||||
void cancel();
|
||||
void restore();
|
||||
|
||||
void loadKeys(const QMap<QString, QVariant> &keys);
|
||||
|
||||
void setApplyImmediately(bool y);
|
||||
|
||||
signals:
|
||||
void keyChanged(const QString &key, const QVariant &value);
|
||||
|
||||
private slots:
|
||||
void on_spnFontSize_valueChanged(int size);
|
||||
void on_cbFont_currentFontChanged(QFont font);
|
||||
|
||||
void on_spnTabWidth_valueChanged(int n);
|
||||
|
||||
void on_chkReplaceTabs_toggled(bool y);
|
||||
|
||||
void on_chkShowTabsInText_toggled(bool y);
|
||||
void on_chkShowLeadingWhitespace_toggled(bool y);
|
||||
void on_chkShowTrailingWhitespace_toggled(bool y);
|
||||
|
||||
void on_cbEncoding_currentIndexChanged(const QString &name);
|
||||
void on_cbLineEndings_currentIndexChanged(int idx);
|
||||
void on_chkDetectLE_toggled(bool y);
|
||||
void on_chkAutoRemoveTrailingWhitespace_toggled(bool y);
|
||||
void on_chkPreserveTrailingIndent_toggled(bool y);
|
||||
|
||||
private:
|
||||
bool m_direct;
|
||||
};
|
||||
|
||||
#endif // _QEDIT_CONFIG_H_
|
|
@ -1,74 +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 _QFORMAT_CONFIG_H_
|
||||
#define _QFORMAT_CONFIG_H_
|
||||
|
||||
#include "qce-config.h"
|
||||
|
||||
/*!
|
||||
\file qformatconfig.h
|
||||
\brief Definition of the QFormatConfig widget
|
||||
|
||||
\see QFormatConfig
|
||||
*/
|
||||
|
||||
#include <QWidget>
|
||||
|
||||
#include "ui_formatconfig.h"
|
||||
|
||||
class QFormatScheme;
|
||||
|
||||
class QCE_EXPORT QFormatConfig : public QWidget, private Ui::FormatConfig {
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
QFormatConfig(QWidget *w = 0);
|
||||
|
||||
bool isAutonomous() const;
|
||||
|
||||
bool hasUnsavedChanges() const;
|
||||
|
||||
QList<QFormatScheme *> schemes() const;
|
||||
|
||||
public slots:
|
||||
void retranslate();
|
||||
|
||||
void apply();
|
||||
void cancel();
|
||||
void restore();
|
||||
|
||||
void setAutonomous(bool y);
|
||||
|
||||
void addScheme(const QString &name, QFormatScheme *scheme);
|
||||
void removeScheme(QFormatScheme *scheme);
|
||||
|
||||
void setCurrentScheme(QFormatScheme *scheme);
|
||||
|
||||
protected:
|
||||
virtual void hideEvent(QHideEvent *e);
|
||||
|
||||
private slots:
|
||||
void on_m_selector_currentIndexChanged(int idx);
|
||||
|
||||
private:
|
||||
QList<int> modifiedFormats() const;
|
||||
|
||||
bool m_autonomous;
|
||||
QFormatScheme *m_currentScheme;
|
||||
QList<QFormatScheme *> m_schemes;
|
||||
};
|
||||
|
||||
#endif // _QFORMAT_CONFIG_H_
|
|
@ -1,69 +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 "qgotolinedialog.h"
|
||||
|
||||
/*!
|
||||
\file qgotolinedialog.cpp
|
||||
\brief Implementation of the QGotoDialog class.
|
||||
|
||||
\see QGotoDialog
|
||||
*/
|
||||
|
||||
#include "qeditor.h"
|
||||
|
||||
#include "qdocument.h"
|
||||
#include "qdocumentcursor.h"
|
||||
#include "qdocumentline.h"
|
||||
|
||||
/*!
|
||||
\ingroup dialogs
|
||||
@{
|
||||
|
||||
\class QGotoLineDialog
|
||||
\brief A Kate-like generic goto line dialog.
|
||||
|
||||
*/
|
||||
|
||||
QGotoLineDialog::QGotoLineDialog(QWidget *w) : QDialog(w) { setupUi(this); }
|
||||
|
||||
void QGotoLineDialog::exec(QEditor *e) {
|
||||
if (!e)
|
||||
return;
|
||||
|
||||
int ln = e->cursor().lineNumber() + 1, max = e->document()->lines();
|
||||
|
||||
spinLine->setValue(ln);
|
||||
spinLine->setMaximum(max);
|
||||
|
||||
slideLine->setValue(ln);
|
||||
slideLine->setMaximum(max);
|
||||
|
||||
spinLine->selectAll();
|
||||
|
||||
if (QDialog::exec() != QDialog::Accepted)
|
||||
return;
|
||||
|
||||
QDocumentCursor c(e->document(), spinLine->value() - 1);
|
||||
|
||||
if (c.isNull())
|
||||
return;
|
||||
|
||||
// qDebug("going to line : %i [%i]", c.lineNumber(), spinLine->value());
|
||||
|
||||
e->setCursor(c);
|
||||
}
|
||||
|
||||
/*! @} */
|
|
@ -1,61 +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 _QGOTO_LINE_PANEL_H_
|
||||
#define _QGOTO_LINE_PANEL_H_
|
||||
|
||||
#include "qpanel.h"
|
||||
|
||||
/*!
|
||||
\file qgotolinepanel.h
|
||||
\brief Definition of the QGotoLinePanel class.
|
||||
|
||||
\see QGotoLinePanel
|
||||
*/
|
||||
|
||||
#include "ui_gotoline.h"
|
||||
|
||||
class QCE_EXPORT QGotoLinePanel : public QPanel, private Ui::GotoLine {
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
Q_PANEL(QGotoLinePanel, "Goto Line Panel")
|
||||
|
||||
QGotoLinePanel(QWidget *p = nullptr);
|
||||
virtual ~QGotoLinePanel();
|
||||
|
||||
virtual QString type() const;
|
||||
|
||||
public slots:
|
||||
|
||||
protected:
|
||||
virtual bool forward(QMouseEvent *e);
|
||||
virtual void editorChange(QEditor *e);
|
||||
virtual void showEvent(QShowEvent *e);
|
||||
virtual void keyPressEvent(QKeyEvent *e);
|
||||
|
||||
private slots:
|
||||
void on_bClose_clicked();
|
||||
|
||||
void on_bGo_clicked();
|
||||
|
||||
void on_spLine_valueChanged(int v);
|
||||
void on_slLine_valueChanged(int v);
|
||||
|
||||
void lineCountChanged(int n);
|
||||
void cursorPositionChanged();
|
||||
};
|
||||
|
||||
#endif // _QGOTO_LINE_PANEL_H_
|
|
@ -156,23 +156,12 @@ void QLineMarkPanel::mouseReleaseEvent(QMouseEvent *e) {
|
|||
}
|
||||
|
||||
// QMessageBox::warning(0, 0, "clik.");
|
||||
|
||||
QDocumentLine l;
|
||||
QLanguageDefinition *d = editor()->languageDefinition();
|
||||
const int id =
|
||||
QLineMarksInfoCenter::instance()->markTypeId(d->defaultLineMark());
|
||||
|
||||
if (id < 0)
|
||||
return;
|
||||
|
||||
e->accept();
|
||||
|
||||
for (int i = 0; i < m_rects.count(); ++i) {
|
||||
if (m_rects.at(i).contains(e->pos())) {
|
||||
l = editor()->document()->line(m_lines.at(i));
|
||||
l.toggleMark(id);
|
||||
// m->toggleDefaultMark(l, -1);
|
||||
|
||||
auto l = editor()->document()->line(m_lines.at(i));
|
||||
emit onToggleMark(i);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -41,6 +41,9 @@ public:
|
|||
|
||||
virtual QString type() const;
|
||||
|
||||
signals:
|
||||
void onToggleMark(int lineIndex);
|
||||
|
||||
protected:
|
||||
virtual bool paint(QPainter *p, QEditor *e);
|
||||
virtual void mousePressEvent(QMouseEvent *e);
|
||||
|
|
|
@ -1,177 +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 "qstatuspanel.h"
|
||||
|
||||
/*!
|
||||
\file qstatuspanel.cpp
|
||||
\brief Implementation of the QStatusPanel class.
|
||||
|
||||
\see QStatusPanel
|
||||
*/
|
||||
|
||||
#include "qeditor.h"
|
||||
|
||||
#include "qdocument.h"
|
||||
#include "qdocumentcursor.h"
|
||||
#include "qdocumentline.h"
|
||||
|
||||
#include <QApplication>
|
||||
#include <QDateTime>
|
||||
#include <QFontMetrics>
|
||||
#include <QPaintEvent>
|
||||
#include <QPainter>
|
||||
#include <QTimer>
|
||||
|
||||
/*!
|
||||
\ingroup widgets
|
||||
@{
|
||||
*/
|
||||
|
||||
/*!
|
||||
\class QStatusPanel
|
||||
\brief A panel that display some status informations
|
||||
*/
|
||||
|
||||
QCE_AUTO_REGISTER(QStatusPanel)
|
||||
|
||||
/*!
|
||||
\brief Constructor
|
||||
*/
|
||||
QStatusPanel::QStatusPanel(QWidget *p) : QPanel(p) {
|
||||
setFixedHeight(fontMetrics().lineSpacing() + 4);
|
||||
}
|
||||
|
||||
/*!
|
||||
\brief Empty destructor
|
||||
*/
|
||||
QStatusPanel::~QStatusPanel() {}
|
||||
|
||||
/*!
|
||||
|
||||
*/
|
||||
QString QStatusPanel::type() const { return "Status"; }
|
||||
|
||||
/*!
|
||||
|
||||
*/
|
||||
void QStatusPanel::editorChange(QEditor *e) {
|
||||
if (editor()) {
|
||||
disconnect(editor(), SIGNAL(cursorPositionChanged()), this,
|
||||
SLOT(update()));
|
||||
}
|
||||
|
||||
if (e) {
|
||||
connect(e, SIGNAL(cursorPositionChanged()), this, SLOT(update()));
|
||||
}
|
||||
}
|
||||
|
||||
/*!
|
||||
|
||||
*/
|
||||
bool QStatusPanel::paint(QPainter *p, QEditor *e) {
|
||||
// qDebug("drawing status panel... [%i, %i, %i, %i]",
|
||||
// geometry().x(),
|
||||
// geometry().y(),
|
||||
// geometry().width(),
|
||||
// geometry().height());
|
||||
static QPixmap _warn(":/warning.png"), _mod(":/save.png");
|
||||
|
||||
QString s;
|
||||
int xpos = 10;
|
||||
QDocumentCursor c = e->cursor();
|
||||
const QFontMetrics fm(fontMetrics());
|
||||
|
||||
const int ls = fm.lineSpacing();
|
||||
const int ascent = fm.ascent() + 3;
|
||||
|
||||
s = tr("Line : %1 Visual column : %2 Text column : %3")
|
||||
.arg(c.lineNumber() + 1)
|
||||
.arg(c.visualColumnNumber())
|
||||
.arg(c.columnNumber());
|
||||
|
||||
p->drawText(xpos, ascent, s);
|
||||
xpos += fm.horizontalAdvance(s) + 10;
|
||||
|
||||
int sz = qMin(height(), _mod.height());
|
||||
// int lastMod = d->lastModified().secsTo(QDateTime::currentDateTime());
|
||||
// QString timeDiff = tr("(%1 min %2 s ago)").arg(lastMod / 60).arg(lastMod
|
||||
// % 60);
|
||||
|
||||
// xpos += 10;
|
||||
if (e->isContentModified()) {
|
||||
p->drawPixmap(xpos, (height() - sz) / 2, sz, sz, _mod);
|
||||
// xpos += sz;
|
||||
// xpos += 10;
|
||||
// p->drawText(xpos, ascent, timeDiff);
|
||||
}
|
||||
xpos += sz + 10;
|
||||
// xpos += fm.width(timeDiff);
|
||||
// xpos += 20;
|
||||
|
||||
s = editor()->flag(QEditor::Overwrite) ? tr("OVERWRITE") : tr("INSERT");
|
||||
p->drawText(xpos, ascent, s);
|
||||
xpos += fm.horizontalAdvance(s) + 10;
|
||||
|
||||
m_conflictSpot = 0;
|
||||
|
||||
if (editor()->isInConflict()) {
|
||||
s = tr("Conflict");
|
||||
int w = fm.horizontalAdvance(s) + 30;
|
||||
|
||||
if (xpos + w + _warn.width() < width()) {
|
||||
m_conflictSpot = width() - (w + _warn.width());
|
||||
p->drawText(width() - w + 15, ascent, s);
|
||||
p->drawPixmap(m_conflictSpot, (ls - _warn.height()) / 2 + 2, _warn);
|
||||
} else if (xpos + _warn.width() < width()) {
|
||||
m_conflictSpot = width() - _warn.width();
|
||||
p->drawPixmap(m_conflictSpot, (ls - _warn.height()) / 2 + 2, _warn);
|
||||
}
|
||||
}
|
||||
|
||||
setFixedHeight(ls + 4);
|
||||
|
||||
QTimer::singleShot(1000, this, SLOT(update()));
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/*!
|
||||
|
||||
*/
|
||||
void QStatusPanel::mousePressEvent(QMouseEvent *e) {
|
||||
if (!editor() || (e->button() != Qt::LeftButton) || !m_conflictSpot ||
|
||||
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
|
||||
e->position().x() < m_conflictSpot) {
|
||||
#else
|
||||
e->x() < m_conflictSpot) {
|
||||
#endif
|
||||
editor()->setFocus();
|
||||
return;
|
||||
}
|
||||
|
||||
editor()->save();
|
||||
}
|
||||
|
||||
/*!
|
||||
|
||||
*/
|
||||
void QStatusPanel::mouseReleaseEvent(QMouseEvent *e) {
|
||||
Q_UNUSED(e)
|
||||
|
||||
editor()->setFocus();
|
||||
}
|
||||
|
||||
/*! @} */
|
|
@ -1,17 +0,0 @@
|
|||
<!DOCTYPE QNFA>
|
||||
<QNFA language="BibTex" extensions="bib" defaultLineMark="">
|
||||
<context id="comment" format="comment" >
|
||||
<start parenthesis="comment:open" fold="1" >@comment$s*{</start>
|
||||
<stop parenthesis="comment:close" fold="1" >}</stop>
|
||||
</context>
|
||||
|
||||
<word id="keywords/single" format="keyword">@[a-zA-Z]+</word>
|
||||
|
||||
<sequence parenthesis="curly:open" indent="1" fold="1">{</sequence>
|
||||
<sequence parenthesis="curly:close" indent="1" fold="1">}</sequence>
|
||||
|
||||
<context id="string" format="text" >
|
||||
<start>"</start>
|
||||
<stop>"</stop>
|
||||
</context>
|
||||
</QNFA>
|
|
@ -1,75 +0,0 @@
|
|||
<!DOCTYPE QNFA>
|
||||
<QNFA language="ColdFusion" extensions="cfm;cfc;cfml;dbm" >
|
||||
<context id="cfcomment" format="cfcomment" >
|
||||
<start parenthesis="cfcomment:open" indent="1" fold="1"><!---</start>
|
||||
<stop parenthesis="cfcomment:close" indent="1" fold="1">---></stop>
|
||||
</context>
|
||||
|
||||
<context id="cftagscontent">
|
||||
|
||||
<context id="cfexpression" >
|
||||
<sequence parenthesis="round:open">(</sequence>
|
||||
<sequence parenthesis="round:close">)</sequence>
|
||||
<sequence parenthesis="square:open">\[</sequence>
|
||||
<sequence parenthesis="square:close">\]</sequence>
|
||||
<word id="cfdecimal" format="cfnumber">-?[0-9]+</word>
|
||||
|
||||
<context format="cfstring" >
|
||||
<start>"</start>
|
||||
<stop>"</stop>
|
||||
<embed target="ColdFusion:cfweakstring" />
|
||||
</context>
|
||||
|
||||
<embed target="ColdFusion:cfstrongstring" />
|
||||
<context format="cfstring" >
|
||||
<start>'</start>
|
||||
<stop>'</stop>
|
||||
<embed target="ColdFusion:cfstrongstring" />
|
||||
</context>
|
||||
</context>
|
||||
|
||||
<context id="cfweakstring" format="cfstring" >
|
||||
<context format="cfexpression" >
|
||||
<start>#</start>
|
||||
<stop>#</stop>
|
||||
<embed target="ColdFusion:cfexpression" />
|
||||
</context>
|
||||
</context>
|
||||
|
||||
<context id="cfstrongstring" format="cfstring" >
|
||||
<context format="cfexpression" >
|
||||
<start>#</start>
|
||||
<stop>#</stop>
|
||||
<embed target="ColdFusion:cfexpression" />
|
||||
</context>
|
||||
</context>
|
||||
|
||||
<embed target="ColdFusion:cfexpression" />
|
||||
</context>
|
||||
|
||||
<context id="cfquery" format="cftags">
|
||||
<start><cfquery</start>
|
||||
<stop></cfquery></stop>
|
||||
|
||||
<context format="normal" >
|
||||
<start format="cftags">></start>
|
||||
<stop exclusive="false" format="cftags"></cfquery></stop>
|
||||
|
||||
<context format="cfexpression" >
|
||||
<start>#</start>
|
||||
<stop>#</stop>
|
||||
<embed target="ColdFusion:cfexpression" />
|
||||
</context>
|
||||
</context>
|
||||
|
||||
<embed target="ColdFusion:cftagscontent" />
|
||||
</context>
|
||||
|
||||
<context id="cftags" format="cftags">
|
||||
<start parenthesis="cftags:open" indent="1" fold="1" ><cf</start>
|
||||
<start parenthesis="cftags:open" indent="1" fold="1" ></cf</start>
|
||||
<stop parenthesis="cftags:close" indent="1" fold="1" >></stop>
|
||||
|
||||
<embed target="ColdFusion:cftagscontent" />
|
||||
</context>
|
||||
</QNFA>
|
|
@ -1,142 +0,0 @@
|
|||
<!DOCTYPE QXF>
|
||||
<QXF version="1.0" >
|
||||
<format id="normal" >
|
||||
<bold>false</bold>
|
||||
<italic>false</italic>
|
||||
<overline>false</overline>
|
||||
<underline>false</underline>
|
||||
<strikeout>false</strikeout>
|
||||
<waveUnderline>false</waveUnderline>
|
||||
</format>
|
||||
<format id="preprocessor" >
|
||||
<bold>false</bold>
|
||||
<italic>false</italic>
|
||||
<overline>false</overline>
|
||||
<underline>false</underline>
|
||||
<strikeout>false</strikeout>
|
||||
<waveUnderline>false</waveUnderline>
|
||||
<foreground>#008000</foreground>
|
||||
</format>
|
||||
<format id="doxygen/keyword" >
|
||||
<bold>true</bold>
|
||||
<italic>false</italic>
|
||||
<overline>false</overline>
|
||||
<underline>false</underline>
|
||||
<strikeout>false</strikeout>
|
||||
<waveUnderline>false</waveUnderline>
|
||||
<foreground>#ff00ff</foreground>
|
||||
</format>
|
||||
<format id="doxygen" >
|
||||
<bold>false</bold>
|
||||
<italic>true</italic>
|
||||
<overline>false</overline>
|
||||
<underline>false</underline>
|
||||
<strikeout>false</strikeout>
|
||||
<waveUnderline>false</waveUnderline>
|
||||
<foreground>#a0a0a4</foreground>
|
||||
</format>
|
||||
<format id="comment" >
|
||||
<bold>false</bold>
|
||||
<italic>true</italic>
|
||||
<overline>false</overline>
|
||||
<underline>false</underline>
|
||||
<strikeout>false</strikeout>
|
||||
<waveUnderline>false</waveUnderline>
|
||||
<foreground>#000080</foreground>
|
||||
</format>
|
||||
<format id="keyword" >
|
||||
<bold>true</bold>
|
||||
<italic>false</italic>
|
||||
<overline>false</overline>
|
||||
<underline>false</underline>
|
||||
<strikeout>false</strikeout>
|
||||
<waveUnderline>false</waveUnderline>
|
||||
<foreground>#000000</foreground>
|
||||
</format>
|
||||
<format id="extra-keyword" >
|
||||
<bold>true</bold>
|
||||
<italic>false</italic>
|
||||
<overline>false</overline>
|
||||
<underline>false</underline>
|
||||
<strikeout>false</strikeout>
|
||||
<waveUnderline>false</waveUnderline>
|
||||
<foreground>#0095ff</foreground>
|
||||
</format>
|
||||
<format id="match" >
|
||||
<bold>true</bold>
|
||||
<italic>false</italic>
|
||||
<overline>false</overline>
|
||||
<underline>false</underline>
|
||||
<strikeout>false</strikeout>
|
||||
<waveUnderline>false</waveUnderline>
|
||||
<foreground>#ff0000</foreground>
|
||||
<background>#ffff00</background>
|
||||
</format>
|
||||
<format id="braceMatch" >
|
||||
<bold>true</bold>
|
||||
<italic>false</italic>
|
||||
<overline>false</overline>
|
||||
<underline>false</underline>
|
||||
<strikeout>false</strikeout>
|
||||
<waveUnderline>false</waveUnderline>
|
||||
<foreground>#ff0000</foreground>
|
||||
<background>#ffff00</background>
|
||||
</format>
|
||||
<format id="braceMismatch" >
|
||||
<bold>true</bold>
|
||||
<italic>false</italic>
|
||||
<overline>false</overline>
|
||||
<underline>false</underline>
|
||||
<strikeout>false</strikeout>
|
||||
<waveUnderline>false</waveUnderline>
|
||||
<foreground>#ffff00</foreground>
|
||||
<background>#ff0000</background>
|
||||
</format>
|
||||
<format id="search" >
|
||||
<bold>true</bold>
|
||||
<italic>true</italic>
|
||||
<overline>false</overline>
|
||||
<underline>false</underline>
|
||||
<strikeout>false</strikeout>
|
||||
<waveUnderline>false</waveUnderline>
|
||||
<foreground>#ff0000</foreground>
|
||||
<background>#ffff00</background>
|
||||
</format>
|
||||
<format id="danger" >
|
||||
<bold>true</bold>
|
||||
<italic>false</italic>
|
||||
<overline>false</overline>
|
||||
<underline>false</underline>
|
||||
<strikeout>false</strikeout>
|
||||
<waveUnderline>true</waveUnderline>
|
||||
<background>#d060d0</background>
|
||||
<linescolor>#ff0000</linescolor>
|
||||
</format>
|
||||
<format id="numbers" >
|
||||
<bold>false</bold>
|
||||
<italic>false</italic>
|
||||
<overline>false</overline>
|
||||
<underline>false</underline>
|
||||
<strikeout>false</strikeout>
|
||||
<waveUnderline>false</waveUnderline>
|
||||
<foreground>#800080</foreground>
|
||||
</format>
|
||||
<format id="text" >
|
||||
<bold>false</bold>
|
||||
<italic>false</italic>
|
||||
<overline>false</overline>
|
||||
<underline>false</underline>
|
||||
<strikeout>false</strikeout>
|
||||
<waveUnderline>false</waveUnderline>
|
||||
<foreground>#ff0000</foreground>
|
||||
</format>
|
||||
<format id="escapeseq" >
|
||||
<bold>false</bold>
|
||||
<italic>false</italic>
|
||||
<overline>false</overline>
|
||||
<underline>false</underline>
|
||||
<strikeout>false</strikeout>
|
||||
<waveUnderline>false</waveUnderline>
|
||||
<foreground>#ff1493</foreground>
|
||||
</format>
|
||||
</QXF>
|
|
@ -1,123 +0,0 @@
|
|||
<!DOCTYPE QNFA>
|
||||
<QNFA language="C#" extensions="cs" defaultLineMark="breakpoint">
|
||||
|
||||
<context id="comment/multi" format="comment">
|
||||
<start parenthesis="csharpcomment:open" indent="1" fold="1">/\*</start>
|
||||
<stop parenthesis="csharpcomment:close" indent="1" fold="1">\*/</stop>
|
||||
</context>
|
||||
|
||||
<context id="comment/single" format="comment" stayOnLine="true" >
|
||||
<start>//</start>
|
||||
<stop exclusive="false">\n</stop>
|
||||
</context>
|
||||
|
||||
<context id="preprocessor" format="preprocessor" transparency="true" stayOnLine="true" >
|
||||
<start>#</start>
|
||||
<stop exclusive="false">\n</stop>
|
||||
<escape>\\</escape>
|
||||
</context>
|
||||
|
||||
<context id="data/string" format="text" stayOnLine="true" >
|
||||
<start>@?"</start>
|
||||
<stop>"</stop>
|
||||
<escape>\\</escape>
|
||||
</context>
|
||||
|
||||
<sequence parenthesis="round:open">(</sequence>
|
||||
<sequence parenthesis="round:close">)</sequence>
|
||||
<sequence parenthesis="curly:open" indent="1" fold="1">{</sequence>
|
||||
<sequence parenthesis="curly:close" indent="1" fold="1">}</sequence>
|
||||
<sequence parenthesis="square:open">\[</sequence>
|
||||
<sequence parenthesis="square:close">\]</sequence>
|
||||
|
||||
<list id="keywords/visibility" format="keyword">
|
||||
<word>public</word>
|
||||
<word>protected</word>
|
||||
<word>private</word>
|
||||
</list>
|
||||
|
||||
<list id="keywords" format="keyword">
|
||||
<word>abstract</word>
|
||||
<word>as</word>
|
||||
<word>base</word>
|
||||
<word>bool</word>
|
||||
<word>break</word>
|
||||
<word>byte</word>
|
||||
<word>case</word>
|
||||
<word>catch</word>
|
||||
<word>char</word>
|
||||
<word>checked</word>
|
||||
<word>class</word>
|
||||
<word>const</word>
|
||||
<word>continue</word>
|
||||
<word>decimal</word>
|
||||
<word>default</word>
|
||||
<word>delegate</word>
|
||||
<word>do</word>
|
||||
<word>double</word>
|
||||
<word>else</word>
|
||||
<word>enum</word>
|
||||
<word>event</word>
|
||||
<word>explicit</word>
|
||||
<word>extern</word>
|
||||
<word>false</word>
|
||||
<word>finally</word>
|
||||
<word>fixed</word>
|
||||
<word>float</word>
|
||||
<word>for</word>
|
||||
<word>foreach</word>
|
||||
<word>goto</word>
|
||||
<word>if</word>
|
||||
<word>implicit</word>
|
||||
<word>in</word>
|
||||
<word>int</word>
|
||||
<word>interface</word>
|
||||
<word>internal</word>
|
||||
<word>is</word>
|
||||
<word>lock</word>
|
||||
<word>long</word>
|
||||
<word>namespace</word>
|
||||
<word>new</word>
|
||||
<word>null</word>
|
||||
<word>object</word>
|
||||
<word>operator</word>
|
||||
<word>out</word>
|
||||
<word>override</word>
|
||||
<word>params</word>
|
||||
<word>private</word>
|
||||
<word>protected</word>
|
||||
<word>public</word>
|
||||
<word>readonly</word>
|
||||
<word>ref</word>
|
||||
<word>return</word>
|
||||
<word>sbyte</word>
|
||||
<word>sealed</word>
|
||||
<word>short</word>
|
||||
<word>sizeof</word>
|
||||
<word>stackalloc</word>
|
||||
<word>static</word>
|
||||
<word>string</word>
|
||||
<word>struct</word>
|
||||
<word>switch</word>
|
||||
<word>this</word>
|
||||
<word>throw</word>
|
||||
<word>true</word>
|
||||
<word>try</word>
|
||||
<word>typeof</word>
|
||||
<word>uint</word>
|
||||
<word>ulong</word>
|
||||
<word>unchecked</word>
|
||||
<word>unsafe</word>
|
||||
<word>ushort</word>
|
||||
<word>using</word>
|
||||
<word>virtual</word>
|
||||
<word>void</word>
|
||||
<word>volatile</word>
|
||||
<word>while</word>
|
||||
</list>
|
||||
|
||||
<word id="data/float" format="floats">-?[0-9]*.[0-9]+f?</word>
|
||||
<word id="data/hexadecimal" format="numbers">0x[0-9a-fA-F]+</word>
|
||||
<word id="data/octal" format="numbers">0[0-7]+</word>
|
||||
<word id="data/decimal" format="numbers">-?[0-9]+</word>
|
||||
</QNFA>
|
|
@ -1,142 +0,0 @@
|
|||
<!DOCTYPE QXF>
|
||||
<QXF version="1.0" >
|
||||
<format id="normal" >
|
||||
<bold>false</bold>
|
||||
<italic>false</italic>
|
||||
<overline>false</overline>
|
||||
<underline>false</underline>
|
||||
<strikeout>false</strikeout>
|
||||
<waveUnderline>false</waveUnderline>
|
||||
</format>
|
||||
<format id="preprocessor" >
|
||||
<bold>false</bold>
|
||||
<italic>false</italic>
|
||||
<overline>false</overline>
|
||||
<underline>false</underline>
|
||||
<strikeout>false</strikeout>
|
||||
<waveUnderline>false</waveUnderline>
|
||||
<foreground>#008000</foreground>
|
||||
</format>
|
||||
<format id="doxygen/keyword" >
|
||||
<bold>true</bold>
|
||||
<italic>false</italic>
|
||||
<overline>false</overline>
|
||||
<underline>false</underline>
|
||||
<strikeout>false</strikeout>
|
||||
<waveUnderline>false</waveUnderline>
|
||||
<foreground>#ff00ff</foreground>
|
||||
</format>
|
||||
<format id="doxygen" >
|
||||
<bold>false</bold>
|
||||
<italic>true</italic>
|
||||
<overline>false</overline>
|
||||
<underline>false</underline>
|
||||
<strikeout>false</strikeout>
|
||||
<waveUnderline>false</waveUnderline>
|
||||
<foreground>#a0a0a4</foreground>
|
||||
</format>
|
||||
<format id="comment" >
|
||||
<bold>false</bold>
|
||||
<italic>true</italic>
|
||||
<overline>false</overline>
|
||||
<underline>false</underline>
|
||||
<strikeout>false</strikeout>
|
||||
<waveUnderline>false</waveUnderline>
|
||||
<foreground>#000080</foreground>
|
||||
</format>
|
||||
<format id="keyword" >
|
||||
<bold>true</bold>
|
||||
<italic>false</italic>
|
||||
<overline>false</overline>
|
||||
<underline>false</underline>
|
||||
<strikeout>false</strikeout>
|
||||
<waveUnderline>false</waveUnderline>
|
||||
<foreground>#000000</foreground>
|
||||
</format>
|
||||
<format id="extra-keyword" >
|
||||
<bold>true</bold>
|
||||
<italic>false</italic>
|
||||
<overline>false</overline>
|
||||
<underline>false</underline>
|
||||
<strikeout>false</strikeout>
|
||||
<waveUnderline>false</waveUnderline>
|
||||
<foreground>#0095ff</foreground>
|
||||
</format>
|
||||
<format id="match" >
|
||||
<bold>true</bold>
|
||||
<italic>false</italic>
|
||||
<overline>false</overline>
|
||||
<underline>false</underline>
|
||||
<strikeout>false</strikeout>
|
||||
<waveUnderline>false</waveUnderline>
|
||||
<foreground>#ff0000</foreground>
|
||||
<background>#ffff00</background>
|
||||
</format>
|
||||
<format id="braceMatch" >
|
||||
<bold>true</bold>
|
||||
<italic>false</italic>
|
||||
<overline>false</overline>
|
||||
<underline>false</underline>
|
||||
<strikeout>false</strikeout>
|
||||
<waveUnderline>false</waveUnderline>
|
||||
<foreground>#ff0000</foreground>
|
||||
<background>#ffff00</background>
|
||||
</format>
|
||||
<format id="braceMismatch" >
|
||||
<bold>true</bold>
|
||||
<italic>false</italic>
|
||||
<overline>false</overline>
|
||||
<underline>false</underline>
|
||||
<strikeout>false</strikeout>
|
||||
<waveUnderline>false</waveUnderline>
|
||||
<foreground>#ffff00</foreground>
|
||||
<background>#ff0000</background>
|
||||
</format>
|
||||
<format id="search" >
|
||||
<bold>true</bold>
|
||||
<italic>true</italic>
|
||||
<overline>false</overline>
|
||||
<underline>false</underline>
|
||||
<strikeout>false</strikeout>
|
||||
<waveUnderline>false</waveUnderline>
|
||||
<foreground>#ff0000</foreground>
|
||||
<background>#ffff00</background>
|
||||
</format>
|
||||
<format id="danger" >
|
||||
<bold>true</bold>
|
||||
<italic>false</italic>
|
||||
<overline>false</overline>
|
||||
<underline>false</underline>
|
||||
<strikeout>false</strikeout>
|
||||
<waveUnderline>true</waveUnderline>
|
||||
<background>#d060d0</background>
|
||||
<linescolor>#ff0000</linescolor>
|
||||
</format>
|
||||
<format id="numbers" >
|
||||
<bold>false</bold>
|
||||
<italic>false</italic>
|
||||
<overline>false</overline>
|
||||
<underline>false</underline>
|
||||
<strikeout>false</strikeout>
|
||||
<waveUnderline>false</waveUnderline>
|
||||
<foreground>#800080</foreground>
|
||||
</format>
|
||||
<format id="text" >
|
||||
<bold>false</bold>
|
||||
<italic>false</italic>
|
||||
<overline>false</overline>
|
||||
<underline>false</underline>
|
||||
<strikeout>false</strikeout>
|
||||
<waveUnderline>false</waveUnderline>
|
||||
<foreground>#ff0000</foreground>
|
||||
</format>
|
||||
<format id="escapeseq" >
|
||||
<bold>false</bold>
|
||||
<italic>false</italic>
|
||||
<overline>false</overline>
|
||||
<underline>false</underline>
|
||||
<strikeout>false</strikeout>
|
||||
<waveUnderline>false</waveUnderline>
|
||||
<foreground>#ff1493</foreground>
|
||||
</format>
|
||||
</QXF>
|
|
@ -1,362 +0,0 @@
|
|||
<!DOCTYPE QNFA>
|
||||
<QNFA language="CSS" extensions="css" >
|
||||
|
||||
<context id="comment/single/0" format="comment">
|
||||
<start>@</start>
|
||||
<stop exclusive="false">\n</stop>
|
||||
</context>
|
||||
|
||||
<context id="comment/multi/0" format="comment">
|
||||
<start parenthesis="CSScomment0:open" fold="1">/\*</start>
|
||||
<stop parenthesis="CSScomment0:close" fold="1">\*/</stop>
|
||||
</context>
|
||||
|
||||
<context id="data/url" format="text" >
|
||||
<start parenthesis="CSSurl:open" format="keyword" >url(</start>
|
||||
<stop parenthesis="CSSurl:close" format="keyword" >)</stop>
|
||||
</context>
|
||||
|
||||
<sequence parenthesis="round:open">(</sequence>
|
||||
<sequence parenthesis="round:close">)</sequence>
|
||||
<sequence parenthesis="curly:open" indent="1" fold="1">{</sequence>
|
||||
<sequence parenthesis="curly:close" indent="1" fold="1">}</sequence>
|
||||
<sequence parenthesis="square:open">\[</sequence>
|
||||
<sequence parenthesis="square:close">\]</sequence>
|
||||
|
||||
<list id="keywords/1" format="keyword">
|
||||
<word>aqua</word>
|
||||
<word>azimuth</word>
|
||||
<word>background-attachment</word>
|
||||
<word>background-color</word>
|
||||
<word>background-image</word>
|
||||
<word>background-position</word>
|
||||
<word>background-repeat</word>
|
||||
<word>background</word>
|
||||
<word>black</word>
|
||||
<word>blue</word>
|
||||
<word>border-bottom-color</word>
|
||||
<word>border-bottom-style</word>
|
||||
<word>border-bottom-width</word>
|
||||
<word>border-left-color</word>
|
||||
<word>border-left-style</word>
|
||||
<word>border-left-width</word>
|
||||
<word>border-right</word>
|
||||
<word>border-right-color</word>
|
||||
<word>border-right-style</word>
|
||||
<word>border-right-width</word>
|
||||
<word>border-top-color</word>
|
||||
<word>border-top-style</word>
|
||||
<word>border-top-width</word>
|
||||
<word>border-bottom</word>
|
||||
<word>border-collapse</word>
|
||||
<word>border-left</word>
|
||||
<word>border-width</word>
|
||||
<word>border-color</word>
|
||||
<word>border-spacing</word>
|
||||
<word>border-style</word>
|
||||
<word>border-top</word>
|
||||
<word>border</word>
|
||||
<word>caption-side</word>
|
||||
<word>clear</word>
|
||||
<word>clip</word>
|
||||
<word>color</word>
|
||||
<word>content</word>
|
||||
<word>counter-increment</word>
|
||||
<word>counter-reset</word>
|
||||
<word>cue-after</word>
|
||||
<word>cue-before</word>
|
||||
<word>cue</word>
|
||||
<word>cursor</word>
|
||||
<word>direction</word>
|
||||
<word>display</word>
|
||||
<word>elevation</word>
|
||||
<word>empty-cells</word>
|
||||
<word>float</word>
|
||||
<word>font-family</word>
|
||||
<word>font-size</word>
|
||||
<word>font-size-adjust</word>
|
||||
<word>font-stretch</word>
|
||||
<word>font-style</word>
|
||||
<word>font-variant</word>
|
||||
<word>font-weight</word>
|
||||
<word>font</word>
|
||||
<word>line-height</word>
|
||||
<word>letter-spacing</word>
|
||||
<word>list-style</word>
|
||||
<word>list-style-image</word>
|
||||
<word>list-style-position</word>
|
||||
<word>list-style-type</word>
|
||||
<word>margin-bottom</word>
|
||||
<word>margin-left</word>
|
||||
<word>margin-right</word>
|
||||
<word>margin-top</word>
|
||||
<word>margin</word>
|
||||
<word>marker-offset</word>
|
||||
<word>marks</word>
|
||||
<word>max-height</word>
|
||||
<word>max-width</word>
|
||||
<word>min-height</word>
|
||||
<word>min-width</word>
|
||||
<word>orphans</word>
|
||||
<word>outline</word>
|
||||
<word>outline-color</word>
|
||||
<word>outline-style</word>
|
||||
<word>outline-width</word>
|
||||
<word>overflow</word>
|
||||
<word>padding-bottom</word>
|
||||
<word>padding-left</word>
|
||||
<word>padding-right</word>
|
||||
<word>padding-top</word>
|
||||
<word>padding</word>
|
||||
<word>page</word>
|
||||
<word>page-break-after</word>
|
||||
<word>page-break-before</word>
|
||||
<word>page-break-inside</word>
|
||||
<word>pause-after</word>
|
||||
<word>pause-before</word>
|
||||
<word>pause</word>
|
||||
<word>pitch</word>
|
||||
<word>pitch-range</word>
|
||||
<word>play-during</word>
|
||||
<word>position</word>
|
||||
<word>quotes</word>
|
||||
<word>richness</word>
|
||||
<word>right</word>
|
||||
<word>size</word>
|
||||
<word>speak-header</word>
|
||||
<word>speak-numeral</word>
|
||||
<word>speak-punctuation</word>
|
||||
<word>speak</word>
|
||||
<word>speech-rate</word>
|
||||
<word>stress</word>
|
||||
<word>table-layout</word>
|
||||
<word>text-align</word>
|
||||
<word>text-decoration</word>
|
||||
<word>text-indent</word>
|
||||
<word>text-shadow</word>
|
||||
<word>text-transform</word>
|
||||
<word>top</word>
|
||||
<word>unicode-bidi</word>
|
||||
<word>vertical-align</word>
|
||||
<word>visibility</word>
|
||||
<word>voice-family</word>
|
||||
<word>volume</word>
|
||||
<word>white-space</word>
|
||||
<word>widows</word>
|
||||
<word>width</word>
|
||||
<word>word-spacing</word>
|
||||
<word>z-index</word>
|
||||
<word>bottom</word>
|
||||
<word>left</word>
|
||||
<word>height</word>
|
||||
</list>
|
||||
<list id="keywords/2" format="keyword">
|
||||
<word>above</word>
|
||||
<word>absolute</word>
|
||||
<word>always</word>
|
||||
<word>armenian</word>
|
||||
<word>aural</word>
|
||||
<word>auto</word>
|
||||
<word>avoid</word>
|
||||
<word>baseline</word>
|
||||
<word>behind</word>
|
||||
<word>below</word>
|
||||
<word>bidi-override</word>
|
||||
<word>blink</word>
|
||||
<word>block</word>
|
||||
<word>bold</word>
|
||||
<word>bolder</word>
|
||||
<word>both</word>
|
||||
<word>capitalize</word>
|
||||
<word>center-left</word>
|
||||
<word>center-right</word>
|
||||
<word>center</word>
|
||||
<word>circle</word>
|
||||
<word>cjk-ideographic</word>
|
||||
<word>close-quote</word>
|
||||
<word>collapse</word>
|
||||
<word>condensed</word>
|
||||
<word>continuous</word>
|
||||
<word>crop</word>
|
||||
<word>crosshair</word>
|
||||
<word>cross</word>
|
||||
<word>cursive</word>
|
||||
<word>dashed</word>
|
||||
<word>decimal-leading-zero</word>
|
||||
<word>decimal</word>
|
||||
<word>default</word>
|
||||
<word>digits</word>
|
||||
<word>disc</word>
|
||||
<word>dotted</word>
|
||||
<word>double</word>
|
||||
<word>e-resize</word>
|
||||
<word>embed</word>
|
||||
<word>extra-condensed</word>
|
||||
<word>extra-expanded</word>
|
||||
<word>expanded</word>
|
||||
<word>fantasy</word>
|
||||
<word>far-left</word>
|
||||
<word>far-right</word>
|
||||
<word>faster</word>
|
||||
<word>fast</word>
|
||||
<word>fixed</word>
|
||||
<word>fuchsia</word>
|
||||
<word>georgian</word>
|
||||
<word>gray</word>
|
||||
<word>green</word>
|
||||
<word>groove</word>
|
||||
<word>hebrew</word>
|
||||
<word>help</word>
|
||||
<word>hidden</word>
|
||||
<word>hide</word>
|
||||
<word>higher</word>
|
||||
<word>high</word>
|
||||
<word>hiragana-iroha</word>
|
||||
<word>hiragana</word>
|
||||
<word>icon</word>
|
||||
<word>inherit</word>
|
||||
<word>inline-table</word>
|
||||
<word>inline</word>
|
||||
<word>inset</word>
|
||||
<word>inside</word>
|
||||
<word>invert</word>
|
||||
<word>italic</word>
|
||||
<word>justify</word>
|
||||
<word>katakana-iroha</word>
|
||||
<word>katakana</word>
|
||||
<word>landscape</word>
|
||||
<word>larger</word>
|
||||
<word>large</word>
|
||||
<word>left-side</word>
|
||||
<word>leftwards</word>
|
||||
<word>level</word>
|
||||
<word>lighter</word>
|
||||
<word>lime</word>
|
||||
<word>line-through</word>
|
||||
<word>list-item</word>
|
||||
<word>loud</word>
|
||||
<word>lower-alpha</word>
|
||||
<word>lower-greek</word>
|
||||
<word>lower-roman</word>
|
||||
<word>lowercase</word>
|
||||
<word>ltr</word>
|
||||
<word>lower</word>
|
||||
<word>low</word>
|
||||
<word>maroon</word>
|
||||
<word>medium</word>
|
||||
<word>message-box</word>
|
||||
<word>middle</word>
|
||||
<word>mix</word>
|
||||
<word>monospace</word>
|
||||
<word>n-resize</word>
|
||||
<word>narrower</word>
|
||||
<word>navy</word>
|
||||
<word>ne-resize</word>
|
||||
<word>no-close-quote</word>
|
||||
<word>no-open-quote</word>
|
||||
<word>no-repeat</word>
|
||||
<word>none</word>
|
||||
<word>normal</word>
|
||||
<word>nowrap</word>
|
||||
<word>nw-resize</word>
|
||||
<word>oblique</word>
|
||||
<word>olive</word>
|
||||
<word>once</word>
|
||||
<word>open-quote</word>
|
||||
<word>outset</word>
|
||||
<word>outside</word>
|
||||
<word>overline</word>
|
||||
<word>pointer</word>
|
||||
<word>portrait</word>
|
||||
<word>purple</word>
|
||||
<word>px</word>
|
||||
<word>red</word>
|
||||
<word>relative</word>
|
||||
<word>repeat-x</word>
|
||||
<word>repeat-y</word>
|
||||
<word>repeat</word>
|
||||
<word>rgb</word>
|
||||
<word>ridge</word>
|
||||
<word>right-side</word>
|
||||
<word>rightwards</word>
|
||||
<word>s-resize</word>
|
||||
<word>sans-serif</word>
|
||||
<word>scroll</word>
|
||||
<word>se-resize</word>
|
||||
<word>semi-condensed</word>
|
||||
<word>semi-expanded</word>
|
||||
<word>separate</word>
|
||||
<word>serif</word>
|
||||
<word>show</word>
|
||||
<word>silent</word>
|
||||
<word>silver</word>
|
||||
<word>slow</word>
|
||||
<word>slower</word>
|
||||
<word>small-caps</word>
|
||||
<word>small-caption</word>
|
||||
<word>smaller</word>
|
||||
<word>soft</word>
|
||||
<word>solid</word>
|
||||
<word>spell-out</word>
|
||||
<word>square</word>
|
||||
<word>static</word>
|
||||
<word>status-bar</word>
|
||||
<word>super</word>
|
||||
<word>sw-resize</word>
|
||||
<word>table-caption</word>
|
||||
<word>table-cell</word>
|
||||
<word>table-column</word>
|
||||
<word>table-column-group</word>
|
||||
<word>table-footer-group</word>
|
||||
<word>table-header-group</word>
|
||||
<word>table-row</word>
|
||||
<word>table-row-group</word>
|
||||
<word>teal</word>
|
||||
<word>text</word>
|
||||
<word>text-bottom</word>
|
||||
<word>text-top</word>
|
||||
<word>thick</word>
|
||||
<word>thin</word>
|
||||
<word>transparent</word>
|
||||
<word>ultra-condensed</word>
|
||||
<word>ultra-expanded</word>
|
||||
<word>underline</word>
|
||||
<word>upper-alpha</word>
|
||||
<word>upper-latin</word>
|
||||
<word>upper-roman</word>
|
||||
<word>uppercase</word>
|
||||
<word>visible</word>
|
||||
<word>w-resize</word>
|
||||
<word>wait</word>
|
||||
<word>white</word>
|
||||
<word>wider</word>
|
||||
<word>x-fast</word>
|
||||
<word>x-high</word>
|
||||
<word>x-large</word>
|
||||
<word>x-loud</word>
|
||||
<word>x-low</word>
|
||||
<word>x-small</word>
|
||||
<word>x-soft</word>
|
||||
<word>xx-large</word>
|
||||
<word>xx-small</word>
|
||||
<word>yellow</word>
|
||||
<word>yes</word>
|
||||
</list>
|
||||
<word format="extra-keyword">#[a-zA-Z0-9-_]+</word>
|
||||
<word format="extra-keyword">\.[a-zA-Z0-9-_]+</word>
|
||||
<!--<word format="extra-keyword">:[a-zA-Z0-9-]+</word>-->
|
||||
<word format="numbers">$d+e[mx]</word>
|
||||
<word format="numbers">$d+p[tx]</word>
|
||||
<word format="numbers">$d+cm</word>
|
||||
<word format="numbers">$d+in</word>
|
||||
<word format="numbers">$d+%?</word>
|
||||
<word id="regex/3" format="number">$d+\.$d+%?</word>
|
||||
<word id="regex/3" format="number">$d+\.$d+in</word>
|
||||
<word id="regex/3" format="number">$d+\.$d+cm</word>
|
||||
<word id="regex/3" format="number">$d+\.$d+p[tx]</word>
|
||||
<word id="regex/3" format="number">$d+\.$d+e[mx]</word>
|
||||
<!--
|
||||
<word id="regex/3" format="number">$d+$s*(e[mx]|p[tx]|cm|in|%)</word>
|
||||
<word id="regex/3" format="number">$d+\.$d+$s*(e[mx]|p[tx]|cm|in|%)</word>
|
||||
-->
|
||||
</QNFA>
|
|
@ -1,142 +0,0 @@
|
|||
<!DOCTYPE QXF>
|
||||
<QXF version="1.0" >
|
||||
<format id="normal" >
|
||||
<bold>false</bold>
|
||||
<italic>false</italic>
|
||||
<overline>false</overline>
|
||||
<underline>false</underline>
|
||||
<strikeout>false</strikeout>
|
||||
<waveUnderline>false</waveUnderline>
|
||||
</format>
|
||||
<format id="preprocessor" >
|
||||
<bold>false</bold>
|
||||
<italic>false</italic>
|
||||
<overline>false</overline>
|
||||
<underline>false</underline>
|
||||
<strikeout>false</strikeout>
|
||||
<waveUnderline>false</waveUnderline>
|
||||
<foreground>#008000</foreground>
|
||||
</format>
|
||||
<format id="doxygen/keyword" >
|
||||
<bold>true</bold>
|
||||
<italic>false</italic>
|
||||
<overline>false</overline>
|
||||
<underline>false</underline>
|
||||
<strikeout>false</strikeout>
|
||||
<waveUnderline>false</waveUnderline>
|
||||
<foreground>#ff00ff</foreground>
|
||||
</format>
|
||||
<format id="doxygen" >
|
||||
<bold>false</bold>
|
||||
<italic>true</italic>
|
||||
<overline>false</overline>
|
||||
<underline>false</underline>
|
||||
<strikeout>false</strikeout>
|
||||
<waveUnderline>false</waveUnderline>
|
||||
<foreground>#a0a0a4</foreground>
|
||||
</format>
|
||||
<format id="comment" >
|
||||
<bold>false</bold>
|
||||
<italic>true</italic>
|
||||
<overline>false</overline>
|
||||
<underline>false</underline>
|
||||
<strikeout>false</strikeout>
|
||||
<waveUnderline>false</waveUnderline>
|
||||
<foreground>#000080</foreground>
|
||||
</format>
|
||||
<format id="keyword" >
|
||||
<bold>true</bold>
|
||||
<italic>false</italic>
|
||||
<overline>false</overline>
|
||||
<underline>false</underline>
|
||||
<strikeout>false</strikeout>
|
||||
<waveUnderline>false</waveUnderline>
|
||||
<foreground>#000000</foreground>
|
||||
</format>
|
||||
<format id="extra-keyword" >
|
||||
<bold>true</bold>
|
||||
<italic>false</italic>
|
||||
<overline>false</overline>
|
||||
<underline>false</underline>
|
||||
<strikeout>false</strikeout>
|
||||
<waveUnderline>false</waveUnderline>
|
||||
<foreground>#0095ff</foreground>
|
||||
</format>
|
||||
<format id="match" >
|
||||
<bold>true</bold>
|
||||
<italic>false</italic>
|
||||
<overline>false</overline>
|
||||
<underline>false</underline>
|
||||
<strikeout>false</strikeout>
|
||||
<waveUnderline>false</waveUnderline>
|
||||
<foreground>#ff0000</foreground>
|
||||
<background>#ffff00</background>
|
||||
</format>
|
||||
<format id="braceMatch" >
|
||||
<bold>true</bold>
|
||||
<italic>false</italic>
|
||||
<overline>false</overline>
|
||||
<underline>false</underline>
|
||||
<strikeout>false</strikeout>
|
||||
<waveUnderline>false</waveUnderline>
|
||||
<foreground>#ff0000</foreground>
|
||||
<background>#ffff00</background>
|
||||
</format>
|
||||
<format id="braceMismatch" >
|
||||
<bold>true</bold>
|
||||
<italic>false</italic>
|
||||
<overline>false</overline>
|
||||
<underline>false</underline>
|
||||
<strikeout>false</strikeout>
|
||||
<waveUnderline>false</waveUnderline>
|
||||
<foreground>#ffff00</foreground>
|
||||
<background>#ff0000</background>
|
||||
</format>
|
||||
<format id="search" >
|
||||
<bold>true</bold>
|
||||
<italic>true</italic>
|
||||
<overline>false</overline>
|
||||
<underline>false</underline>
|
||||
<strikeout>false</strikeout>
|
||||
<waveUnderline>false</waveUnderline>
|
||||
<foreground>#ff0000</foreground>
|
||||
<background>#ffff00</background>
|
||||
</format>
|
||||
<format id="danger" >
|
||||
<bold>true</bold>
|
||||
<italic>false</italic>
|
||||
<overline>false</overline>
|
||||
<underline>false</underline>
|
||||
<strikeout>false</strikeout>
|
||||
<waveUnderline>true</waveUnderline>
|
||||
<background>#d060d0</background>
|
||||
<linescolor>#ff0000</linescolor>
|
||||
</format>
|
||||
<format id="numbers" >
|
||||
<bold>false</bold>
|
||||
<italic>false</italic>
|
||||
<overline>false</overline>
|
||||
<underline>false</underline>
|
||||
<strikeout>false</strikeout>
|
||||
<waveUnderline>false</waveUnderline>
|
||||
<foreground>#800080</foreground>
|
||||
</format>
|
||||
<format id="text" >
|
||||
<bold>false</bold>
|
||||
<italic>false</italic>
|
||||
<overline>false</overline>
|
||||
<underline>false</underline>
|
||||
<strikeout>false</strikeout>
|
||||
<waveUnderline>false</waveUnderline>
|
||||
<foreground>#ff0000</foreground>
|
||||
</format>
|
||||
<format id="escapeseq" >
|
||||
<bold>false</bold>
|
||||
<italic>false</italic>
|
||||
<overline>false</overline>
|
||||
<underline>false</underline>
|
||||
<strikeout>false</strikeout>
|
||||
<waveUnderline>false</waveUnderline>
|
||||
<foreground>#ff1493</foreground>
|
||||
</format>
|
||||
</QXF>
|
|
@ -1,133 +0,0 @@
|
|||
<!DOCTYPE QNFA>
|
||||
<QNFA language="Doxygen" extensions="dox" >
|
||||
|
||||
<context id="multi" format="doxygen">
|
||||
<start parenthesis="doxycomment:open" indent="1" fold="1">/\*[*!][^*]?</start>
|
||||
<stop parenthesis="doxycomment:close" indent="1" fold="1">\*/</stop>
|
||||
|
||||
<embed target="XML" />
|
||||
|
||||
<list format="doxygen/keyword">
|
||||
<prefix>@</prefix>
|
||||
<prefix>\\</prefix>
|
||||
|
||||
<word>a</word>
|
||||
<word>dot</word>
|
||||
<word>addindex</word>
|
||||
<word>dotfile</word>
|
||||
<word>addtogroup</word>
|
||||
<word>e</word>
|
||||
<word>anchor</word>
|
||||
<word>else</word>
|
||||
<word>arg</word>
|
||||
<word>elseif</word>
|
||||
<word>attention</word>
|
||||
<word>em</word>
|
||||
<word>author</word>
|
||||
<word>endcode</word>
|
||||
<word>b</word>
|
||||
<word>endcond</word>
|
||||
<word>brief</word>
|
||||
<word>enddot</word>
|
||||
<word>bug</word>
|
||||
<word>endhtmlonly</word>
|
||||
<word>c</word>
|
||||
<word>endif</word>
|
||||
<word>callgraph</word>
|
||||
<word>endlatexonly</word>
|
||||
<word>category</word>
|
||||
<word>endlink</word>
|
||||
<word>class</word>
|
||||
<word>endmanonly</word>
|
||||
<word>code</word>
|
||||
<word>endverbatim</word>
|
||||
<word>cond</word>
|
||||
<word>endxmlonly</word>
|
||||
<word>copydoc</word>
|
||||
<word>enum</word>
|
||||
<word>date</word>
|
||||
<word>example</word>
|
||||
<word>def</word>
|
||||
<word>exception</word>
|
||||
<word>defgroup</word>
|
||||
<word>deprecated</word>
|
||||
<word>dir</word>
|
||||
<word>dontinclude</word>
|
||||
<word>file</word>
|
||||
<word>fn</word>
|
||||
<word>protocol</word>
|
||||
<word>hideinitializer</word>
|
||||
<word>htmlinclude</word>
|
||||
<word>htmlonly</word>
|
||||
<word>ref</word>
|
||||
<word>if</word>
|
||||
<word>relates</word>
|
||||
<word>ifnot</word>
|
||||
<word>relatesalso</word>
|
||||
<word>image</word>
|
||||
<word>remarks</word>
|
||||
<word>include</word>
|
||||
<word>return</word>
|
||||
<word>includelineno</word>
|
||||
<word>retval</word>
|
||||
<word>ingroup</word>
|
||||
<word>sa</word>
|
||||
<word>internal</word>
|
||||
<word>section</word>
|
||||
<word>invariant</word>
|
||||
<word>see</word>
|
||||
<word>interface</word>
|
||||
<word>showinitializer</word>
|
||||
<word>test</word>
|
||||
<word>namespace</word>
|
||||
<word>throw</word>
|
||||
<word>nosubgrouping</word>
|
||||
<word>todo</word>
|
||||
<word>note</word>
|
||||
<word>typedef</word>
|
||||
<word>overload</word>
|
||||
<word>union</word>
|
||||
<word>p</word>
|
||||
<word>until</word>
|
||||
<word>package</word>
|
||||
<word>var</word>
|
||||
<word>page</word>
|
||||
<word>verbatim</word>
|
||||
<word>par</word>
|
||||
<word>verbinclude</word>
|
||||
<word>paragraph</word>
|
||||
<word>version</word>
|
||||
<word>param</word>
|
||||
<word>warning</word>
|
||||
<word>post</word>
|
||||
<word>weakgroup</word>
|
||||
<word>pre</word>
|
||||
<word>xmlonly</word>
|
||||
<word>xrefitem</word>
|
||||
<word>property</word>
|
||||
<word>mainpage</word>
|
||||
|
||||
<word>&</word>
|
||||
<word>@</word>
|
||||
<word>\$</word>
|
||||
<word>\\</word>
|
||||
<word>%</word>
|
||||
<word>#</word>
|
||||
<word>~</word>
|
||||
<word><</word>
|
||||
<word>></word>
|
||||
<word>{</word>
|
||||
<word>}</word>
|
||||
<word>f\$</word>
|
||||
<word>f\[</word>
|
||||
<word>f\]</word>
|
||||
</list>
|
||||
</context>
|
||||
|
||||
<context id="single" format="doxygen">
|
||||
<start>//[/!]</start>
|
||||
<stop>\n</stop>
|
||||
<embed target="Doxygen:multi"/>
|
||||
</context>
|
||||
|
||||
</QNFA>
|
|
@ -1,151 +0,0 @@
|
|||
<!DOCTYPE QXF>
|
||||
<QXF version="1.0" >
|
||||
<format id="normal" >
|
||||
<bold>false</bold>
|
||||
<italic>false</italic>
|
||||
<overline>false</overline>
|
||||
<underline>false</underline>
|
||||
<strikeout>false</strikeout>
|
||||
<waveUnderline>false</waveUnderline>
|
||||
</format>
|
||||
<format id="preprocessor" >
|
||||
<bold>false</bold>
|
||||
<italic>false</italic>
|
||||
<overline>false</overline>
|
||||
<underline>false</underline>
|
||||
<strikeout>false</strikeout>
|
||||
<waveUnderline>false</waveUnderline>
|
||||
<foreground>#008000</foreground>
|
||||
</format>
|
||||
<format id="doxygen/keyword" >
|
||||
<bold>true</bold>
|
||||
<italic>false</italic>
|
||||
<overline>false</overline>
|
||||
<underline>false</underline>
|
||||
<strikeout>false</strikeout>
|
||||
<waveUnderline>false</waveUnderline>
|
||||
<foreground>#ff00ff</foreground>
|
||||
</format>
|
||||
<format id="doxygen" >
|
||||
<bold>false</bold>
|
||||
<italic>true</italic>
|
||||
<overline>false</overline>
|
||||
<underline>false</underline>
|
||||
<strikeout>false</strikeout>
|
||||
<waveUnderline>false</waveUnderline>
|
||||
<foreground>#a0a0a4</foreground>
|
||||
</format>
|
||||
<format id="comment" >
|
||||
<bold>false</bold>
|
||||
<italic>true</italic>
|
||||
<overline>false</overline>
|
||||
<underline>false</underline>
|
||||
<strikeout>false</strikeout>
|
||||
<waveUnderline>false</waveUnderline>
|
||||
<foreground>#000080</foreground>
|
||||
</format>
|
||||
<format id="keyword" >
|
||||
<bold>true</bold>
|
||||
<italic>false</italic>
|
||||
<overline>false</overline>
|
||||
<underline>false</underline>
|
||||
<strikeout>false</strikeout>
|
||||
<waveUnderline>false</waveUnderline>
|
||||
<foreground>#000000</foreground>
|
||||
</format>
|
||||
<format id="extra-keyword" >
|
||||
<bold>true</bold>
|
||||
<italic>false</italic>
|
||||
<overline>false</overline>
|
||||
<underline>false</underline>
|
||||
<strikeout>false</strikeout>
|
||||
<waveUnderline>false</waveUnderline>
|
||||
<foreground>#0095ff</foreground>
|
||||
</format>
|
||||
<format id="match" >
|
||||
<bold>true</bold>
|
||||
<italic>false</italic>
|
||||
<overline>false</overline>
|
||||
<underline>false</underline>
|
||||
<strikeout>false</strikeout>
|
||||
<waveUnderline>false</waveUnderline>
|
||||
<foreground>#ff0000</foreground>
|
||||
<background>#ffff00</background>
|
||||
</format>
|
||||
<format id="braceMatch" >
|
||||
<bold>true</bold>
|
||||
<italic>false</italic>
|
||||
<overline>false</overline>
|
||||
<underline>false</underline>
|
||||
<strikeout>false</strikeout>
|
||||
<waveUnderline>false</waveUnderline>
|
||||
<foreground>#ff0000</foreground>
|
||||
<background>#ffff00</background>
|
||||
</format>
|
||||
<format id="braceMismatch" >
|
||||
<bold>true</bold>
|
||||
<italic>false</italic>
|
||||
<overline>false</overline>
|
||||
<underline>false</underline>
|
||||
<strikeout>false</strikeout>
|
||||
<waveUnderline>false</waveUnderline>
|
||||
<foreground>#ffff00</foreground>
|
||||
<background>#ff0000</background>
|
||||
</format>
|
||||
<format id="search" >
|
||||
<bold>true</bold>
|
||||
<italic>true</italic>
|
||||
<overline>false</overline>
|
||||
<underline>false</underline>
|
||||
<strikeout>false</strikeout>
|
||||
<waveUnderline>false</waveUnderline>
|
||||
<foreground>#ff0000</foreground>
|
||||
<background>#ffff00</background>
|
||||
</format>
|
||||
<format id="danger" >
|
||||
<bold>true</bold>
|
||||
<italic>false</italic>
|
||||
<overline>false</overline>
|
||||
<underline>false</underline>
|
||||
<strikeout>false</strikeout>
|
||||
<waveUnderline>true</waveUnderline>
|
||||
<background>#d060d0</background>
|
||||
<linescolor>#ff0000</linescolor>
|
||||
</format>
|
||||
<format id="numbers" >
|
||||
<bold>false</bold>
|
||||
<italic>false</italic>
|
||||
<overline>false</overline>
|
||||
<underline>false</underline>
|
||||
<strikeout>false</strikeout>
|
||||
<waveUnderline>false</waveUnderline>
|
||||
<foreground>#800080</foreground>
|
||||
</format>
|
||||
<format id="text" >
|
||||
<bold>false</bold>
|
||||
<italic>false</italic>
|
||||
<overline>false</overline>
|
||||
<underline>false</underline>
|
||||
<strikeout>false</strikeout>
|
||||
<waveUnderline>false</waveUnderline>
|
||||
<foreground>#ff0000</foreground>
|
||||
</format>
|
||||
<format id="escapeseq" >
|
||||
<bold>false</bold>
|
||||
<italic>false</italic>
|
||||
<overline>false</overline>
|
||||
<underline>false</underline>
|
||||
<strikeout>false</strikeout>
|
||||
<waveUnderline>false</waveUnderline>
|
||||
<foreground>#ff1493</foreground>
|
||||
</format>
|
||||
<format id="phpvar" >
|
||||
<bold>false</bold>
|
||||
<italic>false</italic>
|
||||
<overline>false</overline>
|
||||
<underline>false</underline>
|
||||
<strikeout>false</strikeout>
|
||||
<waveUnderline>false</waveUnderline>
|
||||
<foreground>#008000</foreground>
|
||||
</format>
|
||||
</QXF>
|
|
@ -1,122 +0,0 @@
|
|||
<!DOCTYPE QNFA>
|
||||
<QNFA language="PHP" extensions="php;php3;php4;php5" defaultLineMark="" >
|
||||
<context id="code" >
|
||||
<embed target="Doxygen"/>
|
||||
|
||||
<start format="keyword" parenthesis="phpcode:open" indent="1" fold="1"><\?php</start>
|
||||
<stop format="keyword" parenthesis="phpcode:close" indent="1" fold="1">\?></stop>
|
||||
|
||||
<context id="comment/multi" format="comment" >
|
||||
<start parenthesis="phpcomment:open" indent="1" fold="1">/\*</start>
|
||||
<stop parenthesis="phpcomment:close" indent="1" fold="1">\*/</stop>
|
||||
</context>
|
||||
|
||||
<context id="comment/single" format="comment" stayOnLine="true" >
|
||||
<start>//</start>
|
||||
<start>#</start>
|
||||
<stop>\n</stop>
|
||||
</context>
|
||||
|
||||
<context id="data/weakstring" format="text" >
|
||||
<start>"</start>
|
||||
<stop>"</stop>
|
||||
<stop>\n</stop>
|
||||
<sequence id="variable" format="phpvar" >\$$w+</sequence>
|
||||
<sequence id="escape" format="escapeseq" >\\[nrtvf\\"\n]</sequence>
|
||||
</context>
|
||||
|
||||
<context id="data/strongstring" format="text" stayOnLine="true" >
|
||||
<start>'</start>
|
||||
<stop>'</stop>
|
||||
<escape>\\</escape>
|
||||
</context>
|
||||
|
||||
<list id="keywords" format="keyword" >
|
||||
<word>and</word>
|
||||
<word>or</word>
|
||||
<word>xor</word>
|
||||
<word>__FILE__</word>
|
||||
<word>exception</word>
|
||||
<word>__LINE__</word>
|
||||
<word>array</word>
|
||||
<word>as</word>
|
||||
<word>break</word>
|
||||
<word>case</word>
|
||||
<word>class</word>
|
||||
<word>const</word>
|
||||
<word>continue</word>
|
||||
<word>declare</word>
|
||||
<word>default</word>
|
||||
<word>die</word>
|
||||
<word>do</word>
|
||||
<word>echo</word>
|
||||
<word>else</word>
|
||||
<word>elseif</word>
|
||||
<word>empty</word>
|
||||
<word>enddeclare</word>
|
||||
<word>endfor</word>
|
||||
<word>endforeach</word>
|
||||
<word>endif</word>
|
||||
<word>endswitch</word>
|
||||
<word>endwhile</word>
|
||||
<word>eval</word>
|
||||
<word>exit</word>
|
||||
<word>extends</word>
|
||||
<word>for</word>
|
||||
<word>foreach</word>
|
||||
<word>function</word>
|
||||
<word>global</word>
|
||||
<word>if</word>
|
||||
<word>include</word>
|
||||
<word>include_once</word>
|
||||
<word>isset</word>
|
||||
<word>list</word>
|
||||
<word>new</word>
|
||||
<word>print</word>
|
||||
<word>require</word>
|
||||
<word>require_once</word>
|
||||
<word>return</word>
|
||||
<word>static</word>
|
||||
<word>switch</word>
|
||||
<word>unset</word>
|
||||
<word>use</word>
|
||||
<word>var</word>
|
||||
<word>while</word>
|
||||
<word>__FUNCTION__</word>
|
||||
<word>__CLASS__</word>
|
||||
<word>__METHOD__ </word>
|
||||
<word>final</word>
|
||||
<word>php_user_filter</word>
|
||||
<word>interface</word>
|
||||
<word>implements</word>
|
||||
<word>extends</word>
|
||||
<word>public</word>
|
||||
<word>private</word>
|
||||
<word>protected</word>
|
||||
<word>abstract</word>
|
||||
<word>clone</word>
|
||||
<word>try</word>
|
||||
<word>catch</word>
|
||||
<word>throw</word>
|
||||
<word>cfunction</word>
|
||||
<word>old_function</word>
|
||||
<word>true</word>
|
||||
<word>false</word>
|
||||
<word>null</word>
|
||||
</list>
|
||||
|
||||
<sequence id="variable" format="phpvar" >\$$w+</sequence>
|
||||
|
||||
<sequence parenthesis="round:open">(</sequence>
|
||||
<sequence parenthesis="round:close">)</sequence>
|
||||
<sequence parenthesis="curly:open" indent="1" fold="1">{</sequence>
|
||||
<sequence parenthesis="curly:close" indent="1" fold="1">}</sequence>
|
||||
<sequence parenthesis="square:open">\[</sequence>
|
||||
<sequence parenthesis="square:close">\]</sequence>
|
||||
|
||||
<word id="data/float" format="numbers">-?[0-9]*.[0-9]+f?</word>
|
||||
<word id="data/hexadecimal" format="numbers">0[xX][0-9a-fA-F]+</word>
|
||||
<word id="data/octal" format="numbers">0[0-7]+</word>
|
||||
<word id="data/decimal" format="numbers">-?[0-9]+</word>
|
||||
</context>
|
||||
</QNFA>
|
|
@ -1,151 +0,0 @@
|
|||
<!DOCTYPE QXF>
|
||||
<QXF version="1.0" >
|
||||
<format id="normal" >
|
||||
<bold>false</bold>
|
||||
<italic>false</italic>
|
||||
<overline>false</overline>
|
||||
<underline>false</underline>
|
||||
<strikeout>false</strikeout>
|
||||
<waveUnderline>false</waveUnderline>
|
||||
</format>
|
||||
<format id="preprocessor" >
|
||||
<bold>false</bold>
|
||||
<italic>false</italic>
|
||||
<overline>false</overline>
|
||||
<underline>false</underline>
|
||||
<strikeout>false</strikeout>
|
||||
<waveUnderline>false</waveUnderline>
|
||||
<foreground>#008000</foreground>
|
||||
</format>
|
||||
<format id="doxygen/keyword" >
|
||||
<bold>true</bold>
|
||||
<italic>false</italic>
|
||||
<overline>false</overline>
|
||||
<underline>false</underline>
|
||||
<strikeout>false</strikeout>
|
||||
<waveUnderline>false</waveUnderline>
|
||||
<foreground>#ff00ff</foreground>
|
||||
</format>
|
||||
<format id="doxygen" >
|
||||
<bold>false</bold>
|
||||
<italic>true</italic>
|
||||
<overline>false</overline>
|
||||
<underline>false</underline>
|
||||
<strikeout>false</strikeout>
|
||||
<waveUnderline>false</waveUnderline>
|
||||
<foreground>#a0a0a4</foreground>
|
||||
</format>
|
||||
<format id="comment" >
|
||||
<bold>false</bold>
|
||||
<italic>true</italic>
|
||||
<overline>false</overline>
|
||||
<underline>false</underline>
|
||||
<strikeout>false</strikeout>
|
||||
<waveUnderline>false</waveUnderline>
|
||||
<foreground>#000080</foreground>
|
||||
</format>
|
||||
<format id="keyword" >
|
||||
<bold>true</bold>
|
||||
<italic>false</italic>
|
||||
<overline>false</overline>
|
||||
<underline>false</underline>
|
||||
<strikeout>false</strikeout>
|
||||
<waveUnderline>false</waveUnderline>
|
||||
<foreground>#000000</foreground>
|
||||
</format>
|
||||
<format id="extra-keyword" >
|
||||
<bold>true</bold>
|
||||
<italic>false</italic>
|
||||
<overline>false</overline>
|
||||
<underline>false</underline>
|
||||
<strikeout>false</strikeout>
|
||||
<waveUnderline>false</waveUnderline>
|
||||
<foreground>#0095ff</foreground>
|
||||
</format>
|
||||
<format id="match" >
|
||||
<bold>true</bold>
|
||||
<italic>false</italic>
|
||||
<overline>false</overline>
|
||||
<underline>false</underline>
|
||||
<strikeout>false</strikeout>
|
||||
<waveUnderline>false</waveUnderline>
|
||||
<foreground>#ff0000</foreground>
|
||||
<background>#ffff00</background>
|
||||
</format>
|
||||
<format id="braceMatch" >
|
||||
<bold>true</bold>
|
||||
<italic>false</italic>
|
||||
<overline>false</overline>
|
||||
<underline>false</underline>
|
||||
<strikeout>false</strikeout>
|
||||
<waveUnderline>false</waveUnderline>
|
||||
<foreground>#ff0000</foreground>
|
||||
<background>#ffff00</background>
|
||||
</format>
|
||||
<format id="braceMismatch" >
|
||||
<bold>true</bold>
|
||||
<italic>false</italic>
|
||||
<overline>false</overline>
|
||||
<underline>false</underline>
|
||||
<strikeout>false</strikeout>
|
||||
<waveUnderline>false</waveUnderline>
|
||||
<foreground>#ffff00</foreground>
|
||||
<background>#ff0000</background>
|
||||
</format>
|
||||
<format id="search" >
|
||||
<bold>true</bold>
|
||||
<italic>true</italic>
|
||||
<overline>false</overline>
|
||||
<underline>false</underline>
|
||||
<strikeout>false</strikeout>
|
||||
<waveUnderline>false</waveUnderline>
|
||||
<foreground>#ff0000</foreground>
|
||||
<background>#ffff00</background>
|
||||
</format>
|
||||
<format id="danger" >
|
||||
<bold>true</bold>
|
||||
<italic>false</italic>
|
||||
<overline>false</overline>
|
||||
<underline>false</underline>
|
||||
<strikeout>false</strikeout>
|
||||
<waveUnderline>true</waveUnderline>
|
||||
<background>#d060d0</background>
|
||||
<linescolor>#ff0000</linescolor>
|
||||
</format>
|
||||
<format id="numbers" >
|
||||
<bold>false</bold>
|
||||
<italic>false</italic>
|
||||
<overline>false</overline>
|
||||
<underline>false</underline>
|
||||
<strikeout>false</strikeout>
|
||||
<waveUnderline>false</waveUnderline>
|
||||
<foreground>#800080</foreground>
|
||||
</format>
|
||||
<format id="text" >
|
||||
<bold>false</bold>
|
||||
<italic>false</italic>
|
||||
<overline>false</overline>
|
||||
<underline>false</underline>
|
||||
<strikeout>false</strikeout>
|
||||
<waveUnderline>false</waveUnderline>
|
||||
<foreground>#ff0000</foreground>
|
||||
</format>
|
||||
<format id="escapeseq" >
|
||||
<bold>false</bold>
|
||||
<italic>false</italic>
|
||||
<overline>false</overline>
|
||||
<underline>false</underline>
|
||||
<strikeout>false</strikeout>
|
||||
<waveUnderline>false</waveUnderline>
|
||||
<foreground>#ff1493</foreground>
|
||||
</format>
|
||||
<format id="phpvar" >
|
||||
<bold>false</bold>
|
||||
<italic>false</italic>
|
||||
<overline>false</overline>
|
||||
<underline>false</underline>
|
||||
<strikeout>false</strikeout>
|
||||
<waveUnderline>false</waveUnderline>
|
||||
<foreground>#008000</foreground>
|
||||
</format>
|
||||
</QXF>
|
|
@ -1,84 +0,0 @@
|
|||
<!DOCTYPE QNFA>
|
||||
<QNFA language="QMake projects" extensions="pro;pri;prf" defaultLineMark="">
|
||||
|
||||
<context id="comment/single" format="comment" stayOnLine="true" >
|
||||
<start>#</start>
|
||||
<stop exclusive="false">\n</stop>
|
||||
</context>
|
||||
|
||||
<context id="data/string" format="text" stayOnLine="true" >
|
||||
<start>"</start>
|
||||
<stop>"</stop>
|
||||
<stop exclusive="false">\n</stop>
|
||||
</context>
|
||||
|
||||
<context id="reference/qmake" >
|
||||
<start parenthesis="qmakeref:open" format="phpvar">\$\${</start>
|
||||
<stop parenthesis="qmakeref:close" format="phpvar">}</stop>
|
||||
</context>
|
||||
|
||||
<context id="reference/environment" >
|
||||
<start parenthesis="qenvref:open" format="phpvar">\$\$(</start>
|
||||
<stop parenthesis="qenvref:close" format="phpvar">)</stop>
|
||||
</context>
|
||||
|
||||
<context id="reference/properties" >
|
||||
<start parenthesis="qmakeprop:open" format="phpvar">\$\$\[</start>
|
||||
<stop parenthesis="qmakeprop:close" format="phpvar">\]</stop>
|
||||
</context>
|
||||
|
||||
<context id="reference/makefile" >
|
||||
<start parenthesis="makeref:open" format="phpvar">\$(</start>
|
||||
<stop parenthesis="makeref:open" format="phpvar">)</stop>
|
||||
</context>
|
||||
|
||||
<list id="keywords/functions" format="keyword">
|
||||
<prefix></prefix>
|
||||
<prefix>\$\$</prefix>
|
||||
<word>basename</word>
|
||||
<word>CONFIG</word>
|
||||
<word>contains</word>
|
||||
<word>count</word>
|
||||
<word>dirname</word>
|
||||
<word>else</word>
|
||||
<word>error</word>
|
||||
<word>eval</word>
|
||||
<word>exists</word>
|
||||
<word>find</word>
|
||||
<word>for</word>
|
||||
<word>include</word>
|
||||
<word>infile</word>
|
||||
<word>isEmpty</word>
|
||||
<word>load</word>
|
||||
<word>join</word>
|
||||
<word>member</word>
|
||||
<word>message</word>
|
||||
<word>prompt</word>
|
||||
<word>quote</word>
|
||||
<word>replace</word>
|
||||
<word>sprintf</word>
|
||||
<word>system</word>
|
||||
<word>unique</word>
|
||||
<word>warning</word>
|
||||
<suffix parenthesis="round:open" >(</suffix>
|
||||
</list>
|
||||
|
||||
<sequence parenthesis="round:open">(</sequence>
|
||||
<sequence parenthesis="round:close">)</sequence>
|
||||
<sequence parenthesis="curly:open" indent="1" fold="1">{</sequence>
|
||||
<sequence parenthesis="curly:close" indent="1" fold="1">}</sequence>
|
||||
<sequence parenthesis="square:open">\[</sequence>
|
||||
<sequence parenthesis="square:close">\]</sequence>
|
||||
|
||||
<context id="variable" transparency="true" stayOnLine="true" >
|
||||
<start format="keyword">$w+$s*[+-*~]?=</start>
|
||||
<stop exclusive="false">\n</stop>
|
||||
<escape>\\</escape>
|
||||
</context>
|
||||
|
||||
<list id="keywords/scopes" format="keyword">
|
||||
<word>win32</word>
|
||||
<word>unix</word>
|
||||
<word>macx</word>
|
||||
</list>
|
||||
</QNFA>
|
|
@ -1,142 +0,0 @@
|
|||
<!DOCTYPE QXF>
|
||||
<QXF version="1.0" >
|
||||
<format id="normal" >
|
||||
<bold>false</bold>
|
||||
<italic>false</italic>
|
||||
<overline>false</overline>
|
||||
<underline>false</underline>
|
||||
<strikeout>false</strikeout>
|
||||
<waveUnderline>false</waveUnderline>
|
||||
</format>
|
||||
<format id="preprocessor" >
|
||||
<bold>false</bold>
|
||||
<italic>false</italic>
|
||||
<overline>false</overline>
|
||||
<underline>false</underline>
|
||||
<strikeout>false</strikeout>
|
||||
<waveUnderline>false</waveUnderline>
|
||||
<foreground>#008000</foreground>
|
||||
</format>
|
||||
<format id="doxygen/keyword" >
|
||||
<bold>true</bold>
|
||||
<italic>false</italic>
|
||||
<overline>false</overline>
|
||||
<underline>false</underline>
|
||||
<strikeout>false</strikeout>
|
||||
<waveUnderline>false</waveUnderline>
|
||||
<foreground>#ff00ff</foreground>
|
||||
</format>
|
||||
<format id="doxygen" >
|
||||
<bold>false</bold>
|
||||
<italic>true</italic>
|
||||
<overline>false</overline>
|
||||
<underline>false</underline>
|
||||
<strikeout>false</strikeout>
|
||||
<waveUnderline>false</waveUnderline>
|
||||
<foreground>#a0a0a4</foreground>
|
||||
</format>
|
||||
<format id="comment" >
|
||||
<bold>false</bold>
|
||||
<italic>true</italic>
|
||||
<overline>false</overline>
|
||||
<underline>false</underline>
|
||||
<strikeout>false</strikeout>
|
||||
<waveUnderline>false</waveUnderline>
|
||||
<foreground>#000080</foreground>
|
||||
</format>
|
||||
<format id="keyword" >
|
||||
<bold>true</bold>
|
||||
<italic>false</italic>
|
||||
<overline>false</overline>
|
||||
<underline>false</underline>
|
||||
<strikeout>false</strikeout>
|
||||
<waveUnderline>false</waveUnderline>
|
||||
<foreground>#000000</foreground>
|
||||
</format>
|
||||
<format id="extra-keyword" >
|
||||
<bold>true</bold>
|
||||
<italic>false</italic>
|
||||
<overline>false</overline>
|
||||
<underline>false</underline>
|
||||
<strikeout>false</strikeout>
|
||||
<waveUnderline>false</waveUnderline>
|
||||
<foreground>#0095ff</foreground>
|
||||
</format>
|
||||
<format id="match" >
|
||||
<bold>true</bold>
|
||||
<italic>false</italic>
|
||||
<overline>false</overline>
|
||||
<underline>false</underline>
|
||||
<strikeout>false</strikeout>
|
||||
<waveUnderline>false</waveUnderline>
|
||||
<foreground>#ff0000</foreground>
|
||||
<background>#ffff00</background>
|
||||
</format>
|
||||
<format id="braceMatch" >
|
||||
<bold>true</bold>
|
||||
<italic>false</italic>
|
||||
<overline>false</overline>
|
||||
<underline>false</underline>
|
||||
<strikeout>false</strikeout>
|
||||
<waveUnderline>false</waveUnderline>
|
||||
<foreground>#ff0000</foreground>
|
||||
<background>#ffff00</background>
|
||||
</format>
|
||||
<format id="braceMismatch" >
|
||||
<bold>true</bold>
|
||||
<italic>false</italic>
|
||||
<overline>false</overline>
|
||||
<underline>false</underline>
|
||||
<strikeout>false</strikeout>
|
||||
<waveUnderline>false</waveUnderline>
|
||||
<foreground>#ffff00</foreground>
|
||||
<background>#ff0000</background>
|
||||
</format>
|
||||
<format id="search" >
|
||||
<bold>true</bold>
|
||||
<italic>true</italic>
|
||||
<overline>false</overline>
|
||||
<underline>false</underline>
|
||||
<strikeout>false</strikeout>
|
||||
<waveUnderline>false</waveUnderline>
|
||||
<foreground>#ff0000</foreground>
|
||||
<background>#ffff00</background>
|
||||
</format>
|
||||
<format id="danger" >
|
||||
<bold>true</bold>
|
||||
<italic>false</italic>
|
||||
<overline>false</overline>
|
||||
<underline>false</underline>
|
||||
<strikeout>false</strikeout>
|
||||
<waveUnderline>true</waveUnderline>
|
||||
<background>#d060d0</background>
|
||||
<linescolor>#ff0000</linescolor>
|
||||
</format>
|
||||
<format id="numbers" >
|
||||
<bold>false</bold>
|
||||
<italic>false</italic>
|
||||
<overline>false</overline>
|
||||
<underline>false</underline>
|
||||
<strikeout>false</strikeout>
|
||||
<waveUnderline>false</waveUnderline>
|
||||
<foreground>#800080</foreground>
|
||||
</format>
|
||||
<format id="text" >
|
||||
<bold>false</bold>
|
||||
<italic>false</italic>
|
||||
<overline>false</overline>
|
||||
<underline>false</underline>
|
||||
<strikeout>false</strikeout>
|
||||
<waveUnderline>false</waveUnderline>
|
||||
<foreground>#ff0000</foreground>
|
||||
</format>
|
||||
<format id="escapeseq" >
|
||||
<bold>false</bold>
|
||||
<italic>false</italic>
|
||||
<overline>false</overline>
|
||||
<underline>false</underline>
|
||||
<strikeout>false</strikeout>
|
||||
<waveUnderline>false</waveUnderline>
|
||||
<foreground>#ff1493</foreground>
|
||||
</format>
|
||||
</QXF>
|
|
@ -1,79 +0,0 @@
|
|||
<!DOCTYPE QNFA>
|
||||
<QNFA language="Python" extensions="py" indentationFold="true" defaultLineMark="breakpoint">
|
||||
<embed target="Doxygen"/>
|
||||
|
||||
<context id="comment/single" format="comment" stayOnLine="true" >
|
||||
<start>#</start>
|
||||
<stop exclusive="false">\n</stop>
|
||||
</context>
|
||||
|
||||
<context id="data/longstring1" format="text" >
|
||||
<start>"""</start>
|
||||
<stop>"""</stop>
|
||||
</context>
|
||||
|
||||
<context id="data/longstring2" format="text" >
|
||||
<start>'''</start>
|
||||
<stop>'''</stop>
|
||||
</context>
|
||||
|
||||
<context id="data/shortstring1" format="text" stayOnLine="true" >
|
||||
<start>"</start>
|
||||
<stop>"</stop>
|
||||
<stop exclusive="false">\n</stop>
|
||||
<escape>\\</escape>
|
||||
</context>
|
||||
|
||||
<context id="data/shortstring2" format="text" stayOnLine="true" >
|
||||
<start>'</start>
|
||||
<stop>'</stop>
|
||||
<stop exclusive="false">\n</stop>
|
||||
<escape>\\</escape>
|
||||
</context>
|
||||
|
||||
<sequence parenthesis="round:open">(</sequence>
|
||||
<sequence parenthesis="round:close">)</sequence>
|
||||
<sequence parenthesis="curly:open">{</sequence>
|
||||
<sequence parenthesis="curly:close">}</sequence>
|
||||
<sequence parenthesis="square:open">\[</sequence>
|
||||
<sequence parenthesis="square:close">\]</sequence>
|
||||
|
||||
<list id="keywords" format="keyword">
|
||||
<word>and</word>
|
||||
<word>del</word>
|
||||
<word>from</word>
|
||||
<word>not</word>
|
||||
<word>while</word>
|
||||
<word>as</word>
|
||||
<word>elif</word>
|
||||
<word>global</word>
|
||||
<word>or</word>
|
||||
<word>with</word>
|
||||
<word>assert</word>
|
||||
<word>else</word>
|
||||
<word>if</word>
|
||||
<word>pass</word>
|
||||
<word>yield</word>
|
||||
<word>break</word>
|
||||
<word>except</word>
|
||||
<word>import</word>
|
||||
<word>print</word>
|
||||
<word>class</word>
|
||||
<word>exec</word>
|
||||
<word>in</word>
|
||||
<word>raise</word>
|
||||
<word>continue</word>
|
||||
<word>finally</word>
|
||||
<word>is</word>
|
||||
<word>return</word>
|
||||
<word>def</word>
|
||||
<word>for</word>
|
||||
<word>lambda</word>
|
||||
<word>try</word>
|
||||
</list>
|
||||
|
||||
<word id="data/float" format="floats">-?[0-9]*.[0-9]+f?</word>
|
||||
<word id="data/hexadecimal" format="numbers">0[xX][0-9a-fA-F]+</word>
|
||||
<word id="data/octal" format="numbers">0[0-7]+</word>
|
||||
<word id="data/decimal" format="numbers">-?[0-9]+</word>
|
||||
</QNFA>
|
|
@ -1,142 +0,0 @@
|
|||
<!DOCTYPE QXF>
|
||||
<QXF version="1.0" >
|
||||
<format id="normal" >
|
||||
<bold>false</bold>
|
||||
<italic>false</italic>
|
||||
<overline>false</overline>
|
||||
<underline>false</underline>
|
||||
<strikeout>false</strikeout>
|
||||
<waveUnderline>false</waveUnderline>
|
||||
</format>
|
||||
<format id="preprocessor" >
|
||||
<bold>false</bold>
|
||||
<italic>false</italic>
|
||||
<overline>false</overline>
|
||||
<underline>false</underline>
|
||||
<strikeout>false</strikeout>
|
||||
<waveUnderline>false</waveUnderline>
|
||||
<foreground>#008000</foreground>
|
||||
</format>
|
||||
<format id="doxygen/keyword" >
|
||||
<bold>true</bold>
|
||||
<italic>false</italic>
|
||||
<overline>false</overline>
|
||||
<underline>false</underline>
|
||||
<strikeout>false</strikeout>
|
||||
<waveUnderline>false</waveUnderline>
|
||||
<foreground>#ff00ff</foreground>
|
||||
</format>
|
||||
<format id="doxygen" >
|
||||
<bold>false</bold>
|
||||
<italic>true</italic>
|
||||
<overline>false</overline>
|
||||
<underline>false</underline>
|
||||
<strikeout>false</strikeout>
|
||||
<waveUnderline>false</waveUnderline>
|
||||
<foreground>#a0a0a4</foreground>
|
||||
</format>
|
||||
<format id="comment" >
|
||||
<bold>false</bold>
|
||||
<italic>true</italic>
|
||||
<overline>false</overline>
|
||||
<underline>false</underline>
|
||||
<strikeout>false</strikeout>
|
||||
<waveUnderline>false</waveUnderline>
|
||||
<foreground>#000080</foreground>
|
||||
</format>
|
||||
<format id="keyword" >
|
||||
<bold>true</bold>
|
||||
<italic>false</italic>
|
||||
<overline>false</overline>
|
||||
<underline>false</underline>
|
||||
<strikeout>false</strikeout>
|
||||
<waveUnderline>false</waveUnderline>
|
||||
<foreground>#000000</foreground>
|
||||
</format>
|
||||
<format id="extra-keyword" >
|
||||
<bold>true</bold>
|
||||
<italic>false</italic>
|
||||
<overline>false</overline>
|
||||
<underline>false</underline>
|
||||
<strikeout>false</strikeout>
|
||||
<waveUnderline>false</waveUnderline>
|
||||
<foreground>#0095ff</foreground>
|
||||
</format>
|
||||
<format id="match" >
|
||||
<bold>true</bold>
|
||||
<italic>false</italic>
|
||||
<overline>false</overline>
|
||||
<underline>false</underline>
|
||||
<strikeout>false</strikeout>
|
||||
<waveUnderline>false</waveUnderline>
|
||||
<foreground>#ff0000</foreground>
|
||||
<background>#ffff00</background>
|
||||
</format>
|
||||
<format id="braceMatch" >
|
||||
<bold>true</bold>
|
||||
<italic>false</italic>
|
||||
<overline>false</overline>
|
||||
<underline>false</underline>
|
||||
<strikeout>false</strikeout>
|
||||
<waveUnderline>false</waveUnderline>
|
||||
<foreground>#ff0000</foreground>
|
||||
<background>#ffff00</background>
|
||||
</format>
|
||||
<format id="braceMismatch" >
|
||||
<bold>true</bold>
|
||||
<italic>false</italic>
|
||||
<overline>false</overline>
|
||||
<underline>false</underline>
|
||||
<strikeout>false</strikeout>
|
||||
<waveUnderline>false</waveUnderline>
|
||||
<foreground>#ffff00</foreground>
|
||||
<background>#ff0000</background>
|
||||
</format>
|
||||
<format id="search" >
|
||||
<bold>true</bold>
|
||||
<italic>true</italic>
|
||||
<overline>false</overline>
|
||||
<underline>false</underline>
|
||||
<strikeout>false</strikeout>
|
||||
<waveUnderline>false</waveUnderline>
|
||||
<foreground>#ff0000</foreground>
|
||||
<background>#ffff00</background>
|
||||
</format>
|
||||
<format id="danger" >
|
||||
<bold>true</bold>
|
||||
<italic>false</italic>
|
||||
<overline>false</overline>
|
||||
<underline>false</underline>
|
||||
<strikeout>false</strikeout>
|
||||
<waveUnderline>true</waveUnderline>
|
||||
<background>#d060d0</background>
|
||||
<linescolor>#ff0000</linescolor>
|
||||
</format>
|
||||
<format id="numbers" >
|
||||
<bold>false</bold>
|
||||
<italic>false</italic>
|
||||
<overline>false</overline>
|
||||
<underline>false</underline>
|
||||
<strikeout>false</strikeout>
|
||||
<waveUnderline>false</waveUnderline>
|
||||
<foreground>#800080</foreground>
|
||||
</format>
|
||||
<format id="text" >
|
||||
<bold>false</bold>
|
||||
<italic>false</italic>
|
||||
<overline>false</overline>
|
||||
<underline>false</underline>
|
||||
<strikeout>false</strikeout>
|
||||
<waveUnderline>false</waveUnderline>
|
||||
<foreground>#ff0000</foreground>
|
||||
</format>
|
||||
<format id="escapeseq" >
|
||||
<bold>false</bold>
|
||||
<italic>false</italic>
|
||||
<overline>false</overline>
|
||||
<underline>false</underline>
|
||||
<strikeout>false</strikeout>
|
||||
<waveUnderline>false</waveUnderline>
|
||||
<foreground>#ff1493</foreground>
|
||||
</format>
|
||||
</QXF>
|
|
@ -1,101 +0,0 @@
|
|||
<!DOCTYPE QNFA>
|
||||
<QNFA language="QtScript" extensions="js;qs" >
|
||||
<embed target="Doxygen"/>
|
||||
|
||||
<context id="comment/single" format="comment" >
|
||||
<start>//</start>
|
||||
<stop exclusive="false">\n</stop>
|
||||
</context>
|
||||
|
||||
<context id="comment/single" format="comment" >
|
||||
<start parenthesis="jscomment:open" indent="1" fold="1">/\*</start>
|
||||
<stop parenthesis="jscomment:close" indent="1" fold="1">\*/</stop>
|
||||
</context>
|
||||
|
||||
<context id="data/string1" format="text" >
|
||||
<start>"</start>
|
||||
<stop>"</stop>
|
||||
<stop exclusive="false">\n</stop>
|
||||
<sequence id="escape" format="escapeseq" >\\[nrtvf\\"'\n]</sequence>
|
||||
</context>
|
||||
|
||||
<context id="data/string2" format="text" >
|
||||
<start>'</start>
|
||||
<stop>'</stop>
|
||||
<stop exclusive="false">\n</stop>
|
||||
<sequence id="escape" format="escapeseq" >\\[nrtvf\\"'\n]</sequence>
|
||||
</context>
|
||||
|
||||
<sequence parenthesis="round:open">(</sequence>
|
||||
<sequence parenthesis="round:close">)</sequence>
|
||||
<sequence parenthesis="curly:open">{</sequence>
|
||||
<sequence parenthesis="curly:close">}</sequence>
|
||||
<sequence parenthesis="square:open">\[</sequence>
|
||||
<sequence parenthesis="square:close">\]</sequence>
|
||||
|
||||
<list id="keywords" format="keyword">
|
||||
<word>Infinity</word>
|
||||
<word>NaN</word>
|
||||
<word>abstract</word>
|
||||
<word>boolean</word>
|
||||
<word>byte</word>
|
||||
<word>case</word>
|
||||
<word>catch</word>
|
||||
<word>char</word>
|
||||
<word>class</word>
|
||||
<word>const</word>
|
||||
<word>constructor</word>
|
||||
<word>continue</word>
|
||||
<word>debugger</word>
|
||||
<word>default</word>
|
||||
<word>delete</word>
|
||||
<word>do</word>
|
||||
<word>double</word>
|
||||
<word>else</word>
|
||||
<word>enum</word>
|
||||
<word>export</word>
|
||||
<word>extends</word>
|
||||
<word>false</word>
|
||||
<word>final</word>
|
||||
<word>finally</word>
|
||||
<word>float</word>
|
||||
<word>for</word>
|
||||
<word>function</word>
|
||||
<word>goto</word>
|
||||
<word>if</word>
|
||||
<word>implements</word>
|
||||
<word>import</word>
|
||||
<word>in</word>
|
||||
<word>instanceof</word>
|
||||
<word>int</word>
|
||||
<word>interface</word>
|
||||
<word>long</word>
|
||||
<word>native</word>
|
||||
<word>new</word>
|
||||
<word>package</word>
|
||||
<word>private</word>
|
||||
<word>protected</word>
|
||||
<word>public</word>
|
||||
<word>return</word>
|
||||
<word>short</word>
|
||||
<word>static</word>
|
||||
<word>super</word>
|
||||
<word>switch</word>
|
||||
<word>synchronized</word>
|
||||
<word>this</word>
|
||||
<word>throw</word>
|
||||
<word>throws</word>
|
||||
<word>transient</word>
|
||||
<word>true</word>
|
||||
<word>try</word>
|
||||
<word>typeof</word>
|
||||
<word>undefined</word>
|
||||
<word>var</word>
|
||||
<word>void</word>
|
||||
<word>volatile</word>
|
||||
<word>with</word>
|
||||
</list>
|
||||
|
||||
<word id="data/float" format="floats">-?[0-9]*.[0-9]+</word>
|
||||
<word id="data/decimal" format="numbers">-?[0-9]+</word>
|
||||
</QNFA>
|
|
@ -1,142 +0,0 @@
|
|||
<!DOCTYPE QXF>
|
||||
<QXF version="1.0" >
|
||||
<format id="normal" >
|
||||
<bold>false</bold>
|
||||
<italic>false</italic>
|
||||
<overline>false</overline>
|
||||
<underline>false</underline>
|
||||
<strikeout>false</strikeout>
|
||||
<waveUnderline>false</waveUnderline>
|
||||
</format>
|
||||
<format id="preprocessor" >
|
||||
<bold>false</bold>
|
||||
<italic>false</italic>
|
||||
<overline>false</overline>
|
||||
<underline>false</underline>
|
||||
<strikeout>false</strikeout>
|
||||
<waveUnderline>false</waveUnderline>
|
||||
<foreground>#008000</foreground>
|
||||
</format>
|
||||
<format id="doxygen/keyword" >
|
||||
<bold>true</bold>
|
||||
<italic>false</italic>
|
||||
<overline>false</overline>
|
||||
<underline>false</underline>
|
||||
<strikeout>false</strikeout>
|
||||
<waveUnderline>false</waveUnderline>
|
||||
<foreground>#ff00ff</foreground>
|
||||
</format>
|
||||
<format id="doxygen" >
|
||||
<bold>false</bold>
|
||||
<italic>true</italic>
|
||||
<overline>false</overline>
|
||||
<underline>false</underline>
|
||||
<strikeout>false</strikeout>
|
||||
<waveUnderline>false</waveUnderline>
|
||||
<foreground>#a0a0a4</foreground>
|
||||
</format>
|
||||
<format id="comment" >
|
||||
<bold>false</bold>
|
||||
<italic>true</italic>
|
||||
<overline>false</overline>
|
||||
<underline>false</underline>
|
||||
<strikeout>false</strikeout>
|
||||
<waveUnderline>false</waveUnderline>
|
||||
<foreground>#000080</foreground>
|
||||
</format>
|
||||
<format id="keyword" >
|
||||
<bold>true</bold>
|
||||
<italic>false</italic>
|
||||
<overline>false</overline>
|
||||
<underline>false</underline>
|
||||
<strikeout>false</strikeout>
|
||||
<waveUnderline>false</waveUnderline>
|
||||
<foreground>#000000</foreground>
|
||||
</format>
|
||||
<format id="extra-keyword" >
|
||||
<bold>true</bold>
|
||||
<italic>false</italic>
|
||||
<overline>false</overline>
|
||||
<underline>false</underline>
|
||||
<strikeout>false</strikeout>
|
||||
<waveUnderline>false</waveUnderline>
|
||||
<foreground>#0095ff</foreground>
|
||||
</format>
|
||||
<format id="match" >
|
||||
<bold>true</bold>
|
||||
<italic>false</italic>
|
||||
<overline>false</overline>
|
||||
<underline>false</underline>
|
||||
<strikeout>false</strikeout>
|
||||
<waveUnderline>false</waveUnderline>
|
||||
<foreground>#ff0000</foreground>
|
||||
<background>#ffff00</background>
|
||||
</format>
|
||||
<format id="braceMatch" >
|
||||
<bold>true</bold>
|
||||
<italic>false</italic>
|
||||
<overline>false</overline>
|
||||
<underline>false</underline>
|
||||
<strikeout>false</strikeout>
|
||||
<waveUnderline>false</waveUnderline>
|
||||
<foreground>#ff0000</foreground>
|
||||
<background>#ffff00</background>
|
||||
</format>
|
||||
<format id="braceMismatch" >
|
||||
<bold>true</bold>
|
||||
<italic>false</italic>
|
||||
<overline>false</overline>
|
||||
<underline>false</underline>
|
||||
<strikeout>false</strikeout>
|
||||
<waveUnderline>false</waveUnderline>
|
||||
<foreground>#ffff00</foreground>
|
||||
<background>#ff0000</background>
|
||||
</format>
|
||||
<format id="search" >
|
||||
<bold>true</bold>
|
||||
<italic>true</italic>
|
||||
<overline>false</overline>
|
||||
<underline>false</underline>
|
||||
<strikeout>false</strikeout>
|
||||
<waveUnderline>false</waveUnderline>
|
||||
<foreground>#ff0000</foreground>
|
||||
<background>#ffff00</background>
|
||||
</format>
|
||||
<format id="danger" >
|
||||
<bold>true</bold>
|
||||
<italic>false</italic>
|
||||
<overline>false</overline>
|
||||
<underline>false</underline>
|
||||
<strikeout>false</strikeout>
|
||||
<waveUnderline>true</waveUnderline>
|
||||
<background>#d060d0</background>
|
||||
<linescolor>#ff0000</linescolor>
|
||||
</format>
|
||||
<format id="numbers" >
|
||||
<bold>false</bold>
|
||||
<italic>false</italic>
|
||||
<overline>false</overline>
|
||||
<underline>false</underline>
|
||||
<strikeout>false</strikeout>
|
||||
<waveUnderline>false</waveUnderline>
|
||||
<foreground>#800080</foreground>
|
||||
</format>
|
||||
<format id="text" >
|
||||
<bold>false</bold>
|
||||
<italic>false</italic>
|
||||
<overline>false</overline>
|
||||
<underline>false</underline>
|
||||
<strikeout>false</strikeout>
|
||||
<waveUnderline>false</waveUnderline>
|
||||
<foreground>#ff0000</foreground>
|
||||
</format>
|
||||
<format id="escapeseq" >
|
||||
<bold>false</bold>
|
||||
<italic>false</italic>
|
||||
<overline>false</overline>
|
||||
<underline>false</underline>
|
||||
<strikeout>false</strikeout>
|
||||
<waveUnderline>false</waveUnderline>
|
||||
<foreground>#ff1493</foreground>
|
||||
</format>
|
||||
</QXF>
|
|
@ -1,12 +0,0 @@
|
|||
<!DOCTYPE QNFA>
|
||||
<QNFA language="QCE::Snippet" extensions="snip" defaultLineMark="">
|
||||
<sequence id="placeholder/short" format="extra-keyword" >${[0-9]+}</sequence>
|
||||
|
||||
<context id="placeholder/long" format="extra-keyword" >
|
||||
<start parenthesis="snippet-placeholder:open" >${</start>
|
||||
<stop parenthesis="snippet-placeholder:close" >}</stop>
|
||||
<sequence format="numbers">[0-9]+</sequence>
|
||||
<sequence parenthesis="snippet-placeholder:boundary">:</sequence>
|
||||
</context>
|
||||
</QNFA>
|
||||
|
|
@ -1,57 +0,0 @@
|
|||
<!DOCTYPE QNFA>
|
||||
<QNFA language="(La-)Tex" extensions="tex" defaultLineMark="">
|
||||
<context id="comment/single" format="comment" stayOnLine="true" >
|
||||
<start>%</start>
|
||||
<stop exclusive="false">\n</stop>
|
||||
</context>
|
||||
|
||||
<context id="mathmode" format="numbers" transparency="true" >
|
||||
<start parenthesis="math:open" fold="true" >$</start>
|
||||
<stop parenthesis="math:close" fold="true" >$</stop>
|
||||
|
||||
<word id="keywords/math-fallback" format="keyword">\\[a-zA-Z]+</word>
|
||||
</context>
|
||||
|
||||
<context id="mathmodeNormal" format="numbers" transparency="true">
|
||||
<start parenthesis="math:open" fold="true" format="extra-keyword">\\begin{math}</start>
|
||||
<stop parenthesis="math:close" fold="true" format="extra-keyword">\\end{math}</stop>
|
||||
<start parenthesis="math:open" fold="true" >\\\(</start>
|
||||
<stop parenthesis="math:close" fold="true" >\\\)</stop>
|
||||
|
||||
<word id="keywords/math-fallback" format="keyword">\\[a-zA-Z]+</word>
|
||||
</context>
|
||||
|
||||
<context id="mathmodeDisplay" format="numbers" transparency="true">
|
||||
<start parenthesis="math:open" fold="true" format="extra-keyword">\\begin{displaymath}</start>
|
||||
<stop parenthesis="math:close" fold="true" format="extra-keyword">\\end{displaymath}</stop>
|
||||
<start parenthesis="math:open" fold="true" >\\\[</start>
|
||||
<stop parenthesis="math:close" fold="true" >\\\]</stop>
|
||||
<start parenthesis="math:open" fold="true" format="extra-keyword">\\begin{equation}</start>
|
||||
<stop parenthesis="math:close" fold="true" format="extra-keyword">\\end{equation}</stop>
|
||||
|
||||
<word id="keywords/math-fallback" format="keyword">\\[a-zA-Z]+</word>
|
||||
</context>
|
||||
|
||||
<word parenthesis="block:open" fold="true" indent="true" ambiguous="true" format="extra-keyword">\\begin</word>
|
||||
<word parenthesis="block:close" fold="true" indent="true" format="extra-keyword" >\\end</word>
|
||||
|
||||
<list id="keywords/block" format="extra-keyword">
|
||||
<word parenthesis="part:boundary" fold="true" indent="true" >\\part</word>
|
||||
<word parenthesis="chapter:boundary" fold="true" indent="true" >\\chapter</word>
|
||||
<word parenthesis="section:boundary" fold="true" indent="true" >\\section</word>
|
||||
<word parenthesis="subsection:boundary" fold="true" indent="true" >\\subsection</word>
|
||||
<word parenthesis="paragraph:boundary" fold="true" indent="true" >\\paragraph</word>
|
||||
<word parenthesis="subparagraph:boundary" fold="true" indent="true" >\\subparagraph</word>
|
||||
</list>
|
||||
|
||||
<!-- Keep that one near the end or all the other \commands will be matched by this one... -->
|
||||
<word id="keywords/single" ambiguous="true" format="keyword">\\[a-zA-Z]+</word>
|
||||
|
||||
<sequence parenthesis="round:open">(</sequence>
|
||||
<sequence parenthesis="round:close">)</sequence>
|
||||
<sequence parenthesis="curly:open" indent="true" fold="true">{</sequence>
|
||||
<sequence parenthesis="curly:close" indent="true" fold="true">}</sequence>
|
||||
<sequence parenthesis="square:open">\[</sequence>
|
||||
<sequence parenthesis="square:close">\]</sequence>
|
||||
</QNFA>
|
||||
|
|
@ -1,142 +0,0 @@
|
|||
<!DOCTYPE QXF>
|
||||
<QXF version="1.0" >
|
||||
<format id="normal" >
|
||||
<bold>false</bold>
|
||||
<italic>false</italic>
|
||||
<overline>false</overline>
|
||||
<underline>false</underline>
|
||||
<strikeout>false</strikeout>
|
||||
<waveUnderline>false</waveUnderline>
|
||||
</format>
|
||||
<format id="preprocessor" >
|
||||
<bold>false</bold>
|
||||
<italic>false</italic>
|
||||
<overline>false</overline>
|
||||
<underline>false</underline>
|
||||
<strikeout>false</strikeout>
|
||||
<waveUnderline>false</waveUnderline>
|
||||
<foreground>#008000</foreground>
|
||||
</format>
|
||||
<format id="doxygen/keyword" >
|
||||
<bold>true</bold>
|
||||
<italic>false</italic>
|
||||
<overline>false</overline>
|
||||
<underline>false</underline>
|
||||
<strikeout>false</strikeout>
|
||||
<waveUnderline>false</waveUnderline>
|
||||
<foreground>#ff00ff</foreground>
|
||||
</format>
|
||||
<format id="doxygen" >
|
||||
<bold>false</bold>
|
||||
<italic>true</italic>
|
||||
<overline>false</overline>
|
||||
<underline>false</underline>
|
||||
<strikeout>false</strikeout>
|
||||
<waveUnderline>false</waveUnderline>
|
||||
<foreground>#a0a0a4</foreground>
|
||||
</format>
|
||||
<format id="comment" >
|
||||
<bold>false</bold>
|
||||
<italic>true</italic>
|
||||
<overline>false</overline>
|
||||
<underline>false</underline>
|
||||
<strikeout>false</strikeout>
|
||||
<waveUnderline>false</waveUnderline>
|
||||
<foreground>#000080</foreground>
|
||||
</format>
|
||||
<format id="keyword" >
|
||||
<bold>true</bold>
|
||||
<italic>false</italic>
|
||||
<overline>false</overline>
|
||||
<underline>false</underline>
|
||||
<strikeout>false</strikeout>
|
||||
<waveUnderline>false</waveUnderline>
|
||||
<foreground>#000000</foreground>
|
||||
</format>
|
||||
<format id="extra-keyword" >
|
||||
<bold>true</bold>
|
||||
<italic>false</italic>
|
||||
<overline>false</overline>
|
||||
<underline>false</underline>
|
||||
<strikeout>false</strikeout>
|
||||
<waveUnderline>false</waveUnderline>
|
||||
<foreground>#0095ff</foreground>
|
||||
</format>
|
||||
<format id="match" >
|
||||
<bold>true</bold>
|
||||
<italic>false</italic>
|
||||
<overline>false</overline>
|
||||
<underline>false</underline>
|
||||
<strikeout>false</strikeout>
|
||||
<waveUnderline>false</waveUnderline>
|
||||
<foreground>#ff0000</foreground>
|
||||
<background>#ffff00</background>
|
||||
</format>
|
||||
<format id="braceMatch" >
|
||||
<bold>true</bold>
|
||||
<italic>false</italic>
|
||||
<overline>false</overline>
|
||||
<underline>false</underline>
|
||||
<strikeout>false</strikeout>
|
||||
<waveUnderline>false</waveUnderline>
|
||||
<foreground>#ff0000</foreground>
|
||||
<background>#ffff00</background>
|
||||
</format>
|
||||
<format id="braceMismatch" >
|
||||
<bold>true</bold>
|
||||
<italic>false</italic>
|
||||
<overline>false</overline>
|
||||
<underline>false</underline>
|
||||
<strikeout>false</strikeout>
|
||||
<waveUnderline>false</waveUnderline>
|
||||
<foreground>#ffff00</foreground>
|
||||
<background>#ff0000</background>
|
||||
</format>
|
||||
<format id="search" >
|
||||
<bold>true</bold>
|
||||
<italic>true</italic>
|
||||
<overline>false</overline>
|
||||
<underline>false</underline>
|
||||
<strikeout>false</strikeout>
|
||||
<waveUnderline>false</waveUnderline>
|
||||
<foreground>#ff0000</foreground>
|
||||
<background>#ffff00</background>
|
||||
</format>
|
||||
<format id="danger" >
|
||||
<bold>true</bold>
|
||||
<italic>false</italic>
|
||||
<overline>false</overline>
|
||||
<underline>false</underline>
|
||||
<strikeout>false</strikeout>
|
||||
<waveUnderline>true</waveUnderline>
|
||||
<background>#d060d0</background>
|
||||
<linescolor>#ff0000</linescolor>
|
||||
</format>
|
||||
<format id="numbers" >
|
||||
<bold>false</bold>
|
||||
<italic>false</italic>
|
||||
<overline>false</overline>
|
||||
<underline>false</underline>
|
||||
<strikeout>false</strikeout>
|
||||
<waveUnderline>false</waveUnderline>
|
||||
<foreground>#800080</foreground>
|
||||
</format>
|
||||
<format id="text" >
|
||||
<bold>false</bold>
|
||||
<italic>false</italic>
|
||||
<overline>false</overline>
|
||||
<underline>false</underline>
|
||||
<strikeout>false</strikeout>
|
||||
<waveUnderline>false</waveUnderline>
|
||||
<foreground>#ff0000</foreground>
|
||||
</format>
|
||||
<format id="escapeseq" >
|
||||
<bold>false</bold>
|
||||
<italic>false</italic>
|
||||
<overline>false</overline>
|
||||
<underline>false</underline>
|
||||
<strikeout>false</strikeout>
|
||||
<waveUnderline>false</waveUnderline>
|
||||
<foreground>#ff1493</foreground>
|
||||
</format>
|
||||
</QXF>
|
|
@ -1,52 +0,0 @@
|
|||
<!DOCTYPE QNFA>
|
||||
<QNFA language="XML" extensions="xml;xsl;qnfa;qxm;qxf;ui" >
|
||||
<context id="comment" format="comment" >
|
||||
<start parenthesis="xmlcomment:open" indent="1" fold="1"><!--</start>
|
||||
<stop parenthesis="xmlcomment:close" indent="1" fold="1">--></stop>
|
||||
</context>
|
||||
|
||||
<context id="cdata" format="comment" >
|
||||
<start parenthesis="xmlcdata:open" indent="1" fold="1"><\[CDATA\[</start>
|
||||
<stop parenthesis="xmlcdata:close" indent="1" fold="1">\]\]></stop>
|
||||
</context>
|
||||
|
||||
<context id="preprocessor" format="preprocessor" >
|
||||
<start parenthesis="xmlpreproc:open" indent="1" fold="1"><\?xml</start>
|
||||
<stop parenthesis="xmlpreproc:close" indent="1" fold="1">\?></stop>
|
||||
</context>
|
||||
|
||||
<context id="doctype" format="text" >
|
||||
<start><!DOCTYPE</start>
|
||||
<stop>></stop>
|
||||
</context>
|
||||
|
||||
<sequence id="entity" format="numbers">&$w+;</sequence>
|
||||
|
||||
<context id="closetag" format="numbers">
|
||||
<start format="keyword" ></[$w$d:]+</start>
|
||||
<stop format="keyword" parenthesis="xmltag:close@nomatch" indent="1" fold="1" >></stop>
|
||||
|
||||
</context>
|
||||
|
||||
<context id="opentag" format="numbers">
|
||||
<start format="keyword" ><[$w$d:]+</start>
|
||||
<stop format="keyword" parenthesis="xmltag:open@nomatch" indent="1" fold="1" >></stop>
|
||||
<stop format="keyword" >/$s*></stop>
|
||||
|
||||
<sequence format="preprocessor">[$w:\-]+\s*=</sequence>
|
||||
|
||||
<context id="data/string1" format="text" >
|
||||
<start>"</start>
|
||||
<stop>"</stop>
|
||||
</context>
|
||||
|
||||
<context id="data/string2" format="text" >
|
||||
<start>"</start>
|
||||
<stop>"</stop>
|
||||
</context>
|
||||
</context>
|
||||
|
||||
<!--
|
||||
<sequence id="tag/stop" parenthesis="xmltag:close@nomatch" indent="1" fold="1" format="keyword" ></[a-zA-Z0-9_:]+></sequence>
|
||||
-->
|
||||
</QNFA>
|
|
@ -1,144 +0,0 @@
|
|||
<!DOCTYPE QXF>
|
||||
<QXF version="1.0" >
|
||||
<format id="normal" >
|
||||
<bold>false</bold>
|
||||
<italic>false</italic>
|
||||
<overline>false</overline>
|
||||
<underline>false</underline>
|
||||
<strikeout>false</strikeout>
|
||||
<waveUnderline>false</waveUnderline>
|
||||
</format>
|
||||
<format id="preprocessor" >
|
||||
<bold>false</bold>
|
||||
<italic>false</italic>
|
||||
<overline>false</overline>
|
||||
<underline>false</underline>
|
||||
<strikeout>false</strikeout>
|
||||
<waveUnderline>false</waveUnderline>
|
||||
<foreground>#008000</foreground>
|
||||
</format>
|
||||
<format id="doxygen/keyword" >
|
||||
<bold>true</bold>
|
||||
<italic>false</italic>
|
||||
<overline>false</overline>
|
||||
<underline>false</underline>
|
||||
<strikeout>false</strikeout>
|
||||
<waveUnderline>false</waveUnderline>
|
||||
<foreground>#ff00ff</foreground>
|
||||
</format>
|
||||
<format id="doxygen" >
|
||||
<bold>false</bold>
|
||||
<italic>true</italic>
|
||||
<overline>false</overline>
|
||||
<underline>false</underline>
|
||||
<strikeout>false</strikeout>
|
||||
<waveUnderline>false</waveUnderline>
|
||||
<foreground>#a0a0a4</foreground>
|
||||
</format>
|
||||
<format id="comment" >
|
||||
<bold>false</bold>
|
||||
<italic>true</italic>
|
||||
<overline>false</overline>
|
||||
<underline>false</underline>
|
||||
<strikeout>false</strikeout>
|
||||
<waveUnderline>false</waveUnderline>
|
||||
<foreground>#000080</foreground>
|
||||
</format>
|
||||
<format id="keyword" >
|
||||
<bold>true</bold>
|
||||
<italic>false</italic>
|
||||
<overline>false</overline>
|
||||
<underline>false</underline>
|
||||
<strikeout>false</strikeout>
|
||||
<waveUnderline>false</waveUnderline>
|
||||
<foreground>#000000</foreground>
|
||||
<background>#55aa00</background>
|
||||
<linescolor>#ff0000</linescolor>
|
||||
</format>
|
||||
<format id="extra-keyword" >
|
||||
<bold>true</bold>
|
||||
<italic>false</italic>
|
||||
<overline>false</overline>
|
||||
<underline>false</underline>
|
||||
<strikeout>false</strikeout>
|
||||
<waveUnderline>false</waveUnderline>
|
||||
<foreground>#0095ff</foreground>
|
||||
</format>
|
||||
<format id="match" >
|
||||
<bold>true</bold>
|
||||
<italic>false</italic>
|
||||
<overline>false</overline>
|
||||
<underline>false</underline>
|
||||
<strikeout>false</strikeout>
|
||||
<waveUnderline>false</waveUnderline>
|
||||
<foreground>#ff0000</foreground>
|
||||
<background>#ffff00</background>
|
||||
</format>
|
||||
<format id="braceMatch" >
|
||||
<bold>true</bold>
|
||||
<italic>false</italic>
|
||||
<overline>false</overline>
|
||||
<underline>false</underline>
|
||||
<strikeout>false</strikeout>
|
||||
<waveUnderline>false</waveUnderline>
|
||||
<foreground>#ff0000</foreground>
|
||||
<background>#ffff00</background>
|
||||
</format>
|
||||
<format id="braceMismatch" >
|
||||
<bold>true</bold>
|
||||
<italic>false</italic>
|
||||
<overline>false</overline>
|
||||
<underline>false</underline>
|
||||
<strikeout>false</strikeout>
|
||||
<waveUnderline>false</waveUnderline>
|
||||
<foreground>#ffff00</foreground>
|
||||
<background>#ff0000</background>
|
||||
</format>
|
||||
<format id="search" >
|
||||
<bold>true</bold>
|
||||
<italic>true</italic>
|
||||
<overline>false</overline>
|
||||
<underline>false</underline>
|
||||
<strikeout>false</strikeout>
|
||||
<waveUnderline>false</waveUnderline>
|
||||
<foreground>#ff0000</foreground>
|
||||
<background>#ffff00</background>
|
||||
</format>
|
||||
<format id="danger" >
|
||||
<bold>true</bold>
|
||||
<italic>false</italic>
|
||||
<overline>false</overline>
|
||||
<underline>false</underline>
|
||||
<strikeout>false</strikeout>
|
||||
<waveUnderline>true</waveUnderline>
|
||||
<background>#d060d0</background>
|
||||
<linescolor>#ff0000</linescolor>
|
||||
</format>
|
||||
<format id="numbers" >
|
||||
<bold>false</bold>
|
||||
<italic>false</italic>
|
||||
<overline>false</overline>
|
||||
<underline>false</underline>
|
||||
<strikeout>false</strikeout>
|
||||
<waveUnderline>false</waveUnderline>
|
||||
<foreground>#800080</foreground>
|
||||
</format>
|
||||
<format id="text" >
|
||||
<bold>false</bold>
|
||||
<italic>false</italic>
|
||||
<overline>false</overline>
|
||||
<underline>false</underline>
|
||||
<strikeout>false</strikeout>
|
||||
<waveUnderline>false</waveUnderline>
|
||||
<foreground>#ff0000</foreground>
|
||||
</format>
|
||||
<format id="escapeseq" >
|
||||
<bold>false</bold>
|
||||
<italic>false</italic>
|
||||
<overline>false</overline>
|
||||
<underline>false</underline>
|
||||
<strikeout>false</strikeout>
|
||||
<waveUnderline>false</waveUnderline>
|
||||
<foreground>#ff1493</foreground>
|
||||
</format>
|
||||
</QXF>
|
|
@ -0,0 +1,50 @@
|
|||
cmake_minimum_required(VERSION 3.6)
|
||||
project(QCodeModel2 LANGUAGES CXX)
|
||||
|
||||
set(CMAKE_CXX_STANDARD 17)
|
||||
|
||||
set(CMAKE_AUTOUIC ON)
|
||||
set(CMAKE_AUTOMOC ON)
|
||||
set(CMAKE_AUTORCC ON)
|
||||
|
||||
find_package(QT NAMES Qt6 Qt5 REQUIRED COMPONENTS Widgets Gui)
|
||||
find_package(Qt${QT_VERSION_MAJOR} REQUIRED COMPONENTS Widgets Gui)
|
||||
|
||||
add_definitions(-D_QCODE_MODEL_BUILD_STATIC_)
|
||||
|
||||
add_library(
|
||||
QCodeModel2 STATIC
|
||||
qcm-config.h
|
||||
qcodemodel.h
|
||||
qcodeproxymodel.h
|
||||
qcodenode.h
|
||||
qcodenodepool.h
|
||||
qsourcecodewatcher.h
|
||||
qcodeview.h
|
||||
qcodeserializer.h
|
||||
qcodestream.h
|
||||
qcodedevice.h
|
||||
qcodebuffer.h
|
||||
qcodelexer.h
|
||||
qcodeparser.h
|
||||
qcodeloader.h
|
||||
qcodemodel.cpp
|
||||
qcodeproxymodel.cpp
|
||||
qcodenode.cpp
|
||||
qcodenodepool.cpp
|
||||
qsourcecodewatcher.cpp
|
||||
qcodeview.cpp
|
||||
qcodeserializer.cpp
|
||||
qcodestream.cpp
|
||||
qcodedevice.cpp
|
||||
qcodebuffer.cpp
|
||||
qcodelexer.cpp
|
||||
qcodeparser.cpp
|
||||
qcodeloader.cpp)
|
||||
|
||||
target_include_directories(QCodeModel2 PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}")
|
||||
|
||||
target_link_libraries(QCodeModel2 PRIVATE Qt${QT_VERSION_MAJOR}::Widgets
|
||||
Qt${QT_VERSION_MAJOR}::Gui)
|
||||
|
||||
target_compile_definitions(QCodeModel2 PUBLIC -D_QCODE_MODEL_BUILD_STATIC_)
|
|
@ -0,0 +1,46 @@
|
|||
/****************************************************************************
|
||||
**
|
||||
** 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>
|
||||
|
||||
/*!
|
||||
\macro QCM_EXPORT
|
||||
Allow a cross-platform and sure possibility to link in static or dynamic
|
||||
way, depending to what's needed...
|
||||
*/
|
||||
#ifdef _QCODE_MODEL_BUILD_DLL_
|
||||
#if (defined(QT_SHARED) || defined(QT_DLL)) && !defined(QT_PLUGIN)
|
||||
#define QCM_EXPORT Q_DECL_EXPORT
|
||||
#endif
|
||||
#else
|
||||
#ifdef _QCODE_MODEL_BUILD_STATIC_
|
||||
#define QCM_EXPORT
|
||||
#else
|
||||
#define QCM_EXPORT Q_DECL_IMPORT
|
||||
#endif
|
||||
#endif
|
||||
|
||||
class QByteArray;
|
||||
|
||||
template <typename T>
|
||||
class QList;
|
||||
|
||||
typedef QByteArray QToken;
|
||||
typedef QList<QToken> QTokenList;
|
||||
|
||||
#endif // _QCM_CONFIG_H_
|
|
@ -0,0 +1,84 @@
|
|||
/****************************************************************************
|
||||
**
|
||||
** 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 "qcodebuffer.h"
|
||||
|
||||
/*!
|
||||
\file qcodebuffer.cpp
|
||||
\brief Implementation of the QCodebuffer class.
|
||||
*/
|
||||
|
||||
#include <QString>
|
||||
|
||||
/*!
|
||||
\class QCodebuffer
|
||||
\brief Code stream that operates on a static string buffer
|
||||
*/
|
||||
|
||||
/*!
|
||||
\brief Constructs a code buffer from an Unicode string
|
||||
|
||||
\note The string is converted to local8Bit()
|
||||
*/
|
||||
QCodeBuffer::QCodeBuffer(const QString &s)
|
||||
: QCodeStream(), iPos(0), sBuffer(s.toLocal8Bit()) {
|
||||
sBuffer.replace("\r\n", "\n");
|
||||
sBuffer.replace("\r", "\n");
|
||||
}
|
||||
|
||||
/*!
|
||||
\brief Constructs a code buffer from a byte array
|
||||
*/
|
||||
QCodeBuffer::QCodeBuffer(const QByteArray &s)
|
||||
: QCodeStream(), iPos(0), sBuffer(s) {
|
||||
sBuffer.replace("\r\n", "\n");
|
||||
sBuffer.replace("\r", "\n");
|
||||
}
|
||||
|
||||
/*!
|
||||
\brief return the char pointed to by the internal pointer and update the
|
||||
pointer
|
||||
*/
|
||||
char QCodeBuffer::getChar() {
|
||||
if (iPos < sBuffer.length())
|
||||
return sBuffer.at(iPos++);
|
||||
else
|
||||
return '\0';
|
||||
}
|
||||
|
||||
/*!
|
||||
\brief Move back by one character
|
||||
*/
|
||||
void QCodeBuffer::ungetChar(char) {
|
||||
if (iPos > 0)
|
||||
--iPos;
|
||||
}
|
||||
|
||||
/*!
|
||||
\return the content of the current line
|
||||
*/
|
||||
QByteArray QCodeBuffer::readLine() {
|
||||
char c;
|
||||
QByteArray s;
|
||||
|
||||
while ((c = getChar())) {
|
||||
if (c == '\n')
|
||||
break;
|
||||
|
||||
s += c;
|
||||
}
|
||||
|
||||
return s;
|
||||
}
|
|
@ -13,32 +13,31 @@
|
|||
**
|
||||
****************************************************************************/
|
||||
|
||||
#ifndef _QGOTO_LINE__DIALOG_H_
|
||||
#define _QGOTO_LINE__DIALOG_H_
|
||||
#ifndef _QCODE_BUFFER_H_
|
||||
#define _QCODE_BUFFER_H_
|
||||
|
||||
#include "qce-config.h"
|
||||
#include "qcodestream.h"
|
||||
|
||||
/*!
|
||||
\file qgotodialog.h
|
||||
\brief Definition of the QGotoLineDialog class
|
||||
|
||||
\see QGotoLineDialog
|
||||
\file qcodebuffer.h
|
||||
\brief Definition of the QCodeBuffer class.
|
||||
*/
|
||||
|
||||
#include "ui_gotolinedialog.h"
|
||||
|
||||
#include <QDialog>
|
||||
|
||||
class QEditor;
|
||||
|
||||
class QCE_EXPORT QGotoLineDialog : public QDialog, private Ui::GotoDialog {
|
||||
Q_OBJECT
|
||||
#include <QByteArray>
|
||||
|
||||
class QCM_EXPORT QCodeBuffer : public QCodeStream {
|
||||
public:
|
||||
QGotoLineDialog(QWidget *w = 0);
|
||||
QCodeBuffer(const QString &s);
|
||||
QCodeBuffer(const QByteArray &s);
|
||||
|
||||
public slots:
|
||||
void exec(QEditor *e);
|
||||
virtual char getChar();
|
||||
virtual void ungetChar(char c);
|
||||
|
||||
virtual QByteArray readLine();
|
||||
|
||||
private:
|
||||
int iPos;
|
||||
QByteArray sBuffer;
|
||||
};
|
||||
|
||||
#endif // _QGOTO_LINE__DIALOG_H_
|
||||
#endif // _QCODE_BUFFER_H_
|
|
@ -0,0 +1,110 @@
|
|||
/****************************************************************************
|
||||
**
|
||||
** 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 "qcodedevice.h"
|
||||
|
||||
/*!
|
||||
\file qcodedevice.cpp
|
||||
\brief Implementation of the QcodeDevice class.
|
||||
*/
|
||||
|
||||
#include <QDir>
|
||||
#include <QFile>
|
||||
#include <QFileInfo>
|
||||
#include <QStringList>
|
||||
|
||||
QString stripped(const QString &s) { return QDir::cleanPath(s); }
|
||||
|
||||
QString makeAbsolute(const QString &rel, const QString &abs) {
|
||||
if (QFileInfo(rel).isAbsolute())
|
||||
return stripped(rel);
|
||||
|
||||
QFileInfo info(abs);
|
||||
QStringList ref, mov = QString(rel).replace("\\", "/").split("/");
|
||||
ref = (info.isFile() ? info.absolutePath() : info.absoluteFilePath())
|
||||
.replace("\\", "/")
|
||||
.split("/");
|
||||
|
||||
foreach (QString s, mov) {
|
||||
if (s == ".")
|
||||
continue;
|
||||
|
||||
if (s == "..") {
|
||||
if (ref.count())
|
||||
ref.removeLast();
|
||||
} else {
|
||||
ref << s;
|
||||
}
|
||||
}
|
||||
|
||||
return stripped(ref.join("/"));
|
||||
}
|
||||
|
||||
/*!
|
||||
\class QCodeDevice
|
||||
\brief Code stream that operates on local files
|
||||
*/
|
||||
|
||||
/*!
|
||||
|
||||
*/
|
||||
QCodeDevice::QCodeDevice(const QString &f) : m_pos(0), m_beg(0) {
|
||||
setContextFile(f);
|
||||
|
||||
QFile file(f);
|
||||
|
||||
if (file.open(QFile::ReadOnly | QFile::Text)) {
|
||||
buffer = file.readAll();
|
||||
} else {
|
||||
qWarning("Device not found : %s", qPrintable(f));
|
||||
}
|
||||
}
|
||||
|
||||
bool QCodeDevice::tryFetchOtherContext(const QString &f) {
|
||||
m_pos = 0;
|
||||
m_beg = 0;
|
||||
buffer.clear();
|
||||
|
||||
QString fn = makeAbsolute(f, contextFile());
|
||||
QFile file(fn);
|
||||
|
||||
if (!file.open(QFile::ReadOnly | QFile::Text)) {
|
||||
qWarning("Unable to read %s", qPrintable(fn));
|
||||
return false;
|
||||
}
|
||||
|
||||
buffer = file.readAll();
|
||||
setContextFile(fn);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
char QCodeDevice::getChar() {
|
||||
return (m_pos < buffer.length()) ? buffer.at(m_pos++) : 0;
|
||||
}
|
||||
|
||||
void QCodeDevice::ungetChar(char) {
|
||||
if (m_beg >= m_pos)
|
||||
return;
|
||||
|
||||
--m_pos;
|
||||
}
|
||||
|
||||
QByteArray QCodeDevice::readLine() {
|
||||
QByteArray b = buffer.mid(buffer.indexOf('\n', m_pos) - m_pos);
|
||||
|
||||
m_pos += b.length();
|
||||
return b;
|
||||
}
|
|
@ -0,0 +1,44 @@
|
|||
/****************************************************************************
|
||||
**
|
||||
** 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_DEVICE_H_
|
||||
#define _QCODE_DEVICE_H_
|
||||
|
||||
#include "qcodestream.h"
|
||||
|
||||
/*!
|
||||
\file qcodedevice.h
|
||||
\brief Definition of the QCodeDevice class.
|
||||
*/
|
||||
|
||||
class QIODevice;
|
||||
|
||||
class QCM_EXPORT QCodeDevice : public QCodeStream {
|
||||
public:
|
||||
QCodeDevice(const QString &f);
|
||||
|
||||
virtual char getChar();
|
||||
virtual void ungetChar(char c);
|
||||
|
||||
virtual QByteArray readLine();
|
||||
|
||||
virtual bool tryFetchOtherContext(const QString &f);
|
||||
|
||||
private:
|
||||
int m_pos, m_beg;
|
||||
QByteArray buffer;
|
||||
};
|
||||
|
||||
#endif // _QCODE_DEVICE_H_
|
|
@ -0,0 +1,44 @@
|
|||
/****************************************************************************
|
||||
**
|
||||
** 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 "qcodelexer.h"
|
||||
|
||||
/*!
|
||||
\file qcodelexer.cpp
|
||||
\brief Implementation of the QCodeLexer class.
|
||||
*/
|
||||
|
||||
#include "qcodestream.h"
|
||||
|
||||
/*!
|
||||
\class QCodeLexer
|
||||
\brief Base class for code lexers
|
||||
*/
|
||||
|
||||
QCodeLexer::QCodeLexer() {}
|
||||
|
||||
QCodeLexer::QCodeLexer(QCodeStream *s) : input(s) {}
|
||||
|
||||
QCodeLexer::~QCodeLexer() {}
|
||||
|
||||
void QCodeLexer::setInput(QCodeStream *s, LexMode m) {
|
||||
Q_UNUSED(m)
|
||||
|
||||
input = s;
|
||||
}
|
||||
|
||||
QString QCodeLexer::contextFile() const {
|
||||
return input ? input->contextFile() : QString();
|
||||
}
|
|
@ -0,0 +1,54 @@
|
|||
/****************************************************************************
|
||||
**
|
||||
** 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_LEXER_H_
|
||||
#define _QCODE_LEXER_H_
|
||||
|
||||
#include "qcm-config.h"
|
||||
|
||||
/*!
|
||||
\file qcodelexer.h
|
||||
\brief Definition of the QCodeLexer class.
|
||||
*/
|
||||
|
||||
#include <QByteArray>
|
||||
#include <QList>
|
||||
|
||||
class QCodeStream;
|
||||
|
||||
class QCM_EXPORT QCodeLexer {
|
||||
public:
|
||||
enum LexMode { Normal, KeepLineSeparators };
|
||||
|
||||
QCodeLexer();
|
||||
QCodeLexer(QCodeStream *s);
|
||||
virtual ~QCodeLexer();
|
||||
|
||||
virtual void setInput(QCodeStream *s, LexMode m = Normal);
|
||||
|
||||
virtual QToken nextToken() = 0;
|
||||
virtual QToken previousToken() = 0;
|
||||
|
||||
virtual QTokenList tokens() = 0;
|
||||
|
||||
virtual int lineForToken(int tokenId, int minLine = 0) const = 0;
|
||||
|
||||
QString contextFile() const;
|
||||
|
||||
protected:
|
||||
QCodeStream *input;
|
||||
};
|
||||
|
||||
#endif // _QCODE_LEXER_H_
|
|
@ -0,0 +1,238 @@
|
|||
/****************************************************************************
|
||||
**
|
||||
** 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 "qcodeloader.h"
|
||||
|
||||
/*!
|
||||
\file qcodeloader.cpp
|
||||
\brief Implementation of the QCodeLoader class.
|
||||
*/
|
||||
|
||||
#include "qcodemodel.h"
|
||||
#include "qcodenode.h"
|
||||
#include "qcodeparser.h"
|
||||
|
||||
#include <QByteArray>
|
||||
#include <QFileInfo>
|
||||
#include <QTimer>
|
||||
|
||||
/*!
|
||||
\class QCodeLoader
|
||||
\brief A parsers management class
|
||||
|
||||
QCodeLoader owns a collection of QCodeParser object
|
||||
and request them to generate project trees from files.
|
||||
*/
|
||||
|
||||
/*!
|
||||
\brief ctor
|
||||
*/
|
||||
QCodeLoader::QCodeLoader(QObject *p) : QThread(p) {}
|
||||
|
||||
/*!
|
||||
\brief dtor
|
||||
*/
|
||||
QCodeLoader::~QCodeLoader() {
|
||||
// qDeleteAll(m_parsers);
|
||||
}
|
||||
|
||||
/*!
|
||||
\brief Add a parser to the collection
|
||||
|
||||
\warning The parser is not taken over. It won't get deleted
|
||||
from QCodeLoader dtor.
|
||||
*/
|
||||
void QCodeLoader::addParser(QCodeParser *p) {
|
||||
if (!m_parsers.contains(p))
|
||||
m_parsers << p;
|
||||
}
|
||||
|
||||
/*!
|
||||
\brief Remove a parser from the collection
|
||||
|
||||
\warning The parser is NOT deleted.
|
||||
*/
|
||||
void QCodeLoader::removeParser(QCodeParser *p) { m_parsers.removeAll(p); }
|
||||
|
||||
/*!
|
||||
\brief Update the content of a given node to
|
||||
*/
|
||||
void QCodeLoader::update(QCodeNode *group, const QString &file) {
|
||||
if (!group)
|
||||
return;
|
||||
|
||||
if (!QFile::exists(file)) {
|
||||
QStack<QCodeNode *> l;
|
||||
|
||||
l.push(group);
|
||||
|
||||
while (l.count()) {
|
||||
QCodeNode *n = l.pop();
|
||||
|
||||
if (n->context() == file) {
|
||||
QCodeNode *p = n->parent;
|
||||
|
||||
n->detach();
|
||||
delete n;
|
||||
|
||||
while (p && p->children.isEmpty() && (p != group)) {
|
||||
n = p;
|
||||
p = p->parent;
|
||||
|
||||
n->detach();
|
||||
delete n;
|
||||
}
|
||||
} else {
|
||||
foreach (QCodeNode *c, n->children)
|
||||
l.push(c);
|
||||
}
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
// qDebug("update(%s, %s)", group->role(QCodeNode::Name).constData(),
|
||||
// qPrintable(file));
|
||||
|
||||
foreach (QCodeParser *p, m_parsers) {
|
||||
if (!p->canParse(file))
|
||||
continue;
|
||||
|
||||
QCodeNode *ln = 0;
|
||||
QByteArray roles("l@");
|
||||
roles += p->language().toLocal8Bit();
|
||||
|
||||
foreach (QCodeNode *c, group->children) {
|
||||
if (c->roles == roles) {
|
||||
ln = c;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (!ln) {
|
||||
ln = p->getNode();
|
||||
ln->roles = roles;
|
||||
ln->attach(group);
|
||||
}
|
||||
|
||||
p->update(ln, file);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/*!
|
||||
\brief Attempt to open load class hierarchy from a set of files
|
||||
\return true on success
|
||||
\param group Name of the toplevel group which will get created on
|
||||
success \param files Files to load \param dest Destination model
|
||||
*/
|
||||
bool QCodeLoader::load(const QString &group, QStringList files,
|
||||
QCodeModel *dest) {
|
||||
// qDebug("load(%s, (%s), %p)", qPrintable(group), qPrintable(files.join(",
|
||||
// ")), dest);
|
||||
bool done = false;
|
||||
|
||||
QCodeNode *g = new QCodeNode;
|
||||
g->roles = QByteArray("g@") + QFileInfo(group).fileName().toLocal8Bit() +
|
||||
"@" + group.toLocal8Bit();
|
||||
dest->appendTopLevelNode(g);
|
||||
|
||||
foreach (QCodeParser *p, m_parsers) {
|
||||
QStringList lf;
|
||||
|
||||
foreach (QString fn, files)
|
||||
if (p->canParse(fn))
|
||||
lf << fn;
|
||||
|
||||
if (lf.isEmpty())
|
||||
continue;
|
||||
|
||||
done = true;
|
||||
break;
|
||||
}
|
||||
|
||||
if (!done)
|
||||
return false;
|
||||
|
||||
OpenRequest r;
|
||||
r.files = files;
|
||||
r.group = group;
|
||||
r.model = dest;
|
||||
|
||||
m_request.enqueue(r);
|
||||
|
||||
if (!isRunning())
|
||||
QTimer::singleShot(0, this, SLOT(start()));
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/*!
|
||||
\internal
|
||||
*/
|
||||
void QCodeLoader::run() {
|
||||
QTimer::singleShot(0, this, SLOT(process()));
|
||||
|
||||
exec();
|
||||
|
||||
// process();
|
||||
}
|
||||
|
||||
/*!
|
||||
\internal
|
||||
*/
|
||||
void QCodeLoader::process() {
|
||||
while (m_request.count()) {
|
||||
OpenRequest r = m_request.dequeue();
|
||||
|
||||
bool done = false;
|
||||
|
||||
QCodeNode *g;
|
||||
QList<QCodeNode *> gl = r.model->topLevelNodes();
|
||||
|
||||
foreach (g, gl) {
|
||||
if (g->role(QCodeNode::Context) != r.group)
|
||||
continue;
|
||||
|
||||
foreach (QCodeParser *p, m_parsers) {
|
||||
QStringList lf;
|
||||
|
||||
foreach (QString fn, r.files)
|
||||
if (p->canParse(fn))
|
||||
lf << fn;
|
||||
|
||||
if (lf.isEmpty())
|
||||
continue;
|
||||
|
||||
done = true;
|
||||
|
||||
QCodeNode *ln = p->getNode();
|
||||
ln->roles = QByteArray("l@") + p->language().toLocal8Bit();
|
||||
|
||||
foreach (QString fn, lf) {
|
||||
r.files.removeAll(fn);
|
||||
|
||||
p->update(ln, fn);
|
||||
}
|
||||
|
||||
ln->attach(g);
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
quit();
|
||||
}
|
|
@ -0,0 +1,66 @@
|
|||
/****************************************************************************
|
||||
**
|
||||
** 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_LOADER_H_
|
||||
#define _QCODE_LOADER_H_
|
||||
|
||||
#include "qcm-config.h"
|
||||
|
||||
/*!
|
||||
\file qcodeloader.h
|
||||
\brief Definition of the QCodeLoader class.
|
||||
*/
|
||||
|
||||
#include <QList>
|
||||
#include <QQueue>
|
||||
#include <QStringList>
|
||||
#include <QThread>
|
||||
|
||||
struct QCodeNode;
|
||||
class QCodeModel;
|
||||
class QCodeParser;
|
||||
|
||||
class QCM_EXPORT QCodeLoader : public QThread {
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
QCodeLoader(QObject *p = 0);
|
||||
virtual ~QCodeLoader();
|
||||
|
||||
public slots:
|
||||
void update(QCodeNode *group, const QString &file);
|
||||
bool load(const QString &group, QStringList files, QCodeModel *dest);
|
||||
|
||||
void addParser(QCodeParser *p);
|
||||
void removeParser(QCodeParser *p);
|
||||
|
||||
protected:
|
||||
virtual void run();
|
||||
|
||||
protected slots:
|
||||
virtual void process();
|
||||
|
||||
private:
|
||||
struct OpenRequest {
|
||||
QString group;
|
||||
QStringList files;
|
||||
QCodeModel *model;
|
||||
};
|
||||
|
||||
QQueue<OpenRequest> m_request;
|
||||
QList<QCodeParser *> m_parsers;
|
||||
};
|
||||
|
||||
#endif // !_QCODE_LOADER_H_
|
|
@ -0,0 +1,500 @@
|
|||
/****************************************************************************
|
||||
**
|
||||
** 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 "qcodemodel.h"
|
||||
|
||||
/*!
|
||||
\file qcodemodel.cpp
|
||||
\brief Implementation of the QCodeModel class.
|
||||
*/
|
||||
|
||||
#include "qcodeloader.h"
|
||||
#include "qcodenode.h"
|
||||
#include "qcodeparser.h"
|
||||
|
||||
#define Q_EXTRACT_INDEX(i, d) \
|
||||
QCodeNode *d = static_cast<QCodeNode *>(i.internalPointer());
|
||||
|
||||
#include <QStack>
|
||||
|
||||
void QCodeModel::q_cache(QCodeNode *n, QByteArray cxt = QByteArray()) {
|
||||
if (isCachable(n, cxt)) {
|
||||
m_cache.insert(cxt, n);
|
||||
|
||||
// qDebug("Caching %s [0x%x] in 0x%x", cxt.constData(), n, this);
|
||||
}
|
||||
|
||||
foreach (QCodeNode *child, n->children)
|
||||
q_cache(child, cxt);
|
||||
}
|
||||
|
||||
void QCodeModel::q_uncache(QCodeNode *n, QByteArray cxt = QByteArray()) {
|
||||
if (isCachable(n, cxt)) {
|
||||
m_cache.remove(cxt);
|
||||
|
||||
// qDebug("De-Caching %s", cxt.constData());
|
||||
}
|
||||
|
||||
foreach (QCodeNode *child, n->children)
|
||||
q_uncache(child, cxt);
|
||||
}
|
||||
|
||||
/*!
|
||||
\class QCodeModel
|
||||
\brief Class used to store code hierarchies and display them through
|
||||
model/view
|
||||
*/
|
||||
|
||||
/*!
|
||||
\brief ctor
|
||||
*/
|
||||
QCodeModel::QCodeModel(QObject *p) : QAbstractItemModel(p), m_loader(0) {}
|
||||
|
||||
/*!
|
||||
\brief dtor
|
||||
*/
|
||||
QCodeModel::~QCodeModel() { clearTopLevelNodes(); }
|
||||
|
||||
/*!
|
||||
\return A list of code nodes occupying the top level of the model
|
||||
(unparented ones)
|
||||
*/
|
||||
QList<QCodeNode *> QCodeModel::topLevelNodes() const { return m_topLevel; }
|
||||
|
||||
/*!
|
||||
\return The current code loader used by this model
|
||||
*/
|
||||
QCodeLoader *QCodeModel::codeLoader() const { return m_loader; }
|
||||
|
||||
/*!
|
||||
\brief Set the code loader used by this model
|
||||
*/
|
||||
void QCodeModel::setCodeLoader(QCodeLoader *p) { m_loader = p; }
|
||||
|
||||
/*!
|
||||
\brief Update a file within a group
|
||||
\param group group of files to remove (as passed to addGroup())
|
||||
\param file file to update
|
||||
*/
|
||||
void QCodeModel::updateGroup(const QString &group, const QString &file) {
|
||||
QByteArray grp = group.toLocal8Bit();
|
||||
|
||||
foreach (QCodeNode *n, m_topLevel) {
|
||||
// qDebug("group %s ?", n->context().constData());
|
||||
|
||||
if (n->role(QCodeNode::Context) == grp) {
|
||||
m_loader->update(n, file);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
// qDebug("group %s not found", qPrintable(group));
|
||||
}
|
||||
|
||||
/*!
|
||||
\brief Add a group of files of whathever type (typically from a project)
|
||||
\param group group of files to add
|
||||
\param files list of files to load to populate the tree
|
||||
*/
|
||||
void QCodeModel::addGroup(const QString &group, const QStringList &files) {
|
||||
if (!m_loader)
|
||||
return;
|
||||
|
||||
foreach (QCodeNode *n, m_topLevel)
|
||||
if (n->context() == group)
|
||||
return;
|
||||
|
||||
// qDebug("loading %i files into group %s", files.count(),
|
||||
// qPrintable(group));
|
||||
m_loader->load(group, files, this);
|
||||
}
|
||||
|
||||
/*!
|
||||
\brief Remove a group of files from the model
|
||||
\param group group of files to remove (as passed to addGroup())
|
||||
*/
|
||||
void QCodeModel::removeGroup(const QString &group) {
|
||||
foreach (QCodeNode *n, m_topLevel) {
|
||||
if (n->role(QCodeNode::Context) == group) {
|
||||
removeTopLevelNode(n);
|
||||
delete n;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*!
|
||||
\brief Please read Qt docs on Model/View framework for more informations
|
||||
*/
|
||||
void QCodeModel::beginInsertRows(const QModelIndex idx, int beg, int end) {
|
||||
QAbstractItemModel::beginInsertRows(idx, beg, end);
|
||||
|
||||
Q_EXTRACT_INDEX(idx, parent)
|
||||
|
||||
m_cache_ops.push(CacheOp(parent, beg, end));
|
||||
}
|
||||
|
||||
/*!
|
||||
\brief Please read Qt docs on Model/View framework for more informations
|
||||
*/
|
||||
void QCodeModel::beginRemoveRows(const QModelIndex idx, int beg, int end) {
|
||||
QAbstractItemModel::beginRemoveRows(idx, beg, end);
|
||||
|
||||
Q_EXTRACT_INDEX(idx, parent)
|
||||
|
||||
const QList<QCodeNode *> &l = parent ? parent->children : m_topLevel;
|
||||
|
||||
QByteArray cxt;
|
||||
|
||||
if (parent)
|
||||
cxt = parent->qualifiedName();
|
||||
|
||||
// qDebug("uncaching %i out of %i", l.count(), end - beg + 1);
|
||||
|
||||
for (int i = beg; (i <= end) && (i < l.count()); ++i)
|
||||
q_uncache(l.at(i), cxt);
|
||||
}
|
||||
|
||||
/*!
|
||||
\brief Please read Qt docs on Model/View framework for more informations
|
||||
*/
|
||||
void QCodeModel::endInsertRows() {
|
||||
if (m_cache_ops.count()) {
|
||||
CacheOp op = m_cache_ops.pop();
|
||||
|
||||
const QList<QCodeNode *> &l =
|
||||
op.parent ? op.parent->children : m_topLevel;
|
||||
|
||||
QByteArray cxt;
|
||||
|
||||
if (op.parent)
|
||||
cxt = op.parent->qualifiedName();
|
||||
|
||||
for (int i = op.begin; i <= op.end; ++i)
|
||||
q_cache(l.at(i), cxt);
|
||||
} else {
|
||||
// qDebug("Odd things happenning over there...");
|
||||
}
|
||||
|
||||
QAbstractItemModel::endInsertRows();
|
||||
}
|
||||
|
||||
/*!
|
||||
\brief Please read Qt docs on Model/View framework for more informations
|
||||
*/
|
||||
void QCodeModel::endRemoveRows() { QAbstractItemModel::endRemoveRows(); }
|
||||
|
||||
/*!
|
||||
\brief Append a top level code node to the model
|
||||
*/
|
||||
void QCodeModel::appendTopLevelNode(QCodeNode *n) {
|
||||
if (!n)
|
||||
return;
|
||||
|
||||
int row = m_topLevel.count();
|
||||
|
||||
beginInsertRows(QModelIndex(), row, row);
|
||||
|
||||
m_topLevel.insert(row, n);
|
||||
|
||||
QStack<QCodeNode *> nodes;
|
||||
nodes.push(n);
|
||||
|
||||
while (nodes.count()) {
|
||||
n = nodes.pop();
|
||||
n->model = this;
|
||||
|
||||
foreach (QCodeNode *c, n->children)
|
||||
nodes.push(c);
|
||||
}
|
||||
|
||||
endInsertRows();
|
||||
}
|
||||
|
||||
/*!
|
||||
\brief remove a top level code node from the model
|
||||
*/
|
||||
void QCodeModel::removeTopLevelNode(QCodeNode *n) {
|
||||
int row = n ? m_topLevel.indexOf(n) : -1;
|
||||
|
||||
if (row == -1)
|
||||
return;
|
||||
|
||||
beginRemoveRows(QModelIndex(), row, row);
|
||||
|
||||
m_topLevel.removeAt(row);
|
||||
|
||||
QStack<QCodeNode *> nodes;
|
||||
nodes.push(n);
|
||||
|
||||
while (nodes.count()) {
|
||||
n = nodes.pop();
|
||||
n->model = 0;
|
||||
|
||||
foreach (QCodeNode *c, n->children)
|
||||
nodes.push(c);
|
||||
}
|
||||
|
||||
endRemoveRows();
|
||||
}
|
||||
|
||||
/*!
|
||||
\brief remove all top level nodes from the model
|
||||
\warning All the nodes get DELETED.
|
||||
*/
|
||||
void QCodeModel::clearTopLevelNodes() {
|
||||
int row = m_topLevel.count() - 1;
|
||||
|
||||
if (row == -1)
|
||||
return;
|
||||
|
||||
beginRemoveRows(QModelIndex(), 0, row);
|
||||
|
||||
qDeleteAll(m_topLevel);
|
||||
m_topLevel.clear();
|
||||
|
||||
/*
|
||||
QCodeNode *n;
|
||||
QStack<QCodeNode*> nodes;
|
||||
|
||||
foreach ( n, m_topLevel )
|
||||
nodes.push(n);
|
||||
|
||||
while ( nodes.count() )
|
||||
{
|
||||
n = nodes.pop();
|
||||
n->model = 0;
|
||||
|
||||
foreach ( QCodeNode *c, n->children )
|
||||
nodes.push(c);
|
||||
}
|
||||
*/
|
||||
|
||||
endRemoveRows();
|
||||
}
|
||||
|
||||
/*!
|
||||
\brief Find a node in the internal cache
|
||||
\param language concerned programming language
|
||||
\param name bare name of the node (e.g class name, typedef, function
|
||||
name, variable name, ...) \return the first node found or 0 if none matching
|
||||
*/
|
||||
QCodeNode *QCodeModel::findNode(const QByteArray &language,
|
||||
const QByteArray &name) {
|
||||
QByteArray id = name;
|
||||
|
||||
if (language.length())
|
||||
id.prepend("::").prepend(language);
|
||||
|
||||
QHash<QByteArray, QCodeNode *>::const_iterator i = m_cache.constFind(id);
|
||||
|
||||
if (i != m_cache.constEnd()) {
|
||||
// qDebug("%s found... [%s] : 0x%x", name.constData(), id.constData(),
|
||||
// *i);
|
||||
return *i;
|
||||
}
|
||||
|
||||
// qDebug("%s not found... [%s]", name.constData(), id.constData());
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*!
|
||||
\brief Find nodes in the internal cache
|
||||
\param name prefix to match against the bare name of the nodes (e.g
|
||||
class name, typedef, function name, variable name, ...) \return the first
|
||||
node found or 0 if none matching
|
||||
*/
|
||||
QList<QCodeNode *> QCodeModel::findRootNodes(const QByteArray &name) {
|
||||
QList<QCodeNode *> l;
|
||||
|
||||
foreach (QCodeNode *g, m_topLevel)
|
||||
foreach (QCodeNode *r, g->children)
|
||||
if (r->role(QCodeNode::Name) == name)
|
||||
l << r;
|
||||
|
||||
return l;
|
||||
}
|
||||
|
||||
/*!
|
||||
\return whether the given node is worth caching
|
||||
\param n node to test
|
||||
\param cxt cache context
|
||||
*/
|
||||
bool QCodeModel::isCachable(QCodeNode *n, QByteArray &cxt) const {
|
||||
int t = n->type();
|
||||
QByteArray qn = n->role(QCodeNode::Name);
|
||||
|
||||
if (cxt.length())
|
||||
qn.prepend("::");
|
||||
|
||||
if (cxt.isEmpty() && (t != QCodeNode::Group)) {
|
||||
cxt += qn;
|
||||
|
||||
return true;
|
||||
} else if ((t == QCodeNode::Enum) || (t == QCodeNode::Union) ||
|
||||
(t == QCodeNode::Class) || (t == QCodeNode::Struct) ||
|
||||
(t == QCodeNode::Typedef)) {
|
||||
cxt += qn;
|
||||
|
||||
return true;
|
||||
} else if (t == QCodeNode::Namespace) {
|
||||
|
||||
cxt += qn;
|
||||
|
||||
return true;
|
||||
|
||||
} else if (t == QCodeNode::Language) {
|
||||
|
||||
cxt += n->role(QCodeNode::Name); // + "/";
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/*!
|
||||
\brief Please read Qt docs on Model/View framework for more informations
|
||||
*/
|
||||
bool QCodeModel::hasChildren(const QModelIndex &parent) const {
|
||||
return rowCount(parent);
|
||||
}
|
||||
|
||||
/*!
|
||||
\brief Please read Qt docs on Model/View framework for more informations
|
||||
*/
|
||||
int QCodeModel::rowCount(const QModelIndex &parent) const {
|
||||
if (!parent.isValid())
|
||||
return m_topLevel.count();
|
||||
|
||||
Q_EXTRACT_INDEX(parent, item)
|
||||
|
||||
return item ? item->children.count() : 0;
|
||||
}
|
||||
|
||||
/*!
|
||||
\brief Please read Qt docs on Model/View framework for more informations
|
||||
*/
|
||||
int QCodeModel::columnCount(const QModelIndex &) const { return 1; }
|
||||
|
||||
/*!
|
||||
\brief Please read Qt docs on Model/View framework for more informations
|
||||
*/
|
||||
QVariant QCodeModel::data(const QModelIndex &index, int role) const {
|
||||
if (!index.isValid() || index.column())
|
||||
return QVariant();
|
||||
|
||||
Q_EXTRACT_INDEX(index, item)
|
||||
|
||||
return item ? item->data(role) : QVariant();
|
||||
}
|
||||
|
||||
/*!
|
||||
\brief Please read Qt docs on Model/View framework for more informations
|
||||
*/
|
||||
Qt::ItemFlags QCodeModel::flags(const QModelIndex &index) const {
|
||||
if (!index.isValid())
|
||||
return Qt::ItemIsEnabled;
|
||||
|
||||
return Qt::ItemIsSelectable | Qt::ItemIsEnabled;
|
||||
}
|
||||
|
||||
/*!
|
||||
\brief Please read Qt docs on Model/View framework for more informations
|
||||
*/
|
||||
QVariant QCodeModel::headerData(int, Qt::Orientation, int) const {
|
||||
return QVariant();
|
||||
}
|
||||
|
||||
/*!
|
||||
\brief Please read Qt docs on Model/View framework for more informations
|
||||
*/
|
||||
QCodeNode *QCodeModel::node(const QModelIndex &idx) const {
|
||||
Q_EXTRACT_INDEX(idx, n)
|
||||
|
||||
return idx.isValid() ? n : 0;
|
||||
}
|
||||
|
||||
/*!
|
||||
\brief Please read Qt docs on Model/View framework for more informations
|
||||
*/
|
||||
QModelIndex QCodeModel::index(QCodeNode *n) const {
|
||||
return n ? createIndex(n->parent ? n->parent->children.indexOf(n)
|
||||
: m_topLevel.indexOf(n),
|
||||
0, n)
|
||||
: QModelIndex();
|
||||
}
|
||||
|
||||
/*!
|
||||
\brief Please read Qt docs on Model/View framework for more informations
|
||||
*/
|
||||
QModelIndex QCodeModel::index(int row, int column,
|
||||
const QModelIndex &parent) const {
|
||||
if ((row < 0) || column)
|
||||
return QModelIndex();
|
||||
|
||||
Q_EXTRACT_INDEX(parent, item)
|
||||
QCodeNode *abs = 0;
|
||||
|
||||
// qDebug("asking index...");
|
||||
|
||||
if (!parent.isValid() && (row < m_topLevel.count())) {
|
||||
abs = m_topLevel.at(row);
|
||||
} else if (item && (row < item->children.count())) {
|
||||
abs = item->children.at(row);
|
||||
}
|
||||
|
||||
#ifdef _TRACE_MODEL_
|
||||
|
||||
qDebug("%s(%i, %i) : %s",
|
||||
item ? qPrintable(item->data(Qt::DisplayRole).toString()) : "root",
|
||||
row, column,
|
||||
abs ? qPrintable(abs->data(Qt::DisplayRole).toString()) : "!none!");
|
||||
|
||||
#endif
|
||||
|
||||
return abs ? createIndex(row, column, abs) : QModelIndex();
|
||||
}
|
||||
|
||||
/*!
|
||||
\brief Please read Qt docs on Model/View framework for more informations
|
||||
*/
|
||||
QModelIndex QCodeModel::parent(const QModelIndex &index) const {
|
||||
if (!index.isValid()) {
|
||||
return QModelIndex();
|
||||
}
|
||||
|
||||
QCodeNode *parent = 0;
|
||||
Q_EXTRACT_INDEX(index, child)
|
||||
|
||||
if (child)
|
||||
parent = child->parent;
|
||||
|
||||
#ifdef _TRACE_MODEL_
|
||||
|
||||
qDebug("%s->parent() = %s",
|
||||
child ? qPrintable(child->data(Qt::DisplayRole).toString())
|
||||
: "@invalid@",
|
||||
parent ? qPrintable(parent->data(Qt::DisplayRole).toString())
|
||||
: "!none!");
|
||||
|
||||
#endif
|
||||
|
||||
if (!parent)
|
||||
return QModelIndex();
|
||||
|
||||
const int row = parent->parent ? parent->parent->children.indexOf(parent)
|
||||
: m_topLevel.indexOf(parent);
|
||||
|
||||
return createIndex(row, 0, parent);
|
||||
}
|
|
@ -0,0 +1,103 @@
|
|||
/****************************************************************************
|
||||
**
|
||||
** 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_MODEL_H_
|
||||
#define _QCODE_MODEL_H_
|
||||
|
||||
#include "qcm-config.h"
|
||||
|
||||
#include <QAbstractItemModel>
|
||||
#include <QHash>
|
||||
#include <QStack>
|
||||
|
||||
struct QCodeNode;
|
||||
class QCodeParser;
|
||||
class QCodeLoader;
|
||||
|
||||
class QCM_EXPORT QCodeModel : public QAbstractItemModel {
|
||||
Q_OBJECT
|
||||
|
||||
friend struct QCodeNode;
|
||||
|
||||
public:
|
||||
enum ExtraRoles { TypeRole = Qt::UserRole, VisibilityRole };
|
||||
|
||||
QCodeModel(QObject *p = 0);
|
||||
virtual ~QCodeModel();
|
||||
|
||||
QVariant data(const QModelIndex &index, int role) const;
|
||||
Qt::ItemFlags flags(const QModelIndex &index) const;
|
||||
QVariant headerData(int section, Qt::Orientation orientation,
|
||||
int role = Qt::DisplayRole) const;
|
||||
|
||||
QModelIndex index(QCodeNode *n) const;
|
||||
QCodeNode *node(const QModelIndex &idx) const;
|
||||
|
||||
QModelIndex index(int row, int column,
|
||||
const QModelIndex &parent = QModelIndex()) const;
|
||||
QModelIndex parent(const QModelIndex &index) const;
|
||||
|
||||
int rowCount(const QModelIndex &parent = QModelIndex()) const;
|
||||
int columnCount(const QModelIndex &parent = QModelIndex()) const;
|
||||
bool hasChildren(const QModelIndex &parent = QModelIndex()) const;
|
||||
|
||||
QList<QCodeNode *> topLevelNodes() const;
|
||||
|
||||
void appendTopLevelNode(QCodeNode *n);
|
||||
void removeTopLevelNode(QCodeNode *n);
|
||||
void clearTopLevelNodes();
|
||||
|
||||
QList<QCodeNode *> findRootNodes(const QByteArray &name);
|
||||
QCodeNode *findNode(const QByteArray &language, const QByteArray &name);
|
||||
|
||||
virtual bool isCachable(QCodeNode *n, QByteArray &cxt) const;
|
||||
|
||||
QCodeLoader *codeLoader() const;
|
||||
void setCodeLoader(QCodeLoader *p);
|
||||
|
||||
public slots:
|
||||
void updateGroup(const QString &group, const QString &file);
|
||||
void addGroup(const QString &group, const QStringList &files);
|
||||
void removeGroup(const QString &group);
|
||||
|
||||
protected:
|
||||
void beginInsertRows(const QModelIndex idx, int beg, int end);
|
||||
void beginRemoveRows(const QModelIndex idx, int beg, int end);
|
||||
void endInsertRows();
|
||||
void endRemoveRows();
|
||||
|
||||
private:
|
||||
struct CacheOp {
|
||||
inline CacheOp() : parent(0), begin(-1), end(-1) {}
|
||||
inline CacheOp(QCodeNode *n, int b, int e)
|
||||
: parent(n), begin(b), end(e) {}
|
||||
|
||||
QCodeNode *parent;
|
||||
int begin;
|
||||
int end;
|
||||
};
|
||||
|
||||
void q_cache(QCodeNode *n, QByteArray cxt);
|
||||
void q_uncache(QCodeNode *n, QByteArray cxt);
|
||||
|
||||
QList<QCodeNode *> m_topLevel;
|
||||
|
||||
QCodeLoader *m_loader;
|
||||
|
||||
QStack<CacheOp> m_cache_ops;
|
||||
QHash<QByteArray, QCodeNode *> m_cache;
|
||||
};
|
||||
|
||||
#endif // !_QCODE_MODEL_H_
|
|
@ -0,0 +1,553 @@
|
|||
/****************************************************************************
|
||||
**
|
||||
** 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 "qcodenode.h"
|
||||
|
||||
#include <QIcon>
|
||||
#include <QVariant>
|
||||
|
||||
#include "qcodemodel.h"
|
||||
#include "qcodenodepool.h"
|
||||
|
||||
#include "qsourcecodewatcher.h"
|
||||
|
||||
enum CacheIndex {
|
||||
ICON_ENUM,
|
||||
ICON_ENUMERATOR,
|
||||
ICON_UNION,
|
||||
ICON_CLASS,
|
||||
ICON_STRUCT,
|
||||
ICON_TYPEDEF,
|
||||
ICON_NAMESPACE,
|
||||
ICON_FUNCTION = ICON_NAMESPACE + 2,
|
||||
ICON_VARIABLE = ICON_FUNCTION + 5
|
||||
};
|
||||
|
||||
static QHash<int, QIcon> q_icon_cache;
|
||||
|
||||
static QIcon icon(int cacheIndex) {
|
||||
static bool setup = false;
|
||||
|
||||
if (!setup) {
|
||||
q_icon_cache[ICON_UNION] = QIcon(":/completion/CVunion.png");
|
||||
|
||||
q_icon_cache[ICON_ENUM] = QIcon(":/completion/CVenum.png");
|
||||
q_icon_cache[ICON_ENUMERATOR] = QIcon(":/completion/CVenumerator.png");
|
||||
|
||||
q_icon_cache[ICON_CLASS] = QIcon(":/completion/CVclass.png");
|
||||
|
||||
q_icon_cache[ICON_STRUCT] = QIcon(":/completion/CVstruct.png");
|
||||
|
||||
q_icon_cache[ICON_TYPEDEF] = QIcon(":/completion/CVtypedef.png");
|
||||
|
||||
q_icon_cache[ICON_NAMESPACE] = QIcon(":/completion/CVnamespace.png");
|
||||
|
||||
q_icon_cache[ICON_FUNCTION + QCodeNode::VISIBILITY_DEFAULT] =
|
||||
QIcon(":/completion/CVglobal_meth.png");
|
||||
|
||||
q_icon_cache[ICON_FUNCTION + QCodeNode::VISIBILITY_PUBLIC] =
|
||||
QIcon(":/completion/CVpublic_meth.png");
|
||||
|
||||
q_icon_cache[ICON_FUNCTION + QCodeNode::VISIBILITY_PROTECTED] =
|
||||
QIcon(":/completion/CVprotected_meth.png");
|
||||
|
||||
q_icon_cache[ICON_FUNCTION + QCodeNode::VISIBILITY_PRIVATE] =
|
||||
QIcon(":/completion/CVprivate_meth.png");
|
||||
|
||||
q_icon_cache[ICON_FUNCTION + QCodeNode::VISIBILITY_SIGNAL] =
|
||||
QIcon(":/completion/CVprotected_signal.png");
|
||||
|
||||
q_icon_cache[ICON_VARIABLE + QCodeNode::VISIBILITY_DEFAULT] =
|
||||
QIcon(":/completion/CVglobal_var.png");
|
||||
|
||||
q_icon_cache[ICON_VARIABLE + QCodeNode::VISIBILITY_PUBLIC] =
|
||||
QIcon(":/completion/CVpublic_var.png");
|
||||
|
||||
q_icon_cache[ICON_VARIABLE + QCodeNode::VISIBILITY_PROTECTED] =
|
||||
QIcon(":/completion/CVprotected_var.png");
|
||||
|
||||
q_icon_cache[ICON_VARIABLE + QCodeNode::VISIBILITY_PRIVATE] =
|
||||
QIcon(":/completion/CVprivate_var.png");
|
||||
|
||||
setup = true;
|
||||
}
|
||||
|
||||
return q_icon_cache.value(cacheIndex);
|
||||
}
|
||||
|
||||
QByteArray section(const QByteArray &b, char c, int beg, int end = -1) {
|
||||
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 if (n->m_pool)
|
||||
n->m_pool->free(n);
|
||||
else
|
||||
::operator delete(p);
|
||||
}
|
||||
|
||||
QCodeNode::QCodeNode() : line(-1), parent(0), model(0), m_pool(0) {}
|
||||
|
||||
QCodeNode::QCodeNode(QCodeNodePool *p)
|
||||
: line(-1), parent(0), model(0), m_pool(p) {}
|
||||
|
||||
QCodeNode::~QCodeNode() {
|
||||
detach();
|
||||
|
||||
model = 0;
|
||||
parent = 0;
|
||||
m_pool = 0;
|
||||
|
||||
clear();
|
||||
|
||||
QSourceCodeWatcher *w = QSourceCodeWatcher::watcher(this, 0);
|
||||
|
||||
if (w)
|
||||
delete w;
|
||||
}
|
||||
|
||||
void QCodeNode::attach(QCodeNode *p) {
|
||||
detach();
|
||||
|
||||
if (!p || p->children.contains(this))
|
||||
return;
|
||||
|
||||
bool modelChange = model != p->model;
|
||||
|
||||
if (modelChange) {
|
||||
QStack<QCodeNode *> tree;
|
||||
|
||||
tree.push(this);
|
||||
|
||||
while (tree.length()) {
|
||||
QCodeNode *n = tree.pop();
|
||||
|
||||
n->model = p->model;
|
||||
|
||||
foreach (QCodeNode *c, n->children)
|
||||
tree.push(c);
|
||||
}
|
||||
}
|
||||
|
||||
int row = p->children.length();
|
||||
|
||||
if (model)
|
||||
model->beginInsertRows(model->index(p), row, row);
|
||||
|
||||
parent = p;
|
||||
p->children.insert(row, this);
|
||||
|
||||
if (model)
|
||||
model->endInsertRows();
|
||||
}
|
||||
|
||||
void QCodeNode::detach() {
|
||||
if (!parent)
|
||||
return;
|
||||
|
||||
int row = parent->children.indexOf(this);
|
||||
|
||||
if (row < 0)
|
||||
return;
|
||||
|
||||
if (model)
|
||||
model->beginRemoveRows(model->index(parent), row, row);
|
||||
|
||||
parent->children.removeAt(row);
|
||||
parent = 0;
|
||||
|
||||
if (model)
|
||||
model->endRemoveRows();
|
||||
|
||||
if (model) {
|
||||
QStack<QCodeNode *> tree;
|
||||
|
||||
tree.push(this);
|
||||
|
||||
while (tree.length()) {
|
||||
QCodeNode *n = tree.pop();
|
||||
|
||||
n->model = 0;
|
||||
|
||||
foreach (QCodeNode *c, n->children)
|
||||
tree.push(c);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void QCodeNode::clear() {
|
||||
QList<QCodeNode *> c = children;
|
||||
|
||||
removeAll();
|
||||
|
||||
qDeleteAll(c);
|
||||
}
|
||||
|
||||
void QCodeNode::removeAll() {
|
||||
if (children.isEmpty())
|
||||
return;
|
||||
|
||||
if (model)
|
||||
model->beginRemoveRows(model->index(this), 0, children.length() - 1);
|
||||
|
||||
foreach (QCodeNode *n, children) {
|
||||
n->model = 0;
|
||||
n->parent = 0;
|
||||
}
|
||||
|
||||
children.clear();
|
||||
|
||||
if (model)
|
||||
model->endRemoveRows();
|
||||
}
|
||||
|
||||
int QCodeNode::type() const {
|
||||
return roles.length() ? role(NodeType).at(0) : 0;
|
||||
}
|
||||
|
||||
QByteArray QCodeNode::context() const {
|
||||
int t = type();
|
||||
|
||||
if ((t == Group) || (t == Language) || (t == Namespace))
|
||||
return QByteArray();
|
||||
|
||||
const QCodeNode *p = this;
|
||||
|
||||
while (p->parent) {
|
||||
int t = p->parent->type();
|
||||
|
||||
if ((t == Group) || (t == Language) || (t == Namespace))
|
||||
break;
|
||||
|
||||
p = p->parent;
|
||||
}
|
||||
|
||||
return p ? p->role(Context) : role(Context);
|
||||
}
|
||||
|
||||
QByteArray QCodeNode::qualifiedName(bool language) const {
|
||||
int t = type();
|
||||
|
||||
if (t == Group)
|
||||
return QByteArray();
|
||||
else if (t == Language)
|
||||
return language ? role(Name) : QByteArray();
|
||||
|
||||
QByteArray cxt = parent ? parent->qualifiedName(language) : QByteArray();
|
||||
|
||||
if (cxt.length()) {
|
||||
// if ( parent->type() == Language )
|
||||
// cxt += "/";
|
||||
// else
|
||||
cxt += "::";
|
||||
}
|
||||
|
||||
// cxt += role(Name);
|
||||
|
||||
cxt += role(Name);
|
||||
|
||||
if (t == Function) {
|
||||
cxt += "(";
|
||||
cxt += role(Arguments);
|
||||
cxt += ")";
|
||||
}
|
||||
|
||||
return cxt;
|
||||
}
|
||||
|
||||
QVariant QCodeNode::data(int r) const {
|
||||
const int t = type();
|
||||
|
||||
switch (r) {
|
||||
case Qt::DisplayRole: {
|
||||
if (t == Function)
|
||||
return role(Name) + "(" + role(Arguments) + ")";
|
||||
|
||||
// if ( t == Enumerator )
|
||||
// ;
|
||||
|
||||
return role(Name);
|
||||
}
|
||||
|
||||
case Qt::ToolTipRole:
|
||||
case Qt::StatusTipRole: {
|
||||
switch (t) {
|
||||
case Class: {
|
||||
QByteArray d("class ");
|
||||
d += role(Name);
|
||||
|
||||
QByteArray a = role(Ancestors);
|
||||
|
||||
if (a.length())
|
||||
d += " : " + a;
|
||||
|
||||
return d;
|
||||
}
|
||||
|
||||
case Struct: {
|
||||
QByteArray d("struct ");
|
||||
d += role(Name);
|
||||
|
||||
QByteArray a = role(Ancestors);
|
||||
|
||||
if (a.length())
|
||||
d += " : " + a;
|
||||
|
||||
return d;
|
||||
}
|
||||
|
||||
case Enum:
|
||||
return QByteArray("enum ") + role(Name);
|
||||
|
||||
case Enumerator:
|
||||
return role(Name) + " = " + role(Value);
|
||||
|
||||
case Union:
|
||||
return QByteArray("union ") + role(Name);
|
||||
|
||||
case Namespace:
|
||||
return QByteArray("namespace ") + role(Name);
|
||||
|
||||
case Typedef:
|
||||
return QByteArray("typedef ") + role(Alias) + " " + role(Name);
|
||||
|
||||
case Variable: {
|
||||
QByteArray signature, specifier;
|
||||
|
||||
signature += role(Type);
|
||||
signature += " ";
|
||||
signature += role(Name);
|
||||
|
||||
int m_visibility = role(Visibility).toInt();
|
||||
int m_specifiers = role(Specifiers).toInt();
|
||||
|
||||
// visibility (for class members)
|
||||
if (m_visibility == QCodeNode::VISIBILITY_PUBLIC)
|
||||
specifier = " public ";
|
||||
else if (m_visibility == QCodeNode::VISIBILITY_PROTECTED)
|
||||
specifier = " protected ";
|
||||
else
|
||||
specifier = " private ";
|
||||
|
||||
// storage class
|
||||
if (m_specifiers & QCodeNode::SPECIFIER_AUTO)
|
||||
specifier += " auto ";
|
||||
else if (m_specifiers & QCodeNode::SPECIFIER_REGISTER)
|
||||
specifier += " register ";
|
||||
else if (m_specifiers & QCodeNode::SPECIFIER_STATIC)
|
||||
specifier += " static ";
|
||||
else if (m_specifiers & QCodeNode::SPECIFIER_EXTERN)
|
||||
specifier += " extern ";
|
||||
else if (m_specifiers & QCodeNode::SPECIFIER_MUTABLE)
|
||||
specifier += " mutable ";
|
||||
|
||||
// cv qualifier (for class members)
|
||||
if (m_specifiers & QCodeNode::SPECIFIER_CONST)
|
||||
specifier += " const ";
|
||||
else if (m_specifiers & QCodeNode::SPECIFIER_VOLATILE)
|
||||
specifier += " volatile ";
|
||||
|
||||
if (specifier.length())
|
||||
signature += " [" + specifier.simplified() + "]";
|
||||
|
||||
return signature;
|
||||
// return role(Type) + " " + role(Name);
|
||||
}
|
||||
|
||||
case Function: {
|
||||
QByteArray signature, qualifier, ret = role(Return);
|
||||
|
||||
if (ret.length())
|
||||
signature += ret + " ";
|
||||
|
||||
signature += role(Name);
|
||||
|
||||
signature += "(";
|
||||
signature += role(Arguments);
|
||||
signature += ")";
|
||||
|
||||
int m_qualifiers = role(Qualifiers).toInt();
|
||||
|
||||
if (m_qualifiers & QCodeNode::QUALIFIER_CONST)
|
||||
qualifier += " const ";
|
||||
else if (m_qualifiers & QCodeNode::QUALIFIER_VOLATILE)
|
||||
qualifier += " volatile ";
|
||||
else if (m_qualifiers & QCodeNode::QUALIFIER_STATIC)
|
||||
qualifier += " static ";
|
||||
|
||||
if (m_qualifiers & QCodeNode::QUALIFIER_PURE_VIRTUAL)
|
||||
qualifier.prepend(" pure virtual ");
|
||||
else if (m_qualifiers & QCodeNode::QUALIFIER_INLINE)
|
||||
qualifier.prepend(" inline ");
|
||||
else if (m_qualifiers & QCodeNode::QUALIFIER_VIRTUAL)
|
||||
qualifier.prepend(" virtual ");
|
||||
|
||||
int m_visibility = role(Visibility).toInt();
|
||||
|
||||
if (m_visibility == QCodeNode::VISIBILITY_PUBLIC)
|
||||
qualifier.prepend(" public ");
|
||||
else if (m_visibility == QCodeNode::VISIBILITY_PROTECTED)
|
||||
qualifier.prepend(" protected ");
|
||||
else if (m_visibility == QCodeNode::VISIBILITY_SIGNAL)
|
||||
qualifier.prepend(" signal ");
|
||||
else if (m_visibility == QCodeNode::VISIBILITY_PRIVATE)
|
||||
qualifier.prepend(" private ");
|
||||
else
|
||||
qualifier.prepend(" global ");
|
||||
|
||||
if (ret.isEmpty()) {
|
||||
if (role(Name).startsWith("~"))
|
||||
qualifier += " destructor ";
|
||||
else
|
||||
qualifier += " constructor ";
|
||||
}
|
||||
|
||||
if (qualifier.length())
|
||||
signature += " [" + qualifier.simplified() + "]";
|
||||
|
||||
// return role(Name) + " " + role(Name);
|
||||
return signature;
|
||||
}
|
||||
|
||||
default:
|
||||
break;
|
||||
};
|
||||
|
||||
return QVariant();
|
||||
}
|
||||
|
||||
case Qt::DecorationRole: {
|
||||
switch (t) {
|
||||
case Class:
|
||||
return icon(ICON_CLASS);
|
||||
|
||||
case Struct:
|
||||
return icon(ICON_STRUCT);
|
||||
|
||||
case Enum:
|
||||
return icon(ICON_ENUM);
|
||||
|
||||
case Enumerator:
|
||||
return icon(ICON_ENUMERATOR);
|
||||
|
||||
case Union:
|
||||
return icon(ICON_UNION);
|
||||
|
||||
case Namespace:
|
||||
return icon(ICON_NAMESPACE);
|
||||
|
||||
case Typedef:
|
||||
return icon(ICON_TYPEDEF);
|
||||
|
||||
case Variable:
|
||||
return icon(ICON_VARIABLE + role(Visibility).toInt());
|
||||
|
||||
case Function:
|
||||
return icon(ICON_FUNCTION + role(Visibility).toInt());
|
||||
|
||||
default:
|
||||
break;
|
||||
};
|
||||
|
||||
return QVariant();
|
||||
}
|
||||
|
||||
case QCodeModel::TypeRole:
|
||||
return type();
|
||||
|
||||
case QCodeModel::VisibilityRole:
|
||||
return role(Visibility).toInt();
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
return QVariant();
|
||||
}
|
||||
|
||||
void QCodeNode::setData(int role, const QVariant &v) {
|
||||
Q_UNUSED(v)
|
||||
Q_UNUSED(role)
|
||||
}
|
||||
|
||||
QByteArray QCodeNode::role(RoleIndex r) const {
|
||||
return section(roles, '@', (int)r, (int)r);
|
||||
}
|
||||
|
||||
void QCodeNode::setRole(RoleIndex r, const QByteArray &b) {
|
||||
setSection(roles, '@', (int)r, (int)r, b);
|
||||
}
|
|
@ -0,0 +1,151 @@
|
|||
/****************************************************************************
|
||||
**
|
||||
** 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_NODE_H_
|
||||
#define _QCODE_NODE_H_
|
||||
|
||||
#include "qcm-config.h"
|
||||
|
||||
#include <QByteArray>
|
||||
#include <QList>
|
||||
|
||||
class QVariant;
|
||||
|
||||
class QCodeModel;
|
||||
class QCodeNodePool;
|
||||
|
||||
struct QCM_EXPORT QCodeNode {
|
||||
enum RoleIndex {
|
||||
NodeType = 0,
|
||||
Name = 1,
|
||||
|
||||
// common
|
||||
Visibility = Name + 2,
|
||||
Templates = Visibility + 1,
|
||||
|
||||
// class/struct
|
||||
Ancestors = Name + 1,
|
||||
Friends = Ancestors + 1,
|
||||
|
||||
// typedef
|
||||
Alias = Name + 1,
|
||||
|
||||
// enumerator
|
||||
Value = Name + 1,
|
||||
|
||||
// variables/members
|
||||
Type = Name + 1,
|
||||
Specifiers = Visibility + 1,
|
||||
|
||||
// function/methods
|
||||
Return = Name + 1,
|
||||
Qualifiers = Templates + 1,
|
||||
Arguments = Qualifiers + 1,
|
||||
|
||||
Context = -1
|
||||
};
|
||||
|
||||
enum DefaultNodeTypes {
|
||||
Group = 'g',
|
||||
Language = 'l',
|
||||
|
||||
Class = 'c',
|
||||
Struct = 's',
|
||||
|
||||
Function = 'f',
|
||||
|
||||
Variable = 'v',
|
||||
|
||||
Enum = 'e',
|
||||
Enumerator = 'r',
|
||||
|
||||
Union = 'u',
|
||||
|
||||
Namespace = 'n',
|
||||
|
||||
Typedef = 't'
|
||||
};
|
||||
|
||||
enum NodeContent {
|
||||
CONTENT_NONE = 0,
|
||||
CONTENT_DEFINITION = 1,
|
||||
CONTENT_IMPLEMENTATION = 2,
|
||||
};
|
||||
|
||||
enum NodeVisibility {
|
||||
VISIBILITY_DEFAULT = -1,
|
||||
VISIBILITY_PUBLIC,
|
||||
VISIBILITY_SIGNAL,
|
||||
VISIBILITY_PROTECTED,
|
||||
VISIBILITY_PRIVATE
|
||||
};
|
||||
|
||||
enum Specifier {
|
||||
SPECIFIER_NONE = 0,
|
||||
SPECIFIER_CONST = 1,
|
||||
SPECIFIER_VOLATILE = 2,
|
||||
SPECIFIER_MUTABLE = 4,
|
||||
SPECIFIER_AUTO = 8,
|
||||
SPECIFIER_STATIC = 16,
|
||||
SPECIFIER_REGISTER = 32,
|
||||
SPECIFIER_EXTERN = 64
|
||||
};
|
||||
|
||||
typedef QFlags<Specifier> TypeSpecifier;
|
||||
|
||||
enum Qualifier {
|
||||
QUALIFIER_NONE = 0,
|
||||
QUALIFIER_CONST = 1,
|
||||
QUALIFIER_VOLATILE = 2,
|
||||
QUALIFIER_STATIC = 4,
|
||||
QUALIFIER_EXTERN = 8,
|
||||
QUALIFIER_VIRTUAL = 16,
|
||||
QUALIFIER_PURE_VIRTUAL = 32,
|
||||
QUALIFIER_INLINE = 64
|
||||
};
|
||||
|
||||
typedef QFlags<Qualifier> FunctionQualifier;
|
||||
|
||||
QCodeNode();
|
||||
QCodeNode(QCodeNodePool *p);
|
||||
virtual ~QCodeNode();
|
||||
|
||||
void operator delete(void *p);
|
||||
|
||||
virtual int type() 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;
|
||||
void setRole(RoleIndex r, const QByteArray &b);
|
||||
|
||||
virtual void clear();
|
||||
virtual void removeAll();
|
||||
|
||||
virtual void attach(QCodeNode *p);
|
||||
virtual void detach();
|
||||
|
||||
int line;
|
||||
QByteArray roles;
|
||||
QCodeNode *parent;
|
||||
QCodeModel *model;
|
||||
QCodeNodePool *m_pool;
|
||||
QList<QCodeNode *> children;
|
||||
};
|
||||
|
||||
#endif // !_QCODE_NODE_H_
|
|
@ -0,0 +1,93 @@
|
|||
/****************************************************************************
|
||||
**
|
||||
** 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 "qcodenodepool.h"
|
||||
|
||||
/*!
|
||||
\file qcodenodepool.cpp
|
||||
\brief Implementation of the QCodeNodePool class.
|
||||
*/
|
||||
|
||||
#include <cstdlib>
|
||||
|
||||
#include "qcodenode.h"
|
||||
|
||||
/*!
|
||||
\class QCodeNodePool
|
||||
\brief Custom allocator for QCodeNode objects
|
||||
*/
|
||||
|
||||
QCodeNodePool::QCodeNodePool(int size)
|
||||
: m_size(size), m_last(0), m_free(0), m_own(true),
|
||||
m_nodes(static_cast<QCodeNode *>(malloc(size * sizeof(QCodeNode)))) {}
|
||||
|
||||
QCodeNodePool::QCodeNodePool(void *data, int size)
|
||||
: m_size(size), m_last(0), m_free(0), m_own(false),
|
||||
m_nodes(static_cast<QCodeNode *>(data)) {}
|
||||
|
||||
QCodeNodePool::~QCodeNodePool() {
|
||||
if (m_own && m_nodes)
|
||||
free(m_nodes);
|
||||
}
|
||||
|
||||
int QCodeNodePool::count() const { return m_last; }
|
||||
|
||||
int QCodeNodePool::bufferSize() const { return m_size; }
|
||||
|
||||
int QCodeNodePool::occupied() const { return (100 * m_last) / m_size; }
|
||||
|
||||
int QCodeNodePool::remaining() const {
|
||||
return (100 * (m_size - m_last)) / m_size;
|
||||
}
|
||||
|
||||
QCodeNode *QCodeNodePool::alloc() {
|
||||
if (m_last == m_size) {
|
||||
// try to fill blanks...
|
||||
if (m_free > 0) {
|
||||
}
|
||||
|
||||
// fallback use malloc()
|
||||
return new QCodeNode(0);
|
||||
} else {
|
||||
return new (m_nodes + m_last++) QCodeNode(this);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
void QCodeNodePool::free(QCodeNode *n) {
|
||||
if ((n < m_nodes) || (n >= (m_nodes + m_size))) {
|
||||
// not from pool... fallback to regular allocator
|
||||
delete n;
|
||||
} else {
|
||||
|
||||
if ((void *)(n + 1) == (void *)(m_nodes + m_last)) {
|
||||
--m_last;
|
||||
|
||||
QCodeNode &n = m_nodes[m_last];
|
||||
|
||||
while (!n.m_pool && !n.parent && !n.model && (m_last > 0) &&
|
||||
(m_free > 0)) {
|
||||
--m_free;
|
||||
--m_last;
|
||||
|
||||
n = m_nodes[m_last];
|
||||
}
|
||||
|
||||
} else {
|
||||
++m_free;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,49 @@
|
|||
/****************************************************************************
|
||||
**
|
||||
** 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_NODE_POOL_H_
|
||||
#define _QCODE_NODE_POOL_H_
|
||||
|
||||
#include "qcm-config.h"
|
||||
|
||||
/*!
|
||||
\file qcodenodepool.h
|
||||
\brief Definition of the QCodeNodePool class.
|
||||
*/
|
||||
|
||||
struct QCodeNode;
|
||||
|
||||
class QCM_EXPORT QCodeNodePool {
|
||||
public:
|
||||
QCodeNodePool(int size);
|
||||
QCodeNodePool(void *data, int size);
|
||||
~QCodeNodePool();
|
||||
|
||||
int count() const;
|
||||
int bufferSize() const;
|
||||
int occupied() const;
|
||||
int remaining() const;
|
||||
|
||||
QCodeNode *alloc();
|
||||
void free(QCodeNode *n);
|
||||
|
||||
private:
|
||||
int m_size, m_last, m_free;
|
||||
|
||||
bool m_own;
|
||||
QCodeNode *m_nodes;
|
||||
};
|
||||
|
||||
#endif // !_QCODE_NODE_POOL_H_
|
|
@ -0,0 +1,150 @@
|
|||
/****************************************************************************
|
||||
**
|
||||
** 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 "qcodeparser.h"
|
||||
|
||||
/*!
|
||||
\file qcodeparser.cpp
|
||||
\brief Implementation of the QCodeParser class.
|
||||
*/
|
||||
|
||||
#include "qcodedevice.h"
|
||||
#include "qcodelexer.h"
|
||||
#include "qcodemodel.h"
|
||||
#include "qcodenode.h"
|
||||
#include "qcodenodepool.h"
|
||||
#include "qcodestream.h"
|
||||
|
||||
#include "qsourcecodewatcher.h"
|
||||
|
||||
#include <QDir>
|
||||
#include <QFile>
|
||||
#include <QFileInfo>
|
||||
#include <QTime>
|
||||
|
||||
/*!
|
||||
\class QCodeParser
|
||||
\brief Base class for code parsers
|
||||
|
||||
\see QCodeLexer
|
||||
\see QCodeLoader
|
||||
*/
|
||||
|
||||
/*!
|
||||
\brief ctor
|
||||
*/
|
||||
QCodeParser::QCodeParser() : m_pool(0) {}
|
||||
|
||||
/*!
|
||||
\brief dtor
|
||||
*/
|
||||
QCodeParser::~QCodeParser() {}
|
||||
|
||||
/*!
|
||||
\return The node pool to which this parser has access
|
||||
*/
|
||||
QCodeNodePool *QCodeParser::nodePool() const { return m_pool; }
|
||||
|
||||
/*!
|
||||
\brief Set the node pool from which the parser should
|
||||
allocate its node (a null pointer causes heap allocation
|
||||
to be used all the time.)
|
||||
*/
|
||||
void QCodeParser::setNodePool(QCodeNodePool *p) { m_pool = p; }
|
||||
|
||||
/*!
|
||||
\return A valid QCodeNode object
|
||||
If the parser has access to a nodePool(), it allocates
|
||||
the new node from it, otherwise it allocates it on heap.
|
||||
*/
|
||||
QCodeNode *QCodeParser::getNode() {
|
||||
return m_pool ? m_pool->alloc() : new QCodeNode;
|
||||
}
|
||||
|
||||
/*!
|
||||
\brief Parse a single file and construct code tree
|
||||
\param f file to parse
|
||||
\return The group node (named after the file) containing parsing result
|
||||
*/
|
||||
QCodeNode *QCodeParser::parse(const QString &f) {
|
||||
if (!QFile::exists(f) || !QFileInfo(f).isReadable())
|
||||
return 0;
|
||||
|
||||
QCodeDevice stream(f);
|
||||
QCodeNode *node = getNode();
|
||||
QCodeLexer *lex = lexer(&stream);
|
||||
|
||||
node->roles = QByteArray("g@") + f.toLocal8Bit() + "@" + f.toLocal8Bit();
|
||||
|
||||
update(node, lex);
|
||||
|
||||
delete lex;
|
||||
|
||||
return node;
|
||||
}
|
||||
|
||||
/*!
|
||||
\brief Update the content of a node according to the content of a file
|
||||
\param n node to update (most probably a group...)
|
||||
\param file file from which to extract code hierarchy
|
||||
*/
|
||||
void QCodeParser::update(QCodeNode *n, const QString &file) {
|
||||
if (!QFile::exists(file) || !QFileInfo(file).isReadable()) {
|
||||
QStack<QCodeNode *> l;
|
||||
|
||||
l.push(n);
|
||||
|
||||
while (l.count()) {
|
||||
QCodeNode *tn = l.pop();
|
||||
|
||||
if (tn->context() == file) {
|
||||
QCodeNode *p = tn->parent;
|
||||
|
||||
tn->detach();
|
||||
delete tn;
|
||||
|
||||
while (p && p->children.isEmpty() &&
|
||||
(p->type() != QCodeNode::Group)) {
|
||||
tn = p;
|
||||
p = p->parent;
|
||||
|
||||
tn->detach();
|
||||
delete tn;
|
||||
}
|
||||
} else {
|
||||
foreach (QCodeNode *c, tn->children)
|
||||
l.push(c);
|
||||
}
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
// qDebug("updating %s in %s", qPrintable(file),
|
||||
// n->role(QCodeNode::Name).constData());
|
||||
|
||||
QCodeDevice stream(file);
|
||||
|
||||
QSourceCodeWatcher *w = QSourceCodeWatcher::watcher(n, this);
|
||||
|
||||
if (w && !w->files().contains(file))
|
||||
w->addPath(file);
|
||||
|
||||
QCodeLexer *lex = lexer(&stream);
|
||||
|
||||
update(n, lex);
|
||||
|
||||
delete lex;
|
||||
}
|
|
@ -0,0 +1,56 @@
|
|||
/****************************************************************************
|
||||
**
|
||||
** 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_PARSER_H_
|
||||
#define _QCODE_PARSER_H_
|
||||
|
||||
#include "qcm-config.h"
|
||||
|
||||
#include <QStringList>
|
||||
|
||||
struct QCodeNode;
|
||||
class QCodeModel;
|
||||
class QCodeLexer;
|
||||
class QCodeStream;
|
||||
class QCodeNodePool;
|
||||
|
||||
class QCM_EXPORT QCodeParser {
|
||||
friend class QCodeLoader;
|
||||
|
||||
public:
|
||||
QCodeParser();
|
||||
virtual ~QCodeParser();
|
||||
|
||||
virtual QString language() const = 0;
|
||||
virtual bool canParse(const QString &fn) const = 0;
|
||||
|
||||
QCodeNodePool *nodePool() const;
|
||||
void setNodePool(QCodeNodePool *p);
|
||||
|
||||
QCodeNode *parse(const QString &f);
|
||||
|
||||
virtual QCodeLexer *lexer(QCodeStream *s) = 0;
|
||||
|
||||
virtual void update(QCodeNode *n, const QString &file);
|
||||
virtual void update(QCodeNode *n, QCodeLexer *l, bool check = true) = 0;
|
||||
|
||||
protected:
|
||||
QCodeNode *getNode();
|
||||
|
||||
private:
|
||||
QCodeNodePool *m_pool;
|
||||
};
|
||||
|
||||
#endif // !_QCODE_PARSER_H_
|
|
@ -0,0 +1,76 @@
|
|||
/****************************************************************************
|
||||
**
|
||||
** 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 "qcodeproxymodel.h"
|
||||
|
||||
/*!
|
||||
\file qcodeproxymodel.cpp
|
||||
\brief Implementation of the QCodeProxyModel class.
|
||||
*/
|
||||
|
||||
#include "qcodemodel.h"
|
||||
#include "qcodenode.h"
|
||||
|
||||
static QList<int> priority = QList<int>()
|
||||
<< QCodeNode::Group << QCodeNode::Language
|
||||
<< QCodeNode::Namespace << QCodeNode::Class
|
||||
<< QCodeNode::Struct << QCodeNode::Union
|
||||
<< QCodeNode::Enum << QCodeNode::Typedef
|
||||
<< QCodeNode::Function << QCodeNode::Variable;
|
||||
|
||||
/*!
|
||||
\class QCodeProxyModel
|
||||
\brief Special proxy model for code models
|
||||
*/
|
||||
|
||||
QCodeProxyModel::QCodeProxyModel(QObject *p) : QSortFilterProxyModel(p) {
|
||||
setDynamicSortFilter(true);
|
||||
}
|
||||
|
||||
QCodeProxyModel::~QCodeProxyModel() {}
|
||||
|
||||
bool QCodeProxyModel::lessThan(const QModelIndex &left,
|
||||
const QModelIndex &right) const {
|
||||
int lt = priority.indexOf(
|
||||
sourceModel()->data(left, QCodeModel::TypeRole).toInt()),
|
||||
rt = priority.indexOf(
|
||||
sourceModel()->data(right, QCodeModel::TypeRole).toInt());
|
||||
|
||||
// if ( lt == rt )
|
||||
// return QSortFilterProxyModel::lessThan(left, right);
|
||||
|
||||
/*
|
||||
foreach ( int p, priority )
|
||||
{
|
||||
if ( lt == p )
|
||||
return false;
|
||||
else if ( rt == p )
|
||||
return true;
|
||||
}
|
||||
|
||||
int lv = sourceModel()->data(left, QCodeModel::VisibilityRole).toInt(),
|
||||
rv = sourceModel()->data(right, QCodeModel::VisibilityRole).toInt();
|
||||
|
||||
if ( lv != rv )
|
||||
return lv > rv;
|
||||
*/
|
||||
|
||||
QString ld = sourceModel()->data(left, Qt::DisplayRole).toString(),
|
||||
rd = sourceModel()->data(right, Qt::DisplayRole).toString();
|
||||
|
||||
// return !((lt == rt) ? (QString::localeAwareCompare(ld, rd) < 0) : (lt <
|
||||
// rt));
|
||||
return !((lt == rt) ? (ld.toUpper() < rd.toUpper()) : (lt < rt));
|
||||
}
|
|
@ -0,0 +1,40 @@
|
|||
/****************************************************************************
|
||||
**
|
||||
** 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_PROXY_MODEL_H_
|
||||
#define _QCODE_PROXY_MODEL_H_
|
||||
|
||||
#include "qcm-config.h"
|
||||
|
||||
/*!
|
||||
\file qcodeproxymodel.h
|
||||
\brief Definition of the QCodeProxyModel class.
|
||||
*/
|
||||
|
||||
#include <QSortFilterProxyModel>
|
||||
|
||||
class QCM_EXPORT QCodeProxyModel : public QSortFilterProxyModel {
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
QCodeProxyModel(QObject *p = 0);
|
||||
virtual ~QCodeProxyModel();
|
||||
|
||||
protected:
|
||||
virtual bool lessThan(const QModelIndex &left,
|
||||
const QModelIndex &right) const;
|
||||
};
|
||||
|
||||
#endif // !_QCODE_PROXY_MODEL_H_
|
|
@ -0,0 +1,198 @@
|
|||
/****************************************************************************
|
||||
**
|
||||
** 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 "qcodenodepool.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), m_pool(0) {}
|
||||
|
||||
QCodeSerializer::~QCodeSerializer() {}
|
||||
|
||||
QCodeModel *QCodeSerializer::targetModel() const { return m_model; }
|
||||
|
||||
void QCodeSerializer::setTargetModel(QCodeModel *m) { m_model = m; }
|
||||
|
||||
QCodeNodePool *QCodeSerializer::nodePool() const { return m_pool; }
|
||||
|
||||
void QCodeSerializer::setNodePool(QCodeNodePool *p) { m_pool = p; }
|
||||
|
||||
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 = m_pool ? m_pool->alloc() : 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;
|
||||
}
|
|
@ -0,0 +1,60 @@
|
|||
/****************************************************************************
|
||||
**
|
||||
** 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 QCodeNodePool;
|
||||
|
||||
class QIODevice;
|
||||
class QTextStream;
|
||||
|
||||
class QCM_EXPORT QCodeSerializer {
|
||||
public:
|
||||
QCodeSerializer();
|
||||
virtual ~QCodeSerializer();
|
||||
|
||||
QCodeModel *targetModel() const;
|
||||
void setTargetModel(QCodeModel *m);
|
||||
|
||||
QCodeNodePool *nodePool() const;
|
||||
void setNodePool(QCodeNodePool *p);
|
||||
|
||||
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;
|
||||
QCodeNodePool *m_pool;
|
||||
};
|
||||
|
||||
#endif // !_QCODE_SERIALIZER_H_
|
|
@ -0,0 +1,38 @@
|
|||
/****************************************************************************
|
||||
**
|
||||
** 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 "qcodestream.h"
|
||||
|
||||
/*!
|
||||
\file qcodestream.cpp
|
||||
\brief Implementation of the QCodeStream class.
|
||||
*/
|
||||
|
||||
/*!
|
||||
\class QCodeStream
|
||||
\brief Base class for code input streams
|
||||
*/
|
||||
|
||||
QString QCodeStream::contextFile() const {
|
||||
// qDebug(" <= context query : %s", qPrintable(sContext));
|
||||
return sContext;
|
||||
}
|
||||
|
||||
void QCodeStream::setContextFile(const QString &f) {
|
||||
// qDebug(" => context switch : %s", qPrintable(f));
|
||||
sContext = f;
|
||||
}
|
||||
|
||||
bool QCodeStream::tryFetchOtherContext(const QString &) { return false; }
|
|
@ -0,0 +1,48 @@
|
|||
/****************************************************************************
|
||||
**
|
||||
** 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_STREAM_H_
|
||||
#define _QCODE_STREAM_H_
|
||||
|
||||
#include "qcm-config.h"
|
||||
|
||||
/*!
|
||||
\file qcodestream.h
|
||||
\brief Definition of the QCodeStream class.
|
||||
*/
|
||||
|
||||
#include <QString>
|
||||
|
||||
class QByteArray;
|
||||
|
||||
class QCM_EXPORT QCodeStream {
|
||||
public:
|
||||
virtual ~QCodeStream() {}
|
||||
|
||||
virtual char getChar() = 0;
|
||||
virtual void ungetChar(char c) = 0;
|
||||
|
||||
virtual QByteArray readLine() = 0;
|
||||
|
||||
virtual QString contextFile() const;
|
||||
virtual void setContextFile(const QString &f);
|
||||
|
||||
virtual bool tryFetchOtherContext(const QString &f);
|
||||
|
||||
private:
|
||||
QString sContext;
|
||||
};
|
||||
|
||||
#endif // !_QCODE_STREAM_H_
|
|
@ -0,0 +1,156 @@
|
|||
/****************************************************************************
|
||||
**
|
||||
** 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 "qcodeview.h"
|
||||
|
||||
/*!
|
||||
\file qcodeview.cpp
|
||||
\brief Implementation of the QCodeView class.
|
||||
*/
|
||||
|
||||
#include "qcodemodel.h"
|
||||
#include "qcodenode.h"
|
||||
|
||||
#include <QAbstractProxyModel>
|
||||
#include <QContextMenuEvent>
|
||||
#include <QFileInfo>
|
||||
|
||||
/*!
|
||||
\class QCodeView
|
||||
\brief Specialized tree view to display code models
|
||||
*/
|
||||
|
||||
QCodeView::QCodeView(QWidget *p) : QTreeView(p) {
|
||||
setAutoScroll(true);
|
||||
setHorizontalScrollBarPolicy(Qt::ScrollBarAsNeeded);
|
||||
|
||||
connect(this, SIGNAL(activated(QModelIndex)), this,
|
||||
SLOT(indexActivated(QModelIndex)));
|
||||
}
|
||||
|
||||
QCodeView::QCodeView(QCodeModel *m, QWidget *p) : QTreeView(p), m_model(0) {
|
||||
setAutoScroll(true);
|
||||
setHorizontalScrollBarPolicy(Qt::ScrollBarAsNeeded);
|
||||
|
||||
connect(this, SIGNAL(activated(QModelIndex)), this,
|
||||
SLOT(indexActivated(QModelIndex)));
|
||||
|
||||
setModel(m);
|
||||
}
|
||||
|
||||
QCodeView::~QCodeView() {}
|
||||
|
||||
void QCodeView::setModel(QAbstractItemModel *model) {
|
||||
QAbstractProxyModel *proxy = qobject_cast<QAbstractProxyModel *>(model);
|
||||
|
||||
if (proxy) {
|
||||
m_model = qobject_cast<QCodeModel *>(proxy->sourceModel());
|
||||
} else {
|
||||
m_model = qobject_cast<QCodeModel *>(model);
|
||||
}
|
||||
|
||||
if (!m_model)
|
||||
qFatal("QCodeView can only display a QCodeModel");
|
||||
|
||||
QTreeView::setModel(model);
|
||||
}
|
||||
|
||||
void QCodeView::contextMenuEvent(QContextMenuEvent *e) {
|
||||
e->accept();
|
||||
|
||||
QModelIndex idx = indexAt(e->pos());
|
||||
|
||||
if (!idx.isValid())
|
||||
return;
|
||||
}
|
||||
|
||||
void QCodeView::indexActivated(const QModelIndex &idx) {
|
||||
static QStringList exts = QStringList() << "cpp"
|
||||
<< "cxx"
|
||||
<< "c"
|
||||
<< "cc";
|
||||
|
||||
if (!m_model)
|
||||
return;
|
||||
|
||||
QCodeNode *n = 0;
|
||||
QAbstractProxyModel *proxy = qobject_cast<QAbstractProxyModel *>(model());
|
||||
|
||||
if (proxy) {
|
||||
n = m_model->node(proxy->mapToSource(idx));
|
||||
} else {
|
||||
n = m_model->node(idx);
|
||||
}
|
||||
|
||||
if (!n)
|
||||
return;
|
||||
|
||||
QString cxt = n->context();
|
||||
|
||||
if (n->type() == QCodeNode::Function) {
|
||||
// open the source file instead (after checking whether it lies in
|
||||
// header...)
|
||||
QFileInfo inf(cxt);
|
||||
|
||||
foreach (const QString &ext, exts) {
|
||||
QString scxt = cxt;
|
||||
scxt.chop(inf.suffix().length());
|
||||
scxt += ext;
|
||||
|
||||
if (QFile::exists(scxt)) {
|
||||
cxt = scxt;
|
||||
break;
|
||||
}
|
||||
}
|
||||
} else if (n->line != -1) {
|
||||
emit actionRequested("open", QStringList() << cxt << "-l"
|
||||
<< QString::number(n->line));
|
||||
return;
|
||||
}
|
||||
|
||||
int i;
|
||||
QString ptp, rxp, qn = n->qualifiedName(false);
|
||||
|
||||
// qDebug("%s [%s] {%s}", qPrintable(qn),
|
||||
// qPrintable(n->data(Qt::DisplayRole).toString()),
|
||||
// n->role(QCodeNode::NodeType).constData());
|
||||
|
||||
// qn.remove(0, qn.indexOf("/") + 1);
|
||||
|
||||
ptp = qn;
|
||||
rxp = QRegularExpression::escape(qn);
|
||||
|
||||
rxp.replace(
|
||||
QRegularExpression("\\s*(::|\\\\[()\\[\\]{}|*$+.?^]|[,&<>])\\s*"),
|
||||
"\\s*\\1\\s*");
|
||||
rxp.replace(" ", "\\s+");
|
||||
|
||||
i = rxp.indexOf("(");
|
||||
|
||||
QString tmp = rxp.mid(i);
|
||||
tmp.replace(
|
||||
QRegularExpression("(\\\\s[+*])[\\w_]+\\\\s\\*(,|\\\\\\)\\\\s\\*$)"),
|
||||
"\\1[\\w_]*\\s*\\2");
|
||||
rxp = rxp.left(i) + tmp;
|
||||
|
||||
ptp.replace(QRegularExpression(" (::|[()<>]) "), "\\1");
|
||||
i = ptp.indexOf("(");
|
||||
|
||||
if (i != -1)
|
||||
ptp = ptp.left(i);
|
||||
|
||||
emit actionRequested("open", QStringList()
|
||||
<< cxt << "-s" << ptp << "-rx" << rxp);
|
||||
}
|
|
@ -13,42 +13,41 @@
|
|||
**
|
||||
****************************************************************************/
|
||||
|
||||
#ifndef _QSTATUS_PANEL_H_
|
||||
#define _QSTATUS_PANEL_H_
|
||||
#ifndef _QCODE_VIEW_H_
|
||||
#define _QCODE_VIEW_H_
|
||||
|
||||
#include "qpanel.h"
|
||||
#include "qcm-config.h"
|
||||
|
||||
/*!
|
||||
\file qstatuspanel.h
|
||||
\brief Definition of the QStatusPanel class.
|
||||
|
||||
\see QStatusPanel
|
||||
\file qcodeview.h
|
||||
\brief Definition of the QCodeView class.
|
||||
*/
|
||||
|
||||
class QLabel;
|
||||
#include <QTreeView>
|
||||
|
||||
class QDocumentLine;
|
||||
class QCodeModel;
|
||||
|
||||
class QCE_EXPORT QStatusPanel : public QPanel {
|
||||
class QCM_EXPORT QCodeView : public QTreeView {
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
Q_PANEL(QStatusPanel, "Status Panel")
|
||||
QCodeView(QWidget *p = 0);
|
||||
QCodeView(QCodeModel *m, QWidget *p = 0);
|
||||
virtual ~QCodeView();
|
||||
|
||||
QStatusPanel(QWidget *p = nullptr);
|
||||
virtual ~QStatusPanel();
|
||||
virtual void setModel(QAbstractItemModel *model);
|
||||
|
||||
virtual QString type() const;
|
||||
signals:
|
||||
void actionRequested(const QString &action, const QStringList ¶ms);
|
||||
|
||||
protected:
|
||||
virtual void editorChange(QEditor *e);
|
||||
virtual bool paint(QPainter *p, QEditor *e);
|
||||
virtual void contextMenuEvent(QContextMenuEvent *e);
|
||||
|
||||
virtual void mousePressEvent(QMouseEvent *e);
|
||||
virtual void mouseReleaseEvent(QMouseEvent *e);
|
||||
protected slots:
|
||||
void indexActivated(const QModelIndex &idx);
|
||||
|
||||
private:
|
||||
int m_conflictSpot;
|
||||
QCodeModel *m_model;
|
||||
};
|
||||
|
||||
#endif // _QSTATUS_PANEL_H_
|
||||
#endif // !_QCODE_VIEW_H_
|
|
@ -0,0 +1,94 @@
|
|||
/****************************************************************************
|
||||
**
|
||||
** 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 "qsourcecodewatcher.h"
|
||||
|
||||
#include "qcodemodel.h"
|
||||
#include "qcodenode.h"
|
||||
#include "qcodeparser.h"
|
||||
|
||||
#include <QTimerEvent>
|
||||
|
||||
QList<QSourceCodeWatcher *> QSourceCodeWatcher::m_instances;
|
||||
|
||||
QSourceCodeWatcher *QSourceCodeWatcher::watcher(QCodeNode *t, QCodeParser *c) {
|
||||
if (!t)
|
||||
return 0;
|
||||
|
||||
for (int i = 0; i < m_instances.count(); ++i) {
|
||||
if (m_instances.at(i)->m_target == t) {
|
||||
return m_instances[i];
|
||||
}
|
||||
}
|
||||
|
||||
return c ? new QSourceCodeWatcher(t, c, t->model) : 0;
|
||||
}
|
||||
|
||||
QSourceCodeWatcher::QSourceCodeWatcher(QCodeNode *n, QCodeParser *c, QObject *p)
|
||||
: QFileSystemWatcher(p), m_target(n), m_parser(c) {
|
||||
connect(this, SIGNAL(fileChanged(QString)), this,
|
||||
SLOT(sourceChanged(QString)));
|
||||
|
||||
m_instances << this;
|
||||
|
||||
// qDebug("%i watchers", m_instances.count());
|
||||
}
|
||||
|
||||
QSourceCodeWatcher::~QSourceCodeWatcher() {
|
||||
m_instances.removeAll(this);
|
||||
|
||||
// qDebug("%i watchers left", m_instances.count());
|
||||
}
|
||||
|
||||
void QSourceCodeWatcher::timerEvent(QTimerEvent *e) {
|
||||
if (e->timerId() != m_timer.timerId())
|
||||
return QFileSystemWatcher::timerEvent(e);
|
||||
|
||||
if (!m_parser)
|
||||
return;
|
||||
|
||||
QHash<QString, char>::iterator it = m_state.begin();
|
||||
|
||||
while (it != m_state.end()) {
|
||||
if (*it & Duplicate) {
|
||||
// postpone...
|
||||
*it = Recent;
|
||||
++it;
|
||||
} else {
|
||||
// process
|
||||
m_parser->update(m_target, it.key());
|
||||
it = m_state.erase(it);
|
||||
}
|
||||
}
|
||||
|
||||
if (m_state.count()) {
|
||||
m_timer.start(50, this);
|
||||
}
|
||||
}
|
||||
|
||||
void QSourceCodeWatcher::sourceChanged(const QString &filepath) {
|
||||
if (!m_target)
|
||||
return;
|
||||
|
||||
m_timer.stop();
|
||||
|
||||
if (!m_state.contains(filepath)) {
|
||||
m_state[filepath] = Recent;
|
||||
} else {
|
||||
m_state[filepath] = Recent | Duplicate;
|
||||
}
|
||||
|
||||
m_timer.start(50, this);
|
||||
}
|
|
@ -0,0 +1,57 @@
|
|||
/****************************************************************************
|
||||
**
|
||||
** 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 _QSOURCE_CODE_WATCHER_H_
|
||||
#define _QSOURCE_CODE_WATCHER_H_
|
||||
|
||||
#include "qcm-config.h"
|
||||
|
||||
#include <QFileSystemWatcher>
|
||||
#include <QHash>
|
||||
#include <QTimer>
|
||||
|
||||
struct QCodeNode;
|
||||
class QCodeParser;
|
||||
|
||||
class QCM_EXPORT QSourceCodeWatcher : public QFileSystemWatcher {
|
||||
friend struct QCodeNode;
|
||||
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
static QSourceCodeWatcher *watcher(QCodeNode *t, QCodeParser *c = 0);
|
||||
|
||||
protected:
|
||||
QSourceCodeWatcher(QCodeNode *n, QCodeParser *c, QObject *p = 0);
|
||||
virtual ~QSourceCodeWatcher();
|
||||
|
||||
virtual void timerEvent(QTimerEvent *e);
|
||||
|
||||
private slots:
|
||||
void sourceChanged(const QString &filepath);
|
||||
|
||||
private:
|
||||
enum State { Recent = 1, Duplicate = 2 };
|
||||
|
||||
QHash<QString, char> m_state;
|
||||
|
||||
QBasicTimer m_timer;
|
||||
QCodeNode *m_target;
|
||||
QCodeParser *m_parser;
|
||||
|
||||
static QList<QSourceCodeWatcher *> m_instances;
|
||||
};
|
||||
|
||||
#endif // !_QSOURCE_CODE_WATCHER_H_
|
|
@ -1 +1 @@
|
|||
Subproject commit 633ef07162e374bb7c9cf007c3a54c3a4168b611
|
||||
Subproject commit f93657fa82bdd37dba68ea962d5e9b2cf4fd4d60
|
298
CMakeLists.txt
298
CMakeLists.txt
|
@ -8,7 +8,7 @@ set(CMAKE_AUTORCC ON)
|
|||
|
||||
set(CMAKE_CXX_STANDARD 17)
|
||||
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
||||
set(PROJECT_VERSION 1.0.0~beta)
|
||||
set(PROJECT_VERSION 1.0.0)
|
||||
|
||||
find_package(QT NAMES Qt6 Qt5 REQUIRED COMPONENTS Widgets Network Concurrent
|
||||
PrintSupport LinguistTools)
|
||||
|
@ -21,29 +21,73 @@ file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/WINGHEX_VERSION" ${PROJECT_VERSION})
|
|||
file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/QT_VERSION" ${QT_VERSION_MAJOR})
|
||||
|
||||
if(WIN32)
|
||||
add_definitions(-DNOMINMAX)
|
||||
add_definitions(-DNOMINMAX -D_CRT_SECURE_NO_WARNINGS)
|
||||
endif()
|
||||
|
||||
if(${QT_VERSION_MAJOR} EQUAL 5)
|
||||
if(Qt5Widgets_VERSION VERSION_LESS 5.14.0)
|
||||
message(FATAL_ERROR "Minimum supported Qt5 version is 5.14!")
|
||||
endif()
|
||||
if(Qt5Widgets_VERSION VERSION_LESS 5.14.0)
|
||||
message(FATAL_ERROR "Minimum supported Qt5 version is 5.14!")
|
||||
endif()
|
||||
elseif(${QT_VERSION_MAJOR} EQUAL 6)
|
||||
if(Qt6Widgets_VERSION VERSION_LESS 6.6.2)
|
||||
message(FATAL_ERROR "Minimum supported Qt6 version is 6.6.2!")
|
||||
endif()
|
||||
else()
|
||||
message(FATAL_ERROR "Unsupported Qt version!")
|
||||
endif()
|
||||
|
||||
if(MSVC)
|
||||
string(APPEND CMAKE_CXX_FLAGS " /utf-8")
|
||||
string(APPEND CMAKE_C_FLAGS " /utf-8")
|
||||
string(APPEND CMAKE_CXX_FLAGS " /utf-8")
|
||||
string(APPEND CMAKE_C_FLAGS " /utf-8")
|
||||
endif()
|
||||
|
||||
set(CMAKE_POLICY_DEFAULT_CMP0077 NEW)
|
||||
option(QWINDOWKIT_BUILD_STATIC "Build static libraries" TRUE)
|
||||
option(QWINDOWKIT_INSTALL "Install library" OFF)
|
||||
set(ADS_VERSION 4.3.1)
|
||||
option(BUILD_EXAMPLES "Build the examples" FALSE)
|
||||
option(BUILD_STATIC "Build the static library" TRUE)
|
||||
|
||||
add_subdirectory(3rdparty/qwindowkit)
|
||||
add_subdirectory(3rdparty/QLogger/qlogger)
|
||||
add_subdirectory(3rdparty/QHexView)
|
||||
add_subdirectory(3rdparty/qcodeedit2)
|
||||
add_subdirectory(3rdparty/qcodemodel2)
|
||||
add_subdirectory(3rdparty/Qt-Advanced-Docking-System)
|
||||
add_subdirectory(3rdparty/AngelScript/sdk/angelscript/projects/cmake)
|
||||
add_subdirectory(3rdparty/QConsoleWidget)
|
||||
add_subdirectory(3rdparty/QJsonModel)
|
||||
|
||||
set(ANGEL_SCRIPT_ADDON_ROOT
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/3rdparty/AngelScript/sdk/add_on")
|
||||
set(ANGEL_SCRIPT_ADDON
|
||||
${ANGEL_SCRIPT_ADDON_ROOT}/autowrapper/aswrappedcall.h
|
||||
${ANGEL_SCRIPT_ADDON_ROOT}/contextmgr/contextmgr.cpp
|
||||
${ANGEL_SCRIPT_ADDON_ROOT}/contextmgr/contextmgr.h
|
||||
${ANGEL_SCRIPT_ADDON_ROOT}/datetime/datetime.cpp
|
||||
${ANGEL_SCRIPT_ADDON_ROOT}/datetime/datetime.h
|
||||
${ANGEL_SCRIPT_ADDON_ROOT}/scriptany/scriptany.cpp
|
||||
${ANGEL_SCRIPT_ADDON_ROOT}/scriptany/scriptany.h
|
||||
${ANGEL_SCRIPT_ADDON_ROOT}/scriptarray/scriptarray.cpp
|
||||
${ANGEL_SCRIPT_ADDON_ROOT}/scriptarray/scriptarray.h
|
||||
${ANGEL_SCRIPT_ADDON_ROOT}/scriptfile/scriptfile.cpp
|
||||
${ANGEL_SCRIPT_ADDON_ROOT}/scriptfile/scriptfile.h
|
||||
${ANGEL_SCRIPT_ADDON_ROOT}/scriptfile/scriptfilesystem.cpp
|
||||
${ANGEL_SCRIPT_ADDON_ROOT}/scriptfile/scriptfilesystem.h
|
||||
${ANGEL_SCRIPT_ADDON_ROOT}/scriptgrid/scriptgrid.cpp
|
||||
${ANGEL_SCRIPT_ADDON_ROOT}/scriptgrid/scriptgrid.h
|
||||
${ANGEL_SCRIPT_ADDON_ROOT}/scripthandle/scripthandle.cpp
|
||||
${ANGEL_SCRIPT_ADDON_ROOT}/scripthandle/scripthandle.h
|
||||
${ANGEL_SCRIPT_ADDON_ROOT}/scripthelper/scripthelper.cpp
|
||||
${ANGEL_SCRIPT_ADDON_ROOT}/scripthelper/scripthelper.h
|
||||
${ANGEL_SCRIPT_ADDON_ROOT}/scriptmath/scriptmath.cpp
|
||||
${ANGEL_SCRIPT_ADDON_ROOT}/scriptmath/scriptmath.h
|
||||
${ANGEL_SCRIPT_ADDON_ROOT}/scriptmath/scriptmathcomplex.cpp
|
||||
${ANGEL_SCRIPT_ADDON_ROOT}/scriptmath/scriptmathcomplex.h
|
||||
${ANGEL_SCRIPT_ADDON_ROOT}/serializer/serializer.cpp
|
||||
${ANGEL_SCRIPT_ADDON_ROOT}/serializer/serializer.h
|
||||
${ANGEL_SCRIPT_ADDON_ROOT}/weakref/weakref.cpp
|
||||
${ANGEL_SCRIPT_ADDON_ROOT}/weakref/weakref.h)
|
||||
|
||||
set(QAPPLICATION_CLASS
|
||||
QApplication
|
||||
CACHE STRING "Inheritance class for SingleApplication")
|
||||
|
@ -116,7 +160,10 @@ set(CONTROL_SRC
|
|||
src/control/qtableviewext.h
|
||||
src/control/qtableviewext.cpp
|
||||
src/control/qlistviewext.h
|
||||
src/control/qlistviewext.cpp)
|
||||
src/control/qlistviewext.cpp
|
||||
src/control/qcodecompletionwidget.h
|
||||
src/control/qcodecompletionwidget_p.h
|
||||
src/control/qcodecompletionwidget.cpp)
|
||||
|
||||
set(CLASS_SRC
|
||||
src/class/logger.cpp
|
||||
|
@ -161,7 +208,19 @@ set(CLASS_SRC
|
|||
src/class/scripteditortheme.cpp
|
||||
src/class/appmanager.h
|
||||
src/class/appmanager.cpp
|
||||
src/class/angelscripthelper.h)
|
||||
src/class/angelscripthelper.h
|
||||
src/class/ascompletion.cpp
|
||||
src/class/ascompletion.h
|
||||
src/class/asbuilder.h
|
||||
src/class/asbuilder.cpp
|
||||
src/class/qaslexer.cpp
|
||||
src/class/qaslexer.h
|
||||
src/class/qasparser.cpp
|
||||
src/class/qasparser.h
|
||||
src/class/qdocumentsearch.cpp
|
||||
src/class/qdocumentsearch.h
|
||||
src/class/ascontextmgr.h
|
||||
src/class/ascontextmgr.cpp)
|
||||
|
||||
set(WIDGET_FRAME_SRC
|
||||
src/widgetframe/windowbar.cpp src/widgetframe/windowbar.h
|
||||
|
@ -182,7 +241,13 @@ set(MODEL_SRC
|
|||
src/model/qjsontablemodel.h
|
||||
src/model/qjsontablemodel.cpp
|
||||
src/model/scriptobjmodel.h
|
||||
src/model/scriptobjmodel.cpp)
|
||||
src/model/scriptobjmodel.cpp
|
||||
src/model/dbgcallstackmodel.h
|
||||
src/model/dbgcallstackmodel.cpp
|
||||
src/model/dbgvarshowmodel.h
|
||||
src/model/dbgvarshowmodel.cpp
|
||||
src/model/dbgbreakpointmodel.h
|
||||
src/model/dbgbreakpointmodel.cpp)
|
||||
|
||||
set(SETTING_SRC
|
||||
src/settings/generalsettingdialog.h
|
||||
|
@ -214,6 +279,20 @@ set(SCRIPT_ADDON_SRC
|
|||
src/scriptaddon/scriptcolor.h
|
||||
src/scriptaddon/scriptcolor.cpp)
|
||||
|
||||
set(CODEEDIT_WIDGET
|
||||
src/qcodeeditwidget/qgotolinepanel.h
|
||||
src/qcodeeditwidget/qgotolinepanel.cpp
|
||||
src/qcodeeditwidget/qgotolinepanel.ui
|
||||
src/qcodeeditwidget/qsearchreplacepanel.h
|
||||
src/qcodeeditwidget/qsearchreplacepanel.cpp
|
||||
src/qcodeeditwidget/qsearchreplacepanel.ui
|
||||
src/qcodeeditwidget/qeditconfig.h
|
||||
src/qcodeeditwidget/qeditconfig.cpp
|
||||
src/qcodeeditwidget/qeditconfig.ui
|
||||
src/qcodeeditwidget/qformatconfig.h
|
||||
src/qcodeeditwidget/qformatconfig.cpp
|
||||
src/qcodeeditwidget/qformatconfig.ui)
|
||||
|
||||
set(PLUGIN_SRC
|
||||
src/plugin/iwingplugin.h src/plugin/pluginsystem.cpp
|
||||
src/plugin/pluginsystem.h src/plugin/settingpage.h
|
||||
|
@ -221,17 +300,17 @@ set(PLUGIN_SRC
|
|||
|
||||
# localization support
|
||||
file(
|
||||
GLOB_RECURSE TS_FILES
|
||||
RELATIVE ${CMAKE_CURRENT_SOURCE_DIR}
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/lang/*/winghex.ts")
|
||||
GLOB_RECURSE TS_FILES
|
||||
RELATIVE ${CMAKE_CURRENT_SOURCE_DIR}
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/lang/*/winghex.ts")
|
||||
|
||||
foreach(TS_FILE IN LISTS TS_FILES)
|
||||
get_filename_component(TS_DIR ${TS_FILE} DIRECTORY)
|
||||
set(QM_DIR "${CMAKE_CURRENT_BINARY_DIR}/.tmp/${TS_DIR}")
|
||||
set(QM_OUT_DIR "${CMAKE_CURRENT_BINARY_DIR}/${TS_DIR}")
|
||||
file(MAKE_DIRECTORY "${QM_DIR}")
|
||||
file(MAKE_DIRECTORY "${QM_OUT_DIR}")
|
||||
set_source_files_properties(${TS_FILE} PROPERTIES OUTPUT_LOCATION ${QM_DIR})
|
||||
get_filename_component(TS_DIR ${TS_FILE} DIRECTORY)
|
||||
set(QM_DIR "${CMAKE_CURRENT_BINARY_DIR}/.tmp/${TS_DIR}")
|
||||
set(QM_OUT_DIR "${CMAKE_CURRENT_BINARY_DIR}/${TS_DIR}")
|
||||
file(MAKE_DIRECTORY "${QM_DIR}")
|
||||
file(MAKE_DIRECTORY "${QM_OUT_DIR}")
|
||||
set_source_files_properties(${TS_FILE} PROPERTIES OUTPUT_LOCATION ${QM_DIR})
|
||||
endforeach()
|
||||
|
||||
set(TRANSLATION_PATH
|
||||
|
@ -240,18 +319,18 @@ set(TRANSLATION_PATH
|
|||
${CMAKE_CURRENT_SOURCE_DIR}/3rdparty/QJsonModel
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/3rdparty/QPathEdit
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/3rdparty/qcodeedit2
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/3rdparty/Qt-Advanced-Docking-System
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/3rdparty/Qt-Advanced-Docking-System/src
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/3rdparty/QWingRibbon
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/3rdparty/SingleApplication
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/src)
|
||||
if(${QT_VERSION_MAJOR} EQUAL 5)
|
||||
qt5_create_translation(QM_FILES ${TRANSLATION_PATH} ${TS_FILES} OPTIONS
|
||||
-no-obsolete)
|
||||
qt5_create_translation(QM_FILES ${TRANSLATION_PATH} ${TS_FILES} OPTIONS
|
||||
-no-obsolete)
|
||||
elseif(${QT_VERSION_MAJOR} EQUAL 6)
|
||||
qt6_create_translation(QM_FILES ${TRANSLATION_PATH} ${TS_FILES} OPTIONS
|
||||
-no-obsolete)
|
||||
qt6_create_translation(QM_FILES ${TRANSLATION_PATH} ${TS_FILES} OPTIONS
|
||||
-no-obsolete)
|
||||
else()
|
||||
message(FATAL_ERROR "Unsupported QT version")
|
||||
message(FATAL_ERROR "Unsupported QT version")
|
||||
endif()
|
||||
|
||||
set(LANG_SRC "${CMAKE_CURRENT_SOURCE_DIR}/lang")
|
||||
|
@ -262,44 +341,44 @@ set(LANG_PAK_NAME "winghex_tr.pak")
|
|||
add_definitions(-DLANG_PAK_NAME="${LANG_PAK_NAME}")
|
||||
|
||||
foreach(TS_FILE IN LISTS TS_FILES)
|
||||
get_filename_component(TS_DIR ${TS_FILE} DIRECTORY)
|
||||
get_filename_component(LANG_NAME "${TS_DIR}" NAME)
|
||||
set(QM_DIR "${CMAKE_CURRENT_BINARY_DIR}/.tmp/${TS_DIR}")
|
||||
set(QM_OUT_DIR "${CMAKE_CURRENT_BINARY_DIR}/${TS_DIR}")
|
||||
set(LANG_NEED_COPY_PREFIX "${CMAKE_CURRENT_SOURCE_DIR}/${TS_DIR}")
|
||||
set(LANG_NEED_COPY
|
||||
"${LANG_NEED_COPY_PREFIX}/about.md"
|
||||
"${LANG_NEED_COPY_PREFIX}/components.md"
|
||||
"${LANG_NEED_COPY_PREFIX}/credits.md"
|
||||
"${LANG_NEED_COPY_PREFIX}/devs.md"
|
||||
"${LANG_NEED_COPY_PREFIX}/trans.md")
|
||||
add_custom_target(
|
||||
copy_lang_files
|
||||
COMMAND ${CMAKE_COMMAND} -E copy ${LANG_NEED_COPY} ${QM_DIR}
|
||||
COMMENT "Copying files to ${LANG_DEST}")
|
||||
get_filename_component(TS_DIR ${TS_FILE} DIRECTORY)
|
||||
get_filename_component(LANG_NAME "${TS_DIR}" NAME)
|
||||
set(QM_DIR "${CMAKE_CURRENT_BINARY_DIR}/.tmp/${TS_DIR}")
|
||||
set(QM_OUT_DIR "${CMAKE_CURRENT_BINARY_DIR}/${TS_DIR}")
|
||||
set(LANG_NEED_COPY_PREFIX "${CMAKE_CURRENT_SOURCE_DIR}/${TS_DIR}")
|
||||
set(LANG_NEED_COPY
|
||||
"${LANG_NEED_COPY_PREFIX}/about.md"
|
||||
"${LANG_NEED_COPY_PREFIX}/components.md"
|
||||
"${LANG_NEED_COPY_PREFIX}/credits.md"
|
||||
"${LANG_NEED_COPY_PREFIX}/devs.md"
|
||||
"${LANG_NEED_COPY_PREFIX}/trans.md")
|
||||
add_custom_target(
|
||||
copy_lang_files
|
||||
COMMAND ${CMAKE_COMMAND} -E copy ${LANG_NEED_COPY} ${QM_DIR}
|
||||
COMMENT "Copying files to ${LANG_DEST}")
|
||||
|
||||
set(LANG_PAK "${QM_DIR}/${LANG_PAK_NAME}")
|
||||
set(LANG_PAK "${QM_DIR}/${LANG_PAK_NAME}")
|
||||
|
||||
set(LANG_COMPRESS_CONTENT "winghex.qm" "about.md" "components.md"
|
||||
"credits.md" "devs.md" "trans.md")
|
||||
set(LANG_COMPRESS_CONTENT "winghex.qm" "about.md" "components.md"
|
||||
"credits.md" "devs.md" "trans.md")
|
||||
|
||||
add_custom_target(
|
||||
pak_lang_files
|
||||
COMMAND ${CMAKE_COMMAND} -E tar cf ${LANG_PAK_NAME} --format=zip
|
||||
${LANG_COMPRESS_CONTENT}
|
||||
WORKING_DIRECTORY "${QM_DIR}"
|
||||
COMMENT "Compressing ${TS_FILE} into ${LANG_PAK_NAME}"
|
||||
DEPENDS ${QM_FILES} copy_lang_files)
|
||||
add_custom_target(
|
||||
pak_lang_files
|
||||
COMMAND ${CMAKE_COMMAND} -E tar cf ${LANG_PAK_NAME} --format=zip
|
||||
${LANG_COMPRESS_CONTENT}
|
||||
WORKING_DIRECTORY "${QM_DIR}"
|
||||
COMMENT "Compressing ${TS_FILE} into ${LANG_PAK_NAME}"
|
||||
DEPENDS ${QM_FILES} copy_lang_files)
|
||||
|
||||
set(TARGET_NAME "langgen_${LANG_NAME}")
|
||||
add_custom_target(
|
||||
${TARGET_NAME}
|
||||
COMMAND ${CMAKE_COMMAND} -E copy ${LANG_PAK_NAME} ${QM_OUT_DIR}
|
||||
WORKING_DIRECTORY "${QM_DIR}"
|
||||
COMMENT "Copy ${TS_FILE} into ${LANG_PAK_NAME}"
|
||||
DEPENDS pak_lang_files)
|
||||
set(TARGET_NAME "langgen_${LANG_NAME}")
|
||||
add_custom_target(
|
||||
${TARGET_NAME}
|
||||
COMMAND ${CMAKE_COMMAND} -E copy ${LANG_PAK_NAME} ${QM_OUT_DIR}
|
||||
WORKING_DIRECTORY "${QM_DIR}"
|
||||
COMMENT "Copy ${TS_FILE} into ${LANG_PAK_NAME}"
|
||||
DEPENDS pak_lang_files)
|
||||
|
||||
list(APPEND LANG_TARGETS ${TARGET_NAME})
|
||||
list(APPEND LANG_TARGETS ${TARGET_NAME})
|
||||
endforeach()
|
||||
|
||||
add_custom_target(post_build_tasks ALL DEPENDS ${LANG_TARGETS})
|
||||
|
@ -318,76 +397,81 @@ set(PROJECT_SOURCES
|
|||
${CONTROL_SRC}
|
||||
${SETTING_SRC}
|
||||
${SCRIPT_ADDON_SRC}
|
||||
${ANGEL_SCRIPT_ADDON}
|
||||
${CODEEDIT_WIDGET}
|
||||
${QM_FILES}
|
||||
theme/breeze.qrc
|
||||
resources.qrc)
|
||||
|
||||
add_custom_target(
|
||||
build-time-make-directory ALL
|
||||
COMMAND
|
||||
${CMAKE_COMMAND} -E make_directory "${CMAKE_CURRENT_BINARY_DIR}/lang"
|
||||
"${CMAKE_CURRENT_BINARY_DIR}/scripts" "${CMAKE_CURRENT_BINARY_DIR}/.tmp")
|
||||
build-time-make-directory ALL
|
||||
COMMAND
|
||||
${CMAKE_COMMAND} -E make_directory "${CMAKE_CURRENT_BINARY_DIR}/lang"
|
||||
"${CMAKE_CURRENT_BINARY_DIR}/scripts"
|
||||
"${CMAKE_CURRENT_BINARY_DIR}/.tmp")
|
||||
|
||||
if(${QT_VERSION_MAJOR} GREATER_EQUAL 6)
|
||||
if(WIN32)
|
||||
set(app_icon_resource_windows "${CMAKE_CURRENT_SOURCE_DIR}/favicon.rc")
|
||||
qt_add_executable(WingHexExplorer2 MANUAL_FINALIZATION ${PROJECT_SOURCES}
|
||||
${app_icon_resource_windows})
|
||||
else()
|
||||
qt_add_executable(WingHexExplorer2 MANUAL_FINALIZATION ${PROJECT_SOURCES})
|
||||
endif()
|
||||
else()
|
||||
if(ANDROID)
|
||||
message(FATAL_ERROR "Android is not supported!")
|
||||
else()
|
||||
if(WIN32)
|
||||
set(app_icon_resource_windows "${CMAKE_CURRENT_SOURCE_DIR}/favicon.rc")
|
||||
add_executable(${CMAKE_PROJECT_NAME} ${PROJECT_SOURCES}
|
||||
${app_icon_resource_windows})
|
||||
set(app_icon_resource_windows "${CMAKE_CURRENT_SOURCE_DIR}/favicon.rc")
|
||||
qt_add_executable(WingHexExplorer2 MANUAL_FINALIZATION
|
||||
${PROJECT_SOURCES} ${app_icon_resource_windows})
|
||||
else()
|
||||
add_executable(${CMAKE_PROJECT_NAME} ${PROJECT_SOURCES})
|
||||
qt_add_executable(WingHexExplorer2 MANUAL_FINALIZATION
|
||||
${PROJECT_SOURCES})
|
||||
endif()
|
||||
else()
|
||||
if(ANDROID)
|
||||
message(FATAL_ERROR "Android is not supported!")
|
||||
else()
|
||||
if(WIN32)
|
||||
set(app_icon_resource_windows
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/favicon.rc")
|
||||
add_executable(${CMAKE_PROJECT_NAME} ${PROJECT_SOURCES}
|
||||
${app_icon_resource_windows})
|
||||
else()
|
||||
add_executable(${CMAKE_PROJECT_NAME} ${PROJECT_SOURCES})
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
|
||||
target_link_libraries(
|
||||
${CMAKE_PROJECT_NAME}
|
||||
PRIVATE Qt${QT_VERSION_MAJOR}::Widgets
|
||||
Qt${QT_VERSION_MAJOR}::Network
|
||||
Qt${QT_VERSION_MAJOR}::Concurrent
|
||||
Qt${QT_VERSION_MAJOR}::PrintSupport
|
||||
Qt${QT_VERSION_MAJOR}::GuiPrivate
|
||||
Qt${QT_VERSION_MAJOR}::CorePrivate
|
||||
SingleApplication::SingleApplication
|
||||
QWKCore
|
||||
QWKWidgets
|
||||
QHexView
|
||||
QLoggerLib
|
||||
QCodeEditor2
|
||||
QJsonModel
|
||||
angelscript
|
||||
QConsoleWidget
|
||||
qt${QT_VERSION_MAJOR}advanceddocking)
|
||||
${CMAKE_PROJECT_NAME}
|
||||
PRIVATE Qt${QT_VERSION_MAJOR}::Widgets
|
||||
Qt${QT_VERSION_MAJOR}::Network
|
||||
Qt${QT_VERSION_MAJOR}::Concurrent
|
||||
Qt${QT_VERSION_MAJOR}::PrintSupport
|
||||
Qt${QT_VERSION_MAJOR}::GuiPrivate
|
||||
Qt${QT_VERSION_MAJOR}::CorePrivate
|
||||
SingleApplication::SingleApplication
|
||||
QWKCore
|
||||
QWKWidgets
|
||||
QHexView
|
||||
QCodeEditor2
|
||||
QCodeModel2
|
||||
QJsonModel
|
||||
angelscript
|
||||
QConsoleWidget
|
||||
qt${QT_VERSION_MAJOR}advanceddocking)
|
||||
|
||||
target_include_directories(
|
||||
${CMAKE_PROJECT_NAME} PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/3rdparty"
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/src")
|
||||
${CMAKE_PROJECT_NAME} PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/3rdparty"
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/src")
|
||||
|
||||
# Qt for iOS sets MACOSX_BUNDLE_GUI_IDENTIFIER automatically since Qt 6.1. If
|
||||
# you are developing for iOS or macOS you should consider setting an explicit,
|
||||
# fixed bundle identifier manually though.
|
||||
if(${QT_VERSION} VERSION_LESS 6.1.0)
|
||||
set(BUNDLE_ID_OPTION MACOSX_BUNDLE_GUI_IDENTIFIER
|
||||
com.wingsummer.WingHexExplorer2)
|
||||
set(BUNDLE_ID_OPTION MACOSX_BUNDLE_GUI_IDENTIFIER
|
||||
com.wingsummer.WingHexExplorer2)
|
||||
endif()
|
||||
set_target_properties(
|
||||
WingHexExplorer2
|
||||
PROPERTIES ${BUNDLE_ID_OPTION} MACOSX_BUNDLE_BUNDLE_VERSION
|
||||
${PROJECT_VERSION} MACOSX_BUNDLE_SHORT_VERSION_STRING
|
||||
${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR} MACOSX_BUNDLE
|
||||
TRUE WIN32_EXECUTABLE
|
||||
TRUE)
|
||||
WingHexExplorer2
|
||||
PROPERTIES ${BUNDLE_ID_OPTION} MACOSX_BUNDLE_BUNDLE_VERSION
|
||||
${PROJECT_VERSION} MACOSX_BUNDLE_SHORT_VERSION_STRING
|
||||
${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR} MACOSX_BUNDLE
|
||||
TRUE WIN32_EXECUTABLE
|
||||
TRUE)
|
||||
|
||||
if(QT_VERSION_MAJOR EQUAL 6)
|
||||
qt_finalize_executable(WingHexExplorer2)
|
||||
qt_finalize_executable(WingHexExplorer2)
|
||||
endif()
|
||||
|
|
134
README.md
134
README.md
|
@ -7,22 +7,8 @@
|
|||
- [WingHexExplorer2](#winghexexplorer2)
|
||||
- [协议](#协议)
|
||||
- [使用声明](#使用声明)
|
||||
- [打包者必读](#打包者必读)
|
||||
- [issue 前必读](#issue-前必读)
|
||||
- [使用的开源项目](#使用的开源项目)
|
||||
- [QHexView](#qhexview)
|
||||
- [QHexEdit2](#qhexedit2)
|
||||
- [Qt-Advanced-Docking-System](#qt-advanced-docking-system)
|
||||
- [QCodeEditor2](#qcodeeditor2)
|
||||
- [QWingRibbon](#qwingribbon)
|
||||
- [QLogger](#qlogger)
|
||||
- [SingleApplication](#singleapplication)
|
||||
- [QPathEdit](#qpathedit)
|
||||
- [QWindowKit](#qwindowkit)
|
||||
- [AngelScript](#angelscript)
|
||||
- [QConsoleWidget](#qconsolewidget)
|
||||
- [QColorPicker](#qcolorpicker)
|
||||
- [QtJsonModel](#qtjsonmodel)
|
||||
- [主题](#主题)
|
||||
- [效果图](#效果图)
|
||||
- [捐助](#捐助)
|
||||
- [有关仓库](#有关仓库)
|
||||
|
@ -35,13 +21,20 @@
|
|||
<h1 align="center"> WingSummer.WingHexExplorer2</h1>
|
||||
|
||||
<p align="center">
|
||||
<img alt="PEHexExplorer" src="images/icon.png">
|
||||
<img alt="WingHexExplorer2" src="images/icon.png" />
|
||||
<p align="center">羽云十六进制浏览器</p>
|
||||
</p>
|
||||
|
||||
<p align="center">
|
||||
<img alt="作者" src="authorband.svg">
|
||||
<img alt="协议" src="licenseband.svg">
|
||||
<img alt="作者" src="authorband.svg" />
|
||||
<img alt="协议" src="licenseband.svg" />
|
||||
</p>
|
||||
|
||||
<p align="center">
|
||||
<img src="https://github.com/Wing-summer/WingHexExplorer2/actions/workflows/qt-build-test.yml/badge.svg" />
|
||||
<img src="https://github.com/Wing-summer/WingHexExplorer2/actions/workflows/clang-format-check.yml/badge.svg" />
|
||||
<img src="https://github.com/Wing-summer/WingHexExplorer2/actions/workflows/cmake-format-check.yml/badge.svg" />
|
||||
<img src="https://github.com/Wing-summer/WingHexExplorer2/actions/workflows/conventional-commit-check-push.yml/badge.svg" />
|
||||
</p>
|
||||
|
||||
- 开源不易,给个 Star 或者 [捐助](#捐助) 吧
|
||||
|
@ -101,18 +94,12 @@
|
|||
|
||||
## 软件编译运行情况
|
||||
|
||||
> 对于 QT5 版本只支持 5.14.0 及其以上的版本,其他低版本由于关键库的 API 缺失导致功能缺失,所以不提供支持。
|
||||
> 对于 Qt 5 版本,仅支持 5.15.2 或更高版本,Qt 6 的话 6.6.2 或更高的版本,其他低版本由于关键库的 API 缺失和自身的一些 Bug,所以不提供支持。
|
||||
|
||||
| 操作系统平台 | QT5 | QT6 | 缺陷 |
|
||||
| :----------: | :---: | :---: | :------------------: |
|
||||
| Windows 11 | ✔️ | ✔️ | - |
|
||||
| Deepin 20 | ✔️ | ❔ | - |
|
||||
| MacOS | ❌ | ❌ | 没有测试,未添加支持 |
|
||||
  该仓库代码使用 Qt 5.15.2 和 6.6.2 在最新版 Windows 和 Ubuntu 编译情况: 
|
||||
|
||||
## WingHexExplorer2
|
||||
|
||||
> 该项目目前版本已经有基本的功能,但还功能不太全,不过是可以保证编译通过的(建议 QT6),大家也可以克隆仓库编译看看啥情况。
|
||||
|
||||
  本软件是基于 QT 编写的十六进制编辑器,采用 C++ 进行开发,提供强大而免费的十六进制编辑器。目前只有 010 Editor 具有强大的十六进制编辑功能,但它是商用的。关注我开发动态的应该知道我开发了在 Windows 上用 C# 开发的`WingSummer.WingCloudHexExplorer`,目的是方便专业人士修改分析 PE 文件,并可作为学习 PE 结构的重要辅助工具。还有我已经开发了只针对 Deepin 平台适配的`WingHexExplorer`,目前功能已基本完善了。除了在大文件搜索功能有问题,其他已经可以稳定使用了,我决定不再维护`WingHexExplorer`,我将移植重置这个项目。
|
||||
|
||||
  为什么要开发这个项目?`WingHexExplorer2`和原来的版本有什么不同?首先,窗体界面是我自己基于开源项目进行修改,重新实现了自己的界面,保证在跨平台的 UI 一致性。虽然功能和系统原生相比还是有点缺陷,也只是算美中不足了。
|
||||
|
@ -134,6 +121,18 @@
|
|||
3. 本人非计算机专业,编写程序难免有 Bug ,欢迎提交 PR 。
|
||||
4. 无论在什么时候有疑问,请详细阅读 Wiki 。
|
||||
|
||||
### 打包者必读
|
||||
|
||||
  首先,我对你的热心帮助表示真挚的感谢。作为一个自由软件,你可以在遵守开源协议和精神的条件下,无需告知我就可以打包并通过合法渠道进行分发。你可以在打包信息里包含自己的信息,但是,你必须遵守以下作为该软件的作者我的约定:
|
||||
|
||||
1. 软件包必须包含`LICENSE`、`authorband.svg`、`licenseband.svg`、 `screenshot.png`和`README.md`这几个文件,且都放到和主程序一致的目录下。这些文件都在项目的根目录下,直接复制就行了。
|
||||
2. 除非事前声明该软件已经被二次修改,打包的二进制安装包中不得含有经修改后源码编译的主程序。
|
||||
3. 打包后的二进制安装包不得含有侵犯他人合法权益的内容,比如向其加入未经授权的付费内容或计算机病毒等。
|
||||
4. 包内最好含有主程序的校验和,但不强求。
|
||||
5. 无论是哪种打包形式,都一定要声明其开源协议和自由属性,不得隐藏而借机收费。虽然收费我并不反感,下载服务器还是需要资金维护的,但借着信息差骗人收费,这是我极其深恶痛绝的。
|
||||
6. 无论以任何为目的,如未获得我作者的授权,不得修改任意程序内指向的网络链接和软件关于信息,比如赞助和关于软件部分的内容等。
|
||||
7. 不得在安装程序内插入任何含有商业推广的插件,并且严格遵守第二条内容。
|
||||
|
||||
### issue 前必读
|
||||
|
||||
  如果你有任何形式的建议,在提交 issue 之前,请一定要阅读下面的声明,以免浪费我们双方宝贵的时间:
|
||||
|
@ -145,91 +144,8 @@
|
|||
|
||||
  如果出现比较严重的 Bug ,本人也可能不会及时的响应,谢绝站在道德的制高点不嫌冷的指指点点。
|
||||
|
||||
### 使用的开源项目
|
||||
|
||||
  不站在大佬的肩膀上,软件也不会具有强大而稳定的功能。**本软件使用的开源基础项目的源代码未经我修改的部分,全部遵守原作者的开源协议;我修改的部分,如没有特殊说明,全部遵守本仓库的协议。**
|
||||
|
||||
#### QHexView
|
||||
|
||||
  本软件基于`QHexView`作为十六进制编辑器为基础进行开发,本人在改组件基础上添加新功能和进行代码的深度定制。如下是原仓库的必要说明,详情请点击 [此链接](https://github.com/Dax89/QHexView/tree/master)。
|
||||
|
||||
  本人对改组件的改进如下:
|
||||
|
||||
1. 增加有关描述文件状态相关的功能:指示是否被修改、是否具有可写权限、是否锁定文件以防修改、是否可以增改字节数
|
||||
2. 增加可隐藏地址栏和 ASCII 解码字符栏以及表头的功能
|
||||
3. 实现超大文件(超出2GB)读写功能模块(原组件并未实现此功能)
|
||||
4. 修改地址显示长度,以适应地址的使用习惯
|
||||
5. 简化编码方式,删除一些冗余代码
|
||||
6. 增加更多的信号,充分控制 QHexView 组件
|
||||
7. 增加书签使用和管理功能
|
||||
8. 修复滚动条有关内容完全仍能够显示但仍滚动内容的 Bug
|
||||
9. 修复粘贴指针闪动位置保持不变问题,修改粘贴限制策略
|
||||
10. 增加一些接口适应工作区支持需要
|
||||
11. 修复标记背景色第一行有超出部分的 Bug
|
||||
12. 修复复制中字节含有零字节会截断的 Bug
|
||||
13. 撤销恢复支持光标跟随
|
||||
14. 升级兼容 QT6
|
||||
|
||||
#### QHexEdit2
|
||||
|
||||
  起初我打算使用`QHexEdit2`作为十六进制编辑器为基础进行开发,该组件虽然轻松打开超大文件,但是它的编辑功能能用是能用,但有很多大大小小的 Bug ,我还逐一修了修,但发现仅仅我的力量和时间是杯水车薪。然后我找到了`QHexView`,也就是上面所属的组件,但它有一个致命的缺陷,无法打开超大文件,被我放弃掉了,后来我尝试用了它,发现开发者在开发改组件是下了足够大的功夫的,编辑十分流畅。最近看到`QHexView`贡献者们想搞一个`QHexView 5.0`,对代码进行了重构,但并没有实现任何功能,差不多是个空空的框架,不过从接口看出更强大的易用性,这个是原组件所不具有的,这花费我比较多的时间来阅读源代码,并向外扩展接口以适应我的开发需求。
|
||||
|
||||
  然后我想,既然`QHexEdit2`具有强大的打开文件的能力,而`QHexView`不具备,但它具有强大的编辑界面,于是乎,我移植`QHexEdit2`的打开超大文件的代码到`QHexView`当中,并做好了适配和功能增强。原仓库的链接: <https://github.com/Simsys/qhexedit2> ,原协议为`GPL`。
|
||||
|
||||
#### Qt-Advanced-Docking-System
|
||||
|
||||
  QT Advanced Docking System 允许你使用完整的特色窗户对接系统创建可自定义的布局,类似于许多流行的集成开发环境(IDE)(例如Visual Studio)。该库功能十分强大,为了增强软件的易用性,就采用这个库。我略微修改了构建文件以方便直接嵌入到我的项目当中,也方便更新组件。
|
||||
|
||||
  原仓库的链接: <https://github.com/githubuser0xFFFF/Qt-Advanced-Docking-System> ,原协议为`LGPL`。
|
||||
|
||||
#### QCodeEditor2
|
||||
|
||||
  一个文本编辑器,功能强大。该项目用来开发以及调试针对羽云编辑器的`AngelScript`脚本。该组件来源于`edyuk`开源项目,采用`GPL`协议,不过这玩意在`Github`上也没有,只有在 [SourceForge](https://sourceforge.net/projects/edyuk) 有它的身影。我对其进行了一些定制和小`Bug`的修复。
|
||||
|
||||
#### QWingRibbon
|
||||
|
||||
  虽然这个带`Wing`这个玩意,但并不是完全是我写的,这个是基于`Qt-Ribbon-Widget`魔改来的。之所以换名字是改动的有点多,打算自己维护一个自己的用来给该编辑器使用的。
|
||||
|
||||
  原仓库的链接: <https://github.com/martijnkoopman/Qt-Ribbon-Widget> ,原协议为`LGPL`。
|
||||
|
||||
#### QLogger
|
||||
|
||||
  一个日志框架,原仓库的链接: <https://github.com/sfadiga/QLogger> ,原协议为`MIT`。
|
||||
|
||||
#### SingleApplication
|
||||
|
||||
  保留应用程序的主实例并终止每个后续实例。它可以(如果启用)生成第二(与主实例无关)实例,并且可以从第二实例向主实例发送数据。简而言之就是实现程序单例的库。原仓库的链接: <https://github.com/itay-grudev/SingleApplication> ,它的协议为`MIT`,多了一个额外限制,具体看其协议。
|
||||
|
||||
#### QPathEdit
|
||||
|
||||
  以优化和简单的方式获取本地文件和文件夹路径的一个 QT 组件。原仓库的链接: <https://github.com/Skycoder42/QPathEdit> ,原协议为`MIT`。
|
||||
|
||||
#### QWindowKit
|
||||
|
||||
  该组件是用户界面的基础,用于在不同操作系统平台提供较为统一的用户界面体验。原仓库的链接: <https://github.com/stdware/qwindowkit> ,原协议为`Apache v2.0`。
|
||||
|
||||
#### AngelScript
|
||||
|
||||
  让 C++ 成为具有惊人功能的脚本语言!这个功能强大,且不需要外部依赖,直接编译进去就行,不像之前版本必须携带一个`Python`解释器和库,不太方便编译。
|
||||
|
||||
  镜像库: <https://github.com/codecat/angelscript-mirror> ,原协议为`zlib license`,还是比较宽松的开源协议。
|
||||
|
||||
#### QConsoleWidget
|
||||
|
||||
  一个轻量的控制台组件,协议为`MIT`,仓库链接:<https://github.com/gapost/qconsolewidget> 。
|
||||
|
||||
#### QColorPicker
|
||||
|
||||
  一个颜色选择组件,协议为`MIT`,仓库链接:<https://github.com/arsdever/qcolorpicker> 。
|
||||
|
||||
#### QtJsonModel
|
||||
|
||||
  QJsonModel 是一个基于 QAbstractItemModel 的 Qt6/C++17 的 JSON 树模型类。在该项目用于插件和脚本给予宿主进行树形可视化的基础支持组件。我对其增加了 Qt5 的支持并且写了一个合适的 CMake 文件。原协议为`MIT`,修改不多遵守这个就行了。仓库链接:<https://github.com/dridk/QJsonmodel> 。
|
||||
|
||||
#### 主题
|
||||
|
||||
  主题使用的是`BreezeStyleSheets`,这个主题是我修改的定制衍生版本,我的衍生仓库为:<https://github.com/Wing-summer/BreezeStyleSheets> ,原版仓库是这个:<https://github.com/Alexhuszagh/BreezeStyleSheets>。这个我修改不多,直接`MIT`就行。
|
||||
|
||||
## 效果图
|
||||
|
||||
<p align="center">
|
||||
|
|
132
README_en.md
132
README_en.md
|
@ -7,22 +7,8 @@
|
|||
- [WingHexExplorer2](#winghexexplorer2)
|
||||
- [License](#license)
|
||||
- [Usage Statement](#usage-statement)
|
||||
- [For Packagers](#for-packagers)
|
||||
- [Issue](#issue)
|
||||
- [Open source projects used](#open-source-projects-used)
|
||||
- [QHexView](#qhexview)
|
||||
- [QHexEdit2](#qhexedit2)
|
||||
- [Qt-Advanced-Docking-System](#qt-advanced-docking-system)
|
||||
- [QCodeEditor2](#qcodeeditor2)
|
||||
- [QWingRibbon](#qwingribbon)
|
||||
- [QLogger](#qlogger)
|
||||
- [SingleApplication](#singleapplication)
|
||||
- [QPathEdit](#qpathedit)
|
||||
- [QWindowKit](#qwindowkit)
|
||||
- [AngelScript](#angelscript)
|
||||
- [QConsoleWidget](#qconsolewidget)
|
||||
- [QColorPicker](#qcolorpicker)
|
||||
- [QtJsonModel](#qtjsonmodel)
|
||||
- [Theme](#theme)
|
||||
- [Screenshot](#screenshot)
|
||||
- [Donate](#donate)
|
||||
- [Related Repository](#related-repository)
|
||||
|
@ -35,13 +21,20 @@
|
|||
<h1 align="center"> WingSummer.WingHexExplorer2</h1>
|
||||
|
||||
<p align="center">
|
||||
<img alt="PEHexExplorer" src="images/icon.png">
|
||||
<img alt="WingHexExplorer2" src="images/icon.png" />
|
||||
<p align="center">WingHexExplorer2</p>
|
||||
</p>
|
||||
|
||||
<p align="center">
|
||||
<img alt="Author" src="authorband.svg">
|
||||
<img alt="License" src="licenseband.svg">
|
||||
<img alt="Author" src="authorband.svg" />
|
||||
<img alt="License" src="licenseband.svg" />
|
||||
</p>
|
||||
|
||||
<p align="center">
|
||||
<img src="https://github.com/Wing-summer/WingHexExplorer2/actions/workflows/qt-build-test.yml/badge.svg" />
|
||||
<img src="https://github.com/Wing-summer/WingHexExplorer2/actions/workflows/clang-format-check.yml/badge.svg" />
|
||||
<img src="https://github.com/Wing-summer/WingHexExplorer2/actions/workflows/cmake-format-check.yml/badge.svg" />
|
||||
<img src="https://github.com/Wing-summer/WingHexExplorer2/actions/workflows/conventional-commit-check-push.yml/badge.svg" />
|
||||
</p>
|
||||
|
||||
- Not easy to open source, please Star or [Donate](#donate)
|
||||
|
@ -101,13 +94,9 @@ Make sure that you follow [CODE_OF_CONDUCT.md](CODE_OF_CONDUCT.md) while contrib
|
|||
|
||||
## Status
|
||||
|
||||
> For QT5 version, only version 5.14.0 and above are supported. Other lower versions are not supported because of missing APIs of key libraries.
|
||||
> For Qt 5, only version 5.15.2 or higher is supported, and for Qt 6, only version 6.6.2 or higher is supported. Other lower versions are not supported due to missing APIs of key libraries and some bugs of their own.
|
||||
|
||||
| OS | QT5 | QT6 | faults |
|
||||
| :--------: | :---: | :---: | :--------: |
|
||||
| Windows 11 | ✔️ | ✔️ | - |
|
||||
| Deepin 20 | ✔️ | ❔ | - |
|
||||
| MacOS | ❌ | ❌ | Not tested |
|
||||
The repository code compiles with Qt 5.15.2 and 6.6.2 on the latest versions of Windows and Ubuntu: 
|
||||
|
||||
## WingHexExplorer2
|
||||
|
||||
|
@ -132,6 +121,18 @@ If you want to use the code of this software for closed-source commercial code a
|
|||
3. I am not a computer major, and there are inevitably bugs in the program I write. Welcome to submit PR.
|
||||
4. Whenever you have questions, please read the Wiki in detail.
|
||||
|
||||
### For Packagers
|
||||
|
||||
First of all, I would like to express my sincere tanks for your enthusiastic help. As a free software, you can package and distribute it through legal channels without informing me under the condition of complying with the open source license and spirit. You can include your own information in the packaging information, but you must abide by the following agreements with me as the author of the software:
|
||||
|
||||
1. The software package must contain the files `LICENSE`, `authorband.svg`, `licenseband.svg`, `screenshot.png` and `README.md`, and they must be placed in the same directory as the main program. These files are in the root directory of the project, just copy them.
|
||||
2. Unless it is stated in advance that the software is modified, the package must not contain the main program compiled from the modified source code.
|
||||
3. The package must not contain content that infringes on the legitimate rights and interests of others, such as adding unauthorized paid content or computer viruses to it.
|
||||
4. It is best to contain the checksum of the main program in the package, but it is not mandatory.
|
||||
5. Regardless of the packaging format, its open source agreement and free attributes must be stated, and it is not allowed to hide and charge for it. Although I don't mind charging, the download server still needs money to maintain, but I hate charging by taking advantage of the information gap.
|
||||
6. Regardless of the purpose, if you do not obtain the authorization of me, you may not modify any network links pointed to and the ABOUT contents in the program, such as sponsorship and content about the software.
|
||||
7. You may not insert any plug-in containing commercial promotion in the installation program, and strictly abide by the content of the second article.
|
||||
|
||||
### Issue
|
||||
|
||||
If you have any suggestions, please be sure to read the following statement before submitting an issue to avoid wasting our precious time:
|
||||
|
@ -143,91 +144,8 @@ All of the above, if you are a like-minded open source contributor, you are welc
|
|||
|
||||
If a serious bug occurs, I may not respond in time, and I refuse any gossip from the moral high ground.
|
||||
|
||||
### Open source projects used
|
||||
|
||||
Without standing on the shoulders of giants, it will not have powerful and stable functions.**The source code of the open source basic projects used in this software that have not been modified by me all comply with the open source agreement of the original author; The parts that I have modified, unless otherwise specified, all comply with the agreement of this repository.**
|
||||
|
||||
#### QHexView
|
||||
|
||||
  This software is developed based on `QHexView` as a hexadecimal editor. I added new functions and deeply customized the code based on this component. The following is the necessary instructions for the original warehouse. For details, please click [this link](https://github.com/Dax89/QHexView/tree/master)。
|
||||
|
||||
My improvements to this component are as follows:
|
||||
|
||||
1. Added functions related to describing the file status: indicating whether it has been modified, whether it has writable permissions, whether the file is locked to prevent modification, and whether the number of bytes can be increased or changed
|
||||
2. Added the function of hiding the address bar, ASCII decoding character bar, and header
|
||||
3. Implemented the read and write function module for large files (exceeding 2GB) (the original component did not implement this function)
|
||||
4. Modified the address display length to adapt to the usage habits of the address
|
||||
5. Simplified the encoding method and deleted some redundant codes
|
||||
6. Added more signals to fully control the QHexView component
|
||||
7. Added bookmark usage and management functions
|
||||
8. Fixed the bug that the scroll bar related content can still be displayed but still scrolls the content
|
||||
9. Fixed the problem that the flashing position of the paste pointer remains unchanged, and modified the paste restriction strategy
|
||||
10. Added some interfaces to adapt to the needs of workspace support
|
||||
11. Fixed the bug that the first line of the mark background color has an excess part
|
||||
12. Fixed the bug that the bytes in the copy contain zero bytes and will be truncated
|
||||
13. Undo and restore support cursor following
|
||||
14. Upgraded to be compatible with QT6
|
||||
|
||||
#### QHexEdit2
|
||||
|
||||
At first, I planned to use `QHexEdit2` as the basis for the development of the hexadecimal editor. Although this component can easily open very large files. Its editing function can be used, but there are many bugs. I also fixed them one by one, but found that my strength and time alone were not enough. Then I found `QHexView`, which is the component mentioned above, but it has a fatal problem: cannot open very large files. I gave up on it. Later, I tried to use it and found that the developers put enough effort in developing the component, and the editing is very smooth.
|
||||
|
||||
Then I thought, since `QHexEdit2` has a powerful file opening capability, while `QHexView` does not, but it has a powerful editing interface, I ported the code of `QHexEdit2` for opening large files to `QHexView`, and made adaptation and functional enhancement. The link of the original repository is: <https://github.com/Simsys/qhexedit2>, the original agreement is `GPL`.
|
||||
|
||||
#### Qt-Advanced-Docking-System
|
||||
|
||||
QT Advanced Docking System allows you to create customizable layouts with a full featured window docking system, similar to many popular integrated development environments (IDEs) (such as Visual Studio). This library is very powerful, and in order to enhance the ease of use of the software, this library is used. I slightly modified the build file to facilitate direct embedding into my project and to facilitate updating components.
|
||||
|
||||
The link to the original repository: <https://github.com/githubuser0xFFFF/Qt-Advanced-Docking-System>, the original agreement is `LGPL`.
|
||||
|
||||
#### QCodeEditor2
|
||||
|
||||
A text editor with powerful functions. This project is used to develop and debug AngelScript scripts for WingHexExplorer2. This component comes from the open source project `edyuk` and uses the GPL. However, it is not available on Github, only on SourceForge. I made some customizations and fixed some minor bugs.
|
||||
|
||||
#### QWingRibbon
|
||||
|
||||
Although it contains the `Wing` string, it is not entirely written by me. It is based on the `Qt-Ribbon-Widget`. The reason for the name change is that there are too many changes, and I plan to maintain my own one for use with this editor.
|
||||
|
||||
The link to the original repository: <https://github.com/martijnkoopman/Qt-Ribbon-Widget>, the original agreement is `LGPL`.
|
||||
|
||||
#### QLogger
|
||||
|
||||
A logging framework, the link of the original repository: <https://github.com/sfadiga/QLogger>, the original license is `MIT`.
|
||||
|
||||
#### SingleApplication
|
||||
|
||||
Keeps the Primary Instance of your Application and kills each subsequent instances. It can (if enabled) spawn secondary (non-related to the primary) instances and can send data to the primary instance from secondary instances. In short, it is a library that implements a singleton program. The link to the original warehouse: <https://github.com/itay-grudev/SingleApplication>, its license is `MIT`, with an additional restriction, please refer to its license for details.
|
||||
|
||||
#### QPathEdit
|
||||
|
||||
A QT component for getting local file and folder paths in an optimized and simple way. The link to the original repository: <https://github.com/Skycoder42/QPathEdit>, the original license is `MIT`.
|
||||
|
||||
#### QWindowKit
|
||||
|
||||
This component is the basis of the user interface and is used to provide a relatively unified user interface experience on different operating system platforms. The link to the original repository is: <https://github.com/stdware/qwindowkit>, and the original protocol is `Apache v2.0`.
|
||||
|
||||
#### AngelScript
|
||||
|
||||
Make C++ a scripting language with amazing features! This is powerful and does not require external dependencies. You can compile it directly, unlike previous versions that require a `Python` interpreter and library, which is not very convenient to compile.
|
||||
|
||||
Mirror library: <https://github.com/codecat/angelscript-mirror>, the original agreement is `zlib license`, which is a relatively loose open source agreement.
|
||||
|
||||
#### QConsoleWidget
|
||||
|
||||
A lightweight console component, the license is `MIT`, repository link: <https://github.com/gapost/qconsolewidget> .
|
||||
|
||||
#### QColorPicker
|
||||
|
||||
A color selection component, the license is `MIT`, repository link: <https://github.com/arsdever/qcolorpicker>.
|
||||
|
||||
#### QtJsonModel
|
||||
|
||||
QJsonModel is a Qt6/C++17 JSON tree model class based on QAbstractItemModel. In this project, plugins and scripts provide basic support components for tree visualization. I added Qt5 support and wrote a suitable CMake file. The original license is `MIT`, and you can follow it without making too many changes. Repository link: <https://github.com/dridk/QJsonmodel> .
|
||||
|
||||
#### Theme
|
||||
|
||||
The theme uses `BreezeStyleSheets`, which is a customized derivative version modified by me. My repository is: <https://github.com/Wing-summer/BreezeStyleSheets>, and the original repository is this: <https://github.com/Alexhuszagh/BreezeStyleSheets>. I don't modify much, just `MIT` directly.
|
||||
|
||||
## Screenshot
|
||||
|
||||
<p align="center">
|
||||
|
|
16
TODO.txt
16
TODO.txt
|
@ -1,15 +1,11 @@
|
|||
v2.0.0 版本规划(不知道啥时候会完成,很可能会鸽):
|
||||
|
||||
1. 增加脚本的 Json 支持和正则表达式支持。
|
||||
2. 对编辑器提供更加细节的设置:比如日志显示级别以及开发者模式等等。
|
||||
3. 完成内置的 AngelScript 脚本的开发和调试的编辑器。
|
||||
4. 实现在 Win 和 Linux 的基于 GitAction 自动化编译,在本地编译后只需输入一个命令或程序即可完成对当前平台支持的安装程序打包。
|
||||
5. 对程序的操作细节优化,增加更多的提醒,完成剩余的细节功能(比如最近打开功能、打开文件等)。
|
||||
6. 尝试增加 AngelScript 脚本模块调用支持(类似标准库)。
|
||||
7. 增加使用通用文件对话框按钮和标题栏是否使用系统提供的切换。
|
||||
8. 使用文档和开发文档。
|
||||
|
||||
等 v2.0.0 前 7 项完成之后,我会考虑多平台的支持和安装包的发布:rpm、linglong、flatpak、 Win 安装包(考虑 InnoSetup)等;以及其他硬件平台:arm64 、RISC-V 和 LoongArch 实验性支持。
|
||||
1. 增加 AngelScript 脚本编辑器的词法相关支持,比如更好的语法高亮以及增加智能提示等。
|
||||
2. 增加对内置的 AngelScript 脚本编辑器设置功能,增加语法片段管理器和支持。
|
||||
3. 对程序的操作细节优化,增加更多的提醒。
|
||||
4. 完善 AngelScript 脚本模块标准库。
|
||||
5. 为 AngelScript 增加宏的条件编译,拓展宏的功能。
|
||||
6. 使用文档和开发文档。
|
||||
|
||||
v3.0.0 版本规划:
|
||||
|
||||
|
|
Binary file not shown.
After Width: | Height: | Size: 11 KiB |
Binary file not shown.
After Width: | Height: | Size: 7.3 KiB |
Binary file not shown.
After Width: | Height: | Size: 3.8 KiB |
Binary file not shown.
After Width: | Height: | Size: 3.4 KiB |
|
@ -21,16 +21,16 @@ QT Advanced Docking System 允许你使用完整的特色窗户对接系统创
|
|||
|
||||
一个文本编辑器,功能强大。该项目用来开发以及调试针对羽云编辑器的`AngelScript`脚本。该组件来源于`edyuk`开源项目,采用`GPL`协议,不过这玩意在`Github`上也没有,只有在 [SourceForge](https://sourceforge.net/projects/edyuk) 有它的身影。我对其进行了一些定制和小`Bug`的修复。
|
||||
|
||||
#### QCodeModel2
|
||||
|
||||
该组件来源于`edyuk`这一个项目,用于代码解析。本项目的代码分析和代码智能提示也是基于该项目中的`C++`分析器相关代码修改而来,来源同`QCodeEditor2`。
|
||||
|
||||
#### QWingRibbon
|
||||
|
||||
虽然这个带`Wing`这个玩意,但并不是完全是我写的,这个是基于`Qt-Ribbon-Widget`魔改来的。之所以换名字是改动的有点多,打算自己维护一个自己的用来给该编辑器使用的。
|
||||
|
||||
原仓库的链接: <https://github.com/martijnkoopman/Qt-Ribbon-Widget> ,原协议为`LGPL`。
|
||||
|
||||
#### QLogger
|
||||
|
||||
一个日志框架,原仓库的链接: <https://github.com/sfadiga/QLogger> ,原协议为`MIT`。
|
||||
|
||||
#### SingleApplication
|
||||
|
||||
保留应用程序的主实例并终止每个后续实例。它可以(如果启用)生成第二(与主实例无关)实例,并且可以从第二实例向主实例发送数据。简而言之就是实现程序单例的库。原仓库的链接: <https://github.com/itay-grudev/SingleApplication> ,它的协议为`MIT`,多了一个额外限制,具体看其协议。
|
||||
|
|
|
@ -3,7 +3,8 @@
|
|||
|
||||
  维护一个好用的工具并不是一个人能做到了,更重要的是大家共同维护,如下是对本仓库代码有贡献的同志,特此感谢:
|
||||
|
||||
> 吉位招租
|
||||
* oPengLuo (大大的力量)
|
||||
|
||||
|
||||
## 赞助鸣谢
|
||||
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -1,4 +0,0 @@
|
|||
#! /usr/bin/bash
|
||||
|
||||
export LD_LIBRARY_PATH=/opt/WingHexExplorer2:$LD_LIBRARY_PATH
|
||||
/opt/WingHexExplorer2/WingHexExplorer2 "$@"
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue