Added a QSS lexer and updated the source docu.

Tue, 01 Apr 2014 19:22:33 +0200

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Tue, 01 Apr 2014 19:22:33 +0200
changeset 3461
ea12ebbbb61b
parent 3460
c556c7e7d7fe
child 3462
6d6e7334a787

Added a QSS lexer and updated the source docu.

APIs/Python3/eric5.api file | annotate | diff | comparison | revisions
APIs/Python3/eric5.bas file | annotate | diff | comparison | revisions
Documentation/Help/source.qch file | annotate | diff | comparison | revisions
Documentation/Help/source.qhp file | annotate | diff | comparison | revisions
Documentation/Source/eric5.QScintilla.Lexers.LexerQSS.html file | annotate | diff | comparison | revisions
Documentation/Source/eric5.UI.Previewers.PreviewerHTML.html file | annotate | diff | comparison | revisions
Documentation/Source/eric5.UI.Previewers.PreviewerQSS.html file | annotate | diff | comparison | revisions
Documentation/Source/index-eric5.QScintilla.Lexers.html file | annotate | diff | comparison | revisions
Documentation/Source/index-eric5.UI.Previewers.html file | annotate | diff | comparison | revisions
QScintilla/Lexers/LexerQSS.py file | annotate | diff | comparison | revisions
QScintilla/Lexers/__init__.py file | annotate | diff | comparison | revisions
eric5.e4p file | annotate | diff | comparison | revisions
--- a/APIs/Python3/eric5.api	Tue Apr 01 18:56:45 2014 +0200
+++ b/APIs/Python3/eric5.api	Tue Apr 01 19:22:33 2014 +0200
@@ -7286,6 +7286,12 @@
 eric5.QScintilla.Lexers.LexerPython.LexerPython.isStringStyle?4(style)
 eric5.QScintilla.Lexers.LexerPython.LexerPython.language?4()
 eric5.QScintilla.Lexers.LexerPython.LexerPython?1(variant="", parent=None)
+eric5.QScintilla.Lexers.LexerQSS.LexerQSS.defaultKeywords?4(kwSet)
+eric5.QScintilla.Lexers.LexerQSS.LexerQSS.initProperties?4()
+eric5.QScintilla.Lexers.LexerQSS.LexerQSS.isCommentStyle?4(style)
+eric5.QScintilla.Lexers.LexerQSS.LexerQSS.isStringStyle?4(style)
+eric5.QScintilla.Lexers.LexerQSS.LexerQSS.language?4()
+eric5.QScintilla.Lexers.LexerQSS.LexerQSS?1(parent=None)
 eric5.QScintilla.Lexers.LexerRegistry?7
 eric5.QScintilla.Lexers.LexerRuby.LexerRuby.autoCompletionWordSeparators?4()
 eric5.QScintilla.Lexers.LexerRuby.LexerRuby.defaultKeywords?4(kwSet)
@@ -8116,6 +8122,8 @@
 eric5.UI.Previewers.PreviewerHTML.PreviewerHTML?1(parent=None)
 eric5.UI.Previewers.PreviewerHTML._StrikeThroughExtension.DEL_RE?7
 eric5.UI.Previewers.PreviewerHTML._StrikeThroughExtension.extendMarkdown?4(md, md_globals)
+eric5.UI.Previewers.PreviewerQSS.PreviewerQSS.processEditor?4(editor=None)
+eric5.UI.Previewers.PreviewerQSS.PreviewerQSS?1(parent=None)
 eric5.UI.SearchWidget.SearchWidget.keyPressEvent?4(event)
 eric5.UI.SearchWidget.SearchWidget.on_closeButton_clicked?4()
 eric5.UI.SearchWidget.SearchWidget.on_findNextButton_clicked?4()
--- a/APIs/Python3/eric5.bas	Tue Apr 01 18:56:45 2014 +0200
+++ b/APIs/Python3/eric5.bas	Tue Apr 01 19:22:33 2014 +0200
@@ -438,6 +438,7 @@
 LexerProperties Lexer QsciLexerProperties
 LexerPygments LexerContainer
 LexerPython Lexer QsciLexerPython
