int QsciLexer::qt_metacall(QMetaObject::Call _c, int _id, void **_a) { _id = QObject::qt_metacall(_c, _id, _a); if (_id < 0) return _id; if (_c == QMetaObject::InvokeMetaMethod) { switch (_id) { case 0: colorChanged((*reinterpret_cast< const QColor(*)>(_a[1])),(*reinterpret_cast< int(*)>(_a[2]))); break; case 1: eolFillChanged((*reinterpret_cast< bool(*)>(_a[1])),(*reinterpret_cast< int(*)>(_a[2]))); break; case 2: fontChanged((*reinterpret_cast< const QFont(*)>(_a[1])),(*reinterpret_cast< int(*)>(_a[2]))); break; case 3: paperChanged((*reinterpret_cast< const QColor(*)>(_a[1])),(*reinterpret_cast< int(*)>(_a[2]))); break; case 4: propertyChanged((*reinterpret_cast< const char*(*)>(_a[1])),(*reinterpret_cast< const char*(*)>(_a[2]))); break; case 5: setAutoIndentStyle((*reinterpret_cast< int(*)>(_a[1]))); break; case 6: setColor((*reinterpret_cast< const QColor(*)>(_a[1])),(*reinterpret_cast< int(*)>(_a[2]))); break; case 7: setColor((*reinterpret_cast< const QColor(*)>(_a[1]))); break; case 8: setEolFill((*reinterpret_cast< bool(*)>(_a[1])),(*reinterpret_cast< int(*)>(_a[2]))); break; case 9: setEolFill((*reinterpret_cast< bool(*)>(_a[1]))); break; case 10: setFont((*reinterpret_cast< const QFont(*)>(_a[1])),(*reinterpret_cast< int(*)>(_a[2]))); break; case 11: setFont((*reinterpret_cast< const QFont(*)>(_a[1]))); break; case 12: setPaper((*reinterpret_cast< const QColor(*)>(_a[1])),(*reinterpret_cast< int(*)>(_a[2]))); break; case 13: setPaper((*reinterpret_cast< const QColor(*)>(_a[1]))); break; default: ; } _id -= 14; } return _id; }
void SonicPiLexer::unhighlightAll() { setPaper(theme->color("Background")); setColor(theme->color("Foreground")); setColor(theme->color("DefaultForeground"), Default); setColor(theme->color("CommentForeground"),Comment); setColor(theme->color("PODForeground"),POD); setColor(theme->color("NumberForeground"),Number); setColor(theme->color("FunctionMethodNameForeground"),FunctionMethodName); setColor(theme->color("KeywordForeground"),Keyword); setColor(theme->color("DemotedKeywordForeground"),DemotedKeyword); setColor(theme->color("DoubleQuotedStringForeground"),DoubleQuotedString); setColor(theme->color("SingleQuotedStringForeground"),SingleQuotedString); setColor(theme->color("HereDocumentForeground"),HereDocument); setColor(theme->color("PercentStringqForeground"),PercentStringq); setColor(theme->color("PercentStringQForeground"),PercentStringQ); setColor(theme->color("ClassNameForeground"),ClassName); setColor(theme->color("RegexForeground"),Regex); setColor(theme->color("HereDocumentDelimiterForeground"),HereDocumentDelimiter); setColor(theme->color("PercentStringrForeground"),PercentStringr); setColor(theme->color("PercentStringwForeground"),PercentStringw); setColor(theme->color("GlobalForeground"),Global); setColor(theme->color("SymbolForeground"),Symbol); setColor(theme->color("ModuleNameForeground"),ModuleName); setColor(theme->color("InstanceVariableForeground"),InstanceVariable); setColor(theme->color("ClassVariableForeground"),ClassVariable); setColor(theme->color("BackticksForeground"),Backticks); setColor(theme->color("PercentStringxForeground"),PercentStringx); setColor(theme->color("DataSectionForeground"),DataSection); }
void EditorView::paperChanged(int id) { if( p->paperId != id ) return; setPaper(p->paperId); }
// A ctor. QsciStyle::QsciStyle(int style) { init(style); QPalette pal = QApplication::palette(); setColor(pal.text().color()); setPaper(pal.base().color()); setFont(QApplication::font()); setEolFill(false); }
// A ctor. QsciStyle::QsciStyle(int style) { init(style); QColorGroup cg = QApplication::palette().active(); setColor(cg.text()); setPaper(cg.base()); setFont(QApplication::font()); setEolFill(false); }
// Refresh the style. void QsciStyle::refresh() { setColor(color()); setPaper(paper()); setFont(font()); setEolFill(eolFill()); setTextCase(textCase()); setVisible(visible()); setChangeable(changeable()); setHotspot(hotspot()); }
// A ctor. QsciStyle::QsciStyle(int style, const QString &description, const QColor &color, const QColor &paper, const QFont &font, bool eolFill) { init(style); setDescription(description); setColor(color); setPaper(paper); setFont(font); setEolFill(eolFill); }
KNSourceViewWindow::KNSourceViewWindow(const QString &text) : KTextBrowser(0) { setWFlags(WType_TopLevel | WDestructiveClose); QAccel *accel = new QAccel(this, "browser close-accel"); accel->connectItem(accel->insertItem(Qt::Key_Escape), this , SLOT(close())); KNConfig::Appearance *app = knGlobals.configManager()->appearance(); setTextFormat(PlainText); setCaption(kapp->makeStdCaption(i18n("Article Source"))); setPaper(QBrush(app->backgroundColor())); setFont(app->articleFixedFont()); setColor(app->textColor()); setWordWrap(KTextBrowser::NoWrap); setText(text); KNHelper::restoreWindowSize("sourceWindow", this, QSize(500, 300)); show(); }
void mAsciLexerChucK::preferencesChanged() { ZSettings settings; setPaper(QColor(settings.get(mAPreferencesSyntaxColoringBackground).toUInt())); setColor(QColor(settings.get(mAPreferencesSyntaxColoringNormalText).toUInt())); if(settings.get(mAPreferencesSyntaxColoringEnabled).toBool()) { setColor(QColor(settings.get(mAPreferencesSyntaxColoringKeywords).toUInt()), QsciLexerCPP::Keyword); setColor(QColor(settings.get(mAPreferencesSyntaxColoringClasses).toUInt()), QsciLexerCPP::KeywordSet2); setColor(QColor(settings.get(mAPreferencesSyntaxColoringUGens).toUInt()), QsciLexerCPP::GlobalClass); setColor(QColor(settings.get(mAPreferencesSyntaxColoringComments).toUInt()), QsciLexerCPP::Comment); setColor(QColor(settings.get(mAPreferencesSyntaxColoringComments).toUInt()), QsciLexerCPP::CommentLine); setColor(QColor(settings.get(mAPreferencesSyntaxColoringStrings).toUInt()), QsciLexerCPP::DoubleQuotedString); setColor(QColor(settings.get(mAPreferencesSyntaxColoringNumbers).toUInt()), QsciLexerCPP::Number); } setFont(QFont(settings.get(mAPreferencesFontName).toString(), settings.get(mAPreferencesFontSize).toInt())); }
void SonicPiLexer::highlightAll() { setPaper(theme->color("SelectionBackground"), -1); setColor(theme->color("SelectionForeground"), -1); this->setDefaultPaper(theme->color("Background")); }
QsciEditor::QsciEditor( QWidget *parent ) : QsciScintilla( parent ) { setFocus(); /* Set tab width, and fonts */ setTabWidth( 4 ); setFont( QFont( "Envy Code R", 9 ) ); setTabIndents( true ); setIndentationsUseTabs( true ); /* Set folding style */ setFolding( QsciScintilla::BoxedTreeFoldStyle ); /* Remove Horizontal Scrollbar, put a Vertical one */ setHorizontalScrollBarPolicy( Qt::ScrollBarAlwaysOff ); setVerticalScrollBarPolicy( Qt::ScrollBarAsNeeded ); /* Whitespace, indentation markings, and eol */ setIndentationGuides( false ); setWhitespaceVisibility( WsInvisible ); setEolMode( EolUnix ); /* Create Margins */ setMarginWidth( 0, QString( " %1 " ).arg( lines() ) ); setMarginWidth( 1, " " ); setMarginWidth( 2, 10 ); setMarginsFont( QFont( "Envy Code R", 9 ) ); setWrapMode( QsciScintilla::WrapWord ); /* Current Line Visibility */ ensureCursorVisible(); setCaretLineVisible( true ); setCaretLineBackgroundColor( QColor( "#555555" ) ); setCaretForegroundColor( QColor( "#FAFFAF" ) ); setCaretWidth( 2 ); /* Selection Color */ // setSelectionBackgroundColor( "#333964" ); // setSelectionForegroundColor( "*" ); /* Margin and folding margins background colors */ setMarginsBackgroundColor( QColor( "#A0A0A0" ) ); setFoldMarginColors( QColor( "#666666" ), Qt::black ); /* Set the width of the line */ setLineWidth( 144 ); ensureLineVisible( true ); /* Set the paper and pen color - Editor BG and FG color */ setPaper( Qt::black ); setColor( Qt::white ); /* Brace coloring */ setBraceMatching( QsciScintilla::SloppyBraceMatch ); setUnmatchedBraceForegroundColor( Qt::red ); setUnmatchedBraceBackgroundColor( Qt::black ); setMatchedBraceForegroundColor( Qt::darkGreen ); setMatchedBraceBackgroundColor( Qt::black ); /* Multi-selection and typing */ SendScintilla( SCI_SETADDITIONALSELECTIONTYPING, true ); SendScintilla( SCI_SETMULTIPLESELECTION, true ); SendScintilla( SCI_SETMULTIPASTE, true ); /* Scroll beyond the last line */ SendScintilla( SCI_SETENDATLASTLINE, false ); /* Set the editor state as not modified */ setModified( false ); /* Auto Save Timer: 60 sec */ autoSaveTimer = new QBasicTimer(); /* Enable and Show Custom context Menu */ setContextMenuPolicy( Qt::CustomContextMenu ); /* Connections */ setupActions(); /* Default Lexer */ setLexer( new QLexerDefault() ); QsciScintilla::FoldStyle state = static_cast<QsciScintilla::FoldStyle>( ( !folding() ) * 5 ); if ( !state ) foldAll( false ); setFolding( state ); };
void SonicPiLexer::highlightAll() { setPaper(QColor("deeppink"),-1); setColor(QColor("white"), -1); this->setDefaultPaper(theme->color("Background")); }
/* * Read system locales using org.freedesktop.locale1 dbus interface */ void EnabledLocalesModel::updateSystemLocales() { QDBusInterface dbusInterface( "org.freedesktop.locale1", "/org/freedesktop/locale1", "org.freedesktop.locale1", QDBusConnection::systemBus() ); QStringList localeEnviromentVariables = dbusInterface.property( "Locale" ).toStringList(); QModelIndex defaultIndex = QModelIndex(); for ( QString lev : localeEnviromentVariables ) { if ( lev.startsWith( "LANG=" ) ) { int defaultLocaleRow = findKey( lev.section( '=', 1 ) ); defaultIndex = index( defaultLocaleRow,0 ); } } setAddress( defaultIndex ); setCollate( defaultIndex ); setCtype( defaultIndex ); setIdentification( defaultIndex ); setLang( defaultIndex ); setLanguage( defaultIndex ); setMeasurement( defaultIndex ); setMonetary( defaultIndex ); setMessages( defaultIndex ); setName( defaultIndex ); setNumeric( defaultIndex ); setPaper( defaultIndex ); setTelephone( defaultIndex ); setTime( defaultIndex ); for ( QString lev : localeEnviromentVariables ) { QString value = lev.section( '=', 1 ); if ( lev.startsWith( "LC_ADDRESS=" ) ) { if ( value.isEmpty() ) setAddress( defaultIndex ); else { int row = findKey( value ); setAddress( index( row, 0 ) ); } } else if ( lev.startsWith( "LC_COLLATE=" ) ) { if ( value.isEmpty() ) setCollate( defaultIndex ); else { int row = findKey( value ); setCollate( index( row, 0 ) ); } } else if ( lev.startsWith( "LC_CTYPE=" ) ) { if ( value.isEmpty() ) setCtype( defaultIndex ); else { int row = findKey( value ); setCtype( index( row, 0 ) ); } } else if ( lev.startsWith( "LC_IDENTIFICATION=" ) ) { if ( value.isEmpty() ) setIdentification( defaultIndex ); else { int row = findKey( value ); setIdentification( index( row, 0 ) ); } } else if ( lev.startsWith( "LANG=" ) ) { if ( value.isEmpty() ) setLang( defaultIndex ); else { int row = findKey( value ); setLang( index( row, 0 ) ); } } else if ( lev.startsWith( "LANGUAGE=" ) ) { if ( value.isEmpty() ) setLanguage( defaultIndex ); else { int row = findKey( value ); setLanguage( index( row, 0 ) ); } } else if ( lev.startsWith( "LC_MEASUREMENT=" ) ) { if ( value.isEmpty() ) setMeasurement( defaultIndex ); else { int row = findKey( value ); setMeasurement( index( row, 0 ) ); } } else if ( lev.startsWith( "LC_MESSAGES=" ) ) { if ( value.isEmpty() ) setMessages( defaultIndex ); else { int row = findKey( value ); setMessages( index( row, 0 ) ); } } else if ( lev.startsWith( "LC_MONETARY=" ) ) { if ( value.isEmpty() ) setMonetary( defaultIndex ); else { int row = findKey( value ); setMonetary( index( row, 0 ) ); } } else if ( lev.startsWith( "LC_NAME=" ) ) { if ( value.isEmpty() ) setName( defaultIndex ); else { int row = findKey( value ); setName( index( row, 0 ) ); } } else if ( lev.startsWith( "LC_NUMERIC=" ) ) { if ( value.isEmpty() ) setNumeric( defaultIndex ); else { int row = findKey( value ); setNumeric( index( row, 0 ) ); } } else if ( lev.startsWith( "LC_PAPER=" ) ) { if ( value.isEmpty() ) setPaper( defaultIndex ); else { int row = findKey( value ); setPaper( index( row, 0 ) ); } } else if ( lev.startsWith( "LC_TELEPHONE=" ) ) { if ( value.isEmpty() ) setTelephone( defaultIndex ); else { int row = findKey( value ); setTelephone( index( row, 0 ) ); } } else if ( lev.startsWith( "LC_TIME=" ) ) { if ( value.isEmpty() ) setTime( defaultIndex ); else { int row = findKey( value ); setTime( index( row, 0 ) ); } } } }