Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move code editor color scheme tracking to dedicated registry,
QgsCodeEditorColorSchemeRegistry This cleans up the code, and makes it possible for creation of plugins which add new code editor color schemes!
- Loading branch information
1 parent
1bafa2f
commit 3098fa5
Showing
26 changed files
with
894 additions
and
584 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
102 changes: 102 additions & 0 deletions
102
python/gui/auto_generated/codeeditors/qgscodeeditorcolorscheme.sip.in
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,102 @@ | ||
/************************************************************************ | ||
* This file has been generated automatically from * | ||
* * | ||
* src/gui/codeeditors/qgscodeeditorcolorscheme.h * | ||
* * | ||
* Do not edit manually ! Edit header and run scripts/sipify.pl again * | ||
************************************************************************/ | ||
|
||
|
||
|
||
class QgsCodeEditorColorScheme | ||
{ | ||
%Docstring | ||
Defines a color scheme for use in QgsCodeEditor widgets. | ||
|
||
.. versionadded:: 3.16 | ||
%End | ||
|
||
%TypeHeaderCode | ||
#include "qgscodeeditorcolorscheme.h" | ||
%End | ||
public: | ||
|
||
enum class ColorRole | ||
{ | ||
Default, | ||
Keyword, | ||
Class, | ||
Method, | ||
Decoration, | ||
Number, | ||
Comment, | ||
CommentLine, | ||
CommentBlock, | ||
Background, | ||
Cursor, | ||
CaretLine, | ||
SingleQuote, | ||
DoubleQuote, | ||
TripleSingleQuote, | ||
TripleDoubleQuote, | ||
Operator, | ||
QuotedOperator, | ||
Identifier, | ||
QuotedIdentifier, | ||
Tag, | ||
UnknownTag, | ||
MarginBackground, | ||
MarginForeground, | ||
SelectionBackground, | ||
SelectionForeground, | ||
MatchedBraceBackground, | ||
MatchedBraceForeground, | ||
Edge, | ||
Fold, | ||
Error, | ||
}; | ||
|
||
QgsCodeEditorColorScheme( const QString &id = QString(), const QString &name = QString() ); | ||
%Docstring | ||
Constructor for QgsCodeEditorColorScheme. | ||
|
||
The ``id`` argument must be set to a unique, non-translated identifier for the color scheme. | ||
|
||
The ``name`` argument must be set to a translated, user-visible descriptive name of the scheme. | ||
%End | ||
|
||
|
||
QString id() const; | ||
%Docstring | ||
Returns the ID of the color scheme, which is a unique, non-translated identifier for the scheme. | ||
%End | ||
|
||
QString name() const; | ||
%Docstring | ||
Returns the name of the color scheme, which is the translated, user-visible name of the scheme. | ||
%End | ||
|
||
QColor color( ColorRole role ) const; | ||
%Docstring | ||
Returns the color to use in the editor for the specified ``role``. | ||
|
||
.. seealso:: :py:func:`setColor` | ||
%End | ||
|
||
void setColor( ColorRole role, const QColor &color ); | ||
%Docstring | ||
Sets the ``color`` to use in the editor for the specified ``role``. | ||
|
||
.. seealso:: :py:func:`color` | ||
%End | ||
|
||
|
||
}; | ||
|
||
/************************************************************************ | ||
* This file has been generated automatically from * | ||
* * | ||
* src/gui/codeeditors/qgscodeeditorcolorscheme.h * | ||
* * | ||
* Do not edit manually ! Edit header and run scripts/sipify.pl again * | ||
************************************************************************/ |
67 changes: 67 additions & 0 deletions
67
python/gui/auto_generated/codeeditors/qgscodeeditorcolorschemeregistry.sip.in
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
/************************************************************************ | ||
* This file has been generated automatically from * | ||
* * | ||
* src/gui/codeeditors/qgscodeeditorcolorschemeregistry.h * | ||
* * | ||
* Do not edit manually ! Edit header and run scripts/sipify.pl again * | ||
************************************************************************/ | ||
|
||
|
||
|
||
|
||
class QgsCodeEditorColorSchemeRegistry | ||
{ | ||
%Docstring | ||
A registry of color schemes for use in QgsCodeEditor widgets. | ||
|
||
QgsCodeEditorColorSchemeRegistry is not usually directly created, but rather accessed through | ||
:py:func:`QgsGui.codeEditorColorSchemeRegistry()`. | ||
|
||
.. versionadded:: 3.16 | ||
%End | ||
|
||
%TypeHeaderCode | ||
#include "qgscodeeditorcolorschemeregistry.h" | ||
%End | ||
public: | ||
|
||
QgsCodeEditorColorSchemeRegistry(); | ||
%Docstring | ||
Constructor for a color scheme registry. | ||
%End | ||
|
||
bool addColorScheme( const QgsCodeEditorColorScheme &scheme ); | ||
%Docstring | ||
Adds a color ``scheme`` to the registry. | ||
|
||
Returns ``True`` if the scheme was successfully added. | ||
%End | ||
|
||
bool removeColorScheme( const QString &id ); | ||
%Docstring | ||
Removes the color scheme with matching ``id`` from the registry. | ||
|
||
Returns ``True`` if scheme was found and removed. | ||
%End | ||
|
||
QStringList schemes() const; | ||
%Docstring | ||
Returns a list of the :py:func:`QgsCodeEditorColorScheme.id()` values for all registered color schemes. | ||
%End | ||
|
||
QgsCodeEditorColorScheme scheme( const QString &id ) const; | ||
%Docstring | ||
Returns the color scheme with matching ``id``. | ||
|
||
If the specified scheme \id does not exist then the default scheme will be returned instead. | ||
%End | ||
|
||
}; | ||
|
||
/************************************************************************ | ||
* This file has been generated automatically from * | ||
* * | ||
* src/gui/codeeditors/qgscodeeditorcolorschemeregistry.h * | ||
* * | ||
* Do not edit manually ! Edit header and run scripts/sipify.pl again * | ||
************************************************************************/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.