+LexerQSS Lexer QsciLexerCSS
 LexerRuby Lexer QsciLexerRuby
 LexerSQL Lexer QsciLexerSQL
 LexerTCL Lexer QsciLexerTCL
@@ -531,6 +532,7 @@
 PreviewProcessingThread QThread
 Previewer QStackedWidget
 PreviewerHTML QWidget Ui_PreviewerHTML
+PreviewerQSS QWidget Ui_PreviewerQSS
 Printer QsciPrinter
 PrinterPage ConfigurationPageBase Ui_PrinterPage
 ProfileTreeWidgetItem QTreeWidgetItem
Binary file Documentation/Help/source.qch has changed
--- a/Documentation/Help/source.qhp	Tue Apr 01 18:56:45 2014 +0200
+++ b/Documentation/Help/source.qhp	Tue Apr 01 19:22:33 2014 +0200
@@ -869,6 +869,7 @@
               <section title="eric5.QScintilla.Lexers.LexerProperties" ref="eric5.QScintilla.Lexers.LexerProperties.html" />
               <section title="eric5.QScintilla.Lexers.LexerPygments" ref="eric5.QScintilla.Lexers.LexerPygments.html" />
               <section title="eric5.QScintilla.Lexers.LexerPython" ref="eric5.QScintilla.Lexers.LexerPython.html" />
+              <section title="eric5.QScintilla.Lexers.LexerQSS" ref="eric5.QScintilla.Lexers.LexerQSS.html" />
               <section title="eric5.QScintilla.Lexers.LexerRuby" ref="eric5.QScintilla.Lexers.LexerRuby.html" />
               <section title="eric5.QScintilla.Lexers.LexerSQL" ref="eric5.QScintilla.Lexers.LexerSQL.html" />
               <section title="eric5.QScintilla.Lexers.LexerTCL" ref="eric5.QScintilla.Lexers.LexerTCL.html" />
@@ -940,6 +941,7 @@
           <section title="eric5.UI" ref="index-eric5.UI.html">
             <section title="eric5.UI.Previewers" ref="index-eric5.UI.Previewers.html">
               <section title="eric5.UI.Previewers.PreviewerHTML" ref="eric5.UI.Previewers.PreviewerHTML.html" />
+              <section title="eric5.UI.Previewers.PreviewerQSS" ref="eric5.UI.Previewers.PreviewerQSS.html" />
             </section>
             <section title="eric5.UI.AuthenticationDialog" ref="eric5.UI.AuthenticationDialog.html" />
             <section title="eric5.UI.Browser" ref="eric5.UI.Browser.html" />
@@ -7653,6 +7655,14 @@
       <keyword name="LexerPython.isCommentStyle" id="LexerPython.isCommentStyle" ref="eric5.QScintilla.Lexers.LexerPython.html#LexerPython.isCommentStyle" />
       <keyword name="LexerPython.isStringStyle" id="LexerPython.isStringStyle" ref="eric5.QScintilla.Lexers.LexerPython.html#LexerPython.isStringStyle" />
       <keyword name="LexerPython.language" id="LexerPython.language" ref="eric5.QScintilla.Lexers.LexerPython.html#LexerPython.language" />
