Initial commit: ReclassX structured binary editor

This commit is contained in:
sysadmin
2026-02-01 11:37:32 -07:00
commit 0be67c8396
786 changed files with 473499 additions and 0 deletions

View File

@@ -0,0 +1,90 @@
// This module defines interface to the QsciAbstractAPIs class.
//
// Copyright (c) 2023 Riverbank Computing Limited <info@riverbankcomputing.com>
//
// This file is part of QScintilla.
//
// This file may be used under the terms of the GNU General Public License
// version 3.0 as published by the Free Software Foundation and appearing in
// the file LICENSE included in the packaging of this file. Please review the
// following information to ensure the GNU General Public License version 3.0
// requirements will be met: http://www.gnu.org/copyleft/gpl.html.
//
// If you do not wish to use this file under the terms of the GPL version 3.0
// then you may purchase a commercial license. For more information contact
// info@riverbankcomputing.com.
//
// 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 QSCIABSTRACTAPIS_H
#define QSCIABSTRACTAPIS_H
#include <QList>
#include <QObject>
#include <QStringList>
#include <Qsci/qsciglobal.h>
#include <Qsci/qsciscintilla.h>
class QsciLexer;
//! \brief The QsciAbstractAPIs class represents the interface to the textual
//! API information used in call tips and for auto-completion. A sub-class
//! will provide the actual implementation of the interface.
//!
//! API information is specific to a particular language lexer but can be
//! shared by multiple instances of the lexer.
class QSCINTILLA_EXPORT QsciAbstractAPIs : public QObject
{
Q_OBJECT
public:
//! Constructs a QsciAbstractAPIs instance attached to lexer \a lexer. \a
//! lexer becomes the instance's parent object although the instance can
//! also be subsequently attached to other lexers.
QsciAbstractAPIs(QsciLexer *lexer);
//! Destroy the QsciAbstractAPIs instance.
virtual ~QsciAbstractAPIs();
//! Return the lexer that the instance is attached to.
QsciLexer *lexer() const;
//! Update the list \a list with API entries derived from \a context. \a
//! context is the list of words in the text preceding the cursor position.
//! The characters that make up a word and the characters that separate
//! words are defined by the lexer. The last word is a partial word and
//! may be empty if the user has just entered a word separator.
virtual void updateAutoCompletionList(const QStringList &context,
QStringList &list) = 0;
//! This is called when the user selects the entry \a selection from the
//! auto-completion list. A sub-class can use this as a hint to provide
//! more specific API entries in future calls to
//! updateAutoCompletionList(). The default implementation does nothing.
virtual void autoCompletionSelected(const QString &selection);
//! Return the call tips valid for the context \a context. (Note that the
//! last word of the context will always be empty.) \a commas is the number
//! of commas the user has typed after the context and before the cursor
//! position. The exact position of the list of call tips can be adjusted
//! by specifying a corresponding left character shift in \a shifts. This
//! is normally done to correct for any displayed context according to \a
//! style.
//!
//! \sa updateAutoCompletionList()
virtual QStringList callTips(const QStringList &context, int commas,
QsciScintilla::CallTipsStyle style, QList<int> &shifts) = 0;
private:
QsciLexer *lex;
QsciAbstractAPIs(const QsciAbstractAPIs &);
QsciAbstractAPIs &operator=(const QsciAbstractAPIs &);
};
#endif

View File

@@ -0,0 +1,213 @@
// This module defines interface to the QsciAPIs class.
//
// Copyright (c) 2023 Riverbank Computing Limited <info@riverbankcomputing.com>
//
// This file is part of QScintilla.
//
// This file may be used under the terms of the GNU General Public License
// version 3.0 as published by the Free Software Foundation and appearing in
// the file LICENSE included in the packaging of this file. Please review the
// following information to ensure the GNU General Public License version 3.0
// requirements will be met: http://www.gnu.org/copyleft/gpl.html.
//
// If you do not wish to use this file under the terms of the GPL version 3.0
// then you may purchase a commercial license. For more information contact
// info@riverbankcomputing.com.
//
// 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 QSCIAPIS_H
#define QSCIAPIS_H
#include <QList>
#include <QObject>
#include <QPair>
#include <QStringList>
#include <Qsci/qsciabstractapis.h>
#include <Qsci/qsciglobal.h>
#include <Qsci/qsciscintilla.h>
class QsciAPIsPrepared;
class QsciAPIsWorker;
class QsciLexer;
//! \brief The QsciAPIs class provies an implementation of the textual API
//! information used in call tips and for auto-completion.
//!
//! Raw API information is read from one or more files. Each API function is
//! described by a single line of text comprising the function's name, followed
//! by the function's optional comma separated parameters enclosed in
//! parenthesis, and finally followed by optional explanatory text.
//!
//! A function name may be followed by a `?' and a number. The number is used
//! by auto-completion to display a registered QPixmap with the function name.
//!
//! All function names are used by auto-completion, but only those that include
//! function parameters are used in call tips.
//!
//! QScintilla only deals with prepared API information and not the raw
//! information described above. This is done so that large APIs can be
//! handled while still being responsive to user input. The conversion of raw
//! information to prepared information is time consuming (think tens of
//! seconds) and implemented in a separate thread. Prepared information can
//! be quickly saved to and loaded from files. Such files are portable between
//! different architectures.
//!
//! QScintilla based applications that want to support large APIs would
//! normally provide the user with the ability to specify a set of, possibly
//! project specific, raw API files and convert them to prepared files that are
//! loaded quickly when the application is invoked.
class QSCINTILLA_EXPORT QsciAPIs : public QsciAbstractAPIs
{
Q_OBJECT
public:
//! Constructs a QsciAPIs instance attached to lexer \a lexer. \a lexer
//! becomes the instance's parent object although the instance can also be
//! subsequently attached to other lexers.
QsciAPIs(QsciLexer *lexer);
//! Destroy the QsciAPIs instance.
virtual ~QsciAPIs();
//! Add the single raw API entry \a entry to the current set.
//!
//! \sa clear(), load(), remove()
void add(const QString &entry);
//! Deletes all raw API information.
//!
//! \sa add(), load(), remove()
void clear();
//! Load the API information from the file named \a filename, adding it to
//! the current set. Returns true if successful, otherwise false.
bool load(const QString &filename);
//! Remove the single raw API entry \a entry from the current set.
//!
//! \sa add(), clear(), load()
void remove(const QString &entry);
//! Convert the current raw API information to prepared API information.
//! This is implemented by a separate thread.
//!
//! \sa cancelPreparation()
void prepare();
//! Cancel the conversion of the current raw API information to prepared
//! API information.
//!
//! \sa prepare()
void cancelPreparation();
//! Return the default name of the prepared API information file. It is
//! based on the name of the associated lexer and in the directory defined
//! by the QSCIDIR environment variable. If the environment variable isn't
//! set then $HOME/.qsci is used.
QString defaultPreparedName() const;
//! Check to see is a prepared API information file named \a filename
//! exists. If \a filename is empty then the value returned by
//! defaultPreparedName() is used. Returns true if successful, otherwise
//! false.
//!
//! \sa defaultPreparedName()
bool isPrepared(const QString &filename = QString()) const;
//! Load the prepared API information from the file named \a filename. If
//! \a filename is empty then a name is constructed based on the name of
//! the associated lexer and saved in the directory defined by the QSCIDIR
//! environment variable. If the environment variable isn't set then
//! $HOME/.qsci is used. Returns true if successful, otherwise false.
bool loadPrepared(const QString &filename = QString());
//! Save the prepared API information to the file named \a filename. If
//! \a filename is empty then a name is constructed based on the name of
//! the associated lexer and saved in the directory defined by the QSCIDIR
//! environment variable. If the environment variable isn't set then
//! $HOME/.qsci is used. Returns true if successful, otherwise false.
bool savePrepared(const QString &filename = QString()) const;
//! \reimp
virtual void updateAutoCompletionList(const QStringList &context,
QStringList &list);
//! \reimp
virtual void autoCompletionSelected(const QString &sel);
//! \reimp
virtual QStringList callTips(const QStringList &context, int commas,
QsciScintilla::CallTipsStyle style, QList<int> &shifts);
//! \internal Reimplemented to receive termination events from the worker
//! thread.
virtual bool event(QEvent *e);
//! Return a list of the installed raw API file names for the associated
//! lexer.
QStringList installedAPIFiles() const;
signals:
//! This signal is emitted when the conversion of raw API information to
//! prepared API information has been cancelled.
//!
//! \sa apiPreparationFinished(), apiPreparationStarted()
void apiPreparationCancelled();
//! This signal is emitted when the conversion of raw API information to
//! prepared API information starts and can be used to give some visual
//! feedback to the user.
//!
//! \sa apiPreparationCancelled(), apiPreparationFinished()
void apiPreparationStarted();
//! This signal is emitted when the conversion of raw API information to
//! prepared API information has finished.
//!
//! \sa apiPreparationCancelled(), apiPreparationStarted()
void apiPreparationFinished();
private:
friend class QsciAPIsPrepared;
friend class QsciAPIsWorker;
// This indexes a word in a set of raw APIs. The first part indexes the
// entry in the set, the second part indexes the word within the entry.
typedef QPair<quint32, quint32> WordIndex;
// This is a list of word indexes.
typedef QList<WordIndex> WordIndexList;
QsciAPIsWorker *worker;
QStringList old_context;
QStringList::const_iterator origin;
int origin_len;
QString unambiguous_context;
QStringList apis;
QsciAPIsPrepared *prep;
static bool enoughCommas(const QString &s, int commas);
QStringList positionOrigin(const QStringList &context, QString &path);
bool originStartsWith(const QString &path, const QString &wsep);
const WordIndexList *wordIndexOf(const QString &word) const;
void lastCompleteWord(const QString &word, QStringList &with_context,
bool &unambig);
void lastPartialWord(const QString &word, QStringList &with_context,
bool &unambig);
void addAPIEntries(const WordIndexList &wl, bool complete,
QStringList &with_context, bool &unambig);
QString prepName(const QString &filename, bool mkpath = false) const;
void deleteWorker();
QsciAPIs(const QsciAPIs &);
QsciAPIs &operator=(const QsciAPIs &);
};
#endif

View File

@@ -0,0 +1,408 @@
// This defines the interface to the QsciCommand class.
//
// Copyright (c) 2023 Riverbank Computing Limited <info@riverbankcomputing.com>
//
// This file is part of QScintilla.
//
// This file may be used under the terms of the GNU General Public License
// version 3.0 as published by the Free Software Foundation and appearing in
// the file LICENSE included in the packaging of this file. Please review the
// following information to ensure the GNU General Public License version 3.0
// requirements will be met: http://www.gnu.org/copyleft/gpl.html.
//
// If you do not wish to use this file under the terms of the GPL version 3.0
// then you may purchase a commercial license. For more information contact
// info@riverbankcomputing.com.
//
// 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 QSCICOMMAND_H
#define QSCICOMMAND_H
#include <qstring.h>
#include <Qsci/qsciglobal.h>
#include <Qsci/qsciscintillabase.h>
class QsciScintilla;
//! \brief The QsciCommand class represents an internal editor command that may
//! have one or two keys bound to it.
//!
//! Methods are provided to change the keys bound to the command and to remove
//! a key binding. Each command has a user friendly description of the command
//! for use in key mapping dialogs.
class QSCINTILLA_EXPORT QsciCommand
{
public:
//! This enum defines the different commands that can be assigned to a key.
enum Command {
//! Move down one line.
LineDown = QsciScintillaBase::SCI_LINEDOWN,
//! Extend the selection down one line.
LineDownExtend = QsciScintillaBase::SCI_LINEDOWNEXTEND,
//! Extend the rectangular selection down one line.
LineDownRectExtend = QsciScintillaBase::SCI_LINEDOWNRECTEXTEND,
//! Scroll the view down one line.
LineScrollDown = QsciScintillaBase::SCI_LINESCROLLDOWN,
//! Move up one line.
LineUp = QsciScintillaBase::SCI_LINEUP,
//! Extend the selection up one line.
LineUpExtend = QsciScintillaBase::SCI_LINEUPEXTEND,
//! Extend the rectangular selection up one line.
LineUpRectExtend = QsciScintillaBase::SCI_LINEUPRECTEXTEND,
//! Scroll the view up one line.
LineScrollUp = QsciScintillaBase::SCI_LINESCROLLUP,
//! Scroll to the start of the document.
ScrollToStart = QsciScintillaBase::SCI_SCROLLTOSTART,
//! Scroll to the end of the document.
ScrollToEnd = QsciScintillaBase::SCI_SCROLLTOEND,
//! Scroll vertically to centre the current line.
VerticalCentreCaret = QsciScintillaBase::SCI_VERTICALCENTRECARET,
//! Move down one paragraph.
ParaDown = QsciScintillaBase::SCI_PARADOWN,
//! Extend the selection down one paragraph.
ParaDownExtend = QsciScintillaBase::SCI_PARADOWNEXTEND,
//! Move up one paragraph.
ParaUp = QsciScintillaBase::SCI_PARAUP,
//! Extend the selection up one paragraph.
ParaUpExtend = QsciScintillaBase::SCI_PARAUPEXTEND,
//! Move left one character.
CharLeft = QsciScintillaBase::SCI_CHARLEFT,
//! Extend the selection left one character.
CharLeftExtend = QsciScintillaBase::SCI_CHARLEFTEXTEND,
//! Extend the rectangular selection left one character.
CharLeftRectExtend = QsciScintillaBase::SCI_CHARLEFTRECTEXTEND,
//! Move right one character.
CharRight = QsciScintillaBase::SCI_CHARRIGHT,
//! Extend the selection right one character.
CharRightExtend = QsciScintillaBase::SCI_CHARRIGHTEXTEND,
//! Extend the rectangular selection right one character.
CharRightRectExtend = QsciScintillaBase::SCI_CHARRIGHTRECTEXTEND,
//! Move left one word.
WordLeft = QsciScintillaBase::SCI_WORDLEFT,
//! Extend the selection left one word.
WordLeftExtend = QsciScintillaBase::SCI_WORDLEFTEXTEND,
//! Move right one word.
WordRight = QsciScintillaBase::SCI_WORDRIGHT,
//! Extend the selection right one word.
WordRightExtend = QsciScintillaBase::SCI_WORDRIGHTEXTEND,
//! Move to the end of the previous word.
WordLeftEnd = QsciScintillaBase::SCI_WORDLEFTEND,
//! Extend the selection to the end of the previous word.
WordLeftEndExtend = QsciScintillaBase::SCI_WORDLEFTENDEXTEND,
//! Move to the end of the next word.
WordRightEnd = QsciScintillaBase::SCI_WORDRIGHTEND,
//! Extend the selection to the end of the next word.
WordRightEndExtend = QsciScintillaBase::SCI_WORDRIGHTENDEXTEND,
//! Move left one word part.
WordPartLeft = QsciScintillaBase::SCI_WORDPARTLEFT,
//! Extend the selection left one word part.
WordPartLeftExtend = QsciScintillaBase::SCI_WORDPARTLEFTEXTEND,
//! Move right one word part.
WordPartRight = QsciScintillaBase::SCI_WORDPARTRIGHT,
//! Extend the selection right one word part.
WordPartRightExtend = QsciScintillaBase::SCI_WORDPARTRIGHTEXTEND,
//! Move to the start of the document line.
Home = QsciScintillaBase::SCI_HOME,
//! Extend the selection to the start of the document line.
HomeExtend = QsciScintillaBase::SCI_HOMEEXTEND,
//! Extend the rectangular selection to the start of the document line.
HomeRectExtend = QsciScintillaBase::SCI_HOMERECTEXTEND,
//! Move to the start of the displayed line.
HomeDisplay = QsciScintillaBase::SCI_HOMEDISPLAY,
//! Extend the selection to the start of the displayed line.
HomeDisplayExtend = QsciScintillaBase::SCI_HOMEDISPLAYEXTEND,
//! Move to the start of the displayed or document line.
HomeWrap = QsciScintillaBase::SCI_HOMEWRAP,
//! Extend the selection to the start of the displayed or document
//! line.
HomeWrapExtend = QsciScintillaBase::SCI_HOMEWRAPEXTEND,
//! Move to the first visible character in the document line.
VCHome = QsciScintillaBase::SCI_VCHOME,
//! Extend the selection to the first visible character in the document
//! line.
VCHomeExtend = QsciScintillaBase::SCI_VCHOMEEXTEND,
//! Extend the rectangular selection to the first visible character in
//! the document line.
VCHomeRectExtend = QsciScintillaBase::SCI_VCHOMERECTEXTEND,
//! Move to the first visible character of the displayed or document
//! line.
VCHomeWrap = QsciScintillaBase::SCI_VCHOMEWRAP,
//! Extend the selection to the first visible character of the
//! displayed or document line.
VCHomeWrapExtend = QsciScintillaBase::SCI_VCHOMEWRAPEXTEND,
//! Move to the end of the document line.
LineEnd = QsciScintillaBase::SCI_LINEEND,
//! Extend the selection to the end of the document line.
LineEndExtend = QsciScintillaBase::SCI_LINEENDEXTEND,
//! Extend the rectangular selection to the end of the document line.
LineEndRectExtend = QsciScintillaBase::SCI_LINEENDRECTEXTEND,
//! Move to the end of the displayed line.
LineEndDisplay = QsciScintillaBase::SCI_LINEENDDISPLAY,
//! Extend the selection to the end of the displayed line.
LineEndDisplayExtend = QsciScintillaBase::SCI_LINEENDDISPLAYEXTEND,
//! Move to the end of the displayed or document line.
LineEndWrap = QsciScintillaBase::SCI_LINEENDWRAP,
//! Extend the selection to the end of the displayed or document line.
LineEndWrapExtend = QsciScintillaBase::SCI_LINEENDWRAPEXTEND,
//! Move to the start of the document.
DocumentStart = QsciScintillaBase::SCI_DOCUMENTSTART,
//! Extend the selection to the start of the document.
DocumentStartExtend = QsciScintillaBase::SCI_DOCUMENTSTARTEXTEND,
//! Move to the end of the document.
DocumentEnd = QsciScintillaBase::SCI_DOCUMENTEND,
//! Extend the selection to the end of the document.
DocumentEndExtend = QsciScintillaBase::SCI_DOCUMENTENDEXTEND,
//! Move up one page.
PageUp = QsciScintillaBase::SCI_PAGEUP,
//! Extend the selection up one page.
PageUpExtend = QsciScintillaBase::SCI_PAGEUPEXTEND,
//! Extend the rectangular selection up one page.
PageUpRectExtend = QsciScintillaBase::SCI_PAGEUPRECTEXTEND,
//! Move down one page.
PageDown = QsciScintillaBase::SCI_PAGEDOWN,
//! Extend the selection down one page.
PageDownExtend = QsciScintillaBase::SCI_PAGEDOWNEXTEND,
//! Extend the rectangular selection down one page.
PageDownRectExtend = QsciScintillaBase::SCI_PAGEDOWNRECTEXTEND,
//! Stuttered move up one page.
StutteredPageUp = QsciScintillaBase::SCI_STUTTEREDPAGEUP,
//! Stuttered extend the selection up one page.
StutteredPageUpExtend = QsciScintillaBase::SCI_STUTTEREDPAGEUPEXTEND,
//! Stuttered move down one page.
StutteredPageDown = QsciScintillaBase::SCI_STUTTEREDPAGEDOWN,
//! Stuttered extend the selection down one page.
StutteredPageDownExtend = QsciScintillaBase::SCI_STUTTEREDPAGEDOWNEXTEND,
//! Delete the current character.
Delete = QsciScintillaBase::SCI_CLEAR,
//! Delete the previous character.
DeleteBack = QsciScintillaBase::SCI_DELETEBACK,
//! Delete the previous character if not at start of line.
DeleteBackNotLine = QsciScintillaBase::SCI_DELETEBACKNOTLINE,
//! Delete the word to the left.
DeleteWordLeft = QsciScintillaBase::SCI_DELWORDLEFT,
//! Delete the word to the right.
DeleteWordRight = QsciScintillaBase::SCI_DELWORDRIGHT,
//! Delete right to the end of the next word.
DeleteWordRightEnd = QsciScintillaBase::SCI_DELWORDRIGHTEND,
//! Delete the line to the left.
DeleteLineLeft = QsciScintillaBase::SCI_DELLINELEFT,
//! Delete the line to the right.
DeleteLineRight = QsciScintillaBase::SCI_DELLINERIGHT,
//! Delete the current line.
LineDelete = QsciScintillaBase::SCI_LINEDELETE,
//! Cut the current line to the clipboard.
LineCut = QsciScintillaBase::SCI_LINECUT,
//! Copy the current line to the clipboard.
LineCopy = QsciScintillaBase::SCI_LINECOPY,
//! Transpose the current and previous lines.
LineTranspose = QsciScintillaBase::SCI_LINETRANSPOSE,
//! Duplicate the current line.
LineDuplicate = QsciScintillaBase::SCI_LINEDUPLICATE,
//! Select the whole document.
SelectAll = QsciScintillaBase::SCI_SELECTALL,
//! Move the selected lines up one line.
MoveSelectedLinesUp = QsciScintillaBase::SCI_MOVESELECTEDLINESUP,
//! Move the selected lines down one line.
MoveSelectedLinesDown = QsciScintillaBase::SCI_MOVESELECTEDLINESDOWN,
//! Duplicate the selection.
SelectionDuplicate = QsciScintillaBase::SCI_SELECTIONDUPLICATE,
//! Convert the selection to lower case.
SelectionLowerCase = QsciScintillaBase::SCI_LOWERCASE,
//! Convert the selection to upper case.
SelectionUpperCase = QsciScintillaBase::SCI_UPPERCASE,
//! Cut the selection to the clipboard.
SelectionCut = QsciScintillaBase::SCI_CUT,
//! Copy the selection to the clipboard.
SelectionCopy = QsciScintillaBase::SCI_COPY,
//! Paste from the clipboard.
Paste = QsciScintillaBase::SCI_PASTE,
//! Toggle insert/overtype.
EditToggleOvertype = QsciScintillaBase::SCI_EDITTOGGLEOVERTYPE,
//! Insert a platform dependent newline.
Newline = QsciScintillaBase::SCI_NEWLINE,
//! Insert a formfeed.
Formfeed = QsciScintillaBase::SCI_FORMFEED,
//! Indent one level.
Tab = QsciScintillaBase::SCI_TAB,
//! De-indent one level.
Backtab = QsciScintillaBase::SCI_BACKTAB,
//! Cancel any current operation.
Cancel = QsciScintillaBase::SCI_CANCEL,
//! Undo the last command.
Undo = QsciScintillaBase::SCI_UNDO,
//! Redo the last command.
Redo = QsciScintillaBase::SCI_REDO,
//! Zoom in.
ZoomIn = QsciScintillaBase::SCI_ZOOMIN,
//! Zoom out.
ZoomOut = QsciScintillaBase::SCI_ZOOMOUT,
//! Reverse the selected lines.
ReverseLines = QsciScintillaBase::SCI_LINEREVERSE,
};
//! Return the command that will be executed by this instance.
Command command() const {return scicmd;}
//! Execute the command.
void execute();
//! Binds the key \a key to the command. If \a key is 0 then the key
//! binding is removed. If \a key is invalid then the key binding is
//! unchanged. Valid keys are any visible or control character or any
//! of \c Qt::Key_Down, \c Qt::Key_Up, \c Qt::Key_Left, \c Qt::Key_Right,
//! \c Qt::Key_Home, \c Qt::Key_End, \c Qt::Key_PageUp,
//! \c Qt::Key_PageDown, \c Qt::Key_Delete, \c Qt::Key_Insert,
//! \c Qt::Key_Escape, \c Qt::Key_Backspace, \c Qt::Key_Tab,
//! \c Qt::Key_Backtab, \c Qt::Key_Return, \c Qt::Key_Enter,
//! \c Qt::Key_Super_L, \c Qt::Key_Super_R or \c Qt::Key_Menu. Keys may be
//! modified with any combination of \c Qt::ShiftModifier,
//! \c Qt::ControlModifier, \c Qt::AltModifier and \c Qt::MetaModifier.
//!
//! \sa key(), setAlternateKey(), validKey()
void setKey(int key);
//! Binds the alternate key \a altkey to the command. If \a key is 0
//! then the alternate key binding is removed.
//!
//! \sa alternateKey(), setKey(), validKey()
void setAlternateKey(int altkey);
//! The key that is currently bound to the command is returned.
//!
//! \sa setKey(), alternateKey()
int key() const {return qkey;}
//! The alternate key that is currently bound to the command is
//! returned.
//!
//! \sa setAlternateKey(), key()
int alternateKey() const {return qaltkey;}
//! If the key \a key is valid then true is returned.
static bool validKey(int key);
//! The user friendly description of the command is returned.
QString description() const;
private:
friend class QsciCommandSet;
QsciCommand(QsciScintilla *qs, Command cmd, int key, int altkey,
const char *desc);
void bindKey(int key,int &qk,int &scik);
QsciScintilla *qsCmd;
Command scicmd;
int qkey, scikey, qaltkey, scialtkey;
const char *descCmd;
QsciCommand(const QsciCommand &);
QsciCommand &operator=(const QsciCommand &);
};
#endif

View File

@@ -0,0 +1,89 @@
// This defines the interface to the QsciCommandSet class.
//
// Copyright (c) 2023 Riverbank Computing Limited <info@riverbankcomputing.com>
//
// This file is part of QScintilla.
//
// This file may be used under the terms of the GNU General Public License
// version 3.0 as published by the Free Software Foundation and appearing in
// the file LICENSE included in the packaging of this file. Please review the
// following information to ensure the GNU General Public License version 3.0
// requirements will be met: http://www.gnu.org/copyleft/gpl.html.
//
// If you do not wish to use this file under the terms of the GPL version 3.0
// then you may purchase a commercial license. For more information contact
// info@riverbankcomputing.com.
//
// 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 QSCICOMMANDSET_H
#define QSCICOMMANDSET_H
#include <qglobal.h>
#include <QList>
#include <Qsci/qsciglobal.h>
#include <Qsci/qscicommand.h>
QT_BEGIN_NAMESPACE
class QSettings;
QT_END_NAMESPACE
class QsciScintilla;
//! \brief The QsciCommandSet class represents the set of all internal editor
//! commands that may have keys bound.
//!
//! Methods are provided to access the individual commands and to read and
//! write the current bindings from and to settings files.
class QSCINTILLA_EXPORT QsciCommandSet
{
public:
//! The key bindings for each command in the set are read from the
//! settings \a qs. \a prefix is prepended to the key of each entry.
//! true is returned if there was no error.
//!
//! \sa writeSettings()
bool readSettings(QSettings &qs, const char *prefix = "/Scintilla");
//! The key bindings for each command in the set are written to the
//! settings \a qs. \a prefix is prepended to the key of each entry.
//! true is returned if there was no error.
//!
//! \sa readSettings()
bool writeSettings(QSettings &qs, const char *prefix = "/Scintilla");
//! The commands in the set are returned as a list.
QList<QsciCommand *> &commands() {return cmds;}
//! The primary keys bindings for all commands are removed.
void clearKeys();
//! The alternate keys bindings for all commands are removed.
void clearAlternateKeys();
// Find the command that is bound to \a key.
QsciCommand *boundTo(int key) const;
// Find a specific command \a command.
QsciCommand *find(QsciCommand::Command command) const;
private:
friend class QsciScintilla;
QsciCommandSet(QsciScintilla *qs);
~QsciCommandSet();
QsciScintilla *qsci;
QList<QsciCommand *> cmds;
QsciCommandSet(const QsciCommandSet &);
QsciCommandSet &operator=(const QsciCommandSet &);
};
#endif

View File

@@ -0,0 +1,61 @@
// This defines the interface to the QsciDocument class.
//
// Copyright (c) 2023 Riverbank Computing Limited <info@riverbankcomputing.com>
//
// This file is part of QScintilla.
//
// This file may be used under the terms of the GNU General Public License
// version 3.0 as published by the Free Software Foundation and appearing in
// the file LICENSE included in the packaging of this file. Please review the
// following information to ensure the GNU General Public License version 3.0
// requirements will be met: http://www.gnu.org/copyleft/gpl.html.
//
// If you do not wish to use this file under the terms of the GPL version 3.0
// then you may purchase a commercial license. For more information contact
// info@riverbankcomputing.com.
//
// 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 QSCIDOCUMENT_H
#define QSCIDOCUMENT_H
#include <Qsci/qsciglobal.h>
class QsciScintillaBase;
class QsciDocumentP;
//! \brief The QsciDocument class represents a document to be edited.
//!
//! It is an opaque class that can be attached to multiple instances of
//! QsciScintilla to create different simultaneous views of the same document.
//! QsciDocument uses implicit sharing so that copying class instances is a
//! cheap operation.
class QSCINTILLA_EXPORT QsciDocument
{
public:
//! Create a new unattached document.
QsciDocument();
virtual ~QsciDocument();
QsciDocument(const QsciDocument &);
QsciDocument &operator=(const QsciDocument &);
private:
friend class QsciScintilla;
void attach(const QsciDocument &that);
void detach();
void display(QsciScintillaBase *qsb, const QsciDocument *from);
void undisplay(QsciScintillaBase *qsb);
bool isModified() const;
void setModified(bool m);
QsciDocumentP *pdoc;
};
#endif

View File

@@ -0,0 +1,54 @@
// This module defines various things common to all of the Scintilla Qt port.
//
// Copyright (c) 2023 Riverbank Computing Limited <info@riverbankcomputing.com>
//
// This file is part of QScintilla.
//
// This file may be used under the terms of the GNU General Public License
// version 3.0 as published by the Free Software Foundation and appearing in
// the file LICENSE included in the packaging of this file. Please review the
// following information to ensure the GNU General Public License version 3.0
// requirements will be met: http://www.gnu.org/copyleft/gpl.html.
//
// If you do not wish to use this file under the terms of the GPL version 3.0
// then you may purchase a commercial license. For more information contact
// info@riverbankcomputing.com.
//
// 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 QSCIGLOBAL_H
#define QSCIGLOBAL_H
#include <qglobal.h>
#define QSCINTILLA_VERSION 0x020e01
#define QSCINTILLA_VERSION_STR "2.14.1"
// We only support Qt v5.11 and later.
#if QT_VERSION < 0x050b00
#error "Qt v5.11.0 or later is required"
#endif
// Define QSCINTILLA_MAKE_DLL to create a QScintilla shared library, or
// define QSCINTILLA_DLL to link against a QScintilla shared library, or define
// neither to either build or link against a static QScintilla library.
#if defined(QSCINTILLA_DLL)
#define QSCINTILLA_EXPORT Q_DECL_IMPORT
#elif defined(QSCINTILLA_MAKE_DLL)
#define QSCINTILLA_EXPORT Q_DECL_EXPORT
#else
#define QSCINTILLA_EXPORT
#endif
#if !defined(QT_BEGIN_NAMESPACE)
#define QT_BEGIN_NAMESPACE
#define QT_END_NAMESPACE
#endif
#endif

View File

