Anyone tred this code...?
Anyway, I tested your code. In order to make it run I needed to apply this patch:
diff -ru qcodeedit-0.1.0-beta-orig/example/example.pro qcodeedit-0.1.0-beta/example/example.pro
--- qcodeedit-0.1.0-beta-orig/example/example.pro 2006-07-28 16:37:06.000000000 +0300
+++ qcodeedit-0.1.0-beta/example/example.pro 2006-08-01 23:03:25.000000000 +0300
@@ -4,8 +4,10 @@
TEMPLATE = app
TARGET = example
-
+INCLUDEPATH += ../include ../src ../src/editor ../src/language ../src/generic
+DEFINES += _QCODE_EDIT_GENERIC_
CONFIG += release qcodeedit
+LIBS += -L../src/ -lqcodeedit
diff -ru qcodeedit-0.1.0-beta-orig/example/example.pro qcodeedit-0.1.0-beta/example/example.pro
--- qcodeedit-0.1.0-beta-orig/example/example.pro 2006-07-28 16:37:06.000000000 +0300
+++ qcodeedit-0.1.0-beta/example/example.pro 2006-08-01 23:03:25.000000000 +0300
@@ -4,8 +4,10 @@
TEMPLATE = app
TARGET = example
-
+INCLUDEPATH += ../include ../src ../src/editor ../src/language ../src/generic
+DEFINES += _QCODE_EDIT_GENERIC_
CONFIG += release qcodeedit
+LIBS += -L../src/ -lqcodeedit
To copy to clipboard, switch view to plain text mode
I also needed to copy the *.so file into the example dir. When you type text the application does work, but when pasting large portions of text (qwidget.cpp was my test case) or load it via the command line the text does not get painted.
About the code itself:
The idea of having different contexts in the language definitions if cool. This means that different color can be applied to the same word depending of it's location on the text.
I am not sure that putting the colors definitions inside the syntax declaration is a good idea: you are not able to modify the colors of your syntax. For example, people which have a pink desktop will have problems with your code, since the text editor will always be with white background.
I am not sure that re-inventing the wheel and defining a new syntax declaration is a good idea. If you choose another project language definitions are will gain a lot of syntaxes for free, and you now only have to code an engine to display them. For example:
Sharp develop also use XML for describing the syntaxes:
http://www.icsharpcode.net/OpenSource/SD/
GtkSourceView also uses XML (see also my minimal implementation for this definitions)
http://gtksourceview.sourceforge.net/
And also notepad++ (win32 application):
http://notepad-plus.sourceforge.net/uk/site.htm
Another suggestion can be using plain "ini" files instead XML. This will make the construction on new syntax definition files much easier.
Bookmarks