Skip to content

Commit 520dad5

Browse files
committed
Port to verdigris
1 parent 1d60380 commit 520dad5

35 files changed

Lines changed: 105 additions & 25 deletions

CMakeLists.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ set(SOURCE_FILES
8080
)
8181

8282
# Create code for QObjects
83-
set(CMAKE_AUTOMOC On)
83+
set(CMAKE_AUTOMOC OFF)
8484

8585
# Create code from resource files
8686
set(CMAKE_AUTORCC ON)
@@ -102,6 +102,7 @@ add_library(QCodeEditor STATIC
102102

103103
target_include_directories(QCodeEditor PUBLIC
104104
include
105+
"${OSSIA_3RDPARTY_FOLDER}/verdigris/src"
105106
)
106107

107108
if(CMAKE_COMPILER_IS_GNUCXX)

include/internal/QCXXHighlighter.hpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
// Qt
88
#include <QRegularExpression>
99
#include <QVector>
10+
#include <verdigris>
1011

1112
class QSyntaxStyle;
1213

@@ -16,7 +17,7 @@ class QSyntaxStyle;
1617
*/
1718
class QCXXHighlighter : public QStyleSyntaxHighlighter
1819
{
19-
Q_OBJECT
20+
W_OBJECT(QCXXHighlighter)
2021
public:
2122
/**
2223
* @brief Constructor.

include/internal/QCodeEditor.hpp

Lines changed: 23 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
// Qt
44
#include <QTextEdit> // Required for inheritance
5+
#include <verdigris>
56

67
class QCompleter;
78
class QLineNumberArea;
@@ -14,7 +15,7 @@ class QFramedTextAttribute;
1415
*/
1516
class QCodeEditor : public QTextEdit
1617
{
17-
Q_OBJECT
18+
W_OBJECT(QCodeEditor)
1819

1920
public:
2021
/**
@@ -142,97 +143,110 @@ class QCodeEditor : public QTextEdit
142143
*/
143144
void clearSquiggle();
144145

145-
Q_SIGNALS:
146+
public:
146147
/**
147148
* @brief Signal, the font is changed by the wheel event.
148149
*/
149-
void fontChanged(const QFont &newFont);
150+
void fontChanged(const QFont &newFont) W_SIGNAL(fontChanged, newFont);
150151

151152
/**
152153
* @brief Signal, like QLineEdit::editingFinished
153154
*/
154-
void editingFinished();
155+
void editingFinished() W_SIGNAL(editingFinished);
155156

156157
/**
157158
* @brief CTRL+Enter
158159
*/
159-
void livecodeTrigger();
160-
161-
public Q_SLOTS:
160+
void livecodeTrigger() W_SIGNAL(livecodeTrigger);
162161

162+
public:
163163
/**
164164
* @brief Slot, that performs insertion of
165165
* completion info into code.
166166
* @param s Data.
167167
*/
168168
void insertCompletion(const QString &s);
169+
W_SLOT(insertCompletion);
169170

170171
/**
171172
* @brief Slot, that performs update of
172173
* internal editor viewport based on line
173174
* number area width.
174175
*/
175176
void updateLineNumberAreaWidth(int);
177+
W_SLOT(updateLineNumberAreaWidth);
176178

177179
/**
178180
* @brief Slot, that performs update of some
179181
* part of line number area.
180182
* @param rect Area that has to be updated.
181183
*/
182184
void updateLineNumberArea(QRect rect);
185+
W_SLOT(updateLineNumberArea);
183186

184187
/**
185188
* @brief Slot, that will proceed extra selection
186189
* for current cursor position.
187190
*/
188191
void updateExtraSelection1();
192+
W_SLOT(updateExtraSelection1);
189193
void updateExtraSelection2();
194+
W_SLOT(updateExtraSelection2);
190195

191196
/**
192197
* @brief Slot, that will update editor style.
193198
*/
194199
void updateStyle();
200+
W_SLOT(updateStyle);
195201

196202
/**
197203
* @brief Slot, that indent the selected lines.
198204
*/
199205
void indent();
206+
W_SLOT(indent);
200207

201208
/**
202209
* @brief Slot, that unindent the selected lines.
203210
*/
204211
void unindent();
212+
W_SLOT(unindent);
205213

206214
/**
207215
* @brief Slot, that swap the selected lines up.
208216
*/
209217
void swapLineUp();
218+
W_SLOT(swapLineUp);
210219

211220
/**
212221
* @brief Slot, that swap the selected lines down.
213222
*/
214223
void swapLineDown();
224+
W_SLOT(swapLineDown);
215225

216226
/**
217227
* @brief Slot, that delete the selected lines.
218228
*/
219229
void deleteLine();
230+
W_SLOT(deleteLine);
220231

221232
/**
222233
* @brief Slot, that duplicate the current line or the selection.
223234
*/
224235
void duplicate();
236+
W_SLOT(duplicate);
225237

226238
/**
227239
* @brief Slot, that toggle single line comment of the
228240
* selected lines.
229241
*/
230242
void toggleComment();
243+
W_SLOT(toggleComment);
231244

232245
/**
233246
* @brief Slot, that toggle block comment of the selection.
234247
*/
235248
void toggleBlockComment();
249+
W_SLOT(toggleBlockComment);
236250

237251
protected:
238252
/**
@@ -293,11 +307,12 @@ class QCodeEditor : public QTextEdit
293307
*/
294308
bool event(QEvent *e) override;
295309

296-
private Q_SLOTS:
310+
private:
297311
/**
298312
* @brief Slot, that updates the bottom margin.
299313
*/
300314
void updateBottomMargin();
315+
W_SLOT(updateBottomMargin)
301316

302317
private:
303318
/**

include/internal/QGLSLCompleter.hpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,15 @@
22

33
// Qt
44
#include <QCompleter> // Required for inheritance
5+
#include <verdigris>
56

67
/**
78
* @brief Class, that describes completer with
89
* glsl specific types and functions.
910
*/
1011
class QGLSLCompleter : public QCompleter
1112
{
12-
Q_OBJECT
13+
W_OBJECT(QGLSLCompleter)
1314

1415
public:
1516
/**

include/internal/QGLSLHighlighter.hpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
// Qt
88
#include <QRegularExpression>
99
#include <QVector>
10+
#include <verdigris>
1011

1112
class QSyntaxStyle;
1213

@@ -16,7 +17,7 @@ class QSyntaxStyle;
1617
*/
1718
class QGLSLHighlighter : public QStyleSyntaxHighlighter
1819
{
19-
Q_OBJECT
20+
W_OBJECT(QGLSLHighlighter)
2021
public:
2122
/**
2223
* @brief Constructor.

include/internal/QHighlightBlockRule.hpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
// Qt
44
#include <QRegularExpression>
55
#include <QString>
6+
#include <verdigris>
67

78
struct QHighlightBlockRule
89
{

include/internal/QHighlightRule.hpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
// Qt
44
#include <QRegularExpression>
55
#include <QString>
6+
#include <verdigris>
67

78
struct QHighlightRule
89
{
@@ -16,4 +17,4 @@ struct QHighlightRule
1617

1718
QRegularExpression pattern;
1819
QString formatName;
19-
};
20+
};

include/internal/QJSHighlighter.hpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
// Qt
77
#include <QRegularExpression>
88
#include <QVector>
9+
#include <verdigris>
910

1011
class QSyntaxStyle;
1112

@@ -14,7 +15,7 @@ class QSyntaxStyle;
1415
*/
1516
class QJSHighlighter : public QStyleSyntaxHighlighter
1617
{
17-
Q_OBJECT
18+
W_OBJECT(QJSHighlighter)
1819

1920
public:
2021
/**

include/internal/QJSONHighlighter.hpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,15 @@
66

77
// Qt
88
#include <QVector>
9+
#include <verdigris>
910

1011
/**
1112
* @brief Class, that describes JSON code
1213
* highlighter.
1314
*/
1415
class QJSONHighlighter : public QStyleSyntaxHighlighter
1516
{
16-
Q_OBJECT
17+
W_OBJECT(QJSONHighlighter)
1718
public:
1819
/**
1920
* @brief Constructor.

include/internal/QJavaHighlighter.hpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
// Qt
88
#include <QRegularExpression>
99
#include <QVector>
10+
#include <verdigris>
1011

1112
class QSyntaxStyle;
1213

@@ -15,7 +16,7 @@ class QSyntaxStyle;
1516
*/
1617
class QJavaHighlighter : public QStyleSyntaxHighlighter
1718
{
18-
Q_OBJECT
19+
W_OBJECT(QJavaHighlighter)
1920
public:
2021
/**
2122
* @brief Constructs a new instance of a Java highlighter.

0 commit comments

Comments
 (0)