@@ -0,0 +1,356 @@
// This defines the interface to the QsciLexer class.
//
// Copyright (c) 2023 Riverbank Computing Limited <info@riverbankcomputing.com>
//
// This file is part of QScintilla.
//
// This file may be used under the terms of the GNU General Public License
// version 3.0 as published by the Free Software Foundation and appearing in
// the file LICENSE included in the packaging of this file. Please review the
// following information to ensure the GNU General Public License version 3.0
// requirements will be met: http://www.gnu.org/copyleft/gpl.html.
//
// If you do not wish to use this file under the terms of the GPL version 3.0
// then you may purchase a commercial license. For more information contact
// info@riverbankcomputing.com.
//
// 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 QSCILEXER_H
#define QSCILEXER_H
#include <QColor>
#include <QFont>
#include <QMap>
#include <QObject>
#include <QString>
#include <Qsci/qsciglobal.h>
QT_BEGIN_NAMESPACE
class QSettings;
QT_END_NAMESPACE
class QsciAbstractAPIs;
class QsciScintilla;
//! \brief The QsciLexer class is an abstract class used as a base for language
//! lexers.
//!
//! A lexer scans the text breaking it up into separate language objects, e.g.
//! keywords, strings, operators. The lexer then uses a different style to
//! draw each object. A style is identified by a style number and has a number
//! of attributes, including colour and font. A specific language lexer will
//! implement appropriate default styles which can be overriden by an
//! application by further sub-classing the specific language lexer.
//!
//! A lexer may provide one or more sets of words to be recognised as keywords.
//! Most lexers only provide one set, but some may support languages embedded
//! in other languages and provide several sets.
//!
//! QsciLexer provides convenience methods for saving and restoring user
//! preferences for fonts and colours.
//!
//! If you want to write a lexer for a new language then you can add it to the
//! underlying Scintilla code and implement a corresponding QsciLexer sub-class
//! to manage the different styles used. Alternatively you can implement a
//! sub-class of QsciLexerCustom.
class QSCINTILLA_EXPORT QsciLexer : public QObject
{
Q_OBJECT
public:
//! Construct a QsciLexer with parent \a parent. \a parent is typically
//! the QsciScintilla instance.
QsciLexer(QObject *parent = 0);
//! Destroy the QSciLexer.
virtual ~QsciLexer();
//! Returns the name of the language. It must be re-implemented by a
//! sub-class.
virtual const char *language() const = 0;
//! Returns the name of the lexer. If 0 is returned then the lexer's
//! numeric identifier is used. The default implementation returns 0.
//!
//! \sa lexerId()
virtual const char *lexer() const;
//! Returns the identifier (i.e. a QsciScintillaBase::SCLEX_* value) of the
//! lexer. This is only used if lexer() returns 0. The default
//! implementation returns QsciScintillaBase::SCLEX_CONTAINER.
//!
//! \sa lexer()
virtual int lexerId() const;
//! Returns the current API set or 0 if there isn't one.
//!
//! \sa setAPIs()
QsciAbstractAPIs *apis() const;
//! Returns the characters that can fill up auto-completion.
virtual const char *autoCompletionFillups() const;
//! Returns the list of character sequences that can separate
//! auto-completion words. The first in the list is assumed to be the
//! sequence used to separate words in the lexer's API files.
virtual QStringList autoCompletionWordSeparators() const;
//! Returns the auto-indentation style. The default is 0 if the
//! language is block structured, or QsciScintilla::AiMaintain if not.
//!
//! \sa setAutoIndentStyle(), QsciScintilla::AiMaintain,
//! QsciScintilla::AiOpening, QsciScintilla::AiClosing
int autoIndentStyle();
//! Returns a space separated list of words or characters in a particular
//! style that define the end of a block for auto-indentation. The style
//! is returned via \a style.
virtual const char *blockEnd(int *style = 0) const;
//! Returns the number of lines prior to the current one when determining
//! the scope of a block when auto-indenting.
virtual int blockLookback() const;
//! Returns a space separated list of words or characters in a particular
//! style that define the start of a block for auto-indentation. The style
//! is returned via \a style.
virtual const char *blockStart(int *style = 0) const;
//! Returns a space separated list of keywords in a particular style that
//! define the start of a block for auto-indentation. The style is
//! returned via \a style.
virtual const char *blockStartKeyword(int *style = 0) const;
//! Returns the style used for braces for brace matching.
virtual int braceStyle() const;
//! Returns true if the language is case sensitive. The default is true.
virtual bool caseSensitive() const;
//! Returns the foreground colour of the text for style number \a style.
//! The default colour is that returned by defaultColor().
//!
//! \sa defaultColor(), paper()
virtual QColor color(int style) const;
//! Returns the end-of-line for style number \a style. The default is
//! false.
virtual bool eolFill(int style) const;
//! Returns the font for style number \a style. The default font is
//! that returned by defaultFont().
//!
//! \sa defaultFont()
virtual QFont font(int style) const;
//! Returns the view used for indentation guides.
virtual int indentationGuideView() const;
//! Returns the set of keywords for the keyword set \a set recognised
//! by the lexer as a space separated string. Keyword sets are numbered
//! from 1. 0 is returned if there is no such set.
virtual const char *keywords(int set) const;
//! Returns the number of the style used for whitespace. The default
//! implementation returns 0 which is the convention adopted by most
//! lexers.
virtual int defaultStyle() const;
//! Returns the descriptive name for style number \a style. For a valid
//! style number for this language a non-empty QString must be returned.
//! If the style number is invalid then an empty QString must be returned.
//! This is intended to be used in user preference dialogs.
virtual QString description(int style) const = 0;
//! Returns the background colour of the text for style number
//! \a style.
//!
//! \sa defaultPaper(), color()
virtual QColor paper(int style) const;
//! Returns the default text colour.
//!
//! \sa setDefaultColor()
QColor defaultColor() const;
//! Returns the default text colour for style number \a style.
virtual QColor defaultColor(int style) const;
//! Returns the default end-of-line for style number \a style. The default
//! is false.
virtual bool defaultEolFill(int style) const;
//! Returns the default font.
//!
//! \sa setDefaultFont()
QFont defaultFont() const;
//! Returns the default font for style number \a style.
virtual QFont defaultFont(int style) const;
//! Returns the default paper colour.
//!
//! \sa setDefaultPaper()
QColor defaultPaper() const;
//! Returns the default paper colour for style number \a style.
virtual QColor defaultPaper(int style) const;
//! Returns the QsciScintilla instance that the lexer is currently attached
//! to or 0 if it is unattached.
QsciScintilla *editor() const {return attached_editor;}
//! The current set of APIs is set to \a apis. If \a apis is 0 then any
//! existing APIs for this lexer are removed.
//!
//! \sa apis()
void setAPIs(QsciAbstractAPIs *apis);
//! The default text colour is set to \a c.
//!
//! \sa defaultColor(), color()
void setDefaultColor(const QColor &c);
//! The default font is set to \a f.
//!
//! \sa defaultFont(), font()
void setDefaultFont(const QFont &f);
//! The default paper colour is set to \a c.
//!
//! \sa defaultPaper(), paper()
void setDefaultPaper(const QColor &c);
//! \internal Set the QsciScintilla instance that the lexer is attached to.
virtual void setEditor(QsciScintilla *editor);
//! The colour, paper, font and end-of-line for each style number, and
//! all lexer specific properties are read from the settings \a qs.
//! \a prefix is prepended to the key of each entry. true is returned
//! if there was no error.
//!
//! \sa writeSettings(), QsciScintilla::setLexer()
bool readSettings(QSettings &qs,const char *prefix = "/Scintilla");
//! Causes all properties to be refreshed by emitting the
//! propertyChanged() signal as required.
virtual void refreshProperties();
//! Returns the number of style bits needed by the lexer. Normally this
//! should only be re-implemented by custom lexers. This is deprecated and
//! no longer has any effect.
virtual int styleBitsNeeded() const;
//! Returns the string of characters that comprise a word. The default is
//! 0 which implies the upper and lower case alphabetic characters and
//! underscore.
virtual const char *wordCharacters() const;
//! The colour, paper, font and end-of-line for each style number, and
//! all lexer specific properties are written to the settings \a qs.
//! \a prefix is prepended to the key of each entry. true is returned
//! if there was no error.
//!
//! \sa readSettings()
bool writeSettings(QSettings &qs,
const char *prefix = "/Scintilla") const;
public slots:
//! The auto-indentation style is set to \a autoindentstyle.
//!
//! \sa autoIndentStyle(), QsciScintilla::AiMaintain,
//! QsciScintilla::AiOpening, QsciScintilla::AiClosing
virtual void setAutoIndentStyle(int autoindentstyle);
//! The foreground colour for style number \a style is set to \a c. If
//! \a style is -1 then the colour is set for all styles.
virtual void setColor(const QColor &c,int style = -1);
//! The end-of-line fill for style number \a style is set to
//! \a eoffill. If \a style is -1 then the fill is set for all styles.
virtual void setEolFill(bool eoffill,int style = -1);
//! The font for style number \a style is set to \a f. If \a style is
//! -1 then the font is set for all styles.
virtual void setFont(const QFont &f,int style = -1);
//! The background colour for style number \a style is set to \a c. If
//! \a style is -1 then the colour is set for all styles.
virtual void setPaper(const QColor &c,int style = -1);
signals:
//! This signal is emitted when the foreground colour of style number
//! \a style has changed. The new colour is \a c.
void colorChanged(const QColor &c,int style);
//! This signal is emitted when the end-of-file fill of style number
//! \a style has changed. The new fill is \a eolfilled.
void eolFillChanged(bool eolfilled,int style);
//! This signal is emitted when the font of style number \a style has
//! changed. The new font is \a f.
void fontChanged(const QFont &f,int style);
//! This signal is emitted when the background colour of style number
//! \a style has changed. The new colour is \a c.
void paperChanged(const QColor &c,int style);
//! This signal is emitted when the value of the lexer property \a prop
//! needs to be changed. The new value is \a val.
void propertyChanged(const char *prop, const char *val);
protected:
//! The lexer's properties are read from the settings \a qs. \a prefix
//! (which has a trailing '/') should be used as a prefix to the key of
//! each setting. true is returned if there is no error.
//!
virtual bool readProperties(QSettings &qs,const QString &prefix);
//! The lexer's properties are written to the settings \a qs.
//! \a prefix (which has a trailing '/') should be used as a prefix to
//! the key of each setting. true is returned if there is no error.
//!
virtual bool writeProperties(QSettings &qs,const QString &prefix) const;
//! \internal Convert a QString to encoded bytes.
QByteArray textAsBytes(const QString &text) const;
//! \internal Convert encoded bytes to a QString.
QString bytesAsText(const char *bytes, int size) const;
private:
struct StyleData {
QFont font;
QColor color;
QColor paper;
bool eol_fill;
};
struct StyleDataMap {
bool style_data_set;
QMap<int, StyleData> style_data;
};
StyleDataMap *style_map;
int autoIndStyle;
QFont defFont;
QColor defColor;
QColor defPaper;
QsciAbstractAPIs *apiSet;
QsciScintilla *attached_editor;
void setStyleDefaults() const;
StyleData &styleData(int style) const;
QsciLexer(const QsciLexer &);
QsciLexer &operator=(const QsciLexer &);
};
#endif

View File

@@ -0,0 +1,201 @@
// This defines the interface to the abstract QsciLexerAsm class.
//
// Copyright (c) 2023 Riverbank Computing Limited <info@riverbankcomputing.com>
//
// This file is part of QScintilla.
//
// This file may be used under the terms of the GNU General Public License
// version 3.0 as published by the Free Software Foundation and appearing in
// the file LICENSE included in the packaging of this file. Please review the
// following information to ensure the GNU General Public License version 3.0
// requirements will be met: http://www.gnu.org/copyleft/gpl.html.
//
// If you do not wish to use this file under the terms of the GPL version 3.0
// then you may purchase a commercial license. For more information contact
// info@riverbankcomputing.com.
//
// 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 QSCILEXERASM_H
#define QSCILEXERASM_H
#include <QObject>
#include <QChar>
#include <Qsci/qsciglobal.h>
#include <Qsci/qscilexer.h>
//! \brief The abstract QsciLexerAsm class encapsulates the Scintilla Asm
//! lexer.
class QSCINTILLA_EXPORT QsciLexerAsm : public QsciLexer
{
Q_OBJECT
public:
//! This enum defines the meanings of the different styles used by the
//! Asm lexer.
enum {
//! The default.
Default = 0,
//! A comment.
Comment = 1,
//! A number.
Number = 2,
//! A double-quoted string.
DoubleQuotedString = 3,
//! An operator.
Operator = 4,
//! An identifier.
Identifier = 5,
//! A CPU instruction.
CPUInstruction = 6,
//! An FPU instruction.
FPUInstruction = 7,
//! A register.
Register = 8,
//! A directive.
Directive = 9,
//! A directive operand.
DirectiveOperand = 11,
//! A block comment.
BlockComment = 12,
//! A single-quoted string.
SingleQuotedString = 13,
//! The end of a line where a string is not closed.
UnclosedString = 14,
//! An extended instruction.
ExtendedInstruction = 16,
//! A comment directive.
CommentDirective = 17,
};
//! Construct a QsciLexerAsm with parent \a parent. \a parent is
//! typically the QsciScintilla instance.
QsciLexerAsm(QObject *parent = 0);
//! Destroys the QsciLexerAsm instance.
virtual ~QsciLexerAsm();
//! Returns the foreground colour of the text for style number \a style.
QColor defaultColor(int style) const;
//! Returns the end-of-line fill for style number \a style.
bool defaultEolFill(int style) const;
//! Returns the font for style number \a style.
QFont defaultFont(int style) const;
//! Returns the background colour of the text for style number \a style.
//!
//! \sa defaultColor()
QColor defaultPaper(int style) const;
//! Returns the set of keywords for the keyword set \a set recognised
//! by the lexer as a space separated string. Set 1 is normally used for
//! CPU instructions. Set 2 is normally used for FPU instructions. Set 3
//! is normally used for register names. Set 4 is normally used for
//! directives. Set 5 is normally used for directive operands. Set 6 is
//! normally used for extended instructions.
const char *keywords(int set) const;
//! Returns the descriptive name for style number \a style. If the
//! style is invalid for this language then an empty QString is returned.
//! This is intended to be used in user preference dialogs.
QString description(int style) const;
//! Causes all properties to be refreshed by emitting the propertyChanged()
//! signal as required.
void refreshProperties();
//! Returns true if multi-line comment blocks can be folded.
//!
//! \sa setFoldComments()
bool foldComments() const;
//! Returns true if trailing blank lines are included in a fold block.
//!
//! \sa setFoldCompact()
bool foldCompact() const;
//! Returns the delimiter used by the COMMENT directive.
//!
//! \sa setCommentDelimiter()
QChar commentDelimiter() const;
//! Returns true if syntax-based folding is enabled.
//!
//! \sa setFoldSyntaxBased()
bool foldSyntaxBased() const;
public slots:
//! If \a fold is true then multi-line comment blocks can be folded.
//! The default is true.
//!
//! \sa foldComments()
virtual void setFoldComments(bool fold);
//! If \a fold is true then trailing blank lines are included in a fold
//! block. The default is true.
//!
//! \sa foldCompact()
virtual void setFoldCompact(bool fold);
//! \a delimiter is the character used for the COMMENT directive's
//! delimiter. The default is '~'.
//!
//! \sa commentDelimiter()
virtual void setCommentDelimiter(QChar delimeter);
//! If \a syntax_based is true then syntax-based folding is enabled. The
//! default is true.
//!
//! \sa foldSyntaxBased()
virtual void setFoldSyntaxBased(bool syntax_based);
protected:
//! The lexer's properties are read from the settings \a qs. \a prefix
//! (which has a trailing '/') should be used as a prefix to the key of
//! each setting. true is returned if there is no error.
//!
bool readProperties(QSettings &qs, const QString &prefix);
//! The lexer's properties are written to the settings \a qs.
//! \a prefix (which has a trailing '/') should be used as a prefix to
//! the key of each setting. true is returned if there is no error.
//!
bool writeProperties(QSettings &qs, const QString &prefix) const;
private:
void setCommentProp();
void setCompactProp();
void setCommentDelimiterProp();
void setSyntaxBasedProp();
bool fold_comments;
bool fold_compact;
QChar comment_delimiter;
bool fold_syntax_based;
QsciLexerAsm(const QsciLexerAsm &);
QsciLexerAsm &operator=(const QsciLexerAsm &);
};
#endif

View File

@@ -0,0 +1,174 @@
// This defines the interface to the QsciLexerAVS class.
//
// Copyright (c) 2023 Riverbank Computing Limited <info@riverbankcomputing.com>
//
// This file is part of QScintilla.
//
// This file may be used under the terms of the GNU General Public License
// version 3.0 as published by the Free Software Foundation and appearing in
// the file LICENSE included in the packaging of this file. Please review the
// following information to ensure the GNU General Public License version 3.0
// requirements will be met: http://www.gnu.org/copyleft/gpl.html.
//
// If you do not wish to use this file under the terms of the GPL version 3.0
// then you may purchase a commercial license. For more information contact
// info@riverbankcomputing.com.
//
// 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 QSCILEXERAVS_H
#define QSCILEXERAVS_H
#include <QObject>
#include <Qsci/qsciglobal.h>
#include <Qsci/qscilexer.h>
//! \brief The QsciLexerAVS class encapsulates the Scintilla AVS lexer.
class QSCINTILLA_EXPORT QsciLexerAVS : public QsciLexer
{
Q_OBJECT
public:
//! This enum defines the meanings of the different styles used by the
//! AVS lexer.
enum {
//! The default.
Default = 0,
//! A block comment.
BlockComment = 1,
//! A nested block comment.
NestedBlockComment = 2,
//! A line comment.
LineComment = 3,
//! A number.
Number = 4,
//! An operator.
Operator = 5,
//! An identifier
Identifier = 6,
//! A string.
String = 7,
//! A triple quoted string.
TripleString = 8,
//! A keyword (as defined by keyword set number 1)..
Keyword = 9,
//! A filter (as defined by keyword set number 2).
Filter = 10,
//! A plugin (as defined by keyword set number 3).
Plugin = 11,
//! A function (as defined by keyword set number 4).
Function = 12,
//! A clip property (as defined by keyword set number 5).
ClipProperty = 13,
//! A keyword defined in keyword set number 6. The class must be
//! sub-classed and re-implement keywords() to make use of this style.
KeywordSet6 = 14
};
//! Construct a QsciLexerAVS with parent \a parent. \a parent is typically
//! the QsciScintilla instance.
QsciLexerAVS(QObject *parent = 0);
//! Destroys the QsciLexerAVS instance.
virtual ~QsciLexerAVS();
//! Returns the name of the language.
const char *language() const;
//! Returns the name of the lexer. Some lexers support a number of
//! languages.
const char *lexer() const;
//! \internal Returns the style used for braces for brace matching.
int braceStyle() const;
//! Returns the string of characters that comprise a word.
const char *wordCharacters() const;
//! Returns the foreground colour of the text for style number \a style.
//!
//! \sa defaultPaper()
QColor defaultColor(int style) const;
//! Returns the font for style number \a style.
QFont defaultFont(int style) const;
//! Returns the set of keywords for the keyword set \a set recognised
//! by the lexer as a space separated string.
const char *keywords(int set) const;
//! Returns the descriptive name for style number \a style. If the
//! style is invalid for this language then an empty QString is returned.
//! This is intended to be used in user preference dialogs.
QString description(int style) const;
//! Causes all properties to be refreshed by emitting the propertyChanged()
//! signal as required.
void refreshProperties();
//! Returns true if multi-line comment blocks can be folded.
//!
//! \sa setFoldComments()
bool foldComments() const;
//! Returns true if trailing blank lines are included in a fold block.
//!
//! \sa setFoldCompact()
bool foldCompact() const;
public slots:
//! If \a fold is true then multi-line comment blocks can be folded.
//! The default is false.
//!
//! \sa foldComments()
virtual void setFoldComments(bool fold);
//! If \a fold is true then trailing blank lines are included in a fold
//! block. The default is true.
//!
//! \sa foldCompact()
virtual void setFoldCompact(bool fold);
protected:
//! The lexer's properties are read from the settings \a qs. \a prefix
//! (which has a trailing '/') should be used as a prefix to the key of
//! each setting. true is returned if there is no error.
//!
bool readProperties(QSettings &qs,const QString &prefix);
//! The lexer's properties are written to the settings \a qs.
//! \a prefix (which has a trailing '/') should be used as a prefix to
//! the key of each setting. true is returned if there is no error.
//!
bool writeProperties(QSettings &qs,const QString &prefix) const;
private:
void setCommentProp();
void setCompactProp();
bool fold_comments;
bool fold_compact;
QsciLexerAVS(const QsciLexerAVS &);
QsciLexerAVS &operator=(const QsciLexerAVS &);
};
#endif

View File

@@ -0,0 +1,178 @@
// This defines the interface to the QsciLexerBash class.
//
// Copyright (c) 2023 Riverbank Computing Limited <info@riverbankcomputing.com>
//
// This file is part of QScintilla.
//
// This file may be used under the terms of the GNU General Public License
// version 3.0 as published by the Free Software Foundation and appearing in
// the file LICENSE included in the packaging of this file. Please review the
// following information to ensure the GNU General Public License version 3.0
// requirements will be met: http://www.gnu.org/copyleft/gpl.html.
//
// If you do not wish to use this file under the terms of the GPL version 3.0
// then you may purchase a commercial license. For more information contact
// info@riverbankcomputing.com.
//
// 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 QSCILEXERBASH_H
#define QSCILEXERBASH_H
#include <QObject>
#include <Qsci/qsciglobal.h>
#include <Qsci/qscilexer.h>
//! \brief The QsciLexerBash class encapsulates the Scintilla Bash lexer.
class QSCINTILLA_EXPORT QsciLexerBash : public QsciLexer
{
Q_OBJECT
public:
//! This enum defines the meanings of the different styles used by the
//! Bash lexer.
enum {
//! The default.
Default = 0,
//! An error.
Error = 1,
//! A comment.
Comment = 2,
//! A number.
Number = 3,
//! A keyword.
Keyword = 4,
//! A double-quoted string.
DoubleQuotedString = 5,
//! A single-quoted string.
SingleQuotedString = 6,
//! An operator.
Operator = 7,
//! An identifier
Identifier = 8,
//! A scalar.
Scalar = 9,
//! Parameter expansion.
ParameterExpansion = 10,
//! Backticks.
Backticks = 11,
//! A here document delimiter.
HereDocumentDelimiter = 12,
//! A single quoted here document.
SingleQuotedHereDocument = 13
};
//! Construct a QsciLexerBash with parent \a parent. \a parent is
//! typically the QsciScintilla instance.
QsciLexerBash(QObject *parent = 0);
//! Destroys the QsciLexerBash instance.
virtual ~QsciLexerBash();
//! Returns the name of the language.
const char *language() const;
//! Returns the name of the lexer. Some lexers support a number of
//! languages.
const char *lexer() const;
//! \internal Returns the style used for braces for brace matching.
int braceStyle() const;
//! Returns the string of characters that comprise a word.
const char *wordCharacters() const;
//! Returns the foreground colour of the text for style number \a style.
//!
//! \sa defaultPaper()
QColor defaultColor(int style) const;
//! Returns the end-of-line fill for style number \a style.
bool defaultEolFill(int style) const;
//! Returns the font for style number \a style.
QFont defaultFont(int style) const;
//! Returns the background colour of the text for style number \a style.
//!
//! \sa defaultColor()
QColor defaultPaper(int style) const;
//! Returns the set of keywords for the keyword set \a set recognised
//! by the lexer as a space separated string.
const char *keywords(int set) const;
//! Returns the descriptive name for style number \a style. If the
//! style is invalid for this language then an empty QString is returned.
//! This is intended to be used in user preference dialogs.
QString description(int style) const;
//! Causes all properties to be refreshed by emitting the
//! propertyChanged() signal as required.
void refreshProperties();
//! Returns true if multi-line comment blocks can be folded.
//!
//! \sa setFoldComments()
bool foldComments() const;
//! Returns true if trailing blank lines are included in a fold block.
//!
//! \sa setFoldCompact()
bool foldCompact() const;
public slots:
//! If \a fold is true then multi-line comment blocks can be folded.
//! The default is false.
//!
//! \sa foldComments()
virtual void setFoldComments(bool fold);
//! If \a fold is true then trailing blank lines are included in a fold
//! block. The default is true.
//!
//! \sa foldCompact()
virtual void setFoldCompact(bool fold);
protected:
//! The lexer's properties are read from the settings \a qs. \a prefix
//! (which has a trailing '/') should be used as a prefix to the key of
//! each setting. true is returned if there is no error.
//!
bool readProperties(QSettings &qs,const QString &prefix);
//! The lexer's properties are written to the settings \a qs.
//! \a prefix (which has a trailing '/') should be used as a prefix to
//! the key of each setting. true is returned if there is no error.
//!
bool writeProperties(QSettings &qs,const QString &prefix) const;
private:
void setCommentProp();
void setCompactProp();
bool fold_comments;
bool fold_compact;
QsciLexerBash(const QsciLexerBash &);
QsciLexerBash &operator=(const QsciLexerBash &);
};
#endif

View File

@@ -0,0 +1,115 @@
// This defines the interface to the QsciLexerBatch class.
//
// Copyright (c) 2023 Riverbank Computing Limited <info@riverbankcomputing.com>
//
// This file is part of QScintilla.
//
// This file may be used under the terms of the GNU General Public License
// version 3.0 as published by the Free Software Foundation and appearing in
// the file LICENSE included in the packaging of this file. Please review the
// following information to ensure the GNU General Public License version 3.0
// requirements will be met: http://www.gnu.org/copyleft/gpl.html.
//
// If you do not wish to use this file under the terms of the GPL version 3.0
// then you may purchase a commercial license. For more information contact
// info@riverbankcomputing.com.
//
// 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 QSCILEXERBATCH_H
#define QSCILEXERBATCH_H
#include <QObject>
#include <Qsci/qsciglobal.h>
#include <Qsci/qscilexer.h>
//! \brief The QsciLexerBatch class encapsulates the Scintilla batch file
//! lexer.
class QSCINTILLA_EXPORT QsciLexerBatch : public QsciLexer
{
Q_OBJECT
public:
//! This enum defines the meanings of the different styles used by the
//! batch file lexer.
enum {
//! The default.
Default = 0,
//! A comment.
Comment = 1,
//! A keyword.
Keyword = 2,
//! A label.
Label = 3,
//! An hide command character.
HideCommandChar = 4,
//! An external command .
ExternalCommand = 5,
//! A variable.
Variable = 6,
//! An operator
Operator = 7
};
//! Construct a QsciLexerBatch with parent \a parent. \a parent is
//! typically the QsciScintilla instance.
QsciLexerBatch(QObject *parent = 0);
//! Destroys the QsciLexerBatch instance.
virtual ~QsciLexerBatch();
//! Returns the name of the language.
const char *language() const;
//! Returns the name of the lexer. Some lexers support a number of
//! languages.
const char *lexer() const;
//! Returns the string of characters that comprise a word.
const char *wordCharacters() const;
//! \internal Returns true if the language is case sensitive.
bool caseSensitive() const;
//! Returns the foreground colour of the text for style number \a style.
//!
//! \sa defaultPaper()
QColor defaultColor(int style) const;
//! Returns the end-of-line fill for style number \a style.
bool defaultEolFill(int style) const;
//! Returns the font for style number \a style.
QFont defaultFont(int style) const;
//! Returns the background colour of the text for style number \a style.
//!
//! \sa defaultColor()
QColor defaultPaper(int style) const;
//! Returns the set of keywords for the keyword set \a set recognised
//! by the lexer as a space separated string.
const char *keywords(int set) const;
//! Returns the descriptive name for style number \a style. If the
//! style is invalid for this language then an empty QString is returned.
//! This is intended to be used in user preference dialogs.
QString description(int style) const;
private:
QsciLexerBatch(const QsciLexerBatch &);
QsciLexerBatch &operator=(const QsciLexerBatch &);
};
#endif

View File

@@ -0,0 +1,160 @@
// This defines the interface to the QsciLexerCMake class.
//
// Copyright (c) 2023 Riverbank Computing Limited <info@riverbankcomputing.com>
//
// This file is part of QScintilla.
//
// This file may be used under the terms of the GNU General Public License
// version 3.0 as published by the Free Software Foundation and appearing in
// the file LICENSE included in the packaging of this file. Please review the
// following information to ensure the GNU General Public License version 3.0
// requirements will be met: http://www.gnu.org/copyleft/gpl.html.
//
// If you do not wish to use this file under the terms of the GPL version 3.0
// then you may purchase a commercial license. For more information contact
// info@riverbankcomputing.com.
//
// 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 QSCILEXERCMAKE_H
#define QSCILEXERCMAKE_H
#include <QObject>
#include <Qsci/qsciglobal.h>
#include <Qsci/qscilexer.h>
//! \brief The QsciLexerCMake class encapsulates the Scintilla CMake lexer.
class QSCINTILLA_EXPORT QsciLexerCMake : public QsciLexer
{
Q_OBJECT
public:
//! This enum defines the meanings of the different styles used by the
//! CMake lexer.
enum {
//! The default.
Default = 0,
//! A comment.
Comment = 1,
//! A string.
String = 2,
//! A left quoted string.
StringLeftQuote = 3,
//! A right quoted string.
StringRightQuote = 4,
//! A function. (Defined by keyword set number 1.)
Function = 5,
//! A variable. (Defined by keyword set number 2.)
Variable = 6,
//! A label.
Label = 7,
//! A keyword defined in keyword set number 3. The class must be
//! sub-classed and re-implement keywords() to make use of this style.
KeywordSet3 = 8,
//! A WHILE block.
BlockWhile = 9,
//! A FOREACH block.
BlockForeach = 10,
//! An IF block.
BlockIf = 11,
//! A MACRO block.
BlockMacro = 12,
//! A variable within a string.
StringVariable = 13,
//! A number.
Number = 14
};
//! Construct a QsciLexerCMake with parent \a parent. \a parent is
//! typically the QsciScintilla instance.
QsciLexerCMake(QObject *parent = 0);
//! Destroys the QsciLexerCMake instance.
virtual ~QsciLexerCMake();
//! Returns the name of the language.
const char *language() const;
//! Returns the name of the lexer. Some lexers support a number of
//! languages.
const char *lexer() const;
//! Returns the foreground colour of the text for style number \a style.
//!
//! \sa defaultPaper()
QColor defaultColor(int style) const;
//! Returns the font for style number \a style.
QFont defaultFont(int style) const;
//! Returns the background colour of the text for style number \a style.
//!
//! \sa defaultColor()
QColor defaultPaper(int style) const;
//! Returns the set of keywords for the keyword set \a set recognised
//! by the lexer as a space separated string.
const char *keywords(int set) const;
//! Returns the descriptive name for style number \a style. If the
//! style is invalid for this language then an empty QString is returned.
//! This is intended to be used in user preference dialogs.
QString description(int style) const;
//! Causes all properties to be refreshed by emitting the propertyChanged()
//! signal as required.
void refreshProperties();
//! Returns true if ELSE blocks can be folded.
//!
//! \sa setFoldAtElse()
bool foldAtElse() const;
public slots:
//! If \a fold is true then ELSE blocks can be folded. The default is
//! false.
//!
//! \sa foldAtElse()
virtual void setFoldAtElse(bool fold);
protected:
//! The lexer's properties are read from the settings \a qs. \a prefix
//! (which has a trailing '/') should be used as a prefix to the key of
//! each setting. true is returned if there is no error.
//!
bool readProperties(QSettings &qs,const QString &prefix);
//! The lexer's properties are written to the settings \a qs.
//! \a prefix (which has a trailing '/') should be used as a prefix to
//! the key of each setting. true is returned if there is no error.
//!
bool writeProperties(QSettings &qs,const QString &prefix) const;
private:
void setAtElseProp();
bool fold_atelse;
QsciLexerCMake(const QsciLexerCMake &);
QsciLexerCMake &operator=(const QsciLexerCMake &);
};
#endif

View File