+      <keyword name="LexerQSS" id="LexerQSS" ref="eric5.QScintilla.Lexers.LexerQSS.html#LexerQSS" />
+      <keyword name="LexerQSS (Constructor)" id="LexerQSS (Constructor)" ref="eric5.QScintilla.Lexers.LexerQSS.html#LexerQSS.__init__" />
+      <keyword name="LexerQSS (Module)" id="LexerQSS (Module)" ref="eric5.QScintilla.Lexers.LexerQSS.html" />
+      <keyword name="LexerQSS.defaultKeywords" id="LexerQSS.defaultKeywords" ref="eric5.QScintilla.Lexers.LexerQSS.html#LexerQSS.defaultKeywords" />
+      <keyword name="LexerQSS.initProperties" id="LexerQSS.initProperties" ref="eric5.QScintilla.Lexers.LexerQSS.html#LexerQSS.initProperties" />
+      <keyword name="LexerQSS.isCommentStyle" id="LexerQSS.isCommentStyle" ref="eric5.QScintilla.Lexers.LexerQSS.html#LexerQSS.isCommentStyle" />
+      <keyword name="LexerQSS.isStringStyle" id="LexerQSS.isStringStyle" ref="eric5.QScintilla.Lexers.LexerQSS.html#LexerQSS.isStringStyle" />
+      <keyword name="LexerQSS.language" id="LexerQSS.language" ref="eric5.QScintilla.Lexers.LexerQSS.html#LexerQSS.language" />
       <keyword name="LexerRuby" id="LexerRuby" ref="eric5.QScintilla.Lexers.LexerRuby.html#LexerRuby" />
       <keyword name="LexerRuby (Constructor)" id="LexerRuby (Constructor)" ref="eric5.QScintilla.Lexers.LexerRuby.html#LexerRuby.__init__" />
       <keyword name="LexerRuby (Module)" id="LexerRuby (Module)" ref="eric5.QScintilla.Lexers.LexerRuby.html" />
@@ -8794,6 +8804,10 @@
       <keyword name="PreviewerHTML.on_ssiCheckBox_clicked" id="PreviewerHTML.on_ssiCheckBox_clicked" ref="eric5.UI.Previewers.PreviewerHTML.html#PreviewerHTML.on_ssiCheckBox_clicked" />
       <keyword name="PreviewerHTML.processEditor" id="PreviewerHTML.processEditor" ref="eric5.UI.Previewers.PreviewerHTML.html#PreviewerHTML.processEditor" />
       <keyword name="PreviewerHTML.shutdown" id="PreviewerHTML.shutdown" ref="eric5.UI.Previewers.PreviewerHTML.html#PreviewerHTML.shutdown" />
+      <keyword name="PreviewerQSS" id="PreviewerQSS" ref="eric5.UI.Previewers.PreviewerQSS.html#PreviewerQSS" />
+      <keyword name="PreviewerQSS (Constructor)" id="PreviewerQSS (Constructor)" ref="eric5.UI.Previewers.PreviewerQSS.html#PreviewerQSS.__init__" />
+      <keyword name="PreviewerQSS (Module)" id="PreviewerQSS (Module)" ref="eric5.UI.Previewers.PreviewerQSS.html" />
+      <keyword name="PreviewerQSS.processEditor" id="PreviewerQSS.processEditor" ref="eric5.UI.Previewers.PreviewerQSS.html#PreviewerQSS.processEditor" />
       <keyword name="Previewers (Package)" id="Previewers (Package)" ref="index-eric5.UI.Previewers.html" />
       <keyword name="Printer" id="Printer" ref="eric5.QScintilla.Printer.html#Printer" />
       <keyword name="Printer (Constructor)" id="Printer (Constructor)" ref="eric5.QScintilla.Printer.html#Printer.__init__" />
@@ -14462,6 +14476,7 @@
       <file>eric5.QScintilla.Lexers.LexerProperties.html</file>
       <file>eric5.QScintilla.Lexers.LexerPygments.html</file>
       <file>eric5.QScintilla.Lexers.LexerPython.html</file>
+      <file>eric5.QScintilla.Lexers.LexerQSS.html</file>
       <file>eric5.QScintilla.Lexers.LexerRuby.html</file>
       <file>eric5.QScintilla.Lexers.LexerSQL.html</file>
       <file>eric5.QScintilla.Lexers.LexerTCL.html</file>
@@ -14528,6 +14543,7 @@
       <file>eric5.UI.PixmapCache.html</file>
       <file>eric5.UI.Previewer.html</file>
       <file>eric5.UI.Previewers.PreviewerHTML.html</file>
