QLexerPython::QLexerPython( QObject *parent ) : QsciLexerPython( parent ) {

	populateKeywords();

	setDefaultFont( QFont( "Envy Code R", 9 ) );

	setDefaultPaper( QColor( "#000000" ) );
	setColor( QColor( "#FFFFFF" ), QsciLexerPython::Default );
	setColor( QColor( "#AAAAFF" ), QsciLexerPython::ClassName );
	setColor( QColor( "#55AA00" ), QsciLexerPython::Comment );
	setColor( QColor( "#55AA00" ), QsciLexerPython::CommentBlock );
	setColor( QColor( "#77DDFF" ), QsciLexerPython::Decorator );
	setColor( QColor( "#FFFF00" ), QsciLexerPython::DoubleQuotedString );
	setColor( QColor( "#FF00FF" ), QsciLexerPython::FunctionMethodName );
	setColor( QColor( "#FFAAFF" ), QsciLexerPython::HighlightedIdentifier );
	setColor( QColor( "#FFFFFF" ), QsciLexerPython::Identifier );
	setColor( QColor( "#8080FF" ), QsciLexerPython::Keyword );
	setColor( QColor( "#AC3C90" ), QsciLexerPython::Number );
	setColor( QColor( "#FABBAF" ), QsciLexerPython::Operator );
	setColor( QColor( "#FFFF00" ), QsciLexerPython::SingleQuotedString );
	setColor( QColor( "#FF0000" ), QsciLexerPython::UnclosedString );
	setColor( QColor( "#FFFF00" ), QsciLexerPython::TripleDoubleQuotedString );
	setColor( QColor( "#FFFF00" ), QsciLexerPython::TripleSingleQuotedString );

	setFont( QFont( "Envy Code R", 9 ), -1 );

	setFoldComments( true );
	setFoldQuotes( true );
};
Exemple #2
0
ScadLexer::ScadLexer(QObject *parent) : QsciLexerCPP(parent)
{
	// -> Style: Keyword (lexer.l)
	keywordSet[0] =
		"if else let for each module function true false undef "
		"include use assert";

	// -> Style: KeywordSet2 (func.cc)
	keywordSet[1] =
		"abs sign rands min max sin cos asin acos tan atan atan2 "
		"round ceil floor pow sqrt exp len log ln str chr concat "
		"lookup search version version_num norm cross parent_module "
		"dxf_dim dxf_cross";

	// -> used in comments only like /*! \cube */
	keywordSet[2] =
		"struct union enum fn var def typedef file namespace package "
		"interface param see return class brief";

	// -> Style: GlobalClass
	keywordSet[3] =
		"cube sphere cylinder polyhedron square circle polygon text "
		"minkowski hull resize child children echo union difference "
		"intersection linear_extrude rotate_extrude import group  "
		"projection render surface scale rotate mirror translate "
		"multmatrix color offset ";

    setFoldComments(true);
    setFoldAtElse(true);
}
int QsciLexerBash::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
{
    _id = QsciLexer::qt_metacall(_c, _id, _a);
    if (_id < 0)
        return _id;
    if (_c == QMetaObject::InvokeMetaMethod) {
        switch (_id) {
        case 0: setFoldComments((*reinterpret_cast< bool(*)>(_a[1]))); break;
        case 1: setFoldCompact((*reinterpret_cast< bool(*)>(_a[1]))); break;
        default: ;
        }
        _id -= 2;
    }
    return _id;
}
int QsciLexerPython::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
{
    _id = QsciLexer::qt_metacall(_c, _id, _a);
    if (_id < 0)
        return _id;
    if (_c == QMetaObject::InvokeMetaMethod) {
        switch (_id) {
        case 0: setFoldComments((*reinterpret_cast< bool(*)>(_a[1]))); break;
        case 1: setFoldQuotes((*reinterpret_cast< bool(*)>(_a[1]))); break;
        case 2: setIndentationWarning((*reinterpret_cast< QsciLexerPython::IndentationWarning(*)>(_a[1]))); break;
        default: ;
        }
        _id -= 3;
    }
    return _id;
}
int QsciLexerCPP::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
{
    _id = QsciLexer::qt_metacall(_c, _id, _a);
    if (_id < 0)
        return _id;
    if (_c == QMetaObject::InvokeMetaMethod) {
        switch (_id) {
        case 0: setFoldAtElse((*reinterpret_cast< bool(*)>(_a[1]))); break;
        case 1: setFoldComments((*reinterpret_cast< bool(*)>(_a[1]))); break;
        case 2: setFoldCompact((*reinterpret_cast< bool(*)>(_a[1]))); break;
        case 3: setFoldPreprocessor((*reinterpret_cast< bool(*)>(_a[1]))); break;
        case 4: setStylePreprocessor((*reinterpret_cast< bool(*)>(_a[1]))); break;
        default: ;
        }
        _id -= 5;
    }
    return _id;
}