@@ -0,0 +1,264 @@
// This defines the interface to the QsciLexerCoffeeScript class.
//
// Copyright (c) 2023 Riverbank Computing Limited <info@riverbankcomputing.com>
//
// This file is part of QScintilla.
//
// This file may be used under the terms of the GNU General Public License
// version 3.0 as published by the Free Software Foundation and appearing in
// the file LICENSE included in the packaging of this file. Please review the
// following information to ensure the GNU General Public License version 3.0
// requirements will be met: http://www.gnu.org/copyleft/gpl.html.
//
// If you do not wish to use this file under the terms of the GPL version 3.0
// then you may purchase a commercial license. For more information contact
// info@riverbankcomputing.com.
//
// 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 QSCILEXERCOFFEESCRIPT_H
#define QSCILEXERCOFFEESCRIPT_H
#include <QObject>
#include <Qsci/qsciglobal.h>
#include <Qsci/qscilexer.h>
//! \brief The QsciLexerCoffeeScript class encapsulates the Scintilla
//! CoffeeScript lexer.
class QSCINTILLA_EXPORT QsciLexerCoffeeScript : public QsciLexer
{
Q_OBJECT
public:
//! This enum defines the meanings of the different styles used by the
//! C++ lexer.
enum {
//! The default.
Default = 0,
//! A C-style comment.
Comment = 1,
//! A C++-style comment line.
CommentLine = 2,
//! A JavaDoc/Doxygen C-style comment.
CommentDoc = 3,
//! A number.
Number = 4,
//! A keyword.
Keyword = 5,
//! A double-quoted string.
DoubleQuotedString = 6,
//! A single-quoted string.
SingleQuotedString = 7,
//! An IDL UUID.
UUID = 8,
//! A pre-processor block.
PreProcessor = 9,
//! An operator.
Operator = 10,
//! An identifier
Identifier = 11,
//! The end of a line where a string is not closed.
UnclosedString = 12,
//! A C# verbatim string.
VerbatimString = 13,
//! A regular expression.
Regex = 14,
//! A JavaDoc/Doxygen C++-style comment line.
CommentLineDoc = 15,
//! A keyword defined in keyword set number 2. The class must be
//! sub-classed and re-implement keywords() to make use of this style.
KeywordSet2 = 16,
//! A JavaDoc/Doxygen keyword.
CommentDocKeyword = 17,
//! A JavaDoc/Doxygen keyword error defined in keyword set number 3.
//! The class must be sub-classed and re-implement keywords() to make
//! use of this style.
CommentDocKeywordError = 18,
//! A global class defined in keyword set number 4. The class must be
//! sub-classed and re-implement keywords() to make use of this style.
GlobalClass = 19,
//! A block comment.
CommentBlock = 22,
//! A block regular expression.
BlockRegex = 23,
//! A block regular expression comment.
BlockRegexComment = 24,
//! An instance property.
InstanceProperty = 25,
};
//! Construct a QsciLexerCoffeeScript with parent \a parent. \a parent is
//! typically the QsciScintilla instance.
QsciLexerCoffeeScript(QObject *parent = 0);
//! Destroys the QsciLexerCoffeeScript instance.
virtual ~QsciLexerCoffeeScript();
//! Returns the name of the language.
const char *language() const;
//! Returns the name of the lexer. Some lexers support a number of
//! languages.
const char *lexer() const;
//! \internal Returns the character sequences that can separate
//! auto-completion words.
QStringList autoCompletionWordSeparators() const;
//! \internal Returns a space separated list of words or characters in
//! a particular style that define the end of a block for
//! auto-indentation. The styles is returned via \a style.
const char *blockEnd(int *style = 0) const;
//! \internal Returns a space separated list of words or characters in
//! a particular style that define the start of a block for
//! auto-indentation. The styles is returned via \a style.
const char *blockStart(int *style = 0) const;
//! \internal Returns a space separated list of keywords in a
//! particular style that define the start of a block for
//! auto-indentation. The styles is returned via \a style.
const char *blockStartKeyword(int *style = 0) const;
//! \internal Returns the style used for braces for brace matching.
int braceStyle() const;
//! Returns the string of characters that comprise a word.
const char *wordCharacters() const;
//! Returns the foreground colour of the text for style number \a style.
//!
//! \sa defaultPaper()
QColor defaultColor(int style) const;
//! Returns the end-of-line fill for style number \a style.
bool defaultEolFill(int style) const;
//! Returns the font for style number \a style.
QFont defaultFont(int style) const;
//! Returns the background colour of the text for style number \a style.
//!
//! \sa defaultColor()
QColor defaultPaper(int style) const;
//! Returns the set of keywords for the keyword set \a set recognised
//! by the lexer as a space separated string. Set 1 is normally used for
//! primary keywords and identifiers. Set 2 is normally used for secondary
//! keywords and identifiers. Set 3 is normally used for documentation
//! comment keywords. Set 4 is normally used for global classes and
//! typedefs.
const char *keywords(int set) const;
//! Returns the descriptive name for style number \a style. If the
//! style is invalid for this language then an empty QString is returned.
//! This is intended to be used in user preference dialogs.
QString description(int style) const;
//! Causes all properties to be refreshed by emitting the
//! propertyChanged() signal as required.
void refreshProperties();
//! Returns true if '$' characters are allowed in identifier names.
//!
//! \sa setDollarsAllowed()
bool dollarsAllowed() const {return dollars;}
//! If \a allowed is true then '$' characters are allowed in identifier
//! names. The default is true.
//!
//! \sa dollarsAllowed()
void setDollarsAllowed(bool allowed);
//! Returns true if multi-line comment blocks can be folded.
//!
//! \sa setFoldComments()
bool foldComments() const {return fold_comments;}
//! If \a fold is true then multi-line comment blocks can be folded.
//! The default is false.
//!
//! \sa foldComments()
void setFoldComments(bool fold);
//! Returns true if trailing blank lines are included in a fold block.
//!
//! \sa setFoldCompact()
bool foldCompact() const {return fold_compact;}
//! If \a fold is true then trailing blank lines are included in a fold
//! block. The default is true.
//!
//! \sa foldCompact()
void setFoldCompact(bool fold);
//! Returns true if preprocessor lines (after the preprocessor
//! directive) are styled.
//!
//! \sa setStylePreprocessor()
bool stylePreprocessor() const {return style_preproc;}
//! If \a style is true then preprocessor lines (after the preprocessor
//! directive) are styled. The default is false.
//!
//! \sa stylePreprocessor()
void setStylePreprocessor(bool style);
protected:
//! The lexer's properties are read from the settings \a qs. \a prefix
//! (which has a trailing '/') should be used as a prefix to the key of
//! each setting. true is returned if there is no error.
//!
//! \sa writeProperties()
bool readProperties(QSettings &qs,const QString &prefix);
//! The lexer's properties are written to the settings \a qs.
//! \a prefix (which has a trailing '/') should be used as a prefix to
//! the key of each setting. true is returned if there is no error.
//!
//! \sa readProperties()
bool writeProperties(QSettings &qs,const QString &prefix) const;
private:
void setCommentProp();
void setCompactProp();
void setStylePreprocProp();
void setDollarsProp();
bool fold_comments;
bool fold_compact;
bool style_preproc;
bool dollars;
QsciLexerCoffeeScript(const QsciLexerCoffeeScript &);
QsciLexerCoffeeScript &operator=(const QsciLexerCoffeeScript &);
};
#endif

View File

@@ -0,0 +1,398 @@
// This defines the interface to the QsciLexerCPP class.
//
// Copyright (c) 2023 Riverbank Computing Limited <info@riverbankcomputing.com>
//
// This file is part of QScintilla.
//
// This file may be used under the terms of the GNU General Public License
// version 3.0 as published by the Free Software Foundation and appearing in
// the file LICENSE included in the packaging of this file. Please review the
// following information to ensure the GNU General Public License version 3.0
// requirements will be met: http://www.gnu.org/copyleft/gpl.html.
//
// If you do not wish to use this file under the terms of the GPL version 3.0
// then you may purchase a commercial license. For more information contact
// info@riverbankcomputing.com.
//
// 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 QSCILEXERCPP_H
#define QSCILEXERCPP_H
#include <QObject>
#include <Qsci/qsciglobal.h>
#include <Qsci/qscilexer.h>
//! \brief The QsciLexerCPP class encapsulates the Scintilla C++
//! lexer.
class QSCINTILLA_EXPORT QsciLexerCPP : public QsciLexer
{
Q_OBJECT
public:
//! This enum defines the meanings of the different styles used by the
//! C++ lexer.
enum {
//! The default.
Default = 0,
InactiveDefault = Default + 64,
//! A C comment.
Comment = 1,
InactiveComment = Comment + 64,
//! A C++ comment line.
CommentLine = 2,
InactiveCommentLine = CommentLine + 64,
//! A JavaDoc/Doxygen style C comment.
CommentDoc = 3,
InactiveCommentDoc = CommentDoc + 64,
//! A number.
Number = 4,
InactiveNumber = Number + 64,
//! A keyword.
Keyword = 5,
InactiveKeyword = Keyword + 64,
//! A double-quoted string.
DoubleQuotedString = 6,
InactiveDoubleQuotedString = DoubleQuotedString + 64,
//! A single-quoted string.
SingleQuotedString = 7,
InactiveSingleQuotedString = SingleQuotedString + 64,
//! An IDL UUID.
UUID = 8,
InactiveUUID = UUID + 64,
//! A pre-processor block.
PreProcessor = 9,
InactivePreProcessor = PreProcessor + 64,
//! An operator.
Operator = 10,
InactiveOperator = Operator + 64,
//! An identifier
Identifier = 11,
InactiveIdentifier = Identifier + 64,
//! The end of a line where a string is not closed.
UnclosedString = 12,
InactiveUnclosedString = UnclosedString + 64,
//! A C# verbatim string.
VerbatimString = 13,
InactiveVerbatimString = VerbatimString + 64,
//! A JavaScript regular expression.
Regex = 14,
InactiveRegex = Regex + 64,
//! A JavaDoc/Doxygen style C++ comment line.
CommentLineDoc = 15,
InactiveCommentLineDoc = CommentLineDoc + 64,
//! A keyword defined in keyword set number 2. The class must be
//! sub-classed and re-implement keywords() to make use of this style.
KeywordSet2 = 16,
InactiveKeywordSet2 = KeywordSet2 + 64,
//! A JavaDoc/Doxygen keyword.
CommentDocKeyword = 17,
InactiveCommentDocKeyword = CommentDocKeyword + 64,
//! A JavaDoc/Doxygen keyword error.
CommentDocKeywordError = 18,
InactiveCommentDocKeywordError = CommentDocKeywordError + 64,
//! A global class or typedef defined in keyword set number 5. The
//! class must be sub-classed and re-implement keywords() to make use
//! of this style.
GlobalClass = 19,
InactiveGlobalClass = GlobalClass + 64,
//! A C++ raw string.
RawString = 20,
InactiveRawString = RawString + 64,
//! A Vala triple-quoted verbatim string.
TripleQuotedVerbatimString = 21,
InactiveTripleQuotedVerbatimString = TripleQuotedVerbatimString + 64,
//! A Pike hash-quoted string.
HashQuotedString = 22,
InactiveHashQuotedString = HashQuotedString + 64,
//! A pre-processor stream comment.
PreProcessorComment = 23,
InactivePreProcessorComment = PreProcessorComment + 64,
//! A JavaDoc/Doxygen style pre-processor comment.
PreProcessorCommentLineDoc = 24,
InactivePreProcessorCommentLineDoc = PreProcessorCommentLineDoc + 64,
//! A user-defined literal.
UserLiteral = 25,
InactiveUserLiteral = UserLiteral + 64,
//! A task marker.
TaskMarker = 26,
InactiveTaskMarker = TaskMarker + 64,
//! An escape sequence.
EscapeSequence = 27,
InactiveEscapeSequence = EscapeSequence + 64,
};
//! Construct a QsciLexerCPP with parent \a parent. \a parent is typically
//! the QsciScintilla instance. \a caseInsensitiveKeywords is true if the
//! lexer ignores the case of keywords.
QsciLexerCPP(QObject *parent = 0, bool caseInsensitiveKeywords = false);
//! Destroys the QsciLexerCPP instance.
virtual ~QsciLexerCPP();
//! Returns the name of the language.
const char *language() const;
//! Returns the name of the lexer. Some lexers support a number of
//! languages.
const char *lexer() const;
//! \internal Returns the character sequences that can separate
//! auto-completion words.
QStringList autoCompletionWordSeparators() const;
//! \internal Returns a space separated list of words or characters in
//! a particular style that define the end of a block for
//! auto-indentation. The styles is returned via \a style.
const char *blockEnd(int *style = 0) const;
//! \internal Returns a space separated list of words or characters in
//! a particular style that define the start of a block for
//! auto-indentation. The styles is returned via \a style.
const char *blockStart(int *style = 0) const;
//! \internal Returns a space separated list of keywords in a
//! particular style that define the start of a block for
//! auto-indentation. The styles is returned via \a style.
const char *blockStartKeyword(int *style = 0) const;
//! \internal Returns the style used for braces for brace matching.
int braceStyle() const;
//! Returns the string of characters that comprise a word.
const char *wordCharacters() const;
//! Returns the foreground colour of the text for style number \a style.
//!
//! \sa defaultPaper()
QColor defaultColor(int style) const;
//! Returns the end-of-line fill for style number \a style.
bool defaultEolFill(int style) const;
//! Returns the font for style number \a style.
QFont defaultFont(int style) const;
//! Returns the background colour of the text for style number \a style.
//!
//! \sa defaultColor()
QColor defaultPaper(int style) const;
//! Returns the set of keywords for the keyword set \a set recognised
//! by the lexer as a space separated string. Set 1 is normally used for
//! primary keywords and identifiers. Set 2 is normally used for secondary
//! keywords and identifiers. Set 3 is normally used for documentation
//! comment keywords. Set 4 is normally used for global classes and
//! typedefs.
const char *keywords(int set) const;
//! Returns the descriptive name for style number \a style. If the
//! style is invalid for this language then an empty QString is returned.
//! This is intended to be used in user preference dialogs.
QString description(int style) const;
//! Causes all properties to be refreshed by emitting the
//! propertyChanged() signal as required.
void refreshProperties();
//! Returns true if "} else {" lines can be folded.
//!
//! \sa setFoldAtElse()
bool foldAtElse() const {return fold_atelse;}
//! Returns true if multi-line comment blocks can be folded.
//!
//! \sa setFoldComments()
bool foldComments() const {return fold_comments;}
//! Returns true if trailing blank lines are included in a fold block.
//!
//! \sa setFoldCompact()
bool foldCompact() const {return fold_compact;}
//! Returns true if preprocessor blocks can be folded.
//!
//! \sa setFoldPreprocessor()
bool foldPreprocessor() const {return fold_preproc;}
//! Returns true if preprocessor lines (after the preprocessor
//! directive) are styled.
//!
//! \sa setStylePreprocessor()
bool stylePreprocessor() const {return style_preproc;}
//! If \a allowed is true then '$' characters are allowed in identifier
//! names. The default is true.
//!
//! \sa dollarsAllowed()
void setDollarsAllowed(bool allowed);
//! Returns true if '$' characters are allowed in identifier names.
//!
//! \sa setDollarsAllowed()
bool dollarsAllowed() const {return dollars;}
//! If \a enabled is true then triple quoted strings are highlighted. The
//! default is false.
//!
//! \sa highlightTripleQuotedStrings()
void setHighlightTripleQuotedStrings(bool enabled);
//! Returns true if triple quoted strings should be highlighted.
//!
//! \sa setHighlightTripleQuotedStrings()
bool highlightTripleQuotedStrings() const {return highlight_triple;}
//! If \a enabled is true then hash quoted strings are highlighted. The
//! default is false.
//!
//! \sa highlightHashQuotedStrings()
void setHighlightHashQuotedStrings(bool enabled);
//! Returns true if hash quoted strings should be highlighted.
//!
//! \sa setHighlightHashQuotedStrings()
bool highlightHashQuotedStrings() const {return highlight_hash;}
//! If \a enabled is true then back-quoted raw strings are highlighted.
//! The default is false.
//!
//! \sa highlightBackQuotedStrings()
void setHighlightBackQuotedStrings(bool enabled);
//! Returns true if back-quoted raw strings should be highlighted.
//!
//! \sa setHighlightBackQuotedStrings()
bool highlightBackQuotedStrings() const {return highlight_back;}
//! If \a enabled is true then escape sequences in strings are highlighted.
//! The default is false.
//!
//! \sa highlightEscapeSequences()
void setHighlightEscapeSequences(bool enabled);
//! Returns true if escape sequences in strings should be highlighted.
//!
//! \sa setHighlightEscapeSequences()
bool highlightEscapeSequences() const {return highlight_escape;}
//! If \a allowed is true then escape sequences are allowed in verbatim
//! strings. The default is false.
//!
//! \sa verbatimStringEscapeSequencesAllowed()
void setVerbatimStringEscapeSequencesAllowed(bool allowed);
//! Returns true if hash quoted strings should be highlighted.
//!
//! \sa setVerbatimStringEscapeSequencesAllowed()
bool verbatimStringEscapeSequencesAllowed() const {return vs_escape;}
public slots:
//! If \a fold is true then "} else {" lines can be folded. The
//! default is false.
//!
//! \sa foldAtElse()
virtual void setFoldAtElse(bool fold);
//! If \a fold is true then multi-line comment blocks can be folded.
//! The default is false.
//!
//! \sa foldComments()
virtual void setFoldComments(bool fold);
//! If \a fold is true then trailing blank lines are included in a fold
//! block. The default is true.
//!
//! \sa foldCompact()
virtual void setFoldCompact(bool fold);
//! If \a fold is true then preprocessor blocks can be folded. The
//! default is true.
//!
//! \sa foldPreprocessor()
virtual void setFoldPreprocessor(bool fold);
//! If \a style is true then preprocessor lines (after the preprocessor
//! directive) are styled. The default is false.
//!
//! \sa stylePreprocessor()
virtual void setStylePreprocessor(bool style);
protected:
//! The lexer's properties are read from the settings \a qs. \a prefix
//! (which has a trailing '/') should be used as a prefix to the key of
//! each setting. true is returned if there is no error.
//!
//! \sa writeProperties()
bool readProperties(QSettings &qs,const QString &prefix);
//! The lexer's properties are written to the settings \a qs.
//! \a prefix (which has a trailing '/') should be used as a prefix to
//! the key of each setting. true is returned if there is no error.
//!
//! \sa readProperties()
bool writeProperties(QSettings &qs,const QString &prefix) const;
private:
void setAtElseProp();
void setCommentProp();
void setCompactProp();
void setPreprocProp();
void setStylePreprocProp();
void setDollarsProp();
void setHighlightTripleProp();
void setHighlightHashProp();
void setHighlightBackProp();
void setHighlightEscapeProp();
void setVerbatimStringEscapeProp();
bool fold_atelse;
bool fold_comments;
bool fold_compact;
bool fold_preproc;
bool style_preproc;
bool dollars;
bool highlight_triple;
bool highlight_hash;
bool highlight_back;
bool highlight_escape;
bool vs_escape;
bool nocase;
QsciLexerCPP(const QsciLexerCPP &);
QsciLexerCPP &operator=(const QsciLexerCPP &);
};
#endif

View File

@@ -0,0 +1,77 @@
// This defines the interface to the QsciLexerCSharp class.
//
// Copyright (c) 2023 Riverbank Computing Limited <info@riverbankcomputing.com>
//
// This file is part of QScintilla.
//
// This file may be used under the terms of the GNU General Public License
// version 3.0 as published by the Free Software Foundation and appearing in
// the file LICENSE included in the packaging of this file. Please review the
// following information to ensure the GNU General Public License version 3.0
// requirements will be met: http://www.gnu.org/copyleft/gpl.html.
//
// If you do not wish to use this file under the terms of the GPL version 3.0
// then you may purchase a commercial license. For more information contact
// info@riverbankcomputing.com.
//
// 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 QSCILEXERCSHARP_H
#define QSCILEXERCSHARP_H
#include <QObject>
#include <Qsci/qsciglobal.h>
#include <Qsci/qscilexercpp.h>
//! \brief The QsciLexerCSharp class encapsulates the Scintilla C#
//! lexer.
class QSCINTILLA_EXPORT QsciLexerCSharp : public QsciLexerCPP
{
Q_OBJECT
public:
//! Construct a QsciLexerCSharp with parent \a parent. \a parent is
//! typically the QsciScintilla instance.
QsciLexerCSharp(QObject *parent = 0);
//! Destroys the QsciLexerCSharp instance.
virtual ~QsciLexerCSharp();
//! Returns the name of the language.
const char *language() const;
//! Returns the foreground colour of the text for style number \a style.
//!
//! \sa defaultPaper()
QColor defaultColor(int style) const;
//! Returns the end-of-line fill for style number \a style.
bool defaultEolFill(int style) const;
//! Returns the font for style number \a style.
QFont defaultFont(int style) const;
//! Returns the background colour of the text for style number \a style.
//!
//! \sa defaultColor()
QColor defaultPaper(int style) const;
//! Returns the set of keywords for the keyword set \a set recognised
//! by the lexer as a space separated string.
const char *keywords(int set) const;
//! Returns the descriptive name for style number \a style. If the
//! style is invalid for this language then an empty QString is returned.
//! This is intended to be used in user preference dialogs.
QString description(int style) const;
private:
QsciLexerCSharp(const QsciLexerCSharp &);
QsciLexerCSharp &operator=(const QsciLexerCSharp &);
};
#endif

View File

@@ -0,0 +1,252 @@
// This defines the interface to the QsciLexerCSS class.
//
// Copyright (c) 2023 Riverbank Computing Limited <info@riverbankcomputing.com>
//
// This file is part of QScintilla.
//
// This file may be used under the terms of the GNU General Public License
// version 3.0 as published by the Free Software Foundation and appearing in
// the file LICENSE included in the packaging of this file. Please review the
// following information to ensure the GNU General Public License version 3.0
// requirements will be met: http://www.gnu.org/copyleft/gpl.html.
//
// If you do not wish to use this file under the terms of the GPL version 3.0
// then you may purchase a commercial license. For more information contact
// info@riverbankcomputing.com.
//
// 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 QSCILEXERCSS_H
#define QSCILEXERCSS_H
#include <QObject>
#include <Qsci/qsciglobal.h>
#include <Qsci/qscilexer.h>
//! \brief The QsciLexerCSS class encapsulates the Scintilla CSS lexer.
class QSCINTILLA_EXPORT QsciLexerCSS : public QsciLexer
{
Q_OBJECT
public:
//! This enum defines the meanings of the different styles used by the
//! CSS lexer.
enum {
//! The default.
Default = 0,
//! A tag.
Tag = 1,
//! A class selector.
ClassSelector = 2,
//! A pseudo class. The list of pseudo classes is defined by keyword
//! set 2.
PseudoClass = 3,
//! An unknown pseudo class.
UnknownPseudoClass = 4,
//! An operator.
Operator = 5,
//! A CSS1 property. The list of CSS1 properties is defined by keyword
//! set 1.
CSS1Property = 6,
//! An unknown property.
UnknownProperty = 7,
//! A value.
Value = 8,
//! A comment.
Comment = 9,
//! An ID selector.
IDSelector = 10,
//! An important value.
Important = 11,
//! An @-rule.
AtRule = 12,
//! A double-quoted string.
DoubleQuotedString = 13,
//! A single-quoted string.
SingleQuotedString = 14,
//! A CSS2 property. The list of CSS2 properties is defined by keyword
//! set 3.
CSS2Property = 15,
//! An attribute.
Attribute = 16,
//! A CSS3 property. The list of CSS3 properties is defined by keyword
//! set 4.
CSS3Property = 17,
//! A pseudo element. The list of pseudo elements is defined by
//! keyword set 5.
PseudoElement = 18,
//! An extended (browser specific) CSS property. The list of extended
//! CSS properties is defined by keyword set 6.
ExtendedCSSProperty = 19,
//! An extended (browser specific) pseudo class. The list of extended
//! pseudo classes is defined by keyword set 7.
ExtendedPseudoClass = 20,
//! An extended (browser specific) pseudo element. The list of
//! extended pseudo elements is defined by keyword set 8.
ExtendedPseudoElement = 21,
//! A media rule.
MediaRule = 22,
//! A variable.
Variable = 23,
};
//! Construct a QsciLexerCSS with parent \a parent. \a parent is typically
//! the QsciScintilla instance.
QsciLexerCSS(QObject *parent = 0);
//! Destroys the QsciLexerCSS instance.
virtual ~QsciLexerCSS();
//! Returns the name of the language.
const char *language() const;
//! Returns the name of the lexer. Some lexers support a number of
//! languages.
const char *lexer() const;
//! \internal Returns a space separated list of words or characters in
//! a particular style that define the end of a block for
//! auto-indentation. The styles is returned via \a style.
const char *blockEnd(int *style = 0) const;
//! \internal Returns a space separated list of words or characters in
//! a particular style that define the start of a block for
//! auto-indentation. The styles is returned via \a style.
const char *blockStart(int *style = 0) const;
//! Returns the string of characters that comprise a word.
const char *wordCharacters() const;
//! Returns the foreground colour of the text for style number \a style.
QColor defaultColor(int style) const;
//! Returns the font for style number \a style.
QFont defaultFont(int style) const;
//! Returns the set of keywords for the keyword set \a set recognised
//! by the lexer as a space separated string.
const char *keywords(int set) const;
//! Returns the descriptive name for style number \a style. If the
//! style is invalid for this language then an empty QString is returned.
//! This is intended to be used in user preference dialogs.
QString description(int style) const;
//! Causes all properties to be refreshed by emitting the
//! propertyChanged() signal as required.
void refreshProperties();
//! Returns true if multi-line comment blocks can be folded.
//!
//! \sa setFoldComments()
bool foldComments() const;
//! Returns true if trailing blank lines are included in a fold block.
//!
//! \sa setFoldCompact()
bool foldCompact() const;
//! If \a enabled is true then support for HSS is enabled. The default is
//! false.
//!
//! \sa HSSLanguage()
void setHSSLanguage(bool enabled);
//! Returns true if support for HSS is enabled.
//!
//! \sa setHSSLanguage()
bool HSSLanguage() const {return hss_language;}
//! If \a enabled is true then support for Less CSS is enabled. The
//! default is false.
//!
//! \sa LessLanguage()
void setLessLanguage(bool enabled);
//! Returns true if support for Less CSS is enabled.
//!
//! \sa setLessLanguage()
bool LessLanguage() const {return less_language;}
//! If \a enabled is true then support for Sassy CSS is enabled. The
//! default is false.
//!
//! \sa SCSSLanguage()
void setSCSSLanguage(bool enabled);
//! Returns true if support for Sassy CSS is enabled.
//!
//! \sa setSCSSLanguage()
bool SCSSLanguage() const {return scss_language;}
public slots:
//! If \a fold is true then multi-line comment blocks can be folded.
//! The default is false.
//!
//! \sa foldComments()
virtual void setFoldComments(bool fold);
//! If \a fold is true then trailing blank lines are included in a fold
//! block. The default is true.
//!
//! \sa foldCompact()
virtual void setFoldCompact(bool fold);
protected:
//! The lexer's properties are read from the settings \a qs. \a prefix
//! (which has a trailing '/') should be used as a prefix to the key of
//! each setting. true is returned if there is no error.
//!
bool readProperties(QSettings &qs,const QString &prefix);
//! The lexer's properties are written to the settings \a qs.
//! \a prefix (which has a trailing '/') should be used as a prefix to
//! the key of each setting. true is returned if there is no error.
//!
bool writeProperties(QSettings &qs,const QString &prefix) const;
private:
void setCommentProp();
void setCompactProp();
void setHSSProp();
void setLessProp();
void setSCSSProp();
bool fold_comments;
bool fold_compact;
bool hss_language;
bool less_language;
bool scss_language;
QsciLexerCSS(const QsciLexerCSS &);
QsciLexerCSS &operator=(const QsciLexerCSS &);
};
#endif

View File

@@ -0,0 +1,100 @@
// This defines the interface to the QsciLexerCustom class.
//
// Copyright (c) 2023 Riverbank Computing Limited <info@riverbankcomputing.com>
//
// This file is part of QScintilla.
//
// This file may be used under the terms of the GNU General Public License
// version 3.0 as published by the Free Software Foundation and appearing in
// the file LICENSE included in the packaging of this file. Please review the
// following information to ensure the GNU General Public License version 3.0
// requirements will be met: http://www.gnu.org/copyleft/gpl.html.
//
// If you do not wish to use this file under the terms of the GPL version 3.0
// then you may purchase a commercial license. For more information contact
// info@riverbankcomputing.com.
//
// 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 QSCILEXERCUSTOM_H
#define QSCILEXERCUSTOM_H
#include <Qsci/qsciglobal.h>
#include <Qsci/qscilexer.h>
class QsciScintilla;
class QsciStyle;
//! \brief The QsciLexerCustom class is an abstract class used as a base for
//! new language lexers.
//!
//! The advantage of implementing a new lexer this way (as opposed to adding
//! the lexer to the underlying Scintilla code) is that it does not require the
//! QScintilla library to be re-compiled. It also makes it possible to
//! integrate external lexers.
//!
//! All that is necessary to implement a new lexer is to define appropriate
//! styles and to re-implement the styleText() method.
class QSCINTILLA_EXPORT QsciLexerCustom : public QsciLexer
{
Q_OBJECT
public:
//! Construct a QsciLexerCustom with parent \a parent. \a parent is
//! typically the QsciScintilla instance.
QsciLexerCustom(QObject *parent = 0);
//! Destroy the QSciLexerCustom.
virtual ~QsciLexerCustom();
//! The next \a length characters starting from the current styling
//! position have their style set to style number \a style. The current
//! styling position is moved. The styling position is initially set by
//! calling startStyling().
//!
//! \sa startStyling(), styleText()
void setStyling(int length, int style);
//! The next \a length characters starting from the current styling
//! position have their style set to style \a style. The current styling
//! position is moved. The styling position is initially set by calling
//! startStyling().
//!
//! \sa startStyling(), styleText()
void setStyling(int length, const QsciStyle &style);
//! The styling position is set to \a start. \a styleBits is unused.
//!
//! \sa setStyling(), styleBitsNeeded(), styleText()
void startStyling(int pos, int styleBits = 0);
//! This is called when the section of text beginning at position \a start
//! and up to position \a end needs to be styled. \a start will always be
//! at the start of a line. The text is styled by calling startStyling()
//! followed by one or more calls to setStyling(). It must be
//! re-implemented by a sub-class.
//!
//! \sa setStyling(), startStyling(), QsciScintilla::bytes(),
//! QsciScintilla::text()
virtual void styleText(int start, int end) = 0;
//! \reimp
virtual void setEditor(QsciScintilla *editor);
//! \reimp This re-implementation returns 5 as the number of style bits
//! needed.
virtual int styleBitsNeeded() const;
private slots:
void handleStyleNeeded(int pos);
private:
QsciLexerCustom(const QsciLexerCustom &);
QsciLexerCustom &operator=(const QsciLexerCustom &);
};
#endif

View File

@@ -0,0 +1,242 @@
// This defines the interface to the QsciLexerD class.
//
// Copyright (c) 2023 Riverbank Computing Limited <info@riverbankcomputing.com>
//
// This file is part of QScintilla.
//
// This file may be used under the terms of the GNU General Public License
// version 3.0 as published by the Free Software Foundation and appearing in
// the file LICENSE included in the packaging of this file. Please review the
// following information to ensure the GNU General Public License version 3.0
// requirements will be met: http://www.gnu.org/copyleft/gpl.html.
//
// If you do not wish to use this file under the terms of the GPL version 3.0
// then you may purchase a commercial license. For more information contact
// info@riverbankcomputing.com.
//
// 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 QSCILEXERD_H
#define QSCILEXERD_H
#include <QObject>
#include <Qsci/qsciglobal.h>
#include <Qsci/qscilexer.h>
//! \brief The QsciLexerD class encapsulates the Scintilla D lexer.
class QSCINTILLA_EXPORT QsciLexerD : public QsciLexer
{
Q_OBJECT
public:
//! This enum defines the meanings of the different styles used by the D
//! lexer.
enum {
//! The default.
Default = 0,
//! A comment.
Comment = 1,
//! A comment line.
CommentLine = 2,
//! A JavaDoc and Doxygen comment.
CommentDoc = 3,
//! A nested comment.
CommentNested = 4,
//! A number.
Number = 5,
//! A keyword.
Keyword = 6,
//! A secondary keyword.
KeywordSecondary = 7,
//! A doc keyword
KeywordDoc = 8,
//! Typedefs and aliases
Typedefs = 9,
//! A string.
String = 10,
//! The end of a line where a string is not closed.
UnclosedString = 11,
//! A character
Character = 12,
//! An operator.
Operator = 13,
//! An identifier
Identifier = 14,
//! A JavaDoc and Doxygen line.
CommentLineDoc = 15,
//! A JavaDoc and Doxygen keyword.
CommentDocKeyword = 16,
//! A JavaDoc and Doxygen keyword error.
CommentDocKeywordError = 17,
//! A backquoted string.
BackquoteString = 18,
//! A raw, hexadecimal or delimited string.
RawString = 19,
//! A keyword defined in keyword set number 5. The class must be
//! sub-classed and re-implement keywords() to make use of this style.
KeywordSet5 = 20,
//! A keyword defined in keyword set number 6. The class must be
//! sub-classed and re-implement keywords() to make use of this style.
KeywordSet6 = 21,
//! A keyword defined in keyword set number 7. The class must be
//! sub-classed and re-implement keywords() to make use of this style.
KeywordSet7 = 22,
};
//! Construct a QsciLexerD with parent \a parent. \a parent is typically
//! the QsciScintilla instance.
QsciLexerD(QObject *parent = 0);
//! Destroys the QsciLexerD instance.
virtual ~QsciLexerD();
//! Returns the name of the language.
const char *language() const;
//! Returns the name of the lexer. Some lexers support a number of
//! languages.
const char *lexer() const;
//! \internal Returns the character sequences that can separate
//! auto-completion words.
QStringList autoCompletionWordSeparators() const;
//! \internal Returns a space separated list of words or characters in a
//! particular style that define the end of a block for auto-indentation.
//! The styles is returned via \a style.
const char *blockEnd(int *style = 0) const;
//! \internal Returns a space separated list of words or characters in a
//! particular style that define the start of a block for auto-indentation.
//! The styles is returned via \a style.
const char *blockStart(int *style = 0) const;
//! \internal Returns a space separated list of keywords in a particular
//! style that define the start of a block for auto-indentation. The
//! styles is returned via \a style.
const char *blockStartKeyword(int *style = 0) const;
//! \internal Returns the style used for braces for brace matching.
int braceStyle() const;
//! Returns the string of characters that comprise a word.
const char *wordCharacters() const;
//! Returns the foreground colour of the text for style number \a style.
//!
//! \sa defaultPaper()
QColor defaultColor(int style) const;
//! Returns the end-of-line fill for style number \a style.
bool defaultEolFill(int style) const;
//! Returns the font for style number \a style.
QFont defaultFont(int style) const;
//! Returns the background colour of the text for style number \a style.
//!
//! \sa defaultColor()
QColor defaultPaper(int style) const;
//! Returns the set of keywords for the keyword set \a set recognised by
//! the lexer as a space separated string.
const char *keywords(int set) const;
//! Returns the descriptive name for style number \a style. If the style
//! is invalid for this language then an empty QString is returned. This
//! is intended to be used in user preference dialogs.
QString description(int style) const;
//! Causes all properties to be refreshed by emitting the propertyChanged()
//! signal as required.
void refreshProperties();
//! Returns true if "} else {" lines can be folded.
//!
//! \sa setFoldAtElse()
bool foldAtElse() const;
//! Returns true if multi-line comment blocks can be folded.
//!
//! \sa setFoldComments()
bool foldComments() const;
//! Returns true if trailing blank lines are included in a fold block.
//!
//! \sa setFoldCompact()
bool foldCompact() const;
public slots:
//! If \a fold is true then "} else {" lines can be folded. The default is
//! false.
//!
//! \sa foldAtElse()
virtual void setFoldAtElse(bool fold);
//! If \a fold is true then multi-line comment blocks can be folded. The
//! default is false.
//!
//! \sa foldComments()
virtual void setFoldComments(bool fold);
//! If \a fold is true then trailing blank lines are included in a fold
//! block. The default is true.
//!
//! \sa foldCompact()
virtual void setFoldCompact(bool fold);
protected:
//! The lexer's properties are read from the settings \a qs. \a prefix
//! (which has a trailing '/') should be used as a prefix to the key of
//! each setting. true is returned if there is no error.
//!
//! \sa writeProperties()
bool readProperties(QSettings &qs,const QString &prefix);
//! The lexer's properties are written to the settings \a qs. \a prefix
//! (which has a trailing '/') should be used as a prefix to the key of
//! each setting. true is returned if there is no error.
//!
//! \sa readProperties()
bool writeProperties(QSettings &qs,const QString &prefix) const;
private:
void setAtElseProp();
void setCommentProp();
void setCompactProp();
bool fold_atelse;
bool fold_comments;
bool fold_compact;
QsciLexerD(const QsciLexerD &);
QsciLexerD &operator=(const QsciLexerD &);
};
#endif