+      <file>eric5.UI.Previewers.PreviewerQSS.html</file>
       <file>eric5.UI.SearchWidget.html</file>
       <file>eric5.UI.SplashScreen.html</file>
       <file>eric5.UI.SymbolsWidget.html</file>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Documentation/Source/eric5.QScintilla.Lexers.LexerQSS.html	Tue Apr 01 19:22:33 2014 +0200
@@ -0,0 +1,156 @@
+<!DOCTYPE html>
+<html><head>
+<title>eric5.QScintilla.Lexers.LexerQSS</title>
+<meta charset="UTF-8">
+<style>
+body {
+    background: #EDECE6;
+    margin: 0em 1em 10em 1em;
+    color: black;
+}
+
+h1 { color: white; background: #85774A; }
+h2 { color: white; background: #85774A; }
+h3 { color: white; background: #9D936E; }
+h4 { color: white; background: #9D936E; }
+    
+a { color: #BA6D36; }
+
+</style>
+</head>
+<body><a NAME="top" ID="top"></a>
+<h1>eric5.QScintilla.Lexers.LexerQSS</h1>
+<p>
+Module implementing a QSS lexer with some additional methods.
+</p>
+<h3>Global Attributes</h3>
+<table>
+<tr><td>None</td></tr>
+</table>
+<h3>Classes</h3>
+<table>
+<tr>
+<td><a href="#LexerQSS">LexerQSS</a></td>
+<td>Subclass to implement some additional lexer dependent methods.</td>
+</tr>
+</table>
+<h3>Functions</h3>
+<table>
+<tr><td>None</td></tr>
+</table>
+<hr /><hr />
+<a NAME="LexerQSS" ID="LexerQSS"></a>
+<h2>LexerQSS</h2>
+<p>
+    Subclass to implement some additional lexer dependent methods.
+</p>
+<h3>Derived from</h3>
+Lexer, QsciLexerCSS
+<h3>Class Attributes</h3>
+<table>
+<tr><td>None</td></tr>
+</table>
+<h3>Class Methods</h3>
+<table>
+<tr><td>None</td></tr>
+</table>
+<h3>Methods</h3>
+<table>
+<tr>
+<td><a href="#LexerQSS.__init__">LexerQSS</a></td>
+<td>Constructor</td>
+</tr><tr>
+<td><a href="#LexerQSS.defaultKeywords">defaultKeywords</a></td>
+<td>Public method to get the default keywords.</td>
+</tr><tr>
+<td><a href="#LexerQSS.initProperties">initProperties</a></td>
+<td>Public slot to initialize the properties.</td>
+</tr><tr>
+<td><a href="#LexerQSS.isCommentStyle">isCommentStyle</a></td>
+<td>Public method to check, if a style is a comment style.</td>
+</tr><tr>
+<td><a href="#LexerQSS.isStringStyle">isStringStyle</a></td>
+<td>Public method to check, if a style is a string style.</td>
+</tr><tr>
+<td><a href="#LexerQSS.language">language</a></td>
+<td>Public method to return the lexer language.</td>
+</tr>
+</table>
+<h3>Static Methods</h3>
+<table>
+<tr><td>None</td></tr>
+</table>
+<a NAME="LexerQSS.__init__" ID="LexerQSS.__init__"></a>
+<h4>LexerQSS (Constructor)</h4>
+<b>LexerQSS</b>(<i>parent=None</i>)
+<p>
+        Constructor
+</p><dl>
+<dt><i>parent</i></dt>
+<dd>
+parent widget of this lexer
+</dd>
+</dl><a NAME="LexerQSS.defaultKeywords" ID="LexerQSS.defaultKeywords"></a>
+<h4>LexerQSS.defaultKeywords</h4>
+<b>defaultKeywords</b>(<i>kwSet</i>)
+<p>
+        Public method to get the default keywords.
+</p><dl>
+<dt><i>kwSet</i></dt>
+<dd>
+number of the keyword set (integer)
+</dd>
+</dl><dl>
+<dt>Returns:</dt>
+<dd>
+string giving the keywords (string) or None
+</dd>
+</dl><a NAME="LexerQSS.initProperties" ID="LexerQSS.initProperties"></a>
+<h4>LexerQSS.initProperties</h4>
+<b>initProperties</b>(<i></i>)
+<p>
+        Public slot to initialize the properties.
+</p><a NAME="LexerQSS.isCommentStyle" ID="LexerQSS.isCommentStyle"></a>
+<h4>LexerQSS.isCommentStyle</h4>
+<b>isCommentStyle</b>(<i>style</i>)
+<p>
+        Public method to check, if a style is a comment style.
+</p><dl>
+<dt><i>style</i></dt>
+<dd>
+style to check (integer)
+</dd>
+</dl><dl>
+<dt>Returns:</dt>
+<dd>
+flag indicating a comment style (boolean)
+</dd>
+</dl><a NAME="LexerQSS.isStringStyle" ID="LexerQSS.isStringStyle"></a>
+<h4>LexerQSS.isStringStyle</h4>
+<b>isStringStyle</b>(<i>style</i>)
+<p>
+        Public method to check, if a style is a string style.
+</p><dl>
+<dt><i>style</i></dt>
+<dd>
+style to check (integer)
+</dd>
+</dl><dl>
+<dt>Returns:</dt>
+<dd>
+flag indicating a string style (boolean)
+</dd>
+</dl><a NAME="LexerQSS.language" ID="LexerQSS.language"></a>
+<h4>LexerQSS.language</h4>
+<b>language</b>(<i></i>)
+<p>
+        Public method to return the lexer language.
+</p><dl>
+<dt>Returns:</dt>
+<dd>
+lexer language (string)
+</dd>
+</dl>
+<div align="right"><a href="#top">Up</a></div>
+<hr />
+</body></html>
\ No newline at end of file
--- a/Documentation/Source/eric5.UI.Previewers.PreviewerHTML.html	Tue Apr 01 18:56:45 2014 +0200
+++ b/Documentation/Source/eric5.UI.Previewers.PreviewerHTML.html	Tue Apr 01 19:22:33 2014 +0200
@@ -20,7 +20,9 @@
 </head>
 <body><a NAME="top" ID="top"></a>
 <h1>eric5.UI.Previewers.PreviewerHTML</h1>
-
+<p>
+Module implementing a previewer widget for HTML, Markdown and ReST files.
+</p>
 <h3>Global Attributes</h3>
 <table>
 <tr><td>None</td></tr>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Documentation/Source/eric5.UI.Previewers.PreviewerQSS.html	Tue Apr 01 19:22:33 2014 +0200
@@ -0,0 +1,94 @@
+<!DOCTYPE html>
+<html><head>
+<title>eric5.UI.Previewers.PreviewerQSS</title>
+<meta charset="UTF-8">
+<style>
+body {
+    background: #EDECE6;
+    margin: 0em 1em 10em 1em;
+    color: black;
+}
+
+h1 { color: white; background: #85774A; }
+h2 { color: white; background: #85774A; }
+h3 { color: white; background: #9D936E; }
+h4 { color: white; background: #9D936E; }
+    
+a { color: #BA6D36; }
+
+</style>
+</head>
+<body><a NAME="top" ID="top"></a>
+<h1>eric5.UI.Previewers.PreviewerQSS</h1>
+<p>
+Module implementing a previewer widget for Qt style sheet files.
+</p>
+<h3>Global Attributes</h3>
+<table>
+<tr><td>None</td></tr>
+</table>
+<h3>Classes</h3>
+<table>
+<tr>
+<td><a href="#PreviewerQSS">PreviewerQSS</a></td>
+<td>Class implementing a previewer widget for Qt style sheet files.</td>
+</tr>
+</table>
+<h3>Functions</h3>
+<table>
+<tr><td>None</td></tr>
+</table>
+<hr /><hr />
+<a NAME="PreviewerQSS" ID="PreviewerQSS"></a>
+<h2>PreviewerQSS</h2>
+<p>
+    Class implementing a previewer widget for Qt style sheet files.
+</p>
+<h3>Derived from</h3>
+QWidget, Ui_PreviewerQSS
+<h3>Class Attributes</h3>
+<table>
+<tr><td>None</td></tr>
+</table>
+<h3>Class Methods</h3>
+<table>
+<tr><td>None</td></tr>
+</table>
+<h3>Methods</h3>
+<table>
+<tr>
+<td><a href="#PreviewerQSS.__init__">PreviewerQSS</a></td>
+<td>Constructor</td>
+</tr><tr>
+<td><a href="#PreviewerQSS.processEditor">processEditor</a></td>
+<td>Private slot to process an editor's text.</td>
+</tr>
+</table>
+<h3>Static Methods</h3>
+<table>
+<tr><td>None</td></tr>
+</table>
+<a NAME="PreviewerQSS.__init__" ID="PreviewerQSS.__init__"></a>
+<h4>PreviewerQSS (Constructor)</h4>
+<b>PreviewerQSS</b>(<i>parent=None</i>)
+<p>
+        Constructor
+</p><dl>
+<dt><i>parent</i></dt>
+<dd>
+reference to the parent widget (QWidget)
+</dd>
+</dl><a NAME="PreviewerQSS.processEditor" ID="PreviewerQSS.processEditor"></a>
+<h4>PreviewerQSS.processEditor</h4>
+<b>processEditor</b>(<i>editor=None</i>)
+<p>
+        Private slot to process an editor's text.
+</p><dl>
+<dt><i>editor</i></dt>
+<dd>
+editor to be processed (Editor)
+</dd>
+</dl>
+<div align="right"><a href="#top">Up</a></div>
+<hr />
+</body></html>
\ No newline at end of file
--- a/Documentation/Source/index-eric5.QScintilla.Lexers.html	Tue Apr 01 18:56:45 2014 +0200
+++ b/Documentation/Source/index-eric5.QScintilla.Lexers.html	Tue Apr 01 19:22:33 2014 +0200
@@ -109,6 +109,9 @@
 <td><a href="eric5.QScintilla.Lexers.LexerPython.html">LexerPython</a></td>
 <td>Module implementing a Python lexer with some additional methods.</td>
 </tr><tr>
+<td><a href="eric5.QScintilla.Lexers.LexerQSS.html">LexerQSS</a></td>
+<td>Module implementing a QSS lexer with some additional methods.</td>
+</tr><tr>
 <td><a href="eric5.QScintilla.Lexers.LexerRuby.html">LexerRuby</a></td>
 <td>Module implementing a Ruby lexer with some additional methods.</td>
 </tr><tr>
--- a/Documentation/Source/index-eric5.UI.Previewers.html	Tue Apr 01 18:56:45 2014 +0200
+++ b/Documentation/Source/index-eric5.UI.Previewers.html	Tue Apr 01 19:22:33 2014 +0200
@@ -29,7 +29,10 @@
 <table>
 <tr>
 <td><a href="eric5.UI.Previewers.PreviewerHTML.html">PreviewerHTML</a></td>
-<td></td>
+<td>Module implementing a previewer widget for HTML, Markdown and ReST files.</td>
+</tr><tr>
+<td><a href="eric5.UI.Previewers.PreviewerQSS.html">PreviewerQSS</a></td>
+<td>Module implementing a previewer widget for Qt style sheet files.</td>
 </tr>
 </table>
 </body></html>
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/QScintilla/Lexers/LexerQSS.py	Tue Apr 01 19:22:33 2014 +0200
@@ -0,0 +1,152 @@
+# -*- coding: utf-8 -*-
+
+# Copyright (c) 2005 - 2014 Detlev Offenbach <detlev@die-offenbachs.de>
+#
+
+"""
+Module implementing a QSS lexer with some additional methods.
+"""
+
+from PyQt4.Qsci import QsciLexerCSS
+
+from .Lexer import Lexer
+import Preferences
+
+
+class LexerQSS(Lexer, QsciLexerCSS):
+    """
+    Subclass to implement some additional lexer dependent methods.
+    """
+    def __init__(self, parent=None):
+        """
+        Constructor
+        
+        @param parent parent widget of this lexer
+        """
+        QsciLexerCSS.__init__(self, parent)
+        Lexer.__init__(self)
+        
+        self.commentString = "#"
+        self.streamCommentString = {
+            'start': '/* ',
+            'end': ' */'
+        }
+        
+        # TODO: add QSS API generation
+    
+    def initProperties(self):
+        """
+        Public slot to initialize the properties.
+        """
+        self.setFoldComments(Preferences.getEditor("CssFoldComment"))
+        self.setFoldCompact(Preferences.getEditor("AllFoldCompact"))
+        try:
+            self.setHSSLanguage(
+                Preferences.getEditor("CssHssSupport"))
+            self.setLessLanguage(
+                Preferences.getEditor("CssLessSupport"))
+            self.setSCSSLanguage(
+                Preferences.getEditor("CssSassySupport"))
+        except AttributeError:
+            pass
+    
+    def isCommentStyle(self, style):
+        """
+        Public method to check, if a style is a comment style.
+        
+        @param style style to check (integer)
+        @return flag indicating a comment style (boolean)
+        """
+        return style in [QsciLexerCSS.Comment]
+    
+    def isStringStyle(self, style):
+        """
+        Public method to check, if a style is a string style.
+        
+        @param style style to check (integer)
+        @return flag indicating a string style (boolean)
+        """
+        return style in [QsciLexerCSS.DoubleQuotedString,
+                         QsciLexerCSS.SingleQuotedString]
+    
+    def defaultKeywords(self, kwSet):
+        """
+        Public method to get the default keywords.
+        
+        @param kwSet number of the keyword set (integer)
+        @return string giving the keywords (string) or None
+        """
+        if kwSet == 1:
+            return "alternate-background-color background background-color" \
+                " background-image background-repeat background-position" \
+                " background-attachment background-clip background-origin" \
+                " border border-top border-right border-bottom border-left" \
+                " border-color border-top-color border-right-color" \
+                " border-bottom-color border-left-color border-image" \
+                " border-radius border-top-left-radius" \
+                " border-top-right-radius border-bottom-right-radius" \
+                " border-bottom-left-radius border-style border-top-style" \
+                " border-right-style border-bottom-style border-left-style" \
+                " border-width border-top-width border-right-width" \
+                " border-bottom-width border-left-width bottom button-layout" \
+                " color dialogbuttonbox-buttons-have-icons font font-family" \
+                " font-size font-style font-weight gridline-color" \
+                " height icon-size image image-position left" \
+                " lineedit-password-character margin margin-top margin-right" \
+                " margin-bottom margin-left max-height max-width" \
+                " messagebox-text-interaction-flags min-height min-width" \
+                " opacity outline padding padding-top padding-right" \
+                " padding-bottom padding-left" \
+                " paint-alternating-row-colors-for-empty-area" \
+                " position right selection-background-color selection-color" \
+                " show-decoration-selected spacing subcontrol-origin" \
+                " subcontrol-position text-align text-decoration" \
+                " top width" \
+                "" \
+                " backward-icon cd-icon computer-icon desktop-icon" \
+                " dialog-apply-icon dialog-cancel-icon dialog-close-icon" \
+                " dialog-discard-icon dialog-help-icon dialog-no-icon" \
+                " dialog-ok-icon dialog-open-icon dialog-reset-icon" \
+                " dialog-save-icon dialog-yes-icon directory-closed-icon" \
+                " directory-icon directory-link-icon directory-open-icon" \
+                " dockwidget-close-icon downarrow-icon dvd-icon file-icon" \
+                " file-link-icon filedialog-contentsview-icon" \
+                " filedialog-detailedview-icon filedialog-end-icon" \
+                " filedialog-infoview-icon filedialog-listview-icon" \
+                " filedialog-new-directory-icon" \
+                " filedialog-parent-directory-icon filedialog-start-icon" \
+                " floppy-icon forward-icon harddisk-icon home-icon" \
+                " leftarrow-icon messagebox-critical-icon" \
+                " messagebox-information-icon messagebox-question-icon" \
+                " messagebox-warning-icon network-icon rightarrow-icon" \
+                " titlebar-contexthelp-icon titlebar-maximize-icon" \
+                " titlebar-menu-icon titlebar-minimize-icon" \
+                " titlebar-normal-icon titlebar-shade-icon" \
+                " titlebar-unshade-icon trash-icon uparrow-icon"
+        elif kwSet == 2:
+            return "active adjoins-item alternate bottom checked closable" \
+                " closed default disabled editable edit-focus enabled" \
+                " exclusive first flat floatable focus has-children" \
+                " has-siblings horizontal hover indeterminate last left" \
+                " maximized middle minimized movable no-frame" \
+                " non-exclusive off on only-one open next-selected" \
+                " pressed previous-selected read-only right selected top" \
+                " unchecked vertical window" \
+                "" \
+                " add-line add-page branch chunk close-button corner" \
+                " down-arrow down-button drop-down float-button groove" \
+                " indicator handle icon item left-arrow left-corner" \
+                " menu-arrow menu-button menu-indicator right-arrow" \
+                " pane right-corner scroller section separator sub-line" \
+                " sub-page tab tab-bar tear tearoff text title up-arrow" \
+                " up-button"
+        
+        return None
+    
+    def language(self):
+        """
+        Public method to return the lexer language.
+        
+        @return lexer language (string)
+        """
+        return "QSS"
--- a/QScintilla/Lexers/__init__.py	Tue Apr 01 18:56:45 2014 +0200
+++ b/QScintilla/Lexers/__init__.py	Tue Apr 01 19:22:33 2014 +0200
@@ -124,6 +124,8 @@
                     "lexerPython.png"],
         "Python3": [QApplication.translate('Lexers', "Python3"), 'dummy.py',
                     "lexerPython3.png"],
+        "QSS": [QApplication.translate('Lexers', "QSS"), 'dummy.qss',
+                "lexerCSS.png"],
         "Ruby": [QApplication.translate('Lexers', "Ruby"), 'dummy.rb',
                  "lexerRuby.png"],
         "SQL": [QApplication.translate('Lexers', "SQL"), 'dummy.sql',
@@ -284,6 +286,9 @@
             elif language == "Octave":
                 from .LexerOctave import LexerOctave
                 return LexerOctave(parent)
+            elif language == "QSS":
+                from .LexerQSS import LexerQSS
+                return LexerQSS(parent)
             
             elif language in LexerRegistry:
                 return LexerRegistry[language][2](parent)
@@ -685,7 +690,7 @@
         '*.ctest': "CMake",
         '*.ctest.in': "CMake",
         '*.css': "CSS",
-        '*.qss': "CSS",
+        '*.qss': "QSS",
         "*.d": "D",
         "*.di": "D",
         "*.diff": "Diff",
--- a/eric5.e4p	Tue Apr 01 18:56:45 2014 +0200
+++ b/eric5.e4p	Tue Apr 01 19:22:33 2014 +0200
@@ -1133,6 +1133,7 @@
     <Source>UI/Previewers/__init__.py</Source>
     <Source>UI/Previewers/PreviewerHTML.py</Source>
     <Source>UI/Previewers/PreviewerQSS.py</Source>
+    <Source>QScintilla/Lexers/LexerQSS.py</Source>
   </Sources>
   <Forms>
     <Form>PyUnit/UnittestDialog.ui</Form>

eric ide

mercurial