summaryrefslogtreecommitdiff
path: root/noncore/apps/tinykate/libkate/document/katehighlight.cpp
Side-by-side diff
Diffstat (limited to 'noncore/apps/tinykate/libkate/document/katehighlight.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/apps/tinykate/libkate/document/katehighlight.cpp126
1 files changed, 65 insertions, 61 deletions
diff --git a/noncore/apps/tinykate/libkate/document/katehighlight.cpp b/noncore/apps/tinykate/libkate/document/katehighlight.cpp
index 0d2c283..539d356 100644
--- a/noncore/apps/tinykate/libkate/document/katehighlight.cpp
+++ b/noncore/apps/tinykate/libkate/document/katehighlight.cpp
@@ -3,4 +3,4 @@
digisnap@cs.tu-berlin.de
- (C) 2002, 2001 The Kate Team <kwrite-devel@kde.org>
- (C) 2002 Joseph Wenninger <jowenn@kde.org>
+ (C) 2002, 2001 The Kate Team <kwrite-devel@kde.org>
+ (C) 2002 Joseph Wenninger <jowenn@kde.org>
This library is free software; you can redistribute it and/or
@@ -21,18 +21,3 @@
-#include <string.h>
-
-#include <qtextstream.h>
-#include <qpe/config.h>
-#include <kglobal.h>
-//#include <kinstance.h>
-//#include <kmimemagic.h>
-#include <klocale.h>
-//#include <kregexp.h>
-#include <kglobalsettings.h>
-#include <kdebug.h>
-#include <kstddirs.h>
-
#include "katehighlight.h"
-
-
#include "katetextline.h"
@@ -41,2 +26,21 @@
+#include "kglobal.h"
+//#include "kinstance.h"
+//#include "kmimemagic.h"
+#include "klocale.h"
+//#include "kregexp.h"
+#include "kglobalsettings.h"
+#include "kdebug.h"
+#include "kstddirs.h"
+
+/* OPIE */
+#include <opie2/odebug.h>
+#include <qpe/config.h>
+
+/* QT */
+#include <qtextstream.h>
+
+/* STD */
+#include <string.h>
+
@@ -122,4 +126,4 @@ const QChar *HlStringDetect::checkHgl(const QChar *s, int len, bool) {
{
- QString tmp=QString(s,str.length()).upper();
- if (tmp==str) return s+str.length();
+ QString tmp=QString(s,str.length()).upper();
+ if (tmp==str) return s+str.length();
}
@@ -215,6 +219,6 @@ const QChar *HlInt::checkHgl(const QChar *str, int len, bool) {
{
- for (HlItem *it=subItems->first();it;it=subItems->next())
+ for (HlItem *it=subItems->first();it;it=subItems->next())
{
s1=it->checkHgl(s, len, false);
- if (s1) return s1;
+ if (s1) return s1;
}
@@ -250,10 +254,10 @@ const QChar *HlFloat::checkHgl(const QChar *s, int len, bool) {
if (!p) return 0L;
- else
- {
+ else
+ {
if (subItems)
{
- for (HlItem *it=subItems->first();it;it=subItems->next())
+ for (HlItem *it=subItems->first();it;it=subItems->next())
{
s1=it->checkHgl(s, len, false);
- if (s1) return s1;
+ if (s1) return s1;
}
@@ -347,3 +351,3 @@ const QChar *HlCHex::checkHgl(const QChar *str, int len, bool) {
else
- return 0L;
+ return 0L;
@@ -402,3 +406,3 @@ const QChar *HlRegExpr::checkHgl(const QChar *s, int len, bool lineStart)
else
- return (s+Expr->matchedLength());
+ return (s+Expr->matchedLength());
};
@@ -413,5 +417,5 @@ const QChar *HlLineContinue::checkHgl(const QChar *s, int len, bool) {
if ((s[0].latin1() == '\\') && (len == 1))
- {
+ {
return s + 1;
- }
+ }
return 0L;
@@ -623,3 +627,3 @@ int Highlight::doHighlight(int ctxNum, TextLine *textLine)
{
- qDebug("An item has been detected");
+ odebug << "An item has been detected" << oendl;
textLine->setAttribs(item->attr,s1 - str,s2 - str);
@@ -855,3 +859,3 @@ void Highlight::createItemData(ItemDataList &list)
{
- qDebug("Highlight::createItemData");
+ odebug << "Highlight::createItemData" << oendl;
@@ -876,3 +880,3 @@ void Highlight::createItemData(ItemDataList &list)
- qDebug("Trying to read itemData section");
+ odebug << "Trying to read itemData section" << oendl;
@@ -884,3 +888,3 @@ void Highlight::createItemData(ItemDataList &list)
{
- qDebug("Setting up one itemData element");
+ odebug << "Setting up one itemData element" << oendl;
// read all attributes
@@ -935,8 +939,8 @@ int Highlight::lookupAttrName(const QString& name, ItemDataList &iDl)
{
- for (int i=0;i<iDl.count();i++)
- {
- if (iDl.at(i)->name==name) return i;
- }
- kdDebug(13010)<<"Couldn't resolve itemDataName"<<endl;
- return 0;
+ for (int i=0;i<iDl.count();i++)
+ {
+ if (iDl.at(i)->name==name) return i;
+ }
+ kdDebug(13010)<<"Couldn't resolve itemDataName"<<endl;
+ return 0;
}
@@ -1079,7 +1083,7 @@ void Highlight::readCommentConfig()
if (HlManager::self()->syntax->groupData(data,"name")=="singleLine")
- cslStart=HlManager::self()->syntax->groupData(data,"start");
- if (HlManager::self()->syntax->groupData(data,"name")=="multiLine")
+ cslStart=HlManager::self()->syntax->groupData(data,"start");
+ if (HlManager::self()->syntax->groupData(data,"name")=="multiLine")
{
- cmlStart=HlManager::self()->syntax->groupData(data,"start");
- cmlEnd=HlManager::self()->syntax->groupData(data,"end");
+ cmlStart=HlManager::self()->syntax->groupData(data,"start");
+ cmlEnd=HlManager::self()->syntax->groupData(data,"end");
}
@@ -1114,6 +1118,6 @@ void Highlight::readGlobalKeywordConfig()
{
- kdDebug(13010)<<"Found global keyword config"<<endl;
+ kdDebug(13010)<<"Found global keyword config"<<endl;
if (HlManager::self()->syntax->groupItemData(data,QString("casesensitive"))!="0")
- casesensitive=true; else {casesensitive=false; kdDebug(13010)<<"Turning on case insensitiveness"<<endl;}
+ casesensitive=true; else {casesensitive=false; kdDebug(13010)<<"Turning on case insensitiveness"<<endl;}
//get the weak deliminators
@@ -1135,3 +1139,3 @@ void Highlight::readGlobalKeywordConfig()
- HlManager::self()->syntax->freeGroupInfo(data);
+ HlManager::self()->syntax->freeGroupInfo(data);
}
@@ -1206,6 +1210,6 @@ void Highlight::makeContextList()
{
-// kdDebug(13010)<< "In make Contextlist: Item:"<<endl;
- c=createHlItem(data,iDl);
- if (c)
- {
+// kdDebug(13010)<< "In make Contextlist: Item:"<<endl;
+ c=createHlItem(data,iDl);
+ if (c)
+ {
contextList[i]->items.append(c);
@@ -1213,14 +1217,14 @@ void Highlight::makeContextList()
// Not supported completely atm and only one level. Subitems.(all have to be matched to at once)
- datasub=HlManager::self()->syntax->getSubItems(data);
- bool tmpbool;
- if (tmpbool=HlManager::self()->syntax->nextItem(datasub))
- {
+ datasub=HlManager::self()->syntax->getSubItems(data);
+ bool tmpbool;
+ if (tmpbool=HlManager::self()->syntax->nextItem(datasub))
+ {
c->subItems=new QList<HlItem>;
- for (;tmpbool;tmpbool=HlManager::self()->syntax->nextItem(datasub))
+ for (;tmpbool;tmpbool=HlManager::self()->syntax->nextItem(datasub))
c->subItems->append(createHlItem(datasub,iDl));
}
- HlManager::self()->syntax->freeGroupInfo(datasub);
+ HlManager::self()->syntax->freeGroupInfo(datasub);
// end of sublevel
- }
-// kdDebug(13010)<<"Last line in loop"<<endl;
+ }
+// kdDebug(13010)<<"Last line in loop"<<endl;
}
@@ -1314,3 +1318,3 @@ int HlManager::makeAttribs(Highlight *highlight, Attribute *a, int maxAttribs) {
- qDebug("HlManager::makeAttribs");
+ odebug << "HlManager::makeAttribs" << oendl;
@@ -1323,3 +1327,3 @@ int HlManager::makeAttribs(Highlight *highlight, Attribute *a, int maxAttribs) {
for (z = 0; z < nAttribs; z++) {
- qDebug("HlManager::makeAttribs: createing one attribute definition");
+ odebug << "HlManager::makeAttribs: createing one attribute definition" << oendl;
itemData = itemDataList.at(z);
@@ -1417,3 +1421,3 @@ void HlManager::setDefaults(ItemStyleList &list) {
#warning fixme
-/*
+/*
config = KateFactory::instance()->config();