View File

@@ -0,0 +1,107 @@
// This defines the interface to the QsciLexerDiff class.
//
// Copyright (c) 2023 Riverbank Computing Limited <info@riverbankcomputing.com>
//
// This file is part of QScintilla.
//
// This file may be used under the terms of the GNU General Public License
// version 3.0 as published by the Free Software Foundation and appearing in
// the file LICENSE included in the packaging of this file. Please review the
// following information to ensure the GNU General Public License version 3.0
// requirements will be met: http://www.gnu.org/copyleft/gpl.html.
//
// If you do not wish to use this file under the terms of the GPL version 3.0
// then you may purchase a commercial license. For more information contact
// info@riverbankcomputing.com.
//
// 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 QSCILEXERDIFF_H
#define QSCILEXERDIFF_H
#include <QObject>
#include <Qsci/qsciglobal.h>
#include <Qsci/qscilexer.h>
//! \brief The QsciLexerDiff class encapsulates the Scintilla Diff
//! lexer.
class QSCINTILLA_EXPORT QsciLexerDiff : public QsciLexer
{
Q_OBJECT
public:
//! This enum defines the meanings of the different styles used by the
//! Diff lexer.
enum {
//! The default.
Default = 0,
//! A comment.
Comment = 1,
//! A command.
Command = 2,
//! A header.
Header = 3,
//! A position.
Position = 4,
//! A line removed.
LineRemoved = 5,
//! A line added.
LineAdded = 6,
//! A line changed.
LineChanged = 7,
//! An adding patch added.
AddingPatchAdded = 8,
//! A removing patch added.
RemovingPatchAdded = 9,
//! An adding patch added.
AddingPatchRemoved = 10,
//! A removing patch added.
RemovingPatchRemoved = 11,
};
//! Construct a QsciLexerDiff with parent \a parent. \a parent is
//! typically the QsciScintilla instance.
QsciLexerDiff(QObject *parent = 0);
//! Destroys the QsciLexerDiff instance.
virtual ~QsciLexerDiff();
//! Returns the name of the language.
const char *language() const;
//! Returns the name of the lexer. Some lexers support a number of
//! languages.
const char *lexer() const;
//! Returns the string of characters that comprise a word.
const char *wordCharacters() const;
//! Returns the foreground colour of the text for style number \a style.
QColor defaultColor(int style) const;
//! Returns the descriptive name for style number \a style. If the
//! style is invalid for this language then an empty QString is returned.
//! This is intended to be used in user preference dialogs.
QString description(int style) const;
private:
QsciLexerDiff(const QsciLexerDiff &);
QsciLexerDiff &operator=(const QsciLexerDiff &);
};
#endif

View File

@@ -0,0 +1,96 @@
// This defines the interface to the QsciLexerEDIFACT class.
//
// Copyright (c) 2023 Riverbank Computing Limited <info@riverbankcomputing.com>
//
// This file is part of QScintilla.
//
// This file may be used under the terms of the GNU General Public License
// version 3.0 as published by the Free Software Foundation and appearing in
// the file LICENSE included in the packaging of this file. Please review the
// following information to ensure the GNU General Public License version 3.0
// requirements will be met: http://www.gnu.org/copyleft/gpl.html.
//
// If you do not wish to use this file under the terms of the GPL version 3.0
// then you may purchase a commercial license. For more information contact
// info@riverbankcomputing.com.
//
// 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 QSCILEXEREDIFACT_H
#define QSCILEXEREDIFACT_H
#include <QObject>
#include <Qsci/qsciglobal.h>
#include <Qsci/qscilexer.h>
//! \brief The QsciLexerEDIFACT class encapsulates the Scintilla EDIFACT lexer.
class QSCINTILLA_EXPORT QsciLexerEDIFACT : public QsciLexer
{
Q_OBJECT
public:
//! This enum defines the meanings of the different styles used by the
//! EDIFACT lexer.
enum {
//! The default.
Default = 0,
//! A segment start.
SegmentStart = 1,
//! A segment end.
SegmentEnd = 2,
//! An element separator.
ElementSeparator = 3,
//! A composite separator.
CompositeSeparator = 4,
//! A release separator.
ReleaseSeparator = 5,
//! A UNA segment header.
UNASegmentHeader = 6,
//! A UNH segment header.
UNHSegmentHeader = 7,
//! A bad segment.
BadSegment = 8,
};
//! Construct a QsciLexerEDIFACT with parent \a parent. \a parent is
//! typically the QsciScintilla instance.
QsciLexerEDIFACT(QObject *parent = 0);
//! Destroys the QsciLexerEDIFACT instance.
virtual ~QsciLexerEDIFACT();
//! Returns the name of the language.
const char *language() const;
//! Returns the name of the lexer. Some lexers support a number of
//! languages.
const char *lexer() const;
//! Returns the foreground colour of the text for style number \a style.
//!
//! \sa defaultPaper()
QColor defaultColor(int style) const;
//! Returns the descriptive name for style number \a style. If the
//! style is invalid for this language then an empty QString is returned.
//! This is intended to be used in user preference dialogs.
QString description(int style) const;
private:
QsciLexerEDIFACT(const QsciLexerEDIFACT &);
QsciLexerEDIFACT &operator=(const QsciLexerEDIFACT &);
};
#endif

View File

@@ -0,0 +1,59 @@
// This defines the interface to the QsciLexerFortran class.
//
// Copyright (c) 2023 Riverbank Computing Limited <info@riverbankcomputing.com>
//
// This file is part of QScintilla.
//
// This file may be used under the terms of the GNU General Public License
// version 3.0 as published by the Free Software Foundation and appearing in
// the file LICENSE included in the packaging of this file. Please review the
// following information to ensure the GNU General Public License version 3.0
// requirements will be met: http://www.gnu.org/copyleft/gpl.html.
//
// If you do not wish to use this file under the terms of the GPL version 3.0
// then you may purchase a commercial license. For more information contact
// info@riverbankcomputing.com.
//
// 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 QSCILEXERFORTRAN_H
#define QSCILEXERFORTRAN_H
#include <QObject>
#include <Qsci/qsciglobal.h>
#include <Qsci/qscilexerfortran77.h>
//! \brief The QsciLexerFortran class encapsulates the Scintilla Fortran lexer.
class QSCINTILLA_EXPORT QsciLexerFortran : public QsciLexerFortran77
{
Q_OBJECT
public:
//! Construct a QsciLexerFortran with parent \a parent. \a parent is
//! typically the QsciScintilla instance.
QsciLexerFortran(QObject *parent = 0);
//! Destroys the QsciLexerFortran instance.
virtual ~QsciLexerFortran();
//! Returns the name of the language.
const char *language() const;
//! Returns the name of the lexer. Some lexers support a number of
//! languages.
const char *lexer() const;
//! Returns the set of keywords for the keyword set \a set recognised
//! by the lexer as a space separated string.
const char *keywords(int set) const;
private:
QsciLexerFortran(const QsciLexerFortran &);
QsciLexerFortran &operator=(const QsciLexerFortran &);
};
#endif

View File

@@ -0,0 +1,168 @@
// This defines the interface to the QsciLexerFortran77 class.
//
// Copyright (c) 2023 Riverbank Computing Limited <info@riverbankcomputing.com>
//
// This file is part of QScintilla.
//
// This file may be used under the terms of the GNU General Public License
// version 3.0 as published by the Free Software Foundation and appearing in
// the file LICENSE included in the packaging of this file. Please review the
// following information to ensure the GNU General Public License version 3.0
// requirements will be met: http://www.gnu.org/copyleft/gpl.html.
//
// If you do not wish to use this file under the terms of the GPL version 3.0
// then you may purchase a commercial license. For more information contact
// info@riverbankcomputing.com.
//
// 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 QSCILEXERFORTRAN77_H
#define QSCILEXERFORTRAN77_H
#include <QObject>
#include <Qsci/qsciglobal.h>
#include <Qsci/qscilexer.h>
//! \brief The QsciLexerFortran77 class encapsulates the Scintilla Fortran77
//! lexer.
class QSCINTILLA_EXPORT QsciLexerFortran77 : public QsciLexer
{
Q_OBJECT
public:
//! This enum defines the meanings of the different styles used by the
//! Fortran77 lexer.
enum {
//! The default.
Default = 0,
//! A comment.
Comment = 1,
//! A number.
Number = 2,
//! A single-quoted string.
SingleQuotedString = 3,
//! A double-quoted string.
DoubleQuotedString = 4,
//! The end of a line where a string is not closed.
UnclosedString = 5,
//! An operator.
Operator = 6,
//! An identifier
Identifier = 7,
//! A keyword.
Keyword = 8,
//! An intrinsic function.
IntrinsicFunction = 9,
//! An extended, non-standard or user defined function.
ExtendedFunction = 10,
//! A pre-processor block.
PreProcessor = 11,
//! An operator in .NAME. format.
DottedOperator = 12,
//! A label.
Label = 13,
//! A continuation.
Continuation = 14
};
//! Construct a QsciLexerFortran77 with parent \a parent. \a parent is
//! typically the QsciScintilla instance.
QsciLexerFortran77(QObject *parent = 0);
//! Destroys the QsciLexerFortran77 instance.
virtual ~QsciLexerFortran77();
//! Returns the name of the language.
const char *language() const;
//! Returns the name of the lexer. Some lexers support a number of
//! languages.
const char *lexer() const;
//! \internal Returns the style used for braces for brace matching.
int braceStyle() const;
//! Returns the foreground colour of the text for style number \a style.
//!
//! \sa defaultPaper()
QColor defaultColor(int style) const;
//! Returns the end-of-line fill for style number \a style.
bool defaultEolFill(int style) const;
//! Returns the font for style number \a style.
QFont defaultFont(int style) const;
//! Returns the background colour of the text for style number \a style.
//!
//! \sa defaultColor()
QColor defaultPaper(int style) const;
//! Returns the set of keywords for the keyword set \a set recognised
//! by the lexer as a space separated string.
const char *keywords(int set) const;
//! Returns the descriptive name for style number \a style. If the
//! style is invalid for this language then an empty QString is returned.
//! This is intended to be used in user preference dialogs.
QString description(int style) const;
//! Causes all properties to be refreshed by emitting the
//! propertyChanged() signal as required.
void refreshProperties();
//! Returns true if trailing blank lines are included in a fold block.
//!
//! \sa setFoldCompact()
bool foldCompact() const;
public slots:
//! If \a fold is true then trailing blank lines are included in a fold
//! block. The default is true.
//!
//! \sa foldCompact()
virtual void setFoldCompact(bool fold);
protected:
//! The lexer's properties are read from the settings \a qs. \a prefix
//! (which has a trailing '/') should be used as a prefix to the key of
//! each setting. true is returned if there is no error.
//!
//! \sa writeProperties()
bool readProperties(QSettings &qs,const QString &prefix);
//! The lexer's properties are written to the settings \a qs.
//! \a prefix (which has a trailing '/') should be used as a prefix to
//! the key of each setting. true is returned if there is no error.
//!
//! \sa readProperties()
bool writeProperties(QSettings &qs,const QString &prefix) const;
private:
void setCompactProp();
bool fold_compact;
QsciLexerFortran77(const QsciLexerFortran77 &);
QsciLexerFortran77 &operator=(const QsciLexerFortran77 &);
};
#endif

View File

@@ -0,0 +1,120 @@
// This defines the interface to the abstract QsciLexerHex class.
//
// Copyright (c) 2023 Riverbank Computing Limited <info@riverbankcomputing.com>
//
// This file is part of QScintilla.
//
// This file may be used under the terms of the GNU General Public License
// version 3.0 as published by the Free Software Foundation and appearing in
// the file LICENSE included in the packaging of this file. Please review the
// following information to ensure the GNU General Public License version 3.0
// requirements will be met: http://www.gnu.org/copyleft/gpl.html.
//
// If you do not wish to use this file under the terms of the GPL version 3.0
// then you may purchase a commercial license. For more information contact
// info@riverbankcomputing.com.
//
// 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 QSCILEXERHEX_H
#define QSCILEXERHEX_H
#include <QObject>
#include <Qsci/qsciglobal.h>
#include <Qsci/qscilexer.h>
//! \brief The abstract QsciLexerHex class encapsulates the Scintilla Hex
//! lexer.
class QSCINTILLA_EXPORT QsciLexerHex : public QsciLexer
{
Q_OBJECT
public:
//! This enum defines the meanings of the different styles used by the
//! Hex lexer.
enum {
//! The default.
Default = 0,
//! A record start.
RecordStart = 1,
//! A record type.
RecordType = 2,
//! An unknown record type.
UnknownRecordType = 3,
//! A correct byte count field.
ByteCount = 4,
//! An incorrect byte count field.
IncorrectByteCount = 5,
//! No address (S-Record and Intel Hex only).
NoAddress = 6,
//! A data address.
DataAddress = 7,
//! A record count (S-Record only).
RecordCount = 8,
//! A start address.
StartAddress = 9,
//! An extended address (Intel Hex only).
ExtendedAddress = 11,
//! Odd data.
OddData = 12,
//! Even data.
EvenData = 13,
//! Unknown data (S-Record and Intel Hex only).
UnknownData = 14,
//! A correct checksum.
Checksum = 16,
//! An incorrect checksum.
IncorrectChecksum = 17,
//! Garbage data after the record.
TrailingGarbage = 18,
};
//! Construct a QsciLexerHex with parent \a parent. \a parent is
//! typically the QsciScintilla instance.
QsciLexerHex(QObject *parent = 0);
//! Destroys the QsciLexerHex instance.
virtual ~QsciLexerHex();
//! Returns the foreground colour of the text for style number \a style.
QColor defaultColor(int style) const;
//! Returns the font for style number \a style.
QFont defaultFont(int style) const;
//! Returns the background colour of the text for style number \a style.
//!
//! \sa defaultColor()
QColor defaultPaper(int style) const;
//! Returns the descriptive name for style number \a style. If the
//! style is invalid for this language then an empty QString is returned.
//! This is intended to be used in user preference dialogs.
QString description(int style) const;
private:
QsciLexerHex(const QsciLexerHex &);
QsciLexerHex &operator=(const QsciLexerHex &);
};
#endif

View File

@@ -0,0 +1,532 @@
// This defines the interface to the QsciLexerHTML class.
//
// Copyright (c) 2023 Riverbank Computing Limited <info@riverbankcomputing.com>
//
// This file is part of QScintilla.
//
// This file may be used under the terms of the GNU General Public License
// version 3.0 as published by the Free Software Foundation and appearing in
// the file LICENSE included in the packaging of this file. Please review the
// following information to ensure the GNU General Public License version 3.0
// requirements will be met: http://www.gnu.org/copyleft/gpl.html.
//
// If you do not wish to use this file under the terms of the GPL version 3.0
// then you may purchase a commercial license. For more information contact
// info@riverbankcomputing.com.
//
// 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 QSCILEXERHTML_H
#define QSCILEXERHTML_H
#include <QObject>
#include <Qsci/qsciglobal.h>
#include <Qsci/qscilexer.h>
//! \brief The QsciLexerHTML class encapsulates the Scintilla HTML lexer.
class QSCINTILLA_EXPORT QsciLexerHTML : public QsciLexer
{
Q_OBJECT
public:
//! This enum defines the meanings of the different styles used by the
//! HTML lexer.
enum {
//! The default.
Default = 0,
//! A tag.
Tag = 1,
//! An unknown tag.
UnknownTag = 2,
//! An attribute.
Attribute = 3,
//! An unknown attribute.
UnknownAttribute = 4,
//! An HTML number.
HTMLNumber = 5,
//! An HTML double-quoted string.
HTMLDoubleQuotedString = 6,
//! An HTML single-quoted string.
HTMLSingleQuotedString = 7,
//! Other text within a tag.
OtherInTag = 8,
//! An HTML comment.
HTMLComment = 9,
//! An entity.
Entity = 10,
//! The end of an XML style tag.
XMLTagEnd = 11,
//! The start of an XML fragment.
XMLStart = 12,
//! The end of an XML fragment.
XMLEnd = 13,
//! A script tag.
Script = 14,
//! The start of an ASP fragment with @.
ASPAtStart = 15,
//! The start of an ASP fragment.
ASPStart = 16,
//! CDATA.
CDATA = 17,
//! The start of a PHP fragment.
PHPStart = 18,
//! An unquoted HTML value.
HTMLValue = 19,
//! An ASP X-Code comment.
ASPXCComment = 20,
//! The default for SGML.
SGMLDefault = 21,
//! An SGML command.
SGMLCommand = 22,
//! The first parameter of an SGML command.
SGMLParameter = 23,
//! An SGML double-quoted string.
SGMLDoubleQuotedString = 24,
//! An SGML single-quoted string.
SGMLSingleQuotedString = 25,
//! An SGML error.
SGMLError = 26,
//! An SGML special entity.
SGMLSpecial = 27,
//! An SGML entity.
SGMLEntity = 28,
//! An SGML comment.
SGMLComment = 29,
//! A comment with the first parameter of an SGML command.
SGMLParameterComment = 30,
//! The default for an SGML block.
SGMLBlockDefault = 31,
//! The start of a JavaScript fragment.
JavaScriptStart = 40,
//! The default for JavaScript.
JavaScriptDefault = 41,
//! A JavaScript comment.
JavaScriptComment = 42,
//! A JavaScript line comment.
JavaScriptCommentLine = 43,
//! A JavaDoc style JavaScript comment.
JavaScriptCommentDoc = 44,
//! A JavaScript number.
JavaScriptNumber = 45,
//! A JavaScript word.
JavaScriptWord = 46,
//! A JavaScript keyword.
JavaScriptKeyword = 47,
//! A JavaScript double-quoted string.
JavaScriptDoubleQuotedString = 48,
//! A JavaScript single-quoted string.
JavaScriptSingleQuotedString = 49,
//! A JavaScript symbol.
JavaScriptSymbol = 50,
//! The end of a JavaScript line where a string is not closed.
JavaScriptUnclosedString = 51,
//! A JavaScript regular expression.
JavaScriptRegex = 52,
//! The start of an ASP JavaScript fragment.
ASPJavaScriptStart = 55,
//! The default for ASP JavaScript.
ASPJavaScriptDefault = 56,
//! An ASP JavaScript comment.
ASPJavaScriptComment = 57,
//! An ASP JavaScript line comment.
ASPJavaScriptCommentLine = 58,
//! An ASP JavaDoc style JavaScript comment.
ASPJavaScriptCommentDoc = 59,
//! An ASP JavaScript number.
ASPJavaScriptNumber = 60,
//! An ASP JavaScript word.
ASPJavaScriptWord = 61,
//! An ASP JavaScript keyword.
ASPJavaScriptKeyword = 62,
//! An ASP JavaScript double-quoted string.
ASPJavaScriptDoubleQuotedString = 63,
//! An ASP JavaScript single-quoted string.
ASPJavaScriptSingleQuotedString = 64,
//! An ASP JavaScript symbol.
ASPJavaScriptSymbol = 65,
//! The end of an ASP JavaScript line where a string is not
//! closed.
ASPJavaScriptUnclosedString = 66,
//! An ASP JavaScript regular expression.
ASPJavaScriptRegex = 67,
//! The start of a VBScript fragment.
VBScriptStart = 70,
//! The default for VBScript.
VBScriptDefault = 71,
//! A VBScript comment.
VBScriptComment = 72,
//! A VBScript number.
VBScriptNumber = 73,
//! A VBScript keyword.
VBScriptKeyword = 74,
//! A VBScript string.
VBScriptString = 75,
//! A VBScript identifier.
VBScriptIdentifier = 76,
//! The end of a VBScript line where a string is not closed.
VBScriptUnclosedString = 77,
//! The start of an ASP VBScript fragment.
ASPVBScriptStart = 80,
//! The default for ASP VBScript.
ASPVBScriptDefault = 81,
//! An ASP VBScript comment.
ASPVBScriptComment = 82,
//! An ASP VBScript number.
ASPVBScriptNumber = 83,
//! An ASP VBScript keyword.
ASPVBScriptKeyword = 84,
//! An ASP VBScript string.
ASPVBScriptString = 85,
//! An ASP VBScript identifier.
ASPVBScriptIdentifier = 86,
//! The end of an ASP VBScript line where a string is not
//! closed.
ASPVBScriptUnclosedString = 87,
//! The start of a Python fragment.
PythonStart = 90,
//! The default for Python.
PythonDefault = 91,
//! A Python comment.
PythonComment = 92,
//! A Python number.
PythonNumber = 93,
//! A Python double-quoted string.
PythonDoubleQuotedString = 94,
//! A Python single-quoted string.
PythonSingleQuotedString = 95,
//! A Python keyword.
PythonKeyword = 96,
//! A Python triple single-quoted string.
PythonTripleSingleQuotedString = 97,
//! A Python triple double-quoted string.
PythonTripleDoubleQuotedString = 98,
//! The name of a Python class.
PythonClassName = 99,
//! The name of a Python function or method.
PythonFunctionMethodName = 100,
//! A Python operator.
PythonOperator = 101,
//! A Python identifier.
PythonIdentifier = 102,
//! The start of an ASP Python fragment.
ASPPythonStart = 105,
//! The default for ASP Python.
ASPPythonDefault = 106,
//! An ASP Python comment.
ASPPythonComment = 107,
//! An ASP Python number.
ASPPythonNumber = 108,
//! An ASP Python double-quoted string.
ASPPythonDoubleQuotedString = 109,
//! An ASP Python single-quoted string.
ASPPythonSingleQuotedString = 110,
//! An ASP Python keyword.
ASPPythonKeyword = 111,
//! An ASP Python triple single-quoted string.
ASPPythonTripleSingleQuotedString = 112,
//! An ASP Python triple double-quoted string.
ASPPythonTripleDoubleQuotedString = 113,
//! The name of an ASP Python class.
ASPPythonClassName = 114,
//! The name of an ASP Python function or method.
ASPPythonFunctionMethodName = 115,
//! An ASP Python operator.
ASPPythonOperator = 116,
//! An ASP Python identifier
ASPPythonIdentifier = 117,
//! The default for PHP.
PHPDefault = 118,
//! A PHP double-quoted string.
PHPDoubleQuotedString = 119,
//! A PHP single-quoted string.
PHPSingleQuotedString = 120,
//! A PHP keyword.
PHPKeyword = 121,
//! A PHP number.
PHPNumber = 122,
//! A PHP variable.
PHPVariable = 123,
//! A PHP comment.
PHPComment = 124,
//! A PHP line comment.
PHPCommentLine = 125,
//! A PHP double-quoted variable.
PHPDoubleQuotedVariable = 126,
//! A PHP operator.
PHPOperator = 127
};
//! Construct a QsciLexerHTML with parent \a parent. \a parent is
//! typically the QsciScintilla instance.
QsciLexerHTML(QObject *parent = 0);
//! Destroys the QsciLexerHTML instance.
virtual ~QsciLexerHTML();
//! Returns the name of the language.
const char *language() const;
//! Returns the name of the lexer. Some lexers support a number of
//! languages.
const char *lexer() const;
//! \internal Returns the auto-completion fillup characters.
const char *autoCompletionFillups() const;
//! Returns the string of characters that comprise a word.
const char *wordCharacters() const;
//! Returns the foreground colour of the text for style number \a style.
//!
//! \sa defaultPaper()
QColor defaultColor(int style) const;
//! Returns the end-of-line fill for style number \a style.
bool defaultEolFill(int style) const;
//! Returns the font for style number \a style.
QFont defaultFont(int style) const;
//! Returns the background colour of the text for style number \a style.
//!
//! \sa defaultColor()
QColor defaultPaper(int style) const;
//! Returns the set of keywords for the keyword set \a set recognised
//! by the lexer as a space separated string.
const char *keywords(int set) const;
//! Returns the descriptive name for style number \a style. If the
//! style is invalid for this language then an empty QString is returned.
//! This is intended to be used in user preference dialogs.
QString description(int style) const;
//! Causes all properties to be refreshed by emitting the
//! propertyChanged() signal as required.
void refreshProperties();
//! Returns true if tags are case sensitive.
//!
//! \sa setCaseSensitiveTags()
bool caseSensitiveTags() const {return case_sens_tags;}
//! If \a enabled is true then Django templates are enabled. The default
//! is false.
//!
//! \sa djangoTemplates()
void setDjangoTemplates(bool enabled);
//! Returns true if support for Django templates is enabled.
//!
//! \sa setDjangoTemplates()
bool djangoTemplates() const {return django_templates;}
//! Returns true if trailing blank lines are included in a fold block.
//!
//! \sa setFoldCompact()
bool foldCompact() const {return fold_compact;}
//! Returns true if preprocessor blocks can be folded.
//!
//! \sa setFoldPreprocessor()
bool foldPreprocessor() const {return fold_preproc;}
//! If \a fold is true then script comments can be folded. The default is
//! false.
//!
//! \sa foldScriptComments()
void setFoldScriptComments(bool fold);
//! Returns true if script comments can be folded.
//!
//! \sa setFoldScriptComments()
bool foldScriptComments() const {return fold_script_comments;}
//! If \a fold is true then script heredocs can be folded. The default is
//! false.
//!
//! \sa foldScriptHeredocs()
void setFoldScriptHeredocs(bool fold);
//! Returns true if script heredocs can be folded.
//!
//! \sa setFoldScriptHeredocs()
bool foldScriptHeredocs() const {return fold_script_heredocs;}
//! If \a enabled is true then Mako templates are enabled. The default is
//! false.
//!
//! \sa makoTemplates()
void setMakoTemplates(bool enabled);
//! Returns true if support for Mako templates is enabled.
//!
//! \sa setMakoTemplates()
bool makoTemplates() const {return mako_templates;}
public slots:
//! If \a fold is true then trailing blank lines are included in a fold
//! block. The default is true.
//!
//! \sa foldCompact()
virtual void setFoldCompact(bool fold);
//! If \a fold is true then preprocessor blocks can be folded. The
//! default is false.
//!
//! \sa foldPreprocessor()
virtual void setFoldPreprocessor(bool fold);
//! If \a sens is true then tags are case sensitive. The default is false.
//!
//! \sa caseSensitiveTags()
virtual void setCaseSensitiveTags(bool sens);
protected:
//! The lexer's properties are read from the settings \a qs. \a prefix
//! (which has a trailing '/') should be used as a prefix to the key of
//! each setting. true is returned if there is no error.
//!
bool readProperties(QSettings &qs,const QString &prefix);
//! The lexer's properties are written to the settings \a qs.
//! \a prefix (which has a trailing '/') should be used as a prefix to
//! the key of each setting. true is returned if there is no error.
//!
bool writeProperties(QSettings &qs,const QString &prefix) const;
private:
void setCompactProp();
void setPreprocProp();
void setCaseSensTagsProp();
void setScriptCommentsProp();
void setScriptHeredocsProp();
void setDjangoProp();
void setMakoProp();
bool fold_compact;
bool fold_preproc;
bool case_sens_tags;
bool fold_script_comments;
bool fold_script_heredocs;
bool django_templates;
bool mako_templates;
QsciLexerHTML(const QsciLexerHTML &);
QsciLexerHTML &operator=(const QsciLexerHTML &);
};
#endif

View File

@@ -0,0 +1,64 @@
// This defines the interface to the QsciLexerIDL class.
//
// Copyright (c) 2023 Riverbank Computing Limited <info@riverbankcomputing.com>
//
// This file is part of QScintilla.
//
// This file may be used under the terms of the GNU General Public License
// version 3.0 as published by the Free Software Foundation and appearing in
// the file LICENSE included in the packaging of this file. Please review the
// following information to ensure the GNU General Public License version 3.0
// requirements will be met: http://www.gnu.org/copyleft/gpl.html.
//
// If you do not wish to use this file under the terms of the GPL version 3.0
// then you may purchase a commercial license. For more information contact
// info@riverbankcomputing.com.
//
// 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 QSCILEXERIDL_H
#define QSCILEXERIDL_H
#include <QObject>
#include <Qsci/qsciglobal.h>
#include <Qsci/qscilexercpp.h>
//! \brief The QsciLexerIDL class encapsulates the Scintilla IDL
//! lexer.
class QSCINTILLA_EXPORT QsciLexerIDL : public QsciLexerCPP
{
Q_OBJECT
public:
//! Construct a QsciLexerIDL with parent \a parent. \a parent is typically
//! the QsciScintilla instance.
QsciLexerIDL(QObject *parent = 0);
//! Destroys the QsciLexerIDL instance.
virtual ~QsciLexerIDL();
//! Returns the name of the language.
const char *language() const;
//! Returns the foreground colour of the text for style number \a style.
QColor defaultColor(int style) const;
//! Returns the set of keywords for the keyword set \a set recognised
//! by the lexer as a space separated string.
const char *keywords(int set) const;
//! Returns the descriptive name for style number \a style. If the
//! style is invalid for this language then an empty QString is returned.
//! This is intended to be used in user preference dialogs.
QString description(int style) const;
private:
QsciLexerIDL(const QsciLexerIDL &);
QsciLexerIDL &operator=(const QsciLexerIDL &);
};
#endif

View File

