Back to index

scribus-ng  1.3.4.dfsg+svn20071115
Public Member Functions | Public Attributes | Private Member Functions
SyntaxColors Class Reference

Store colors for syntax highligter. More...

#include <pconsole.h>

List of all members.

Public Member Functions

 SyntaxColors ()
 ~SyntaxColors ()

Public Attributes

QColor errorColor
QColor commentColor
QColor keywordColor
QColor signColor
QColor numberColor
QColor stringColor
QColor textColor

Private Member Functions

QString qcolor2named (QColor color)
 Converts QColor into #rrggbb string.

Detailed Description

Store colors for syntax highligter.

It provides defaults, loading and storing preferences.

Author:
Petr Vanek petr@.nosp@m.yarp.nosp@m.en.cz

Definition at line 102 of file pconsole.h.


Constructor & Destructor Documentation

Definition at line 501 of file pconsole.cpp.

{
       PrefsContext* prefs = PrefsManager::instance()->prefsFile->getPluginContext("scriptplugin");
       errorColor.setNamedColor(prefs->get("syntaxerror", "#aa0000"));
       commentColor.setNamedColor(prefs->get("syntaxcomment", "#A0A0A0"));
       keywordColor.setNamedColor(prefs->get("syntaxkeyword", "#00007f"));
       signColor.setNamedColor(prefs->get("syntaxsign", "#aa00ff"));
       numberColor.setNamedColor(prefs->get("syntaxnumber", "#ffaa00"));
       stringColor.setNamedColor(prefs->get("syntaxstring", "#005500"));
       textColor.setNamedColor(prefs->get("syntaxtext", "#000000"));
}

Definition at line 513 of file pconsole.cpp.

{
       PrefsContext* prefs = PrefsManager::instance()->prefsFile->getPluginContext("scriptplugin");
       prefs->set("syntaxerror", qcolor2named(errorColor));
       prefs->set("syntaxcomment", qcolor2named(commentColor));
       prefs->set("syntaxkeyword", qcolor2named(keywordColor));
       prefs->set("syntaxsign", qcolor2named(signColor));
       prefs->set("syntaxnumber", qcolor2named(numberColor));
       prefs->set("syntaxstring", qcolor2named(stringColor));
       prefs->set("syntaxtext", qcolor2named(textColor));
}

Here is the call graph for this function:


Member Function Documentation

QString SyntaxColors::qcolor2named ( QColor  color) [private]

Converts QColor into #rrggbb string.

Parameters:
colora QColor to convert.

Definition at line 525 of file pconsole.cpp.

{
       int r, g, b;
       QString retval("#");
       QString oct;
       color.getRgb(&r, &g, &b);
       retval += oct.setNum(r, 16).rightJustify(2, '0');
       retval += oct.setNum(g, 16).rightJustify(2, '0');
       retval += oct.setNum(b, 16).rightJustify(2, '0');
       return retval;
}

Here is the caller graph for this function:


Member Data Documentation

Definition at line 108 of file pconsole.h.

Definition at line 107 of file pconsole.h.

Definition at line 109 of file pconsole.h.

Definition at line 111 of file pconsole.h.

Definition at line 110 of file pconsole.h.

Definition at line 112 of file pconsole.h.

Definition at line 113 of file pconsole.h.


The documentation for this class was generated from the following files: