Mercurial > hg > forks > UniversalIndentGUI
changeset 558:6211dda17c26
Renamed the class Highlighter to UiguiHighlighter.
git-svn-id: svn://svn.code.sf.net/p/universalindent/code/trunk@798 59b1889a-e5ac-428c-b0c7-476e01d41282
author | thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282> |
---|---|
date | Thu, 02 Oct 2008 20:24:55 +0000 |
parents | 9c799c456379 |
children | fdd8c3619811 |
files | src/highlighter.cpp src/highlighter.h src/mainwindow.cpp src/mainwindow.h |
diffstat | 4 files changed, 20 insertions(+), 20 deletions(-) [+] |
line wrap: on
line diff
--- a/src/highlighter.cpp Thu Oct 02 20:21:32 2008 +0000 +++ b/src/highlighter.cpp Thu Oct 02 20:24:55 2008 +0000 @@ -26,15 +26,15 @@ //! \defgroup grp_EditorComponent All concerning editor widget. /*! - \class Highlighter + \class UiguiHighlighter \ingroup grp_EditorComponent - \brief Highlighter used by QTextEdit fields to syntax highlight cpp source code + \brief UiguiHighlighter used for selecting the syntax highlighter/lexer for the QsciScintilla component. */ /*! \brief The constructor initializes some regular expressions and keywords to identify cpp tokens */ -Highlighter::Highlighter(QsciScintilla *parent) +UiguiHighlighter::UiguiHighlighter(QsciScintilla *parent) : QObject(parent) { this->parent = parent; @@ -98,7 +98,7 @@ /*! \brief Returns the available highlighters as QStringList. */ -QStringList Highlighter::getAvailableHighlighters() { +QStringList UiguiHighlighter::getAvailableHighlighters() { return mapHighlighternameToExtension.keys(); } @@ -106,7 +106,7 @@ /*! \brief This slot handles signals coming from selecting another syntax highlighter. */ -void Highlighter::setHighlighterByAction(QAction* highlighterAction) { +void UiguiHighlighter::setHighlighterByAction(QAction* highlighterAction) { QString highlighterName = highlighterAction->text(); setLexerForExtension( mapHighlighternameToExtension[highlighterName].first() ); //TODO: This is really no nice way. How do it better? @@ -120,7 +120,7 @@ /*! \brief Turns the syntax parser on. */ -void Highlighter::turnHighlightOn() { +void UiguiHighlighter::turnHighlightOn() { highlightningIsOn = true; parent->setLexer(lexer); readCurrentSettings(""); @@ -129,7 +129,7 @@ /*! \brief Turns the syntax parser off. */ -void Highlighter::turnHighlightOff() { +void UiguiHighlighter::turnHighlightOff() { highlightningIsOn = false; parent->setLexer(); parent->setFont( QFont("Courier", 10, QFont::Normal) ); @@ -140,7 +140,7 @@ /*! \brief Read the settings for the current lexer from the settings file. */ -bool Highlighter::readCurrentSettings( const char *prefix ) +bool UiguiHighlighter::readCurrentSettings( const char *prefix ) { bool ok, flag, rc = true; int num; @@ -221,7 +221,7 @@ /*! \brief Write the settings for the current lexer to the settings file. */ -void Highlighter::writeCurrentSettings( const char *prefix ) +void UiguiHighlighter::writeCurrentSettings( const char *prefix ) { QString key; @@ -288,7 +288,7 @@ /*! \brief Sets the \a color for the given \a style. */ -void Highlighter::setColor(const QColor &color, int style) { +void UiguiHighlighter::setColor(const QColor &color, int style) { colorForStyles[style] = color; lexer->setColor( color, style ); } @@ -297,7 +297,7 @@ /*! \brief Sets the \a font for the given \a style. */ -void Highlighter::setFont(const QFont &font, int style) { +void UiguiHighlighter::setFont(const QFont &font, int style) { fontForStyles[style] = font; lexer->setFont( font, style ); } @@ -306,7 +306,7 @@ /*! \brief Sets the to be used lexer by giving his name. */ -void Highlighter::setLexerByName( QString lexerName ) { +void UiguiHighlighter::setLexerByName( QString lexerName ) { setLexerForExtension( mapHighlighternameToExtension[lexerName].first() ); } @@ -314,7 +314,7 @@ /*! \brief Sets the proper highlighter / lexer for the given file \a extension. Returns the index of the used lexer in the list. */ -int Highlighter::setLexerForExtension( QString extension ) { +int UiguiHighlighter::setLexerForExtension( QString extension ) { int indexOfHighlighter = 0; extension = extension.toLower();
--- a/src/highlighter.h Thu Oct 02 20:21:32 2008 +0000 +++ b/src/highlighter.h Thu Oct 02 20:24:55 2008 +0000 @@ -17,8 +17,8 @@ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * ***************************************************************************/ -#ifndef HIGHLIGHTER_H -#define HIGHLIGHTER_H +#ifndef UIGUIHIGHLIGHTER_H +#define UIGUIHIGHLIGHTER_H #include <QObject> #include <QMap> @@ -57,12 +57,12 @@ #include <Qsci/qscilexeryaml.h> -class Highlighter : public QObject +class UiguiHighlighter : public QObject { Q_OBJECT public: - Highlighter(QsciScintilla *parent); + UiguiHighlighter(QsciScintilla *parent); void turnHighlightOff(); void turnHighlightOn(); @@ -96,4 +96,4 @@ void setHighlighterByAction(QAction* highlighterAction); }; -#endif // HIGHLIGHTER_H +#endif // UIGUIHIGHLIGHTER_H
--- a/src/mainwindow.cpp Thu Oct 02 20:21:32 2008 +0000 +++ b/src/mainwindow.cpp Thu Oct 02 20:24:55 2008 +0000 @@ -261,7 +261,7 @@ */ void MainWindow::initSyntaxHighlighter() { // Create the highlighter. - highlighter = new Highlighter(txtedSourceCode); + highlighter = new UiguiHighlighter(txtedSourceCode); // Handle if syntax highlighting is enabled bool syntaxHighlightningEnabled = settings->getValueByName("SyntaxHighlightningEnabled").toBool();
--- a/src/mainwindow.h Thu Oct 02 20:21:32 2008 +0000 +++ b/src/mainwindow.h Thu Oct 02 20:24:55 2008 +0000 @@ -87,7 +87,7 @@ QString sourceFileContent; QString sourceFormattedContent; QString sourceViewContent; - Highlighter *highlighter; + UiguiHighlighter *highlighter; QScrollBar *textEditVScrollBar; AboutDialog *aboutDialog; AboutDialogGraphicsView *aboutDialogGraphicsView;