@@ -0,0 +1,60 @@
// This defines the interface to the QsciLexerIntelHex class.
//
// Copyright (c) 2023 Riverbank Computing Limited <info@riverbankcomputing.com>
//
// This file is part of QScintilla.
//
// This file may be used under the terms of the GNU General Public License
// version 3.0 as published by the Free Software Foundation and appearing in
// the file LICENSE included in the packaging of this file. Please review the
// following information to ensure the GNU General Public License version 3.0
// requirements will be met: http://www.gnu.org/copyleft/gpl.html.
//
// If you do not wish to use this file under the terms of the GPL version 3.0
// then you may purchase a commercial license. For more information contact
// info@riverbankcomputing.com.
//
// 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 QSCILEXERINTELHEX_H
#define QSCILEXERINTELHEX_H
#include <QObject>
#include <Qsci/qsciglobal.h>
#include <Qsci/qscilexerhex.h>
//! \brief The QsciLexerIntelHex class encapsulates the Scintilla Intel Hex
//! lexer.
class QSCINTILLA_EXPORT QsciLexerIntelHex : public QsciLexerHex
{
Q_OBJECT
public:
//! Construct a QsciLexerIntelHex with parent \a parent. \a parent is
//! typically the QsciScintilla instance.
QsciLexerIntelHex(QObject *parent = 0);
//! Destroys the QsciLexerIntelHex instance.
virtual ~QsciLexerIntelHex();
//! Returns the name of the language.
const char *language() const;
//! Returns the name of the lexer.
const char *lexer() const;
//! Returns the descriptive name for style number \a style. If the
//! style is invalid for this language then an empty QString is returned.
//! This is intended to be used in user preference dialogs.
QString description(int style) const;
private:
QsciLexerIntelHex(const QsciLexerIntelHex &);
QsciLexerIntelHex &operator=(const QsciLexerIntelHex &);
};
#endif

View File

@@ -0,0 +1,55 @@
// This defines the interface to the QsciLexerJava class.
//
// Copyright (c) 2023 Riverbank Computing Limited <info@riverbankcomputing.com>
//
// This file is part of QScintilla.
//
// This file may be used under the terms of the GNU General Public License
// version 3.0 as published by the Free Software Foundation and appearing in
// the file LICENSE included in the packaging of this file. Please review the
// following information to ensure the GNU General Public License version 3.0
// requirements will be met: http://www.gnu.org/copyleft/gpl.html.
//
// If you do not wish to use this file under the terms of the GPL version 3.0
// then you may purchase a commercial license. For more information contact
// info@riverbankcomputing.com.
//
// 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 QSCILEXERJAVA_H
#define QSCILEXERJAVA_H
#include <QObject>
#include <Qsci/qsciglobal.h>
#include <Qsci/qscilexercpp.h>
//! \brief The QsciLexerJava class encapsulates the Scintilla Java lexer.
class QSCINTILLA_EXPORT QsciLexerJava : public QsciLexerCPP
{
Q_OBJECT
public:
//! Construct a QsciLexerJava with parent \a parent. \a parent is
//! typically the QsciScintilla instance.
QsciLexerJava(QObject *parent = 0);
//! Destroys the QsciLexerJava instance.
virtual ~QsciLexerJava();
//! Returns the name of the language.
const char *language() const;
//! Returns the set of keywords for the keyword set \a set recognised
//! by the lexer as a space separated string.
const char *keywords(int set) const;
private:
QsciLexerJava(const QsciLexerJava &);
QsciLexerJava &operator=(const QsciLexerJava &);
};
#endif

View File

@@ -0,0 +1,81 @@
// This defines the interface to the QsciLexerJavaScript class.
//
// Copyright (c) 2023 Riverbank Computing Limited <info@riverbankcomputing.com>
//
// This file is part of QScintilla.
//
// This file may be used under the terms of the GNU General Public License
// version 3.0 as published by the Free Software Foundation and appearing in
// the file LICENSE included in the packaging of this file. Please review the
// following information to ensure the GNU General Public License version 3.0
// requirements will be met: http://www.gnu.org/copyleft/gpl.html.
//
// If you do not wish to use this file under the terms of the GPL version 3.0
// then you may purchase a commercial license. For more information contact
// info@riverbankcomputing.com.
//
// 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 QSCILEXERJSCRIPT_H
#define QSCILEXERJSCRIPT_H
#include <QObject>
#include <Qsci/qsciglobal.h>
#include <Qsci/qscilexercpp.h>
//! \brief The QsciLexerJavaScript class encapsulates the Scintilla JavaScript
//! lexer.
class QSCINTILLA_EXPORT QsciLexerJavaScript : public QsciLexerCPP
{
Q_OBJECT
public:
//! Construct a QsciLexerJavaScript with parent \a parent. \a parent is
//! typically the QsciScintilla instance.
QsciLexerJavaScript(QObject *parent = 0);
//! Destroys the QsciLexerJavaScript instance.
virtual ~QsciLexerJavaScript();
//! Returns the name of the language.
const char *language() const;
//! Returns the foreground colour of the text for style number \a style.
//!
//! \sa defaultPaper()
QColor defaultColor(int style) const;
//! Returns the end-of-line fill for style number \a style.
bool defaultEolFill(int style) const;
//! Returns the font for style number \a style.
QFont defaultFont(int style) const;
//! Returns the background colour of the text for style number \a style.
//!
//! \sa defaultColor()
QColor defaultPaper(int style) const;
//! Returns the set of keywords for the keyword set \a set recognised
//! by the lexer as a space separated string.
const char *keywords(int set) const;
//! Returns the descriptive name for style number \a style. If the
//! style is invalid for this language then an empty QString is returned.
//! This is intended to be used in user preference dialogs.
QString description(int style) const;
private:
friend class QsciLexerHTML;
static const char *keywordClass;
QsciLexerJavaScript(const QsciLexerJavaScript &);
QsciLexerJavaScript &operator=(const QsciLexerJavaScript &);
};
#endif

View File

@@ -0,0 +1,184 @@
// This defines the interface to the QsciLexerJSON class.
//
// Copyright (c) 2023 Riverbank Computing Limited <info@riverbankcomputing.com>
//
// This file is part of QScintilla.
//
// This file may be used under the terms of the GNU General Public License
// version 3.0 as published by the Free Software Foundation and appearing in
// the file LICENSE included in the packaging of this file. Please review the
// following information to ensure the GNU General Public License version 3.0
// requirements will be met: http://www.gnu.org/copyleft/gpl.html.
//
// If you do not wish to use this file under the terms of the GPL version 3.0
// then you may purchase a commercial license. For more information contact
// info@riverbankcomputing.com.
//
// 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 QSCILEXERJSON_H
#define QSCILEXERJSON_H
#include <QObject>
#include <Qsci/qsciglobal.h>
#include <Qsci/qscilexer.h>
//! \brief The QsciLexerJSON class encapsulates the Scintilla JSON lexer.
class QSCINTILLA_EXPORT QsciLexerJSON : public QsciLexer
{
Q_OBJECT
public:
//! This enum defines the meanings of the different styles used by the
//! JSON lexer.
enum {
//! The default.
Default = 0,
//! A number.
Number = 1,
//! A string.
String = 2,
//! An unclosed string.
UnclosedString = 3,
//! A property.
Property = 4,
//! An escape sequence.
EscapeSequence = 5,
//! A line comment.
CommentLine = 6,
//! A block comment.
CommentBlock = 7,
//! An operator.
Operator = 8,
//! An Internationalised Resource Identifier (IRI).
IRI = 9,
//! A JSON-LD compact IRI.
IRICompact = 10,
//! A JSON keyword.
Keyword = 11,
//! A JSON-LD keyword.
KeywordLD = 12,
//! A parsing error.
Error = 13,
};
//! Construct a QsciLexerJSON with parent \a parent. \a parent is
//! typically the QsciScintilla instance.
QsciLexerJSON(QObject *parent = 0);
//! Destroys the QsciLexerJSON instance.
virtual ~QsciLexerJSON();
//! Returns the name of the language.
const char *language() const;
//! Returns the name of the lexer. Some lexers support a number of
//! languages.
const char *lexer() const;
//! Returns the foreground colour of the text for style number \a style.
//!
//! \sa defaultPaper()
QColor defaultColor(int style) const;
//! Returns the end-of-line fill for style number \a style.
bool defaultEolFill(int style) const;
//! Returns the font for style number \a style.
QFont defaultFont(int style) const;
//! Returns the background colour of the text for style number \a style.
//!
//! \sa defaultColor()
QColor defaultPaper(int style) const;
//! Returns the set of keywords for the keyword set \a set recognised
//! by the lexer as a space separated string.
const char *keywords(int set) const;
//! Returns the descriptive name for style number \a style. If the
//! style is invalid for this language then an empty QString is returned.
//! This is intended to be used in user preference dialogs.
QString description(int style) const;
//! Causes all properties to be refreshed by emitting the
//! propertyChanged() signal as required.
void refreshProperties();
//! If \a highlight is true then line and block comments will be
//! highlighted. The default is true.
//!
//! \sa hightlightComments()
void setHighlightComments(bool highlight);
//! Returns true if line and block comments are highlighted
//!
//! \sa setHightlightComments()
bool highlightComments() const {return allow_comments;}
//! If \a highlight is true then escape sequences in strings are
//! highlighted. The default is true.
//!
//! \sa highlightEscapeSequences()
void setHighlightEscapeSequences(bool highlight);
//! Returns true if escape sequences in strings are highlighted.
//!
//! \sa setHighlightEscapeSequences()
bool highlightEscapeSequences() const {return escape_sequence;}
//! If \a fold is true then trailing blank lines are included in a fold
//! block. The default is true.
//!
//! \sa foldCompact()
void setFoldCompact(bool fold);
//! Returns true if trailing blank lines are included in a fold block.
//!
//! \sa setFoldCompact()
bool foldCompact() const {return fold_compact;}
protected:
//! The lexer's properties are read from the settings \a qs. \a prefix
//! (which has a trailing '/') should be used as a prefix to the key of
//! each setting. true is returned if there is no error.
//!
bool readProperties(QSettings &qs,const QString &prefix);
//! The lexer's properties are written to the settings \a qs.
//! \a prefix (which has a trailing '/') should be used as a prefix to
//! the key of each setting. true is returned if there is no error.
//!
bool writeProperties(QSettings &qs,const QString &prefix) const;
private:
void setAllowCommentsProp();
void setEscapeSequenceProp();
void setCompactProp();
bool allow_comments;
bool escape_sequence;
bool fold_compact;
QsciLexerJSON(const QsciLexerJSON &);
QsciLexerJSON &operator=(const QsciLexerJSON &);
};
#endif

View File

@@ -0,0 +1,194 @@
// This defines the interface to the QsciLexerLua class.
//
// Copyright (c) 2023 Riverbank Computing Limited <info@riverbankcomputing.com>
//
// This file is part of QScintilla.
//
// This file may be used under the terms of the GNU General Public License
// version 3.0 as published by the Free Software Foundation and appearing in
// the file LICENSE included in the packaging of this file. Please review the
// following information to ensure the GNU General Public License version 3.0
// requirements will be met: http://www.gnu.org/copyleft/gpl.html.
//
// If you do not wish to use this file under the terms of the GPL version 3.0
// then you may purchase a commercial license. For more information contact
// info@riverbankcomputing.com.
//
// 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 QSCILEXERLUA_H
#define QSCILEXERLUA_H
#include <QObject>
#include <Qsci/qsciglobal.h>
#include <Qsci/qscilexer.h>
//! \brief The QsciLexerLua class encapsulates the Scintilla Lua
//! lexer.
class QSCINTILLA_EXPORT QsciLexerLua : public QsciLexer
{
Q_OBJECT
public:
//! This enum defines the meanings of the different styles used by the
//! Lua lexer.
enum {
//! The default.
Default = 0,
//! A block comment.
Comment = 1,
//! A line comment.
LineComment = 2,
//! A number.
Number = 4,
//! A keyword.
Keyword = 5,
//! A string.
String = 6,
//! A character.
Character = 7,
//! A literal string.
LiteralString = 8,
//! Preprocessor
Preprocessor = 9,
//! An operator.
Operator = 10,
//! An identifier
Identifier = 11,
//! The end of a line where a string is not closed.
UnclosedString = 12,
//! Basic functions.
BasicFunctions = 13,
//! String, table and maths functions.
StringTableMathsFunctions = 14,
//! Coroutines, I/O and system facilities.
CoroutinesIOSystemFacilities = 15,
//! A keyword defined in keyword set number 5. The class must be
//! sub-classed and re-implement keywords() to make use of this style.
KeywordSet5 = 16,
//! A keyword defined in keyword set number 6. The class must be
//! sub-classed and re-implement keywords() to make use of this style.
KeywordSet6 = 17,
//! A keyword defined in keyword set number 7. The class must be
//! sub-classed and re-implement keywords() to make use of this style.
KeywordSet7 = 18,
//! A keyword defined in keyword set number 8. The class must be
//! sub-classed and re-implement keywords() to make use of this style.
KeywordSet8 = 19,
//! A label.
Label = 20
};
//! Construct a QsciLexerLua with parent \a parent. \a parent is typically
//! the QsciScintilla instance.
QsciLexerLua(QObject *parent = 0);
//! Destroys the QsciLexerLua instance.
virtual ~QsciLexerLua();
//! Returns the name of the language.
const char *language() const;
//! Returns the name of the lexer. Some lexers support a number of
//! languages.
const char *lexer() const;
//! \internal Returns the character sequences that can separate
//! auto-completion words.
QStringList autoCompletionWordSeparators() const;
//! \internal Returns a space separated list of words or characters in
//! a particular style that define the start of a block for
//! auto-indentation. The styles is returned via \a style.
const char *blockStart(int *style = 0) const;
//! \internal Returns the style used for braces for brace matching.
int braceStyle() const;
//! Returns the foreground colour of the text for style number \a style.
//!
//! \sa defaultPaper()
QColor defaultColor(int style) const;
//! Returns the end-of-line fill for style number \a style.
bool defaultEolFill(int style) const;
//! Returns the font for style number \a style.
QFont defaultFont(int style) const;
//! Returns the background colour of the text for style number \a style.
//!
//! \sa defaultColor()
QColor defaultPaper(int style) const;
//! Returns the set of keywords for the keyword set \a set recognised
//! by the lexer as a space separated string.
const char *keywords(int set) const;
//! Returns the descriptive name for style number \a style. If the
//! style is invalid for this language then an empty QString is returned.
//! This is intended to be used in user preference dialogs.
QString description(int style) const;
//! Causes all properties to be refreshed by emitting the
//! propertyChanged() signal as required.
void refreshProperties();
//! Returns true if trailing blank lines are included in a fold block.
//!
//! \sa setFoldCompact()
bool foldCompact() const;
public slots:
//! If \a fold is true then trailing blank lines are included in a fold
//! block. The default is true.
//!
//! \sa foldCompact()
virtual void setFoldCompact(bool fold);
protected:
//! The lexer's properties are read from the settings \a qs. \a prefix
//! (which has a trailing '/') should be used as a prefix to the key of
//! each setting. true is returned if there is no error.
//!
bool readProperties(QSettings &qs,const QString &prefix);
//! The lexer's properties are written to the settings \a qs.
//! \a prefix (which has a trailing '/') should be used as a prefix to
//! the key of each setting. true is returned if there is no error.
//!
bool writeProperties(QSettings &qs,const QString &prefix) const;
private:
void setCompactProp();
bool fold_compact;
QsciLexerLua(const QsciLexerLua &);
QsciLexerLua &operator=(const QsciLexerLua &);
};
#endif

View File

@@ -0,0 +1,105 @@
// This defines the interface to the QsciLexerMakefile class.
//
// Copyright (c) 2023 Riverbank Computing Limited <info@riverbankcomputing.com>
//
// This file is part of QScintilla.
//
// This file may be used under the terms of the GNU General Public License
// version 3.0 as published by the Free Software Foundation and appearing in
// the file LICENSE included in the packaging of this file. Please review the
// following information to ensure the GNU General Public License version 3.0
// requirements will be met: http://www.gnu.org/copyleft/gpl.html.
//
// If you do not wish to use this file under the terms of the GPL version 3.0
// then you may purchase a commercial license. For more information contact
// info@riverbankcomputing.com.
//
// 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 QSCILEXERMAKEFILE_H
#define QSCILEXERMAKEFILE_H
#include <QObject>
#include <Qsci/qsciglobal.h>
#include <Qsci/qscilexer.h>
//! \brief The QsciLexerMakefile class encapsulates the Scintilla
//! Makefile lexer.
class QSCINTILLA_EXPORT QsciLexerMakefile : public QsciLexer
{
Q_OBJECT
public:
//! This enum defines the meanings of the different styles used by the
//! Makefile lexer.
enum {
//! The default.
Default = 0,
//! A comment.
Comment = 1,
//! A pre-processor directive.
Preprocessor = 2,
//! A variable.
Variable = 3,
//! An operator.
Operator = 4,
//! A target.
Target = 5,
//! An error.
Error = 9
};
//! Construct a QsciLexerMakefile with parent \a parent. \a parent is
//! typically the QsciScintilla instance.
QsciLexerMakefile(QObject *parent = 0);
//! Destroys the QsciLexerMakefile instance.
virtual ~QsciLexerMakefile();
//! Returns the name of the language.
const char *language() const;
//! Returns the name of the lexer. Some lexers support a number of
//! languages.
const char *lexer() const;
//! Returns the string of characters that comprise a word.
const char *wordCharacters() const;
//! Returns the foreground colour of the text for style number \a style.
//!
//! \sa defaultPaper()
QColor defaultColor(int style) const;
//! Returns the end-of-line fill for style number \a style.
bool defaultEolFill(int style) const;
//! Returns the font for style number \a style.
QFont defaultFont(int style) const;
//! Returns the background colour of the text for style number \a style.
//!
//! \sa defaultColor()
QColor defaultPaper(int style) const;
//! Returns the descriptive name for style number \a style. If the
//! style is invalid for this language then an empty QString is returned.
//! This is intended to be used in user preference dialogs.
QString description(int style) const;
private:
QsciLexerMakefile(const QsciLexerMakefile &);
QsciLexerMakefile &operator=(const QsciLexerMakefile &);
};
#endif

View File

@@ -0,0 +1,148 @@
// This defines the interface to the QsciLexerMarkdown class.
//
// Copyright (c) 2023 Riverbank Computing Limited <info@riverbankcomputing.com>
//
// This file is part of QScintilla.
//
// This file may be used under the terms of the GNU General Public License
// version 3.0 as published by the Free Software Foundation and appearing in
// the file LICENSE included in the packaging of this file. Please review the
// following information to ensure the GNU General Public License version 3.0
// requirements will be met: http://www.gnu.org/copyleft/gpl.html.
//
// If you do not wish to use this file under the terms of the GPL version 3.0
// then you may purchase a commercial license. For more information contact
// info@riverbankcomputing.com.
//
// 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 QSCILEXERMARKDOWN_H
#define QSCILEXERMARKDOWN_H
#include <QObject>
#include <Qsci/qsciglobal.h>
#include <Qsci/qscilexer.h>
//! \brief The QsciLexerMarkdown class encapsulates the Scintilla Markdown
//! lexer.
class QSCINTILLA_EXPORT QsciLexerMarkdown : public QsciLexer
{
Q_OBJECT
public:
//! This enum defines the meanings of the different styles used by the
//! Markdown lexer.
// Note that some values are omitted (ie. LINE_BEGIN and PRECHAR) as these
// seem to be internal state information rather than indicating that text
// should be styled differently.
enum {
//! The default.
Default = 0,
//! Special (e.g. end-of-line codes if enabled).
Special = 1,
//! Strong emphasis using double asterisks.
StrongEmphasisAsterisks = 2,
//! Strong emphasis using double underscores.
StrongEmphasisUnderscores = 3,
//! Emphasis using single asterisks.
EmphasisAsterisks = 4,
//! Emphasis using single underscores.
EmphasisUnderscores = 5,
//! A level 1 header.
Header1 = 6,
//! A level 2 header.
Header2 = 7,
//! A level 3 header.
Header3 = 8,
//! A level 4 header.
Header4 = 9,
//! A level 5 header.
Header5 = 10,
//! A level 6 header.
Header6 = 11,
//! Pre-char (up to three indent spaces, e.g. for a sub-list).
Prechar = 12,
//! An unordered list item.
UnorderedListItem = 13,
//! An ordered list item.
OrderedListItem = 14,
//! A block quote.
BlockQuote = 15,
//! Strike out.
StrikeOut = 16,
//! A horizontal rule.
HorizontalRule = 17,
//! A link.
Link = 18,
//! Code between backticks.
CodeBackticks = 19,
//! Code between double backticks.
CodeDoubleBackticks = 20,
//! A code block.
CodeBlock = 21,
};
//! Construct a QsciLexerMarkdown with parent \a parent. \a parent is
//! typically the QsciScintilla instance.
QsciLexerMarkdown(QObject *parent = 0);
//! Destroys the QsciLexerMarkdown instance.
virtual ~QsciLexerMarkdown();
//! Returns the name of the language.
const char *language() const;
//! Returns the name of the lexer. Some lexers support a number of
//! languages.
const char *lexer() const;
//! Returns the foreground colour of the text for style number \a style.
//!
//! \sa defaultPaper()
QColor defaultColor(int style) const;
//! Returns the font for style number \a style.
QFont defaultFont(int style) const;
//! Returns the background colour of the text for style number \a style.
//!
//! \sa defaultColor()
QColor defaultPaper(int style) const;
//! Returns the descriptive name for style number \a style. If the
//! style is invalid for this language then an empty QString is returned.
//! This is intended to be used in user preference dialogs.
QString description(int style) const;
private:
QsciLexerMarkdown(const QsciLexerMarkdown &);
QsciLexerMarkdown &operator=(const QsciLexerMarkdown &);
};
#endif

View File

@@ -0,0 +1,54 @@
// This defines the interface to the QsciLexerMASM class.
//
// Copyright (c) 2023 Riverbank Computing Limited <info@riverbankcomputing.com>
//
// This file is part of QScintilla.
//
// This file may be used under the terms of the GNU General Public License
// version 3.0 as published by the Free Software Foundation and appearing in
// the file LICENSE included in the packaging of this file. Please review the
// following information to ensure the GNU General Public License version 3.0
// requirements will be met: http://www.gnu.org/copyleft/gpl.html.
//
// If you do not wish to use this file under the terms of the GPL version 3.0
// then you may purchase a commercial license. For more information contact
// info@riverbankcomputing.com.
//
// 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 QSCILEXERMASM_H
#define QSCILEXERMASM_H
#include <QObject>
#include <Qsci/qsciglobal.h>
#include <Qsci/qscilexerasm.h>
//! \brief The QsciLexerMASM class encapsulates the Scintilla MASM lexer.
class QSCINTILLA_EXPORT QsciLexerMASM : public QsciLexerAsm
{
Q_OBJECT
public:
//! Construct a QsciLexerMASM with parent \a parent. \a parent is
//! typically the QsciScintilla instance.
QsciLexerMASM(QObject *parent = 0);
//! Destroys the QsciLexerMASM instance.
virtual ~QsciLexerMASM();
//! Returns the name of the language.
const char *language() const;
//! Returns the name of the lexer.
const char *lexer() const;
private:
QsciLexerMASM(const QsciLexerMASM &);
QsciLexerMASM &operator=(const QsciLexerMASM &);
};
#endif

View File

@@ -0,0 +1,104 @@
// This defines the interface to the QsciLexerMatlab class.
//
// Copyright (c) 2023 Riverbank Computing Limited <info@riverbankcomputing.com>
//
// This file is part of QScintilla.
//
// This file may be used under the terms of the GNU General Public License
// version 3.0 as published by the Free Software Foundation and appearing in
// the file LICENSE included in the packaging of this file. Please review the
// following information to ensure the GNU General Public License version 3.0
// requirements will be met: http://www.gnu.org/copyleft/gpl.html.
//
// If you do not wish to use this file under the terms of the GPL version 3.0
// then you may purchase a commercial license. For more information contact
// info@riverbankcomputing.com.
//
// 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 QSCILEXERMATLAB_H
#define QSCILEXERMATLAB_H
#include <QObject>
#include <Qsci/qsciglobal.h>
#include <Qsci/qscilexer.h>
//! \brief The QsciLexerMatlab class encapsulates the Scintilla Matlab file
//! lexer.
class QSCINTILLA_EXPORT QsciLexerMatlab : public QsciLexer
{
Q_OBJECT
public:
//! This enum defines the meanings of the different styles used by the
//! Matlab file lexer.
enum {
//! The default.
Default = 0,
//! A comment.
Comment = 1,
//! A command.
Command = 2,
//! A number.
Number = 3,
//! A keyword.
Keyword = 4,
//! A single quoted string.
SingleQuotedString = 5,
//! An operator
Operator = 6,
//! An identifier.
Identifier = 7,
//! A double quoted string.
DoubleQuotedString = 8
};
//! Construct a QsciLexerMatlab with parent \a parent. \a parent is
//! typically the QsciScintilla instance.
QsciLexerMatlab(QObject *parent = 0);
//! Destroys the QsciLexerMatlab instance.
virtual ~QsciLexerMatlab();
//! Returns the name of the language.
const char *language() const;
//! Returns the name of the lexer. Some lexers support a number of
//! languages.
const char *lexer() const;
//! Returns the foreground colour of the text for style number \a style.
//!
//! \sa defaultPaper()
QColor defaultColor(int style) const;
//! Returns the font for style number \a style.
QFont defaultFont(int style) const;
//! Returns the set of keywords for the keyword set \a set recognised
//! by the lexer as a space separated string.
const char *keywords(int set) const;
//! Returns the descriptive name for style number \a style. If the
//! style is invalid for this language then an empty QString is returned.
//! This is intended to be used in user preference dialogs.
QString description(int style) const;
private:
QsciLexerMatlab(const QsciLexerMatlab &);
QsciLexerMatlab &operator=(const QsciLexerMatlab &);
};
#endif

View File

@@ -0,0 +1,54 @@
// This defines the interface to the QsciLexerNASM class.
//
// Copyright (c) 2023 Riverbank Computing Limited <info@riverbankcomputing.com>
//
// This file is part of QScintilla.
//
// This file may be used under the terms of the GNU General Public License
// version 3.0 as published by the Free Software Foundation and appearing in
// the file LICENSE included in the packaging of this file. Please review the
// following information to ensure the GNU General Public License version 3.0
// requirements will be met: http://www.gnu.org/copyleft/gpl.html.
//
// If you do not wish to use this file under the terms of the GPL version 3.0
// then you may purchase a commercial license. For more information contact
// info@riverbankcomputing.com.
//
// 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 QSCILEXERNASM_H
#define QSCILEXERNASM_H
#include <QObject>
#include <Qsci/qsciglobal.h>
#include <Qsci/qscilexerasm.h>
//! \brief The QsciLexerNASM class encapsulates the Scintilla NASM lexer.
class QSCINTILLA_EXPORT QsciLexerNASM : public QsciLexerAsm
{
Q_OBJECT
public:
//! Construct a QsciLexerNASM with parent \a parent. \a parent is
//! typically the QsciScintilla instance.
QsciLexerNASM(QObject *parent = 0);
//! Destroys the QsciLexerNASM instance.
virtual ~QsciLexerNASM();
//! Returns the name of the language.
const char *language() const;
//! Returns the name of the lexer.
const char *lexer() const;
private:
QsciLexerNASM(const QsciLexerNASM &);
QsciLexerNASM &operator=(const QsciLexerNASM &);
};
#endif

View File

@@ -0,0 +1,60 @@
// This defines the interface to the QsciLexerOctave class.
//
// Copyright (c) 2023 Riverbank Computing Limited <info@riverbankcomputing.com>
//
// This file is part of QScintilla.
//
// This file may be used under the terms of the GNU General Public License
// version 3.0 as published by the Free Software Foundation and appearing in
// the file LICENSE included in the packaging of this file. Please review the
// following information to ensure the GNU General Public License version 3.0
// requirements will be met: http://www.gnu.org/copyleft/gpl.html.
//
// If you do not wish to use this file under the terms of the GPL version 3.0
// then you may purchase a commercial license. For more information contact
// info@riverbankcomputing.com.
//
// 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 QSCILEXEROCTAVE_H
#define QSCILEXEROCTAVE_H
#include <QObject>
#include <Qsci/qsciglobal.h>
#include <Qsci/qscilexermatlab.h>
//! \brief The QsciLexerOctave class encapsulates the Scintilla Octave file
//! lexer.
class QSCINTILLA_EXPORT QsciLexerOctave : public QsciLexerMatlab
{
Q_OBJECT
public:
//! Construct a QsciLexerOctave with parent \a parent. \a parent is
//! typically the QsciScintilla instance.
QsciLexerOctave(QObject *parent = 0);
//! Destroys the QsciLexerOctave instance.
virtual ~QsciLexerOctave();
//! Returns the name of the language.
const char *language() const;
//! Returns the name of the lexer. Some lexers support a number of
//! languages.
const char *lexer() const;
//! Returns the set of keywords for the keyword set \a set recognised
//! by the lexer as a space separated string.
const char *keywords(int set) const;
private:
QsciLexerOctave(const QsciLexerOctave &);
QsciLexerOctave &operator=(const QsciLexerOctave &);
};
#endif

View File

@@ -0,0 +1,227 @@
// This defines the interface to the QsciLexerPascal class.
//
// Copyright (c) 2023 Riverbank Computing Limited <info@riverbankcomputing.com>
//
// This file is part of QScintilla.
//
// This file may be used under the terms of the GNU General Public License
// version 3.0 as published by the Free Software Foundation and appearing in
// the file LICENSE included in the packaging of this file. Please review the
// following information to ensure the GNU General Public License version 3.0
// requirements will be met: http://www.gnu.org/copyleft/gpl.html.
//
// If you do not wish to use this file under the terms of the GPL version 3.0
// then you may purchase a commercial license. For more information contact
// info@riverbankcomputing.com.
//
// 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 QSCILEXERPASCAL_H
#define QSCILEXERPASCAL_H
#include <QObject>
#include <Qsci/qsciglobal.h>
#include <Qsci/qscilexer.h>
//! \brief The QsciLexerPascal class encapsulates the Scintilla Pascal lexer.
class QSCINTILLA_EXPORT QsciLexerPascal : public QsciLexer
{
Q_OBJECT
public:
//! This enum defines the meanings of the different styles used by the
//! C++ lexer.
enum {
//! The default.
Default = 0,
//! An identifier
Identifier = 1,
//! A '{ ... }' style comment.
Comment = 2,
//! A '(* ... *)' style comment.
CommentParenthesis = 3,
//! A comment line.
CommentLine = 4,
//! A '{$ ... }' style pre-processor block.
PreProcessor = 5,
//! A '(*$ ... *)' style pre-processor block.
PreProcessorParenthesis = 6,
//! A number.
Number = 7,
//! A hexadecimal number.
HexNumber = 8,
//! A keyword.
Keyword = 9,
//! A single-quoted string.
SingleQuotedString = 10,
//! The end of a line where a string is not closed.
UnclosedString = 11,
//! A character.
Character = 12,
//! An operator.
Operator = 13,
//! Inline Asm.
Asm = 14
};
//! Construct a QsciLexerPascal with parent \a parent. \a parent is
//! typically the QsciScintilla instance.
QsciLexerPascal(QObject *parent = 0);
//! Destroys the QsciLexerPascal instance.
virtual ~QsciLexerPascal();
//! Returns the name of the language.
const char *language() const;
//! Returns the name of the lexer. Some lexers support a number of
//! languages.
const char *lexer() const;
//! \internal Returns the character sequences that can separate
//! auto-completion words.
QStringList autoCompletionWordSeparators() const;
//! \internal Returns a space separated list of words or characters in
//! a particular style that define the end of a block for
//! auto-indentation. The styles is returned via \a style.
const char *blockEnd(int *style = 0) const;
//! \internal Returns a space separated list of words or characters in
//! a particular style that define the start of a block for
//! auto-indentation. The styles is returned via \a style.
const char *blockStart(int *style = 0) const;
//! \internal Returns a space separated list of keywords in a
//! particular style that define the start of a block for
//! auto-indentation. The styles is returned via \a style.
const char *blockStartKeyword(int *style = 0) const;
//! \internal Returns the style used for braces for brace matching.
int braceStyle() const;
//! Returns the foreground colour of the text for style number \a style.
//!
//! \sa defaultPaper()
QColor defaultColor(int style) const;
//! Returns the end-of-line fill for style number \a style.
bool defaultEolFill(int style) const;
//! Returns the font for style number \a style.
QFont defaultFont(int style) const;
//! Returns the background colour of the text for style number \a style.
//!
//! \sa defaultColor()
QColor defaultPaper(int style) const;
//! Returns the set of keywords for the keyword set \a set recognised
//! by the lexer as a space separated string.
const char *keywords(int set) const;
//! Returns the descriptive name for style number \a style. If the
//! style is invalid for this language then an empty QString is returned.
//! This is intended to be used in user preference dialogs.
QString description(int style) const;
//! Causes all properties to be refreshed by emitting the
//! propertyChanged() signal as required.
void refreshProperties();
//! Returns true if multi-line comment blocks can be folded.
//!
//! \sa setFoldComments()
bool foldComments() const;
//! Returns true if trailing blank lines are included in a fold block.
//!
//! \sa setFoldCompact()
bool foldCompact() const;
//! Returns true if preprocessor blocks can be folded.
//!
//! \sa setFoldPreprocessor()
bool foldPreprocessor() const;
//! If \a enabled is true then some keywords will only be highlighted in an
//! appropriate context (similar to how the Delphi IDE works). The default
//! is true.
//!
//! \sa smartHighlighting()
void setSmartHighlighting(bool enabled);
//! Returns true if some keywords will only be highlighted in an
//! appropriate context (similar to how the Delphi IDE works).
//!
//! \sa setSmartHighlighting()
bool smartHighlighting() const;
public slots:
//! If \a fold is true then multi-line comment blocks can be folded.
//! The default is false.
//!
//! \sa foldComments()
virtual void setFoldComments(bool fold);
//! If \a fold is true then trailing blank lines are included in a fold
//! block. The default is true.
//!
//! \sa foldCompact()
virtual void setFoldCompact(bool fold);
//! If \a fold is true then preprocessor blocks can be folded. The
//! default is true.
//!
//! \sa foldPreprocessor()
virtual void setFoldPreprocessor(bool fold);
protected:
//! The lexer's properties are read from the settings \a qs. \a prefix
//! (which has a trailing '/') should be used as a prefix to the key of
//! each setting. true is returned if there is no error.
//!
//! \sa writeProperties()
bool readProperties(QSettings &qs,const QString &prefix);
//! The lexer's properties are written to the settings \a qs.
//! \a prefix (which has a trailing '/') should be used as a prefix to
//! the key of each setting. true is returned if there is no error.
//!
//! \sa readProperties()
bool writeProperties(QSettings &qs,const QString &prefix) const;
private:
void setCommentProp();
void setCompactProp();
void setPreprocProp();
void setSmartHighlightProp();
bool fold_comments;
bool fold_compact;
bool fold_preproc;
bool smart_highlight;
QsciLexerPascal(const QsciLexerPascal &);
QsciLexerPascal &operator=(const QsciLexerPascal &);
};
#endif

