-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
New template system and more refactoring
- Loading branch information
Showing
105 changed files
with
3,902 additions
and
1,414 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
#ifndef _C_HIGHLIGHTER_HPP_ | ||
#define _C_HIGHLIGHTER_HPP_ | ||
|
||
#include "syntax_highlighter.hpp" | ||
|
||
#include <QHash> | ||
|
||
class QTextDocument; | ||
|
||
namespace Kiss | ||
{ | ||
class CHighlighter : public SyntaxHighlighter | ||
{ | ||
Q_OBJECT | ||
public: | ||
CHighlighter(QTextDocument *parent = 0); | ||
}; | ||
} | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
#ifndef _CODE_EDITOR_HPP_ | ||
#define _CODE_EDITOR_HPP_ | ||
|
||
#include <QMap> | ||
#include <QWidget> | ||
#include <QPlainTextEdit> | ||
|
||
namespace Kiss | ||
{ | ||
namespace Widget | ||
{ | ||
class CodeEditor; | ||
|
||
class CodeEditorMargin : public QWidget | ||
{ | ||
public: | ||
CodeEditorMargin(CodeEditor *editor); | ||
QSize sizeHint() const; | ||
|
||
protected: | ||
void paintEvent(QPaintEvent *event); | ||
|
||
private: | ||
CodeEditor *m_editor; | ||
}; | ||
|
||
class MarginIndicator | ||
{ | ||
public: | ||
MarginIndicator(const QColor& color); | ||
const QColor& color() const; | ||
|
||
static const MarginIndicator& none(); | ||
private: | ||
QColor m_color; | ||
|
||
static MarginIndicator s_none; | ||
}; | ||
|
||
class CodeEditor : public QPlainTextEdit | ||
{ | ||
Q_OBJECT | ||
public: | ||
CodeEditor(QWidget *parent = 0); | ||
|
||
void setEditorFont(const QFont& font); | ||
QFont editorFont() const; | ||
QFont marginFont() const; | ||
|
||
void setMarginIndicator(const int& line, const MarginIndicator& indicator); | ||
void clearIndicators(); | ||
|
||
quint16 marginSize() const; | ||
|
||
friend class CodeEditorMargin; | ||
protected: | ||
void marginPaintEvent(QPaintEvent *event); | ||
void resizeEvent(QResizeEvent *e); | ||
void scrollContentsBy(int dx, int dy); | ||
|
||
void keyPressEvent(QKeyEvent *e); | ||
|
||
private slots: | ||
void highlightCurrentLine(); | ||
void updateMarginArea(const QRect& rect, const int& dy); | ||
void updateMarginSize(); | ||
|
||
private: | ||
QFont m_marginFont; | ||
CodeEditorMargin *m_margin; | ||
QMap<int, MarginIndicator> m_indicators; | ||
}; | ||
} | ||
} | ||
|
||
#endif |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
#ifndef _DUMMY_INTERFACE_HPP_ | ||
#define _DUMMY_INTERFACE_HPP_ | ||
|
||
#include "interface.hpp" | ||
|
||
#include <QObject> | ||
|
||
namespace Kiss | ||
{ | ||
namespace Target | ||
{ | ||
class DummyInterface : public QObject, public Interface | ||
{ | ||
Q_OBJECT | ||
Q_INTERFACES(Kiss::Target::Interface) | ||
public: | ||
DummyInterface(); | ||
|
||
virtual const bool scan(Kiss::Target::InterfaceResponder *responder); | ||
virtual void invalidateResponder(); | ||
}; | ||
} | ||
} | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
#ifndef _KAR_HPP_ | ||
#define _KAR_HPP_ | ||
|
||
#include <QString> | ||
#include <QMap> | ||
#include <QStringList> | ||
#include <QByteArray> | ||
|
||
namespace Kiss | ||
{ | ||
class Kar | ||
{ | ||
public: | ||
bool addFile(const QString& name, const QByteArray& data); | ||
void setFile(const QString& name, const QByteArray& data); | ||
bool removeFile(const QString& name); | ||
bool hasFile(const QString& name); | ||
bool rename(const QString& name, const QString& newName); | ||
|
||
QByteArray data(const QString& name) const; | ||
QStringList files() const; | ||
|
||
static Kar *create(); | ||
static Kar *load(const QString& path); | ||
bool save(const QString& path); | ||
|
||
private: | ||
Kar(); | ||
Kar(const QMap<QString, QByteArray>& data); | ||
|
||
QMap<QString, QByteArray> m_data; | ||
}; | ||
} | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.