View File

@@ -0,0 +1,312 @@
// This defines the interface to the QsciLexerPerl class.
//
// Copyright (c) 2023 Riverbank Computing Limited <info@riverbankcomputing.com>
//
// This file is part of QScintilla.
//
// This file may be used under the terms of the GNU General Public License
// version 3.0 as published by the Free Software Foundation and appearing in
// the file LICENSE included in the packaging of this file. Please review the
// following information to ensure the GNU General Public License version 3.0
// requirements will be met: http://www.gnu.org/copyleft/gpl.html.
//
// If you do not wish to use this file under the terms of the GPL version 3.0
// then you may purchase a commercial license. For more information contact
// info@riverbankcomputing.com.
//
// 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 QSCILEXERPERL_H
#define QSCILEXERPERL_H
#include <QObject>
#include <Qsci/qsciglobal.h>
#include <Qsci/qscilexer.h>
//! \brief The QsciLexerPerl class encapsulates the Scintilla Perl
//! lexer.
class QSCINTILLA_EXPORT QsciLexerPerl : public QsciLexer
{
Q_OBJECT
public:
//! This enum defines the meanings of the different styles used by the
//! Perl lexer.
enum {
//! The default.
Default = 0,
//! An error.
Error = 1,
//! A comment.
Comment = 2,
//! A POD.
POD = 3,
//! A number.
Number = 4,
//! A keyword.
Keyword = 5,
//! A double-quoted string.
DoubleQuotedString = 6,
//! A single-quoted string.
SingleQuotedString = 7,
//! An operator.
Operator = 10,
//! An identifier
Identifier = 11,
//! A scalar.
Scalar = 12,
//! An array.
Array = 13,
//! A hash.
Hash = 14,
//! A symbol table.
SymbolTable = 15,
//! A regular expression.
Regex = 17,
//! A substitution.
Substitution = 18,
//! Backticks.
Backticks = 20,
//! A data section.
DataSection = 21,
//! A here document delimiter.
HereDocumentDelimiter = 22,
//! A single quoted here document.
SingleQuotedHereDocument = 23,
//! A double quoted here document.
DoubleQuotedHereDocument = 24,
//! A backtick here document.
BacktickHereDocument = 25,
//! A quoted string (q).
QuotedStringQ = 26,
//! A quoted string (qq).
QuotedStringQQ = 27,
//! A quoted string (qx).
QuotedStringQX = 28,
//! A quoted string (qr).
QuotedStringQR = 29,
//! A quoted string (qw).
QuotedStringQW = 30,
//! A verbatim POD.
PODVerbatim = 31,
//! A Subroutine prototype.
SubroutinePrototype = 40,
//! A format identifier.
FormatIdentifier = 41,
//! A format body.
FormatBody = 42,
//! A double-quoted string (interpolated variable).
DoubleQuotedStringVar = 43,
//! A translation.
Translation = 44,
//! A regular expression (interpolated variable).
RegexVar = 54,
//! A substitution (interpolated variable).
SubstitutionVar = 55,
//! Backticks (interpolated variable).
BackticksVar = 57,
//! A double quoted here document (interpolated variable).
DoubleQuotedHereDocumentVar = 61,
//! A backtick here document (interpolated variable).
BacktickHereDocumentVar = 62,
//! A quoted string (qq, interpolated variable).
QuotedStringQQVar = 64,
//! A quoted string (qx, interpolated variable).
QuotedStringQXVar = 65,
//! A quoted string (qr, interpolated variable).
QuotedStringQRVar = 66
};
//! Construct a QsciLexerPerl with parent \a parent. \a parent is
//! typically the QsciScintilla instance.
QsciLexerPerl(QObject *parent = 0);
//! Destroys the QsciLexerPerl instance.
virtual ~QsciLexerPerl();
//! Returns the name of the language.
const char *language() const;
//! Returns the name of the lexer. Some lexers support a number of
//! languages.
const char *lexer() const;
//! \internal Returns the character sequences that can separate
//! auto-completion words.
QStringList autoCompletionWordSeparators() const;
//! \internal Returns a space separated list of words or characters in
//! a particular style that define the end of a block for
//! auto-indentation. The styles is returned via \a style.
const char *blockEnd(int *style = 0) const;
//! \internal Returns a space separated list of words or characters in
//! a particular style that define the start of a block for
//! auto-indentation. The styles is returned via \a style.
const char *blockStart(int *style = 0) const;
//! \internal Returns the style used for braces for brace matching.
int braceStyle() const;
//! Returns the string of characters that comprise a word.
const char *wordCharacters() const;
//! Returns the foreground colour of the text for style number
//! \a style.
//!
//! \sa defaultPaper()
QColor defaultColor(int style) const;
//! Returns the end-of-line fill for style number \a style.
bool defaultEolFill(int style) const;
//! Returns the font for style number \a style.
QFont defaultFont(int style) const;
//! Returns the background colour of the text for style number \a style.
//!
//! \sa defaultColor()
QColor defaultPaper(int style) const;
//! Returns the set of keywords for the keyword set \a set recognised
//! by the lexer as a space separated string.
const char *keywords(int set) const;
//! Returns the descriptive name for style number \a style. If the
//! style is invalid for this language then an empty QString is returned.
//! This is intended to be used in user preference dialogs.
QString description(int style) const;
//! Causes all properties to be refreshed by emitting the
//! propertyChanged() signal as required.
void refreshProperties();
//! If \a fold is true then "} else {" lines can be folded. The default is
//! false.
//!
//! \sa foldAtElse()
void setFoldAtElse(bool fold);
//! Returns true if "} else {" lines can be folded.
//!
//! \sa setFoldAtElse()
bool foldAtElse() const {return fold_atelse;}
//! Returns true if multi-line comment blocks can be folded.
//!
//! \sa setFoldComments()
bool foldComments() const;
//! Returns true if trailing blank lines are included in a fold block.
//!
//! \sa setFoldCompact()
bool foldCompact() const;
//! If \a fold is true then packages can be folded. The default is true.
//!
//! \sa foldPackages()
void setFoldPackages(bool fold);
//! Returns true if packages can be folded.
//!
//! \sa setFoldPackages()
bool foldPackages() const;
//! If \a fold is true then POD blocks can be folded. The default is true.
//!
//! \sa foldPODBlocks()
void setFoldPODBlocks(bool fold);
//! Returns true if POD blocks can be folded.
//!
//! \sa setFoldPODBlocks()
bool foldPODBlocks() const;
public slots:
//! If \a fold is true then multi-line comment blocks can be folded.
//! The default is false.
//!
//! \sa foldComments()
virtual void setFoldComments(bool fold);
//! If \a fold is true then trailing blank lines are included in a fold
//! block. The default is true.
//!
//! \sa foldCompact()
virtual void setFoldCompact(bool fold);
protected:
//! The lexer's properties are read from the settings \a qs. \a prefix
//! (which has a trailing '/') should be used as a prefix to the key of
//! each setting. true is returned if there is no error.
//!
bool readProperties(QSettings &qs,const QString &prefix);
//! The lexer's properties are written to the settings \a qs.
//! \a prefix (which has a trailing '/') should be used as a prefix to
//! the key of each setting. true is returned if there is no error.
//!
bool writeProperties(QSettings &qs,const QString &prefix) const;
private:
void setAtElseProp();
void setCommentProp();
void setCompactProp();
void setPackagesProp();
void setPODBlocksProp();
bool fold_atelse;
bool fold_comments;
bool fold_compact;
bool fold_packages;
bool fold_pod_blocks;
QsciLexerPerl(const QsciLexerPerl &);
QsciLexerPerl &operator=(const QsciLexerPerl &);
};
#endif

View File

@@ -0,0 +1,163 @@
// This defines the interface to the QsciLexerPO class.
//
// Copyright (c) 2023 Riverbank Computing Limited <info@riverbankcomputing.com>
//
// This file is part of QScintilla.
//
// This file may be used under the terms of the GNU General Public License
// version 3.0 as published by the Free Software Foundation and appearing in
// the file LICENSE included in the packaging of this file. Please review the
// following information to ensure the GNU General Public License version 3.0
// requirements will be met: http://www.gnu.org/copyleft/gpl.html.
//
// If you do not wish to use this file under the terms of the GPL version 3.0
// then you may purchase a commercial license. For more information contact
// info@riverbankcomputing.com.
//
// 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 QSCILEXERPO_H
#define QSCILEXERPO_H
#include <QObject>
#include <Qsci/qsciglobal.h>
#include <Qsci/qscilexer.h>
//! \brief The QsciLexerPO class encapsulates the Scintilla PO lexer.
class QSCINTILLA_EXPORT QsciLexerPO : public QsciLexer
{
Q_OBJECT
public:
//! This enum defines the meanings of the different styles used by the
//! PO lexer.
enum {
//! The default.
Default = 0,
//! A comment.
Comment = 1,
//! A message identifier.
MessageId = 2,
//! The text of a message identifier.
MessageIdText = 3,
//! A message string.
MessageString = 4,
//! The text of a message string.
MessageStringText = 5,
//! A message context.
MessageContext = 6,
//! The text of a message context.
MessageContextText = 7,
//! The "fuzzy" flag.
Fuzzy = 8,
//! A programmer comment.
ProgrammerComment = 9,
//! A reference.
Reference = 10,
//! A flag.
Flags = 11,
//! A message identifier text end-of-line.
MessageIdTextEOL = 12,
//! A message string text end-of-line.
MessageStringTextEOL = 13,
//! A message context text end-of-line.
MessageContextTextEOL = 14
};
//! Construct a QsciLexerPO with parent \a parent. \a parent is typically
//! the QsciScintilla instance.
QsciLexerPO(QObject *parent = 0);
//! Destroys the QsciLexerPO instance.
virtual ~QsciLexerPO();
//! Returns the name of the language.
const char *language() const;
//! Returns the name of the lexer. Some lexers support a number of
//! languages.
const char *lexer() const;
//! Returns the foreground colour of the text for style number \a style.
//!
//! \sa defaultPaper()
QColor defaultColor(int style) const;
//! Returns the font for style number \a style.
QFont defaultFont(int style) const;
//! Returns the descriptive name for style number \a style. If the
//! style is invalid for this language then an empty QString is returned.
//! This is intended to be used in user preference dialogs.
QString description(int style) const;
//! Causes all properties to be refreshed by emitting the propertyChanged()
//! signal as required.
void refreshProperties();
//! Returns true if multi-line comment blocks can be folded.
//!
//! \sa setFoldComments()
bool foldComments() const;
//! Returns true if trailing blank lines are included in a fold block.
//!
//! \sa setFoldCompact()
bool foldCompact() const;
public slots:
//! If \a fold is true then multi-line comment blocks can be folded.
//! The default is false.
//!
//! \sa foldComments()
virtual void setFoldComments(bool fold);
//! If \a fold is true then trailing blank lines are included in a fold
//! block. The default is true.
//!
//! \sa foldCompact()
virtual void setFoldCompact(bool fold);
protected:
//! The lexer's properties are read from the settings \a qs. \a prefix
//! (which has a trailing '/') should be used as a prefix to the key of
//! each setting. true is returned if there is no error.
//!
bool readProperties(QSettings &qs,const QString &prefix);
//! The lexer's properties are written to the settings \a qs.
//! \a prefix (which has a trailing '/') should be used as a prefix to
//! the key of each setting. true is returned if there is no error.
//!
bool writeProperties(QSettings &qs,const QString &prefix) const;
private:
void setCommentProp();
void setCompactProp();
bool fold_comments;
bool fold_compact;
QsciLexerPO(const QsciLexerPO &);
QsciLexerPO &operator=(const QsciLexerPO &);
};
#endif

View File

@@ -0,0 +1,204 @@
// This defines the interface to the QsciLexerPostScript class.
//
// Copyright (c) 2023 Riverbank Computing Limited <info@riverbankcomputing.com>
//
// This file is part of QScintilla.
//
// This file may be used under the terms of the GNU General Public License
// version 3.0 as published by the Free Software Foundation and appearing in
// the file LICENSE included in the packaging of this file. Please review the
// following information to ensure the GNU General Public License version 3.0
// requirements will be met: http://www.gnu.org/copyleft/gpl.html.
//
// If you do not wish to use this file under the terms of the GPL version 3.0
// then you may purchase a commercial license. For more information contact
// info@riverbankcomputing.com.
//
// 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 QSCILEXERPOSTSCRIPT_H
#define QSCILEXERPOSTSCRIPT_H
#include <QObject>
#include <Qsci/qsciglobal.h>
#include <Qsci/qscilexer.h>
//! \brief The QsciLexerPostScript class encapsulates the Scintilla PostScript
//! lexer.
class QSCINTILLA_EXPORT QsciLexerPostScript : public QsciLexer
{
Q_OBJECT
public:
//! This enum defines the meanings of the different styles used by the
//! PostScript lexer.
enum {
//! The default.
Default = 0,
//! A comment.
Comment = 1,
//! A DSC comment.
DSCComment = 2,
//! A DSC comment value.
DSCCommentValue = 3,
//! A number.
Number = 4,
//! A name.
Name = 5,
//! A keyword.
Keyword = 6,
//! A literal.
Literal = 7,
//! An immediately evaluated literal.
ImmediateEvalLiteral = 8,
//! Array parenthesis.
ArrayParenthesis = 9,
//! Dictionary parenthesis.
DictionaryParenthesis = 10,
//! Procedure parenthesis.
ProcedureParenthesis = 11,
//! Text.
Text = 12,
//! A hexadecimal string.
HexString = 13,
//! A base85 string.
Base85String = 14,
//! A bad string character.
BadStringCharacter = 15
};
//! Construct a QsciLexerPostScript with parent \a parent. \a parent is
//! typically the QsciScintilla instance.
QsciLexerPostScript(QObject *parent = 0);
//! Destroys the QsciLexerPostScript instance.
virtual ~QsciLexerPostScript();
//! Returns the name of the language.
const char *language() const;
//! Returns the name of the lexer. Some lexers support a number of
//! languages.
const char *lexer() const;
//! \internal Returns the style used for braces for brace matching.
int braceStyle() const;
//! Returns the foreground colour of the text for style number \a style.
//!
//! \sa defaultPaper()
QColor defaultColor(int style) const;
//! Returns the font for style number \a style.
QFont defaultFont(int style) const;
//! Returns the background colour of the text for style number \a style.
//!
//! \sa defaultColor()
QColor defaultPaper(int style) const;
//! Returns the set of keywords for the keyword set \a set recognised
//! by the lexer as a space separated string. Set 5 can be used to provide
//! additional user defined keywords.
const char *keywords(int set) const;
//! Returns the descriptive name for style number \a style. If the
//! style is invalid for this language then an empty QString is returned.
//! This is intended to be used in user preference dialogs.
QString description(int style) const;
//! Causes all properties to be refreshed by emitting the propertyChanged()
//! signal as required.
void refreshProperties();
//! Returns true if tokens should be marked.
//!
//! \sa setTokenize()
bool tokenize() const;
//! Returns the PostScript level.
//!
//! \sa setLevel()
int level() const;
//! Returns true if trailing blank lines are included in a fold block.
//!
//! \sa setFoldCompact()
bool foldCompact() const;
//! Returns true if else blocks can be folded.
//!
//! \sa setFoldAtElse()
bool foldAtElse() const;
public slots:
//! If \a tokenize is true then tokens are marked. The default is false.
//!
//! \sa tokenize()
virtual void setTokenize(bool tokenize);
//! The PostScript level is set to \a level. The default is 3.
//!
//! \sa level()
virtual void setLevel(int level);
//! If \a fold is true then trailing blank lines are included in a fold
//! block. The default is true.
//!
//! \sa foldCompact()
virtual void setFoldCompact(bool fold);
//! If \a fold is true then else blocks can be folded. The default is
//! false.
//!
//! \sa foldAtElse()
virtual void setFoldAtElse(bool fold);
protected:
//! The lexer's properties are read from the settings \a qs. \a prefix
//! (which has a trailing '/') should be used as a prefix to the key of
//! each setting. true is returned if there is no error.
//!
bool readProperties(QSettings &qs,const QString &prefix);
//! The lexer's properties are written to the settings \a qs.
//! \a prefix (which has a trailing '/') should be used as a prefix to
//! the key of each setting. true is returned if there is no error.
//!
bool writeProperties(QSettings &qs,const QString &prefix) const;
private:
void setTokenizeProp();
void setLevelProp();
void setCompactProp();
void setAtElseProp();
bool ps_tokenize;
int ps_level;
bool fold_compact;
bool fold_atelse;
QsciLexerPostScript(const QsciLexerPostScript &);
QsciLexerPostScript &operator=(const QsciLexerPostScript &);
};
#endif

View File

@@ -0,0 +1,203 @@
// This defines the interface to the QsciLexerPOV class.
//
// Copyright (c) 2023 Riverbank Computing Limited <info@riverbankcomputing.com>
//
// This file is part of QScintilla.
//
// This file may be used under the terms of the GNU General Public License
// version 3.0 as published by the Free Software Foundation and appearing in
// the file LICENSE included in the packaging of this file. Please review the
// following information to ensure the GNU General Public License version 3.0
// requirements will be met: http://www.gnu.org/copyleft/gpl.html.
//
// If you do not wish to use this file under the terms of the GPL version 3.0
// then you may purchase a commercial license. For more information contact
// info@riverbankcomputing.com.
//
// 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 QSCILEXERPOV_H
#define QSCILEXERPOV_H
#include <QObject>
#include <Qsci/qsciglobal.h>
#include <Qsci/qscilexer.h>
//! \brief The QsciLexerPOV class encapsulates the Scintilla POV lexer.
class QSCINTILLA_EXPORT QsciLexerPOV : public QsciLexer
{
Q_OBJECT
public:
//! This enum defines the meanings of the different styles used by the
//! POV lexer.
enum {
//! The default.
Default = 0,
//! A comment.
Comment = 1,
//! A comment line.
CommentLine = 2,
//! A number.
Number = 3,
//! An operator.
Operator = 4,
//! An identifier
Identifier = 5,
//! A string.
String = 6,
//! The end of a line where a string is not closed.
UnclosedString = 7,
//! A directive.
Directive = 8,
//! A bad directive.
BadDirective = 9,
//! Objects, CSG and appearance.
ObjectsCSGAppearance = 10,
//! Types, modifiers and items.
TypesModifiersItems = 11,
//! Predefined identifiers.
PredefinedIdentifiers = 12,
//! Predefined identifiers.
PredefinedFunctions = 13,
//! A keyword defined in keyword set number 6. The class must be
//! sub-classed and re-implement keywords() to make use of this style.
KeywordSet6 = 14,
//! A keyword defined in keyword set number 7. The class must be
//! sub-classed and re-implement keywords() to make use of this style.
KeywordSet7 = 15,
//! A keyword defined in keyword set number 8. The class must be
//! sub-classed and re-implement keywords() to make use of this style.
KeywordSet8 = 16
};
//! Construct a QsciLexerPOV with parent \a parent. \a parent is typically
//! the QsciScintilla instance.
QsciLexerPOV(QObject *parent = 0);
//! Destroys the QsciLexerPOV instance.
virtual ~QsciLexerPOV();
//! Returns the name of the language.
const char *language() const;
//! Returns the name of the lexer. Some lexers support a number of
//! languages.
const char *lexer() const;
//! \internal Returns the style used for braces for brace matching.
int braceStyle() const;
//! Returns the string of characters that comprise a word.
const char *wordCharacters() const;
//! Returns the foreground colour of the text for style number \a style.
//!
//! \sa defaultPaper()
QColor defaultColor(int style) const;
//! Returns the end-of-line fill for style number \a style.
bool defaultEolFill(int style) const;
//! Returns the font for style number \a style.
QFont defaultFont(int style) const;
//! Returns the background colour of the text for style number \a style.
//!
//! \sa defaultColor()
QColor defaultPaper(int style) const;
//! Returns the set of keywords for the keyword set \a set recognised
//! by the lexer as a space separated string.
const char *keywords(int set) const;
//! Returns the descriptive name for style number \a style. If the
//! style is invalid for this language then an empty QString is returned.
//! This is intended to be used in user preference dialogs.
QString description(int style) const;
//! Causes all properties to be refreshed by emitting the propertyChanged()
//! signal as required.
void refreshProperties();
//! Returns true if multi-line comment blocks can be folded.
//!
//! \sa setFoldComments()
bool foldComments() const;
//! Returns true if trailing blank lines are included in a fold block.
//!
//! \sa setFoldCompact()
bool foldCompact() const;
//! Returns true if directives can be folded.
//!
//! \sa setFoldDirectives()
bool foldDirectives() const;
public slots:
//! If \a fold is true then multi-line comment blocks can be folded.
//! The default is false.
//!
//! \sa foldComments()
virtual void setFoldComments(bool fold);
//! If \a fold is true then trailing blank lines are included in a fold
//! block. The default is true.
//!
//! \sa foldCompact()
virtual void setFoldCompact(bool fold);
//! If \a fold is true then directives can be folded. The default is
//! false.
//!
//! \sa foldDirectives()
virtual void setFoldDirectives(bool fold);
protected:
//! The lexer's properties are read from the settings \a qs. \a prefix
//! (which has a trailing '/') should be used as a prefix to the key of
//! each setting. true is returned if there is no error.
//!
bool readProperties(QSettings &qs,const QString &prefix);
//! The lexer's properties are written to the settings \a qs.
//! \a prefix (which has a trailing '/') should be used as a prefix to
//! the key of each setting. true is returned if there is no error.
//!
bool writeProperties(QSettings &qs,const QString &prefix) const;
private:
void setCommentProp();
void setCompactProp();
void setDirectiveProp();
bool fold_comments;
bool fold_compact;
bool fold_directives;
QsciLexerPOV(const QsciLexerPOV &);
QsciLexerPOV &operator=(const QsciLexerPOV &);
};
#endif

View File

@@ -0,0 +1,150 @@
// This defines the interface to the QsciLexerProperties class.
//
// Copyright (c) 2023 Riverbank Computing Limited <info@riverbankcomputing.com>
//
// This file is part of QScintilla.
//
// This file may be used under the terms of the GNU General Public License
// version 3.0 as published by the Free Software Foundation and appearing in
// the file LICENSE included in the packaging of this file. Please review the
// following information to ensure the GNU General Public License version 3.0
// requirements will be met: http://www.gnu.org/copyleft/gpl.html.
//
// If you do not wish to use this file under the terms of the GPL version 3.0
// then you may purchase a commercial license. For more information contact
// info@riverbankcomputing.com.
//
// 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 QSCILEXERPROPERTIES_H
#define QSCILEXERPROPERTIES_H
#include <QObject>
#include <Qsci/qsciglobal.h>
#include <Qsci/qscilexer.h>
//! \brief The QsciLexerProperties class encapsulates the Scintilla
//! Properties lexer.
class QSCINTILLA_EXPORT QsciLexerProperties : public QsciLexer
{
Q_OBJECT
public:
//! This enum defines the meanings of the different styles used by the
//! Properties lexer.
enum {
//! The default.
Default = 0,
//! A comment.
Comment = 1,
//! A section.
Section = 2,
//! An assignment operator.
Assignment = 3,
//! A default value.
DefaultValue = 4,
//! A key.
Key = 5
};
//! Construct a QsciLexerProperties with parent \a parent. \a parent is
//! typically the QsciScintilla instance.
QsciLexerProperties(QObject *parent = 0);
//! Destroys the QsciLexerProperties instance.
virtual ~QsciLexerProperties();
//! Returns the name of the language.
const char *language() const;
//! Returns the name of the lexer. Some lexers support a number of
//! languages.
const char *lexer() const;
//! Returns the string of characters that comprise a word.
const char *wordCharacters() const;
//! Returns the foreground colour of the text for style number \a style.
//!
//! \sa defaultPaper()
QColor defaultColor(int style) const;
//! Returns the end-of-line fill for style number \a style.
bool defaultEolFill(int style) const;
//! Returns the font for style number \a style.
QFont defaultFont(int style) const;
//! Returns the background colour of the text for style number \a style.
//!
//! \sa defaultColor()
QColor defaultPaper(int style) const;
//! Returns the descriptive name for style number \a style. If the style
//! is invalid for this language then an empty QString is returned. This
//! is intended to be used in user preference dialogs.
QString description(int style) const;
//! Causes all properties to be refreshed by emitting the
//! propertyChanged() signal as required.
void refreshProperties();
//! Returns true if trailing blank lines are included in a fold block.
//!
//! \sa setFoldCompact()
bool foldCompact() const {return fold_compact;}
//! If \a enable is true then initial spaces in a line are allowed. The
//! default is true.
//!
//! \sa initialSpaces()
void setInitialSpaces(bool enable);
//! Returns true if initial spaces in a line are allowed.
//!
//! \sa setInitialSpaces()
bool initialSpaces() const {return initial_spaces;}
public slots:
//! If \a fold is true then trailing blank lines are included in a fold
//! block. The default is true.
//!
//! \sa foldCompact()
virtual void setFoldCompact(bool fold);
protected:
//! The lexer's properties are read from the settings \a qs. \a prefix
//! (which has a trailing '/') should be used as a prefix to the key of
//! each setting. true is returned if there is no error.
//!
//! \sa writeProperties()
bool readProperties(QSettings &qs,const QString &prefix);
//! The lexer's properties are written to the settings \a qs.
//! \a prefix (which has a trailing '/') should be used as a prefix to
//! the key of each setting. true is returned if there is no error.
//!
//! \sa readProperties()
bool writeProperties(QSettings &qs,const QString &prefix) const;
private:
void setCompactProp();
void setInitialSpacesProp();
bool fold_compact;
bool initial_spaces;
QsciLexerProperties(const QsciLexerProperties &);
QsciLexerProperties &operator=(const QsciLexerProperties &);
};
#endif

View File

@@ -0,0 +1,333 @@
// This defines the interface to the QsciLexerPython class.
//
// Copyright (c) 2023 Riverbank Computing Limited <info@riverbankcomputing.com>
//
// This file is part of QScintilla.
//
// This file may be used under the terms of the GNU General Public License
// version 3.0 as published by the Free Software Foundation and appearing in
// the file LICENSE included in the packaging of this file. Please review the
// following information to ensure the GNU General Public License version 3.0
// requirements will be met: http://www.gnu.org/copyleft/gpl.html.
//
// If you do not wish to use this file under the terms of the GPL version 3.0
// then you may purchase a commercial license. For more information contact
// info@riverbankcomputing.com.
//
// 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 QSCILEXERPYTHON_H
#define QSCILEXERPYTHON_H
#include <QObject>
#include <Qsci/qsciglobal.h>
#include <Qsci/qscilexer.h>
#include "Qsci/qsciscintillabase.h"
//! \brief The QsciLexerPython class encapsulates the Scintilla Python lexer.
class QSCINTILLA_EXPORT QsciLexerPython : public QsciLexer
{
Q_OBJECT
public:
//! This enum defines the meanings of the different styles used by the
//! Python lexer.
enum {
//! The default.
Default = 0,
//! A comment.
Comment = 1,
//! A number.
Number = 2,
//! A double-quoted string.
DoubleQuotedString = 3,
//! A single-quoted string.
SingleQuotedString = 4,
//! A keyword.
Keyword = 5,
//! A triple single-quoted string.
TripleSingleQuotedString = 6,
//! A triple double-quoted string.
TripleDoubleQuotedString = 7,
//! The name of a class.
ClassName = 8,
//! The name of a function or method.
FunctionMethodName = 9,
//! An operator.
Operator = 10,
//! An identifier
Identifier = 11,
//! A comment block.
CommentBlock = 12,
//! The end of a line where a string is not closed.
UnclosedString = 13,
//! A highlighted identifier. These are defined by keyword set
//! 2. Reimplement keywords() to define keyword set 2.
HighlightedIdentifier = 14,
//! A decorator.
Decorator = 15,
//! A double-quoted f-string.
DoubleQuotedFString = 16,
//! A single-quoted f-string.
SingleQuotedFString = 17,
//! A triple single-quoted f-string.
TripleSingleQuotedFString = 18,
//! A triple double-quoted f-string.
TripleDoubleQuotedFString = 19,
};
//! This enum defines the different conditions that can cause
//! indentations to be displayed as being bad.
enum IndentationWarning {
//! Bad indentation is not displayed differently.
NoWarning = 0,
//! The indentation is inconsistent when compared to the
//! previous line, ie. it is made up of a different combination
//! of tabs and/or spaces.
Inconsistent = 1,
//! The indentation is made up of spaces followed by tabs.
TabsAfterSpaces = 2,
//! The indentation contains spaces.
Spaces = 3,
//! The indentation contains tabs.
Tabs = 4
};
//! Construct a QsciLexerPython with parent \a parent. \a parent is
//! typically the QsciScintilla instance.
QsciLexerPython(QObject *parent = 0);
//! Destroys the QsciLexerPython instance.
virtual ~QsciLexerPython();
//! Returns the name of the language.
const char *language() const;
//! Returns the name of the lexer. Some lexers support a number of
//! languages.
const char *lexer() const;
//! \internal Returns the character sequences that can separate
//! auto-completion words.
QStringList autoCompletionWordSeparators() const;
//! \internal Returns the number of lines prior to the current one when
//! determining the scope of a block when auto-indenting.
int blockLookback() const;
//! \internal Returns a space separated list of words or characters in
//! a particular style that define the start of a block for
//! auto-indentation. The styles is returned via \a style.
const char *blockStart(int *style = 0) const;
//! \internal Returns the style used for braces for brace matching.
int braceStyle() const;
//! Returns the foreground colour of the text for style number \a style.
//!
//! \sa defaultPaper()
QColor defaultColor(int style) const;
//! Returns the end-of-line fill for style number \a style.
bool defaultEolFill(int style) const;
//! Returns the font for style number \a style.
QFont defaultFont(int style) const;
//! Returns the background colour of the text for style number \a style.
//!
//! \sa defaultColor()
QColor defaultPaper(int style) const;
//! \internal Returns the view used for indentation guides.
virtual int indentationGuideView() const;
//! Returns the set of keywords for the keyword set \a set recognised
//! by the lexer as a space separated string.
const char *keywords(int set) const;
//! Returns the descriptive name for style number \a style. If the
//! style is invalid for this language then an empty QString is returned.
//! This is intended to be used in user preference dialogs.
QString description(int style) const;
//! Causes all properties to be refreshed by emitting the
//! propertyChanged() signal as required.
void refreshProperties();
//! Returns true if indented comment blocks can be folded.
//!
//! \sa setFoldComments()
bool foldComments() const {return fold_comments;}
//! If \a fold is true then trailing blank lines are included in a fold
//! block. The default is true.
//!
//! \sa foldCompact()
void setFoldCompact(bool fold);
//! Returns true if trailing blank lines are included in a fold block.
//!
//! \sa setFoldCompact()
bool foldCompact() const {return fold_compact;}
//! Returns true if triple quoted strings can be folded.
//!
//! \sa setFoldQuotes()
bool foldQuotes() const {return fold_quotes;}
//! Returns the condition that will cause bad indentations to be
//! displayed.
//!
//! \sa setIndentationWarning()
QsciLexerPython::IndentationWarning indentationWarning() const {return indent_warn;}
//! If \a enabled is true then sub-identifiers defined in keyword set 2
//! will be highlighted. For example, if it is false and "open" is defined
//! in keyword set 2 then "foo.open" will not be highlighted. The default
//! is true.
//!
//! \sa highlightSubidentifiers()
void setHighlightSubidentifiers(bool enabled);
//! Returns true if string literals are allowed to span newline characters.
//!
//! \sa setHighlightSubidentifiers()
bool highlightSubidentifiers() const {return highlight_subids;}
//! If \a allowed is true then string literals are allowed to span newline
//! characters. The default is false.
//!
//! \sa stringsOverNewlineAllowed()
void setStringsOverNewlineAllowed(bool allowed);
//! Returns true if string literals are allowed to span newline characters.
//!
//! \sa setStringsOverNewlineAllowed()
bool stringsOverNewlineAllowed() const {return strings_over_newline;}
//! If \a allowed is true then Python v2 unicode string literals (e.g.
//! u"utf8") are allowed. The default is true.
//!
//! \sa v2UnicodeAllowed()
void setV2UnicodeAllowed(bool allowed);
//! Returns true if Python v2 unicode string literals (e.g. u"utf8") are
//! allowed.
//!
//! \sa setV2UnicodeAllowed()
bool v2UnicodeAllowed() const {return v2_unicode;}
//! If \a allowed is true then Python v3 binary and octal literals (e.g.
//! 0b1011, 0o712) are allowed. The default is true.
//!
//! \sa v3BinaryOctalAllowed()
void setV3BinaryOctalAllowed(bool allowed);
//! Returns true if Python v3 binary and octal literals (e.g. 0b1011,
//! 0o712) are allowed.
//!
//! \sa setV3BinaryOctalAllowed()
bool v3BinaryOctalAllowed() const {return v3_binary_octal;}
//! If \a allowed is true then Python v3 bytes string literals (e.g.
//! b"bytes") are allowed. The default is true.
//!
//! \sa v3BytesAllowed()
void setV3BytesAllowed(bool allowed);
//! Returns true if Python v3 bytes string literals (e.g. b"bytes") are
//! allowed.
//!
//! \sa setV3BytesAllowed()
bool v3BytesAllowed() const {return v3_bytes;}
public slots:
//! If \a fold is true then indented comment blocks can be folded. The
//! default is false.
//!
//! \sa foldComments()
virtual void setFoldComments(bool fold);
//! If \a fold is true then triple quoted strings can be folded. The
//! default is false.
//!
//! \sa foldQuotes()
virtual void setFoldQuotes(bool fold);
//! Sets the condition that will cause bad indentations to be
//! displayed.
//!
//! \sa indentationWarning()
virtual void setIndentationWarning(QsciLexerPython::IndentationWarning warn);
protected:
//! The lexer's properties are read from the settings \a qs. \a prefix
//! (which has a trailing '/') should be used as a prefix to the key of
//! each setting. true is returned if there is no error.
//!
bool readProperties(QSettings &qs,const QString &prefix);
//! The lexer's properties are written to the settings \a qs.
//! \a prefix (which has a trailing '/') should be used as a prefix to
//! the key of each setting. true is returned if there is no error.
//!
bool writeProperties(QSettings &qs,const QString &prefix) const;
private:
void setCommentProp();
void setCompactProp();
void setQuotesProp();
void setTabWhingeProp();
void setStringsOverNewlineProp();
void setV2UnicodeProp();
void setV3BinaryOctalProp();
void setV3BytesProp();
void setHighlightSubidsProp();
bool fold_comments;
bool fold_compact;
bool fold_quotes;
IndentationWarning indent_warn;
bool strings_over_newline;
bool v2_unicode;
bool v3_binary_octal;
bool v3_bytes;
bool highlight_subids;
friend class QsciLexerHTML;
static const char *keywordClass;
QsciLexerPython(const QsciLexerPython &);
QsciLexerPython &operator=(const QsciLexerPython &);
};
#endif

View File

@@ -0,0 +1,240 @@
// This defines the interface to the QsciLexerRuby class.
//
// Copyright (c) 2023 Riverbank Computing Limited <info@riverbankcomputing.com>
//
// This file is part of QScintilla.
//
// This file may be used under the terms of the GNU General Public License
// version 3.0 as published by the Free Software Foundation and appearing in
// the file LICENSE included in the packaging of this file. Please review the
// following information to ensure the GNU General Public License version 3.0
// requirements will be met: http://www.gnu.org/copyleft/gpl.html.
//
// If you do not wish to use this file under the terms of the GPL version 3.0
// then you may purchase a commercial license. For more information contact
// info@riverbankcomputing.com.
//
// 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 QSCILEXERRUBY_H
#define QSCILEXERRUBY_H
#include <QObject>
#include <Qsci/qsciglobal.h>
#include <Qsci/qscilexer.h>
//! \brief The QsciLexerRuby class encapsulates the Scintilla Ruby lexer.
class QSCINTILLA_EXPORT QsciLexerRuby : public QsciLexer
{
Q_OBJECT
public:
//! This enum defines the meanings of the different styles used by the
//! Ruby lexer.
enum {
//! The default.
Default = 0,
//! An error.
Error = 1,
//! A comment.
Comment = 2,
//! A POD.
POD = 3,
//! A number.
Number = 4,
//! A keyword.
Keyword = 5,
//! A double-quoted string.
DoubleQuotedString = 6,
//! A single-quoted string.
SingleQuotedString = 7,
//! The name of a class.
ClassName = 8,
//! The name of a function or method.
FunctionMethodName = 9,
//! An operator.
Operator = 10,
//! An identifier
Identifier = 11,
//! A regular expression.
Regex = 12,
//! A global.
Global = 13,
//! A symbol.
Symbol = 14,
//! The name of a module.
ModuleName = 15,
//! An instance variable.
InstanceVariable = 16,
//! A class variable.
ClassVariable = 17,
//! Backticks.
Backticks = 18,
//! A data section.
DataSection = 19,
//! A here document delimiter.
HereDocumentDelimiter = 20,
//! A here document.
HereDocument = 21,
//! A %q string.
PercentStringq = 24,
//! A %Q string.
PercentStringQ = 25,
//! A %x string.
PercentStringx = 26,
//! A %r string.
PercentStringr = 27,
//! A %w string.
PercentStringw = 28,
//! A demoted keyword.
DemotedKeyword = 29,
//! stdin.
Stdin = 30,
//! stdout.
Stdout = 31,
//! stderr.
Stderr = 40
};
//! Construct a QsciLexerRuby with parent \a parent. \a parent is
//! typically the QsciScintilla instance.
QsciLexerRuby(QObject *parent = 0);
//! Destroys the QsciLexerRuby instance.
virtual ~QsciLexerRuby();
//! Returns the name of the language.
const char *language() const;
//! Returns the name of the lexer. Some lexers support a number of
//! languages.
const char *lexer() const;
//! \internal Returns a space separated list of words or characters in
//! a particular style that define the end of a block for
//! auto-indentation. The style is returned via \a style.
const char *blockEnd(int *style = 0) const;
//! \internal Returns a space separated list of words or characters in
//! a particular style that define the start of a block for
//! auto-indentation. The styles is returned via \a style.
const char *blockStart(int *style = 0) const;
//! \internal Returns a space separated list of keywords in a
//! particular style that define the start of a block for
//! auto-indentation. The style is returned via \a style.
const char *blockStartKeyword(int *style = 0) const;
//! \internal Returns the style used for braces for brace matching.
int braceStyle() const;
//! Returns the foreground colour of the text for style number \a style.
//!
//! \sa defaultpaper()
QColor defaultColor(int style) const;
//! Returns the end-of-line fill for style number \a style.
bool defaultEolFill(int style) const;
//! Returns the font for style number \a style.
QFont defaultFont(int style) const;
//! Returns the background colour of the text for style number \a style.
//!
//! \sa defaultColor()
QColor defaultPaper(int style) const;
//! Returns the set of keywords for the keyword set \a set recognised
//! by the lexer as a space separated string.
const char *keywords(int set) const;
//! Returns the descriptive name for style number \a style. If the style
//! is invalid for this language then an empty QString is returned. This
//! is intended to be used in user preference dialogs.
QString description(int style) const;
//! Causes all properties to be refreshed by emitting the
//! propertyChanged() signal as required.
void refreshProperties();
//! If \a fold is true then multi-line comment blocks can be folded.
//! The default is false.
//!
//! \sa foldComments()
void setFoldComments(bool fold);
//! Returns true if multi-line comment blocks can be folded.
//!
//! \sa setFoldComments()
bool foldComments() const {return fold_comments;}
//! If \a fold is true then trailing blank lines are included in a fold
//! block. The default is true.
//!
//! \sa foldCompact()
void setFoldCompact(bool fold);
//! Returns true if trailing blank lines are included in a fold block.
//!
//! \sa setFoldCompact()
bool foldCompact() const {return fold_compact;}
protected:
//! The lexer's properties are read from the settings \a qs. \a prefix
//! (which has a trailing '/') should be used as a prefix to the key of
//! each setting. true is returned if there is no error.
//!
bool readProperties(QSettings &qs, const QString &prefix);
//! The lexer's properties are written to the settings \a qs.
//! \a prefix (which has a trailing '/') should be used as a prefix to
//! the key of each setting. true is returned if there is no error.
//!
bool writeProperties(QSettings &qs, const QString &prefix) const;
private:
void setCommentProp();
void setCompactProp();
bool fold_comments;
bool fold_compact;
QsciLexerRuby(const QsciLexerRuby &);
QsciLexerRuby &operator=(const QsciLexerRuby &);
};
#endif

View File

@@ -0,0 +1,106 @@
// This defines the interface to the QsciLexerSpice class.
//
// Copyright (c) 2023 Riverbank Computing Limited <info@riverbankcomputing.com>
//
// This file is part of QScintilla.
//
// This file may be used under the terms of the GNU General Public License
// version 3.0 as published by the Free Software Foundation and appearing in
// the file LICENSE included in the packaging of this file. Please review the
// following information to ensure the GNU General Public License version 3.0
// requirements will be met: http://www.gnu.org/copyleft/gpl.html.
//
// If you do not wish to use this file under the terms of the GPL version 3.0
// then you may purchase a commercial license. For more information contact
// info@riverbankcomputing.com.
//
// 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 QSCILEXERSPICE_H
#define QSCILEXERSPICE_H
#include <QObject>
#include <Qsci/qsciglobal.h>
#include <Qsci/qscilexer.h>
//! \brief The QsciLexerSpice class encapsulates the Scintilla Spice lexer.
class QSCINTILLA_EXPORT QsciLexerSpice : public QsciLexer
{
Q_OBJECT
public:
//! This enum defines the meanings of the different styles used by the
//! Spice lexer.
enum {
//! The default.
Default = 0,
//! An identifier.
Identifier = 1,
//! A command.
Command = 2,
//! A function.
Function = 3,
//! A parameter.
Parameter = 4,
//! A number.
Number = 5,
//! A delimiter.
Delimiter = 6,
//! A value.
Value = 7,
//! A comment.
Comment = 8
};
//! Construct a QsciLexerSpice with parent \a parent. \a parent is
//! typically the QsciScintilla instance.
QsciLexerSpice(QObject *parent = 0);
//! Destroys the QsciLexerSpice instance.
virtual ~QsciLexerSpice();
//! Returns the name of the language.
const char *language() const;
//! Returns the name of the lexer. Some lexers support a number of
//! languages.
const char *lexer() const;
//! \internal Returns the style used for braces for brace matching.
int braceStyle() const;
//! Returns the set of keywords for the keyword set \a set recognised
//! by the lexer as a space separated string.
const char *keywords(int set) const;
//! Returns the foreground colour of the text for style number \a style.
//!
//! \sa defaultPaper()
QColor defaultColor(int style) const;
//! Returns the font for style number \a style.
QFont defaultFont(int style) const;
//! Returns the descriptive name for style number \a style. If the
//! style is invalid for this language then an empty QString is returned.
//! This is intended to be used in user preference dialogs.
QString description(int style) const;
private:
QsciLexerSpice(const QsciLexerSpice &);
QsciLexerSpice &operator=(const QsciLexerSpice &);
};
#endif

View File

@@ -0,0 +1,286 @@
// This defines the interface to the QsciLexerSQL class.
//
// Copyright (c) 2023 Riverbank Computing Limited <info@riverbankcomputing.com>
//
// This file is part of QScintilla.
//
// This file may be used under the terms of the GNU General Public License
// version 3.0 as published by the Free Software Foundation and appearing in
// the file LICENSE included in the packaging of this file. Please review the
// following information to ensure the GNU General Public License version 3.0
// requirements will be met: http://www.gnu.org/copyleft/gpl.html.
//
// If you do not wish to use this file under the terms of the GPL version 3.0
// then you may purchase a commercial license. For more information contact
// info@riverbankcomputing.com.
//
// 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 QSCILEXERSQL_H
#define QSCILEXERSQL_H
#include <QObject>
#include <Qsci/qsciglobal.h>
#include <Qsci/qscilexer.h>
//! \brief The QsciLexerSQL class encapsulates the Scintilla SQL lexer.
class QSCINTILLA_EXPORT QsciLexerSQL : public QsciLexer
{
Q_OBJECT
public:
//! This enum defines the meanings of the different styles used by the
//! SQL lexer.
enum {
//! The default.
Default = 0,
//! A comment.
Comment = 1,
//! A line comment.
CommentLine = 2,
//! A JavaDoc/Doxygen style comment.
CommentDoc = 3,
//! A number.
Number = 4,
//! A keyword.
Keyword = 5,
//! A double-quoted string.
DoubleQuotedString = 6,
//! A single-quoted string.
SingleQuotedString = 7,
//! An SQL*Plus keyword.
PlusKeyword = 8,
//! An SQL*Plus prompt.
PlusPrompt = 9,
//! An operator.
Operator = 10,
//! An identifier
Identifier = 11,
//! An SQL*Plus comment.
PlusComment = 13,
//! A '#' line comment.
CommentLineHash = 15,
//! A JavaDoc/Doxygen keyword.
CommentDocKeyword = 17,
//! A JavaDoc/Doxygen keyword error.
CommentDocKeywordError = 18,
//! A keyword defined in keyword set number 5. The class must be
//! sub-classed and re-implement keywords() to make use of this style.
//! Note that keywords must be defined using lower case.
KeywordSet5 = 19,
//! A keyword defined in keyword set number 6. The class must be
//! sub-classed and re-implement keywords() to make use of this style.
//! Note that keywords must be defined using lower case.
KeywordSet6 = 20,
//! A keyword defined in keyword set number 7. The class must be
//! sub-classed and re-implement keywords() to make use of this style.
//! Note that keywords must be defined using lower case.
KeywordSet7 = 21,
//! A keyword defined in keyword set number 8. The class must be
//! sub-classed and re-implement keywords() to make use of this style.
//! Note that keywords must be defined using lower case.
KeywordSet8 = 22,
//! A quoted identifier.
QuotedIdentifier = 23,
//! A quoted operator.
QuotedOperator = 24,
};
//! Construct a QsciLexerSQL with parent \a parent. \a parent is typically
//! the QsciScintilla instance.
QsciLexerSQL(QObject *parent = 0);
//! Destroys the QsciLexerSQL instance.
virtual ~QsciLexerSQL();
//! Returns the name of the language.
const char *language() const;
//! Returns the name of the lexer. Some lexers support a number of
//! languages.
const char *lexer() const;
//! \internal Returns the style used for braces for brace matching.
int braceStyle() const;
//! Returns the foreground colour of the text for style number \a style.
//!
//! \sa defaultPaper()
QColor defaultColor(int style) const;
//! Returns the end-of-line fill for style number \a style.
bool defaultEolFill(int style) const;
//! Returns the font for style number \a style.
QFont defaultFont(int style) const;
//! Returns the background colour of the text for style number \a style.
//!
//! \sa defaultColor()
QColor defaultPaper(int style) const;
//! Returns the set of keywords for the keyword set \a set recognised by
//! the lexer as a space separated string.
const char *keywords(int set) const;
//! Returns the descriptive name for style number \a style. If the style
//! is invalid for this language then an empty QString is returned. This
//! is intended to be used in user preference dialogs.
QString description(int style) const;
//! Causes all properties to be refreshed by emitting the
//! propertyChanged() signal as required.
void refreshProperties();
//! Returns true if backslash escapes are enabled.
//!
//! \sa setBackslashEscapes()
bool backslashEscapes() const {return backslash_escapes;}
//! If \a enable is true then words may contain dots (i.e. periods or full
//! stops). The default is false.
//!
//! \sa dottedWords()
void setDottedWords(bool enable);
//! Returns true if words may contain dots (i.e. periods or full stops).
//!
//! \sa setDottedWords()
bool dottedWords() const {return allow_dotted_word;}
//! If \a fold is true then ELSE blocks can be folded. The default is
//! false.
//!
//! \sa foldAtElse()
void setFoldAtElse(bool fold);
//! Returns true if ELSE blocks can be folded.
//!
//! \sa setFoldAtElse()
bool foldAtElse() const {return at_else;}
//! Returns true if multi-line comment blocks can be folded.
//!
//! \sa setFoldComments()
bool foldComments() const {return fold_comments;}
//! Returns true if trailing blank lines are included in a fold block.
//!
//! \sa setFoldCompact()
bool foldCompact() const {return fold_compact;}
//! If \a fold is true then only BEGIN blocks can be folded. The default
//! is false.
//!
//! \sa foldOnlyBegin()
void setFoldOnlyBegin(bool fold);
//! Returns true if BEGIN blocks only can be folded.
//!
//! \sa setFoldOnlyBegin()
bool foldOnlyBegin() const {return only_begin;}
//! If \a enable is true then '#' is used as a comment character. It is
//! typically enabled for MySQL and disabled for Oracle. The default is
//! false.
//!
//! \sa hashComments()
void setHashComments(bool enable);
//! Returns true if '#' is used as a comment character.
//!
//! \sa setHashComments()
bool hashComments() const {return numbersign_comment;}
//! If \a enable is true then quoted identifiers are enabled. The default
//! is false.
//!
//! \sa quotedIdentifiers()
void setQuotedIdentifiers(bool enable);
//! Returns true if quoted identifiers are enabled.
//!
//! \sa setQuotedIdentifiers()
bool quotedIdentifiers() const {return backticks_identifier;}
public slots:
//! If \a enable is true then backslash escapes are enabled. The
//! default is false.
//!
//! \sa backslashEscapes()
virtual void setBackslashEscapes(bool enable);
//! If \a fold is true then multi-line comment blocks can be folded. The
//! default is false.
//!
//! \sa foldComments()
virtual void setFoldComments(bool fold);
//! If \a fold is true then trailing blank lines are included in a fold
//! block. The default is true.
//!
//! \sa foldCompact()
virtual void setFoldCompact(bool fold);
protected:
//! The lexer's properties are read from the settings \a qs. \a prefix
//! (which has a trailing '/') should be used as a prefix to the key of
//! each setting. true is returned if there is no error.
//!
bool readProperties(QSettings &qs, const QString &prefix);
//! The lexer's properties are written to the settings \a qs.
//! \a prefix (which has a trailing '/') should be used as a prefix to
//! the key of each setting. true is returned if there is no error.
//!
bool writeProperties(QSettings &qs, const QString &prefix) const;
private:
void setAtElseProp();
void setCommentProp();
void setCompactProp();
void setOnlyBeginProp();
void setBackticksIdentifierProp();
void setNumbersignCommentProp();
void setBackslashEscapesProp();
void setAllowDottedWordProp();
bool at_else;
bool fold_comments;
bool fold_compact;
bool only_begin;
bool backticks_identifier;
bool numbersign_comment;
bool backslash_escapes;
bool allow_dotted_word;
QsciLexerSQL(const QsciLexerSQL &);
QsciLexerSQL &operator=(const QsciLexerSQL &);
};
#endif

View File

@@ -0,0 +1,59 @@
// This defines the interface to the QsciLexerSRec class.
//
// Copyright (c) 2023 Riverbank Computing Limited <info@riverbankcomputing.com>
//
// This file is part of QScintilla.
//
// This file may be used under the terms of the GNU General Public License
// version 3.0 as published by the Free Software Foundation and appearing in
// the file LICENSE included in the packaging of this file. Please review the
// following information to ensure the GNU General Public License version 3.0
// requirements will be met: http://www.gnu.org/copyleft/gpl.html.
//
// If you do not wish to use this file under the terms of the GPL version 3.0
// then you may purchase a commercial license. For more information contact
// info@riverbankcomputing.com.
//
// 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 QSCILEXERSREC_H
#define QSCILEXERSREC_H
#include <QObject>
#include <Qsci/qsciglobal.h>
#include <Qsci/qscilexerhex.h>
//! \brief The QsciLexerSRec class encapsulates the Scintilla S-Record lexer.
class QSCINTILLA_EXPORT QsciLexerSRec : public QsciLexerHex
{
Q_OBJECT
public:
//! Construct a QsciLexerSRec with parent \a parent. \a parent is
//! typically the QsciScintilla instance.
QsciLexerSRec(QObject *parent = 0);
//! Destroys the QsciLexerSRec instance.
virtual ~QsciLexerSRec();
//! Returns the name of the language.
const char *language() const;
//! Returns the name of the lexer.
const char *lexer() const;
//! Returns the descriptive name for style number \a style. If the
//! style is invalid for this language then an empty QString is returned.
//! This is intended to be used in user preference dialogs.
QString description(int style) const;
private:
QsciLexerSRec(const QsciLexerSRec &);
QsciLexerSRec &operator=(const QsciLexerSRec &);
};
#endif

View File

@@ -0,0 +1,189 @@
// This defines the interface to the QsciLexerTCL class.
//
// Copyright (c) 2023 Riverbank Computing Limited <info@riverbankcomputing.com>
//
// This file is part of QScintilla.
//
// This file may be used under the terms of the GNU General Public License
// version 3.0 as published by the Free Software Foundation and appearing in
// the file LICENSE included in the packaging of this file. Please review the
// following information to ensure the GNU General Public License version 3.0
// requirements will be met: http://www.gnu.org/copyleft/gpl.html.
//
// If you do not wish to use this file under the terms of the GPL version 3.0
// then you may purchase a commercial license. For more information contact
// info@riverbankcomputing.com.
//
// 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 QSCILEXERTCL_H
#define QSCILEXERTCL_H
#include <QObject>
#include <Qsci/qsciglobal.h>
#include <Qsci/qscilexer.h>
//! \brief The QsciLexerTCL class encapsulates the Scintilla TCL lexer.
class QSCINTILLA_EXPORT QsciLexerTCL : public QsciLexer
{
Q_OBJECT
public:
//! This enum defines the meanings of the different styles used by the TCL
//! lexer.
enum {
//! The default.
Default = 0,
//! A comment.
Comment = 1,
//! A comment line.
CommentLine = 2,
//! A number.
Number = 3,
//! A quoted keyword.
QuotedKeyword = 4,
//! A quoted string.
QuotedString = 5,
//! An operator.
Operator = 6,
//! An identifier
Identifier = 7,
//! A substitution.
Substitution = 8,
//! A substitution starting with a brace.
SubstitutionBrace = 9,
//! A modifier.
Modifier = 10,
//! Expand keyword (defined in keyword set number 5).
ExpandKeyword = 11,
//! A TCL keyword (defined in keyword set number 1).
TCLKeyword = 12,
//! A Tk keyword (defined in keyword set number 2).
TkKeyword = 13,
//! An iTCL keyword (defined in keyword set number 3).
ITCLKeyword = 14,
//! A Tk command (defined in keyword set number 4).
TkCommand = 15,
//! A keyword defined in keyword set number 6. The class must be
//! sub-classed and re-implement keywords() to make use of this style.
KeywordSet6 = 16,
//! A keyword defined in keyword set number 7. The class must be
//! sub-classed and re-implement keywords() to make use of this style.
KeywordSet7 = 17,
//! A keyword defined in keyword set number 8. The class must be
//! sub-classed and re-implement keywords() to make use of this style.
KeywordSet8 = 18,
//! A keyword defined in keyword set number 9. The class must be
//! sub-classed and re-implement keywords() to make use of this style.
KeywordSet9 = 19,
//! A comment box.
CommentBox = 20,
//! A comment block.
CommentBlock = 21
};
//! Construct a QsciLexerTCL with parent \a parent. \a parent is
//! typically the QsciScintilla instance.
QsciLexerTCL(QObject *parent = 0);
//! Destroys the QsciLexerTCL instance.
virtual ~QsciLexerTCL();
//! Returns the name of the language.
const char *language() const;
//! Returns the name of the lexer. Some lexers support a number of
//! languages.
const char *lexer() const;
//! \internal Returns the style used for braces for brace matching.
int braceStyle() const;
//! Returns the foreground colour of the text for style number \a style.
//!
//! \sa defaultPaper()
QColor defaultColor(int style) const;
//! Returns the end-of-line fill for style number \a style.
bool defaultEolFill(int style) const;
//! Returns the font for style number \a style.
QFont defaultFont(int style) const;
//! Returns the background colour of the text for style number \a style.
//!
//! \sa defaultColor()
QColor defaultPaper(int style) const;
//! Returns the set of keywords for the keyword set \a set recognised
//! by the lexer as a space separated string.
const char *keywords(int set) const;
//! Returns the descriptive name for style number \a style. If the style
//! is invalid for this language then an empty QString is returned. This
//! is intended to be used in user preference dialogs.
QString description(int style) const;
//! Causes all properties to be refreshed by emitting the
//! propertyChanged() signal as required.
void refreshProperties();
//! If \a fold is true then multi-line comment blocks can be folded. The
//! default is false.
//!
//! \sa foldComments()
void setFoldComments(bool fold);
//! Returns true if multi-line comment blocks can be folded.
//!
//! \sa setFoldComments()
bool foldComments() const {return fold_comments;}
protected:
//! The lexer's properties are read from the settings \a qs. \a prefix
//! (which has a trailing '/') should be used as a prefix to the key of
//! each setting. true is returned if there is no error.
//!
bool readProperties(QSettings &qs,const QString &prefix);
//! The lexer's properties are written to the settings \a qs.
//! \a prefix (which has a trailing '/') should be used as a prefix to
//! the key of each setting. true is returned if there is no error.
//!
bool writeProperties(QSettings &qs,const QString &prefix) const;
private:
void setCommentProp();
bool fold_comments;
QsciLexerTCL(const QsciLexerTCL &);
QsciLexerTCL &operator=(const QsciLexerTCL &);
};
#endif

View File

@@ -0,0 +1,60 @@
// This defines the interface to the QsciLexerTekHex class.
//
// Copyright (c) 2023 Riverbank Computing Limited <info@riverbankcomputing.com>
//
// This file is part of QScintilla.
//
// This file may be used under the terms of the GNU General Public License
// version 3.0 as published by the Free Software Foundation and appearing in
// the file LICENSE included in the packaging of this file. Please review the
// following information to ensure the GNU General Public License version 3.0
// requirements will be met: http://www.gnu.org/copyleft/gpl.html.
//
// If you do not wish to use this file under the terms of the GPL version 3.0
// then you may purchase a commercial license. For more information contact
// info@riverbankcomputing.com.
//
// 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 QSCILEXERTEKHEX_H
#define QSCILEXERTEKHEX_H
#include <QObject>
#include <Qsci/qsciglobal.h>
#include <Qsci/qscilexerhex.h>
//! \brief The QsciLexerTekHex class encapsulates the Scintilla Tektronix Hex
//! lexer.
class QSCINTILLA_EXPORT QsciLexerTekHex : public QsciLexerHex
{
Q_OBJECT
public:
//! Construct a QsciLexerTekHex with parent \a parent. \a parent is
//! typically the QsciScintilla instance.
QsciLexerTekHex(QObject *parent = 0);
//! Destroys the QsciLexerTekHex instance.
virtual ~QsciLexerTekHex();
//! Returns the name of the language.
const char *language() const;
//! Returns the name of the lexer.
const char *lexer() const;
//! Returns the descriptive name for style number \a style. If the
//! style is invalid for this language then an empty QString is returned.
//! This is intended to be used in user preference dialogs.
QString description(int style) const;
private:
QsciLexerTekHex(const QsciLexerTekHex &);
QsciLexerTekHex &operator=(const QsciLexerTekHex &);
};
#endif

View File

@@ -0,0 +1,163 @@
// This defines the interface to the QsciLexerTeX class.
//
// Copyright (c) 2023 Riverbank Computing Limited <info@riverbankcomputing.com>
//
// This file is part of QScintilla.
//
// This file may be used under the terms of the GNU General Public License
// version 3.0 as published by the Free Software Foundation and appearing in
// the file LICENSE included in the packaging of this file. Please review the
// following information to ensure the GNU General Public License version 3.0
// requirements will be met: http://www.gnu.org/copyleft/gpl.html.
//
// If you do not wish to use this file under the terms of the GPL version 3.0
// then you may purchase a commercial license. For more information contact
// info@riverbankcomputing.com.
//
// 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 QSCILEXERTEX_H
#define QSCILEXERTEX_H
#include <QObject>
#include <Qsci/qsciglobal.h>
#include <Qsci/qscilexer.h>
//! \brief The QsciLexerTeX class encapsulates the Scintilla TeX lexer.
class QSCINTILLA_EXPORT QsciLexerTeX : public QsciLexer
{
Q_OBJECT
public:
//! This enum defines the meanings of the different styles used by the
//! TeX lexer.
enum {
//! The default.
Default = 0,
//! A special.
Special = 1,
//! A group.
Group = 2,
//! A symbol.
Symbol = 3,
//! A command.
Command = 4,
//! Text.
Text = 5
};
//! Construct a QsciLexerTeX with parent \a parent. \a parent is typically
//! the QsciScintilla instance.
QsciLexerTeX(QObject *parent = 0);
//! Destroys the QsciLexerTeX instance.
virtual ~QsciLexerTeX();
//! Returns the name of the language.
const char *language() const;
//! Returns the name of the lexer. Some lexers support a number of
//! languages.
const char *lexer() const;
//! Returns the string of characters that comprise a word.
const char *wordCharacters() const;
//! Returns the foreground colour of the text for style number \a style.
QColor defaultColor(int style) const;
//! Returns the set of keywords for the keyword set \a set recognised
//! by the lexer as a space separated string.
const char *keywords(int set) const;
//! Returns the descriptive name for style number \a style. If the
//! style is invalid for this language then an empty QString is returned.
//! This is intended to be used in user preference dialogs.
QString description(int style) const;
//! Causes all properties to be refreshed by emitting the
//! propertyChanged() signal as required.
void refreshProperties();
//! If \a fold is true then multi-line comment blocks can be folded. The
//! default is false.
//!
//! \sa foldComments()
void setFoldComments(bool fold);
//! Returns true if multi-line comment blocks can be folded.
//!
//! \sa setFoldComments()
bool foldComments() const {return fold_comments;}
//! If \a fold is true then trailing blank lines are included in a fold
//! block. The default is true.
//!
//! \sa foldCompact()
void setFoldCompact(bool fold);
//! Returns true if trailing blank lines are included in a fold block.
//!
//! \sa setFoldCompact()
bool foldCompact() const {return fold_compact;}
//! If \a enable is true then comments are processed as TeX source
//! otherwise they are ignored. The default is false.
//!
//! \sa processComments()
void setProcessComments(bool enable);
//! Returns true if comments are processed as TeX source.
//!
//! \sa setProcessComments()
bool processComments() const {return process_comments;}
//! If \a enable is true then \\if<unknown> processed is processed as a
//! command. The default is true.
//!
//! \sa processIf()
void setProcessIf(bool enable);
//! Returns true if \\if<unknown> is processed as a command.
//!
//! \sa setProcessIf()
bool processIf() const {return process_if;}
protected:
//! The lexer's properties are read from the settings \a qs. \a prefix
//! (which has a trailing '/') should be used as a prefix to the key of
//! each setting. true is returned if there is no error.
//!
bool readProperties(QSettings &qs, const QString &prefix);
//! The lexer's properties are written to the settings \a qs.
//! \a prefix (which has a trailing '/') should be used as a prefix to
//! the key of each setting. true is returned if there is no error.
//!
bool writeProperties(QSettings &qs, const QString &prefix) const;
private:
void setCommentProp();
void setCompactProp();
void setProcessCommentsProp();
void setAutoIfProp();
bool fold_comments;
bool fold_compact;
bool process_comments;
bool process_if;
QsciLexerTeX(const QsciLexerTeX &);
QsciLexerTeX &operator=(const QsciLexerTeX &);
};
#endif

View File

@@ -0,0 +1,257 @@
// This defines the interface to the QsciLexerVerilog class.
//
// Copyright (c) 2023 Riverbank Computing Limited <info@riverbankcomputing.com>
//
// This file is part of QScintilla.
//
// This file may be used under the terms of the GNU General Public License
// version 3.0 as published by the Free Software Foundation and appearing in
// the file LICENSE included in the packaging of this file. Please review the
// following information to ensure the GNU General Public License version 3.0
// requirements will be met: http://www.gnu.org/copyleft/gpl.html.
//
// If you do not wish to use this file under the terms of the GPL version 3.0
// then you may purchase a commercial license. For more information contact
// info@riverbankcomputing.com.
//
// 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 QSCILEXERVERILOG_H
#define QSCILEXERVERILOG_H
#include <QObject>
#include <Qsci/qsciglobal.h>
#include <Qsci/qscilexer.h>
//! \brief The QsciLexerVerilog class encapsulates the Scintilla Verilog
//! lexer.
class QSCINTILLA_EXPORT QsciLexerVerilog : public QsciLexer
{
Q_OBJECT
public:
//! This enum defines the meanings of the different styles used by the
//! Verilog lexer.
enum {
//! The default.
Default = 0,
InactiveDefault = Default + 64,
//! A comment.
Comment = 1,
InactiveComment = Comment + 64,
//! A line comment.
CommentLine = 2,
InactiveCommentLine = CommentLine + 64,
//! A bang comment.
CommentBang = 3,
InactiveCommentBang = CommentBang + 64,
//! A number
Number = 4,
InactiveNumber = Number + 64,
//! A keyword.
Keyword = 5,
InactiveKeyword = Keyword + 64,
//! A string.
String = 6,
InactiveString = String + 64,
//! A keyword defined in keyword set number 2. The class must
//! be sub-classed and re-implement keywords() to make use of
//! this style.
KeywordSet2 = 7,
InactiveKeywordSet2 = KeywordSet2 + 64,
//! A system task.
SystemTask = 8,
InactiveSystemTask = SystemTask + 64,
//! A pre-processor block.
Preprocessor = 9,
InactivePreprocessor = Preprocessor + 64,
//! An operator.
Operator = 10,
InactiveOperator = Operator + 64,
//! An identifier.
Identifier = 11,
InactiveIdentifier = Identifier + 64,
//! The end of a line where a string is not closed.
UnclosedString = 12,
InactiveUnclosedString = UnclosedString + 64,
//! A keyword defined in keyword set number 4. The class must
//! be sub-classed and re-implement keywords() to make use of
//! this style. This set is intended to be used for user defined
//! identifiers and tasks.
UserKeywordSet = 19,
InactiveUserKeywordSet = UserKeywordSet + 64,
//! A keyword comment.
CommentKeyword = 20,
InactiveCommentKeyword = CommentKeyword + 64,
//! An input port declaration.
DeclareInputPort = 21,
InactiveDeclareInputPort = DeclareInputPort + 64,
//! An output port declaration.
DeclareOutputPort = 22,
InactiveDeclareOutputPort = DeclareOutputPort + 64,
//! An input/output port declaration.
DeclareInputOutputPort = 23,
InactiveDeclareInputOutputPort = DeclareInputOutputPort + 64,
//! A port connection.
PortConnection = 24,
InactivePortConnection = PortConnection + 64,
};
//! Construct a QsciLexerVerilog with parent \a parent. \a parent is
//! typically the QsciScintilla instance.
QsciLexerVerilog(QObject *parent = 0);
//! Destroys the QsciLexerVerilog instance.
virtual ~QsciLexerVerilog();
//! Returns the name of the language.
const char *language() const;
//! Returns the name of the lexer. Some lexers support a number of
//! languages.
const char *lexer() const;
//! \internal Returns the style used for braces for brace matching.
int braceStyle() const;
//! Returns the string of characters that comprise a word.
const char *wordCharacters() const;
//! Returns the foreground colour of the text for style number \a style.
//!
//! \sa defaultPaper()
QColor defaultColor(int style) const;
//! Returns the end-of-line fill for style number \a style.
bool defaultEolFill(int style) const;
//! Returns the font for style number \a style.
QFont defaultFont(int style) const;
//! Returns the background colour of the text for style number \a style.
//!
//! \sa defaultColor()
QColor defaultPaper(int style) const;
//! Returns the set of keywords for the keyword set \a set recognised
//! by the lexer as a space separated string.
const char *keywords(int set) const;
//! Returns the descriptive name for style number \a style. If the
//! style is invalid for this language then an empty QString is returned.
//! This is intended to be used in user preference dialogs.
QString description(int style) const;
//! Causes all properties to be refreshed by emitting the
//! propertyChanged() signal as required.
void refreshProperties();
//! If \a fold is true then "} else {" lines can be folded. The
//! default is false.
//!
//! \sa foldAtElse()
void setFoldAtElse(bool fold);
//! Returns true if "} else {" lines can be folded.
//!
//! \sa setFoldAtElse()
bool foldAtElse() const {return fold_atelse;}
//! If \a fold is true then multi-line comment blocks can be folded.
//! The default is false.
//!
//! \sa foldComments()
void setFoldComments(bool fold);
//! Returns true if multi-line comment blocks can be folded.
//!
//! \sa setFoldComments()
bool foldComments() const {return fold_comments;}
//! If \a fold is true then trailing blank lines are included in a fold
//! block. The default is true.
//!
//! \sa foldCompact()
void setFoldCompact(bool fold);
//! Returns true if trailing blank lines are included in a fold block.
//!
//! \sa setFoldCompact()
bool foldCompact() const {return fold_compact;};
//! If \a fold is true then preprocessor blocks can be folded. The
//! default is true.
//!
//! \sa foldPreprocessor()
void setFoldPreprocessor(bool fold);
//! Returns true if preprocessor blocks can be folded.
//!
//! \sa setFoldPreprocessor()
bool foldPreprocessor() const {return fold_preproc;};
//! If \a fold is true then modules can be folded. The default is false.
//!
//! \sa foldAtModule()
void setFoldAtModule(bool fold);
//! Returns true if modules can be folded.
//!
//! \sa setFoldAtModule()
bool foldAtModule() const {return fold_atmodule;};
protected:
//! The lexer's properties are read from the settings \a qs. \a prefix
//! (which has a trailing '/') should be used as a prefix to the key of
//! each setting. true is returned if there is no error.
//!
//! \sa writeProperties()
bool readProperties(QSettings &qs,const QString &prefix);
//! The lexer's properties are written to the settings \a qs.
//! \a prefix (which has a trailing '/') should be used as a prefix to
//! the key of each setting. true is returned if there is no error.
//!
//! \sa readProperties()
bool writeProperties(QSettings &qs,const QString &prefix) const;
private:
void setAtElseProp();
void setCommentProp();
void setCompactProp();
void setPreprocProp();
void setAtModuleProp();
bool fold_atelse;
bool fold_comments;
bool fold_compact;
bool fold_preproc;
bool fold_atmodule;
QsciLexerVerilog(const QsciLexerVerilog &);
QsciLexerVerilog &operator=(const QsciLexerVerilog &);
};
#endif

View File

@@ -0,0 +1,221 @@
// This defines the interface to the QsciLexerVHDL class.
//
// Copyright (c) 2023 Riverbank Computing Limited <info@riverbankcomputing.com>
//
// This file is part of QScintilla.
//
// This file may be used under the terms of the GNU General Public License
// version 3.0 as published by the Free Software Foundation and appearing in
// the file LICENSE included in the packaging of this file. Please review the
// following information to ensure the GNU General Public License version 3.0
// requirements will be met: http://www.gnu.org/copyleft/gpl.html.
//
// If you do not wish to use this file under the terms of the GPL version 3.0
// then you may purchase a commercial license. For more information contact
// info@riverbankcomputing.com.
//
// 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 QSCILEXERVHDL_H
#define QSCILEXERVHDL_H
#include <QObject>
#include <Qsci/qsciglobal.h>
#include <Qsci/qscilexer.h>
//! \brief The QsciLexerVHDL class encapsulates the Scintilla VHDL lexer.
class QSCINTILLA_EXPORT QsciLexerVHDL : public QsciLexer
{
Q_OBJECT
public:
//! This enum defines the meanings of the different styles used by the
//! VHDL lexer.
enum {
//! The default.
Default = 0,
//! A comment.
Comment = 1,
//! A comment line.
CommentLine = 2,
//! A number.
Number = 3,
//! A string.
String = 4,
//! An operator.
Operator = 5,
//! An identifier
Identifier = 6,
//! The end of a line where a string is not closed.
UnclosedString = 7,
//! A keyword.
Keyword = 8,
//! A standard operator.
StandardOperator = 9,
//! An attribute.
Attribute = 10,
//! A standard function.
StandardFunction = 11,
//! A standard package.
StandardPackage = 12,
//! A standard type.
StandardType = 13,
//! A keyword defined in keyword set number 7. The class must be
//! sub-classed and re-implement keywords() to make use of this style.
KeywordSet7 = 14,
//! A comment block.
CommentBlock = 15,
};
//! Construct a QsciLexerVHDL with parent \a parent. \a parent is
//! typically the QsciScintilla instance.
QsciLexerVHDL(QObject *parent = 0);
//! Destroys the QsciLexerVHDL instance.
virtual ~QsciLexerVHDL();
//! Returns the name of the language.
const char *language() const;
//! Returns the name of the lexer. Some lexers support a number of
//! languages.
const char *lexer() const;
//! \internal Returns the style used for braces for brace matching.
int braceStyle() const;
//! Returns the foreground colour of the text for style number \a style.
//!
//! \sa defaultPaper()
QColor defaultColor(int style) const;
//! Returns the end-of-line fill for style number \a style.
bool defaultEolFill(int style) const;
//! Returns the font for style number \a style.
QFont defaultFont(int style) const;
//! Returns the background colour of the text for style number \a style.
//!
//! \sa defaultColor()
QColor defaultPaper(int style) const;
//! Returns the set of keywords for the keyword set \a set recognised
//! by the lexer as a space separated string.
const char *keywords(int set) const;
//! Returns the descriptive name for style number \a style. If the
//! style is invalid for this language then an empty QString is returned.
//! This is intended to be used in user preference dialogs.
QString description(int style) const;
//! Causes all properties to be refreshed by emitting the propertyChanged()
//! signal as required.
void refreshProperties();
//! Returns true if multi-line comment blocks can be folded.
//!
//! \sa setFoldComments()
bool foldComments() const;
//! Returns true if trailing blank lines are included in a fold block.
//!
//! \sa setFoldCompact()
bool foldCompact() const;
//! Returns true if else blocks can be folded.
//!
//! \sa setFoldAtElse()
bool foldAtElse() const;
//! Returns true if begin blocks can be folded.
//!
//! \sa setFoldAtBegin()
bool foldAtBegin() const;
//! Returns true if blocks can be folded at a parenthesis.
//!
//! \sa setFoldAtParenthesis()
bool foldAtParenthesis() const;
public slots:
//! If \a fold is true then multi-line comment blocks can be folded.
//! The default is true.
//!
//! \sa foldComments()
virtual void setFoldComments(bool fold);
//! If \a fold is true then trailing blank lines are included in a fold
//! block. The default is true.
//!
//! \sa foldCompact()
virtual void setFoldCompact(bool fold);
//! If \a fold is true then else blocks can be folded. The default is
//! true.
//!
//! \sa foldAtElse()
virtual void setFoldAtElse(bool fold);
//! If \a fold is true then begin blocks can be folded. The default is
//! true.
//!
//! \sa foldAtBegin()
virtual void setFoldAtBegin(bool fold);
//! If \a fold is true then blocks can be folded at a parenthesis. The
//! default is true.
//!
//! \sa foldAtParenthesis()
virtual void setFoldAtParenthesis(bool fold);
protected:
//! The lexer's properties are read from the settings \a qs. \a prefix
//! (which has a trailing '/') should be used as a prefix to the key of
//! each setting. true is returned if there is no error.
//!
bool readProperties(QSettings &qs,const QString &prefix);
//! The lexer's properties are written to the settings \a qs.
//! \a prefix (which has a trailing '/') should be used as a prefix to
//! the key of each setting. true is returned if there is no error.
//!
bool writeProperties(QSettings &qs,const QString &prefix) const;
private:
void setCommentProp();
void setCompactProp();
void setAtElseProp();
void setAtBeginProp();
void setAtParenthProp();
bool fold_comments;
bool fold_compact;
bool fold_atelse;
bool fold_atbegin;
bool fold_atparenth;
QsciLexerVHDL(const QsciLexerVHDL &);
QsciLexerVHDL &operator=(const QsciLexerVHDL &);
};
#endif

View File

@@ -0,0 +1,106 @@
// This defines the interface to the QsciLexerXML class.
//
// Copyright (c) 2023 Riverbank Computing Limited <info@riverbankcomputing.com>
//
// This file is part of QScintilla.
//
// This file may be used under the terms of the GNU General Public License
// version 3.0 as published by the Free Software Foundation and appearing in
// the file LICENSE included in the packaging of this file. Please review the
// following information to ensure the GNU General Public License version 3.0
// requirements will be met: http://www.gnu.org/copyleft/gpl.html.
//
// If you do not wish to use this file under the terms of the GPL version 3.0
// then you may purchase a commercial license. For more information contact
// info@riverbankcomputing.com.
//
// 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 QSCILEXERXML_H
#define QSCILEXERXML_H
#include <QObject>
#include <Qsci/qsciglobal.h>
#include <Qsci/qscilexerhtml.h>
//! \brief The QsciLexerXML class encapsulates the Scintilla XML lexer.
class QSCINTILLA_EXPORT QsciLexerXML : public QsciLexerHTML
{
Q_OBJECT
public:
//! Construct a QsciLexerXML with parent \a parent. \a parent is typically
//! the QsciScintilla instance.
QsciLexerXML(QObject *parent = 0);
//! Destroys the QsciLexerXML instance.
virtual ~QsciLexerXML();
//! Returns the name of the language.
const char *language() const;
//! Returns the name of the lexer. Some lexers support a number of
//! languages.
const char *lexer() const;
//! Returns the foreground colour of the text for style number \a style.
//!
//! \sa defaultPaper()
QColor defaultColor(int style) const;
//! Returns the end-of-line fill for style number \a style.
bool defaultEolFill(int style) const;
//! Returns the font for style number \a style.
QFont defaultFont(int style) const;
//! Returns the background colour of the text for style number \a style.
//!
//! \sa defaultColor()
QColor defaultPaper(int style) const;
//! Returns the set of keywords for the keyword set \a set recognised
//! by the lexer as a space separated string.
const char *keywords(int set) const;
//! Causes all properties to be refreshed by emitting the
//! propertyChanged() signal as required.
void refreshProperties();
//! If \a allowed is true then scripts are styled. The default is true.
//!
//! \sa scriptsStyled()
void setScriptsStyled(bool styled);
//! Returns true if scripts are styled.
//!
//! \sa setScriptsStyled()
bool scriptsStyled() const;
protected:
//! The lexer's properties are read from the settings \a qs. \a prefix
//! (which has a trailing '/') should be used as a prefix to the key of
//! each setting. true is returned if there is no error.
//!
bool readProperties(QSettings &qs, const QString &prefix);
//! The lexer's properties are written to the settings \a qs.
//! \a prefix (which has a trailing '/') should be used as a prefix to
//! the key of each setting. true is returned if there is no error.
//!
bool writeProperties(QSettings &qs, const QString &prefix) const;
private:
void setScriptsProp();
bool scripts;
QsciLexerXML(const QsciLexerXML &);
QsciLexerXML &operator=(const QsciLexerXML &);
};
#endif

View File

@@ -0,0 +1,147 @@
// This defines the interface to the QsciLexerYAML class.
//
// Copyright (c) 2023 Riverbank Computing Limited <info@riverbankcomputing.com>
//
// This file is part of QScintilla.
//
// This file may be used under the terms of the GNU General Public License
// version 3.0 as published by the Free Software Foundation and appearing in
// the file LICENSE included in the packaging of this file. Please review the
// following information to ensure the GNU General Public License version 3.0
// requirements will be met: http://www.gnu.org/copyleft/gpl.html.
//
// If you do not wish to use this file under the terms of the GPL version 3.0
// then you may purchase a commercial license. For more information contact
// info@riverbankcomputing.com.
//
// 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 QSCILEXERYAML_H
#define QSCILEXERYAML_H
#include <QObject>
#include <Qsci/qsciglobal.h>
#include <Qsci/qscilexer.h>
//! \brief The QsciLexerYAML class encapsulates the Scintilla YAML lexer.
class QSCINTILLA_EXPORT QsciLexerYAML : public QsciLexer
{
Q_OBJECT
public:
//! This enum defines the meanings of the different styles used by the
//! YAML lexer.
enum {
//! The default.
Default = 0,
//! A comment.
Comment = 1,
//! An identifier.
Identifier = 2,
//! A keyword
Keyword = 3,
//! A number.
Number = 4,
//! A reference.
Reference = 5,
//! A document delimiter.
DocumentDelimiter = 6,
//! A text block marker.
TextBlockMarker = 7,
//! A syntax error marker.
SyntaxErrorMarker = 8,
//! An operator.
Operator = 9
};
//! Construct a QsciLexerYAML with parent \a parent. \a parent is
//! typically the QsciScintilla instance.
QsciLexerYAML(QObject *parent = 0);
//! Destroys the QsciLexerYAML instance.
virtual ~QsciLexerYAML();
//! Returns the name of the language.
const char *language() const;
//! Returns the name of the lexer. Some lexers support a number of
//! languages.
const char *lexer() const;
//! Returns the foreground colour of the text for style number \a style.
//!
//! \sa defaultPaper()
QColor defaultColor(int style) const;
//! Returns the end-of-line fill for style number \a style.
bool defaultEolFill(int style) const;
//! Returns the font for style number \a style.
QFont defaultFont(int style) const;
//! Returns the background colour of the text for style number \a style.
//!
//! \sa defaultColor()
QColor defaultPaper(int style) const;
//! Returns the set of keywords for the keyword set \a set recognised
//! by the lexer as a space separated string.
const char *keywords(int set) const;
//! Returns the descriptive name for style number \a style. If the
//! style is invalid for this language then an empty QString is returned.
//! This is intended to be used in user preference dialogs.
QString description(int style) const;
//! Causes all properties to be refreshed by emitting the propertyChanged()
//! signal as required.
void refreshProperties();
//! Returns true if multi-line comment blocks can be folded.
//!
//! \sa setFoldComments()
bool foldComments() const;
public slots:
//! If \a fold is true then multi-line comment blocks can be folded.
//! The default is false.
//!
//! \sa foldComments()
virtual void setFoldComments(bool fold);
protected:
//! The lexer's properties are read from the settings \a qs. \a prefix
//! (which has a trailing '/') should be used as a prefix to the key of
//! each setting. true is returned if there is no error.
//!
bool readProperties(QSettings &qs,const QString &prefix);
//! The lexer's properties are written to the settings \a qs.
//! \a prefix (which has a trailing '/') should be used as a prefix to
//! the key of each setting. true is returned if there is no error.
//!
bool writeProperties(QSettings &qs,const QString &prefix) const;
private:
void setCommentProp();
bool fold_comments;
QsciLexerYAML(const QsciLexerYAML &);
QsciLexerYAML &operator=(const QsciLexerYAML &);
};
#endif

View File

@@ -0,0 +1,98 @@
// This defines the interface to the QsciMacro class.
//
// Copyright (c) 2023 Riverbank Computing Limited <info@riverbankcomputing.com>
//
// This file is part of QScintilla.
//
// This file may be used under the terms of the GNU General Public License
// version 3.0 as published by the Free Software Foundation and appearing in
// the file LICENSE included in the packaging of this file. Please review the
// following information to ensure the GNU General Public License version 3.0
// requirements will be met: http://www.gnu.org/copyleft/gpl.html.
//
// If you do not wish to use this file under the terms of the GPL version 3.0
// then you may purchase a commercial license. For more information contact
// info@riverbankcomputing.com.
//
// 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 QSCIMACRO_H
#define QSCIMACRO_H
#include <QList>
#include <QObject>
#include <QString>
#include <Qsci/qsciglobal.h>
class QsciScintilla;
//! \brief The QsciMacro class represents a sequence of recordable editor
//! commands.
//!
//! Methods are provided to convert convert a macro to and from a textual
//! representation so that they can be easily written to and read from
//! permanent storage.
class QSCINTILLA_EXPORT QsciMacro : public QObject
{
Q_OBJECT
public:
//! Construct a QsciMacro with parent \a parent.
QsciMacro(QsciScintilla *parent);
//! Construct a QsciMacro from the printable ASCII representation \a asc,
//! with parent \a parent.
QsciMacro(const QString &asc, QsciScintilla *parent);
//! Destroy the QsciMacro instance.
virtual ~QsciMacro();
//! Clear the contents of the macro.
void clear();
//! Load the macro from the printable ASCII representation \a asc. Returns
//! true if there was no error.
//!
//! \sa save()
bool load(const QString &asc);
//! Return a printable ASCII representation of the macro. It is guaranteed
//! that only printable ASCII characters are used and that double quote
//! characters will not be used.
//!
//! \sa load()
QString save() const;
public slots:
//! Play the macro.
virtual void play();
//! Start recording user commands and add them to the macro.
virtual void startRecording();
//! Stop recording user commands.
virtual void endRecording();
private slots:
void record(unsigned int msg, unsigned long wParam, void *lParam);
private:
struct Macro {
unsigned int msg;
unsigned long wParam;
QByteArray text;
};
QsciScintilla *qsci;
QList<Macro> macro;
QsciMacro(const QsciMacro &);
QsciMacro &operator=(const QsciMacro &);
};
#endif

View File

@@ -0,0 +1,120 @@
// This module defines interface to the QsciPrinter class.
//
// Copyright (c) 2023 Riverbank Computing Limited <info@riverbankcomputing.com>
//
// This file is part of QScintilla.
//
// This file may be used under the terms of the GNU General Public License
// version 3.0 as published by the Free Software Foundation and appearing in
// the file LICENSE included in the packaging of this file. Please review the
// following information to ensure the GNU General Public License version 3.0
// requirements will be met: http://www.gnu.org/copyleft/gpl.html.
//
// If you do not wish to use this file under the terms of the GPL version 3.0
// then you may purchase a commercial license. For more information contact
// info@riverbankcomputing.com.
//
// 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 QSCIPRINTER_H
#define QSCIPRINTER_H
// This is needed for Qt v5.0.0-alpha.
#if defined(B0)
#undef B0
#endif
#include <qprinter.h>
#if !defined(QT_NO_PRINTER)
#include <Qsci/qsciglobal.h>
#include <Qsci/qsciscintilla.h>
QT_BEGIN_NAMESPACE
class QRect;
class QPainter;
QT_END_NAMESPACE
class QsciScintillaBase;
//! \brief The QsciPrinter class is a sub-class of the Qt QPrinter class that
//! is able to print the text of a Scintilla document.
//!
//! The class can be further sub-classed to alter to layout of the text, adding
//! headers and footers for example.
class QSCINTILLA_EXPORT QsciPrinter : public QPrinter
{
public:
//! Constructs a printer paint device with mode \a mode.
QsciPrinter(PrinterMode mode = ScreenResolution);
//! Destroys the QsciPrinter instance.
virtual ~QsciPrinter();
//! Format a page, by adding headers and footers for example, before the
//! document text is drawn on it. \a painter is the painter to be used to
//! add customised text and graphics. \a drawing is true if the page is
//! actually being drawn rather than being sized. \a painter drawing
//! methods must only be called when \a drawing is true. \a area is the
//! area of the page that will be used to draw the text. This should be
//! modified if it is necessary to reserve space for any customised text or
//! graphics. By default the area is relative to the printable area of the
//! page. Use QPrinter::setFullPage() before calling printRange() if you
//! want to try and print over the whole page. \a pagenr is the number of
//! the page. The first page is numbered 1.
virtual void formatPage(QPainter &painter, bool drawing, QRect &area,
int pagenr);
//! Return the number of points to add to each font when printing.
//!
//! \sa setMagnification()
int magnification() const {return mag;}
//! Sets the number of points to add to each font when printing to \a
//! magnification.
//!
//! \sa magnification()
virtual void setMagnification(int magnification);
//! Print a range of lines from the Scintilla instance \a qsb using the
//! supplied QPainter \a painter. \a from is the first line to print and a
//! negative value signifies the first line of text. \a to is the last
//! line to print and a negative value signifies the last line of text.
//! true is returned if there was no error.
virtual int printRange(QsciScintillaBase *qsb, QPainter &painter,
int from = -1, int to = -1);
//! Print a range of lines from the Scintilla instance \a qsb using a
//! default QPainter. \a from is the first line to print and a negative
//! value signifies the first line of text. \a to is the last line to
//! print and a negative value signifies the last line of text. true is
//! returned if there was no error.
virtual int printRange(QsciScintillaBase *qsb, int from = -1, int to = -1);
//! Return the line wrap mode used when printing. The default is
//! QsciScintilla::WrapWord.
//!
//! \sa setWrapMode()
QsciScintilla::WrapMode wrapMode() const {return wrap;}
//! Sets the line wrap mode used when printing to \a wmode.
//!
//! \sa wrapMode()
virtual void setWrapMode(QsciScintilla::WrapMode wmode);
private:
int mag;
QsciScintilla::WrapMode wrap;
QsciPrinter(const QsciPrinter &);
QsciPrinter &operator=(const QsciPrinter &);
};
#endif
#endif

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,204 @@
// This module defines interface to the QsciStyle class.
//
// Copyright (c) 2023 Riverbank Computing Limited <info@riverbankcomputing.com>
//
// This file is part of QScintilla.
//
// This file may be used under the terms of the GNU General Public License
// version 3.0 as published by the Free Software Foundation and appearing in
// the file LICENSE included in the packaging of this file. Please review the
// following information to ensure the GNU General Public License version 3.0
// requirements will be met: http://www.gnu.org/copyleft/gpl.html.
//
// If you do not wish to use this file under the terms of the GPL version 3.0
// then you may purchase a commercial license. For more information contact
// info@riverbankcomputing.com.
//
// 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 QSCISTYLE_H
#define QSCISTYLE_H
#include <qcolor.h>
#include <qfont.h>
#include <qstring.h>
#include <Qsci/qsciglobal.h>
class QsciScintillaBase;
//! \brief The QsciStyle class encapsulates all the attributes of a style.
//!
//! Each character of a document has an associated style which determines how
//! the character is displayed, e.g. its font and color. A style is identified
//! by a number. Lexers define styles for each of the language's features so
//! that they are displayed differently. Some style numbers have hard-coded
//! meanings, e.g. the style used for call tips.
class QSCINTILLA_EXPORT QsciStyle
{
public:
//! This enum defines the different ways the displayed case of the text can
//! be changed.
enum TextCase {
//! The text is displayed as its original case.
OriginalCase = 0,
//! The text is displayed as upper case.
UpperCase = 1,
//! The text is displayed as lower case.
LowerCase = 2
};
//! Constructs a QsciStyle instance for style number \a style. If \a style
//! is negative then a new style number is automatically allocated if
//! possible. If it is not possible then style() will return a negative
//! value.
//!
//! \sa style()
QsciStyle(int style = -1);
//! Constructs a QsciStyle instance for style number \a style. If \a style
//! is negative then a new style number is automatically allocated if
//! possible. If it is not possible then style() will return a negative
//! value. The styles description, color, paper color, font and
//! end-of-line fill are set to \a description, \a color, \a paper, \a font
//! and \a eolFill respectively.
//!
//! \sa style()
QsciStyle(int style, const QString &description, const QColor &color,
const QColor &paper, const QFont &font, bool eolFill = false);
//! \internal Apply the style to a particular editor.
void apply(QsciScintillaBase *sci) const;
//! The style's number is set to \a style.
//!
//! \sa style()
void setStyle(int style) {style_nr = style;}
//! Returns the number of the style. This will be negative if the style is
//! invalid.
//!
//! \sa setStyle()
int style() const {return style_nr;}
//! The style's description is set to \a description.
//!
//! \sa description()
void setDescription(const QString &description) {style_description = description;}
//! Returns the style's description.
//!
//! \sa setDescription()
QString description() const {return style_description;}
//! The style's foreground color is set to \a color. The default is taken
//! from the application's default palette.
//!
//! \sa color()
void setColor(const QColor &color);
//! Returns the style's foreground color.
//!
//! \sa setColor()
QColor color() const {return style_color;}
//! The style's background color is set to \a paper. The default is taken
//! from the application's default palette.
//!
//! \sa paper()
void setPaper(const QColor &paper);
//! Returns the style's background color.
//!
//! \sa setPaper()
QColor paper() const {return style_paper;}
//! The style's font is set to \a font. The default is the application's
//! default font.
//!
//! \sa font()
void setFont(const QFont &font);
//! Returns the style's font.
//!
//! \sa setFont()
QFont font() const {return style_font;}
//! The style's end-of-line fill is set to \a fill. The default is false.
//!
//! \sa eolFill()
void setEolFill(bool fill);
//! Returns the style's end-of-line fill.
//!
//! \sa setEolFill()
bool eolFill() const {return style_eol_fill;}
//! The style's text case is set to \a text_case. The default is
//! OriginalCase.
//!
//! \sa textCase()
void setTextCase(TextCase text_case);
//! Returns the style's text case.
//!
//! \sa setTextCase()
TextCase textCase() const {return style_case;}
//! The style's visibility is set to \a visible. The default is true.
//!
//! \sa visible()
void setVisible(bool visible);
//! Returns the style's visibility.
//!
//! \sa setVisible()
bool visible() const {return style_visible;}
//! The style's changeability is set to \a changeable. The default is
//! true.
//!
//! \sa changeable()
void setChangeable(bool changeable);
//! Returns the style's changeability.
//!
//! \sa setChangeable()
bool changeable() const {return style_changeable;}
//! The style's sensitivity to mouse clicks is set to \a hotspot. The
//! default is false.
//!
//! \sa hotspot()
void setHotspot(bool hotspot);
//! Returns the style's sensitivity to mouse clicks.
//!
//! \sa setHotspot()
bool hotspot() const {return style_hotspot;}
//! Refresh the style settings.
void refresh();
private:
int style_nr;
QString style_description;
QColor style_color;
QColor style_paper;
QFont style_font;
bool style_eol_fill;
TextCase style_case;
bool style_visible;
bool style_changeable;
bool style_hotspot;
void init(int style);
};
#endif

View File

@@ -0,0 +1,61 @@
// This module defines interface to the QsciStyledText class.
//
// Copyright (c) 2023 Riverbank Computing Limited <info@riverbankcomputing.com>
//
// This file is part of QScintilla.
//
// This file may be used under the terms of the GNU General Public License
// version 3.0 as published by the Free Software Foundation and appearing in
// the file LICENSE included in the packaging of this file. Please review the
// following information to ensure the GNU General Public License version 3.0
// requirements will be met: http://www.gnu.org/copyleft/gpl.html.
//
// If you do not wish to use this file under the terms of the GPL version 3.0
// then you may purchase a commercial license. For more information contact
// info@riverbankcomputing.com.
//
// 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 QSCISTYLEDTEXT_H
#define QSCISTYLEDTEXT_H
#include <qstring.h>
#include <Qsci/qsciglobal.h>
class QsciScintillaBase;
class QsciStyle;
//! \brief The QsciStyledText class is a container for a piece of text and the
//! style used to display the text.
class QSCINTILLA_EXPORT QsciStyledText
{
public:
//! Constructs a QsciStyledText instance for text \a text and style number
//! \a style.
QsciStyledText(const QString &text, int style);
//! Constructs a QsciStyledText instance for text \a text and style \a
//! style.
QsciStyledText(const QString &text, const QsciStyle &style);
//! \internal Apply the style to a particular editor.
void apply(QsciScintillaBase *sci) const;
//! Returns a reference to the text.
const QString &text() const {return styled_text;}
//! Returns the number of the style.
int style() const;
private:
QString styled_text;
int style_nr;
const QsciStyle *explicit_style;
};
#endif